diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2021-10-22 00:19:04 +0300 |
---|---|---|
committer | fixeria <vyanitskiy@sysmocom.de> | 2021-10-25 14:51:21 +0000 |
commit | c5f75f0bcf7060254362a015e2ba64efed306ffc (patch) | |
tree | 3bdebcfd37b47ebc461de11b01fab6efb179c4d3 /src/common/rsl.c | |
parent | 430954630becc415877b306a32e3622f654df78f (diff) |
[overpower] rsl: store full content of RSL_IE_OSMO_TEMP_OVP_ACCH_CAP
The new fields in 'struct abis_rsl_osmo_temp_ovp_acch_cap' allow:
* selectively enabling SACCH and/or FACCH,
* setting the RxQual (BER) threshold.
Both features are implemented in the follow-up commits.
Change-Id: I370c8f95fb64eceb60a9dc2eae1412f8a0df0f4e
Depends: Ia28293a12de0af71f55e701fb65c46e905dae217
Related: SYS#5319
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r-- | src/common/rsl.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c index c100687c..a952d253 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1592,18 +1592,22 @@ static int parse_repeated_acch_capability(struct gsm_lchan *lchan, struct tlv_pa static int parse_temporary_overpower_acch_capability(struct gsm_lchan *lchan, const struct tlv_parsed *tp) { - struct abis_rsl_osmo_temp_ovp_acch_cap *top; + memset(&lchan->top_acch_cap, 0, sizeof(lchan->top_acch_cap)); - lchan->bs_acch_overpower_db = 0; - - if (!TLVP_PRES_LEN(tp, RSL_IE_OSMO_TEMP_OVP_ACCH_CAP, sizeof(*top))) + if (!TLVP_PRES_LEN(tp, RSL_IE_OSMO_TEMP_OVP_ACCH_CAP, sizeof(lchan->top_acch_cap))) return 0; if (!osmo_bts_has_feature(lchan->ts->trx->bts->features, BTS_FEAT_ACCH_TEMP_OVP)) return -RSL_ERR_OPT_IE_ERROR; - top = (struct abis_rsl_osmo_temp_ovp_acch_cap *)TLVP_VAL(tp, RSL_IE_OSMO_TEMP_OVP_ACCH_CAP); - lchan->bs_acch_overpower_db = top->overpower_db; + memcpy(&lchan->top_acch_cap, + TLVP_VAL(tp, RSL_IE_OSMO_TEMP_OVP_ACCH_CAP), + sizeof(lchan->top_acch_cap)); + + /* Simplify checking whether the overpower is enabled at all: allow + * testing just one parameter (overpower_db > 0) instead of all three. */ + if (!lchan->top_acch_cap.sacch_enable && !lchan->top_acch_cap.facch_enable) + lchan->top_acch_cap.overpower_db = 0; return 0; } |