diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/l1sap.c | 11 | ||||
-rw-r--r-- | src/common/measurement.c | 16 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 8e71cd4f..b74fd5a8 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -697,6 +697,8 @@ static inline void set_ms_to_data(struct gsm_lchan *lchan, int16_t data, bool se } } +bool trx_sched_is_sacch_fn(const struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink); + /* measurement information received from bts model */ static void process_l1sap_meas_data(struct gsm_lchan *lchan, const struct osmo_phsap_prim *l1sap, @@ -720,8 +722,10 @@ static void process_l1sap_meas_data(struct gsm_lchan *lchan, .inv_rssi = info_meas_ind->inv_rssi, .ber10k = info_meas_ind->ber10k, .ci_cb = info_meas_ind->c_i_cb, - .is_sub = info_meas_ind->is_sub, }; + /* additionally treat SACCH frames (match by TDMA FN) as SUB frames */ + if (info_meas_ind->is_sub || trx_sched_is_sacch_fn(lchan->ts, fn, true)) + ulm.is_sub = 1; break; case PRIM_TCH: ph_tch_ind = &l1sap->u.tch; @@ -736,6 +740,7 @@ static void process_l1sap_meas_data(struct gsm_lchan *lchan, .ci_cb = ph_tch_ind->lqual_cb, .is_sub = ph_tch_ind->is_sub, }; + /* PRIM_TCH always carries DCCH, not SACCH */ break; case PRIM_PH_DATA: ph_data_ind = &l1sap->u.data; @@ -748,8 +753,10 @@ static void process_l1sap_meas_data(struct gsm_lchan *lchan, .inv_rssi = abs(ph_data_ind->rssi), .ber10k = ph_data_ind->ber10k, .ci_cb = ph_data_ind->lqual_cb, - .is_sub = ph_data_ind->is_sub, }; + /* additionally treat SACCH frames (match by RSL link ID) as SUB frames */ + if (ph_data_ind->is_sub || L1SAP_IS_LINK_SACCH(ph_data_ind->link_id)) + ulm.is_sub = 1; break; default: OSMO_ASSERT(false); diff --git a/src/common/measurement.c b/src/common/measurement.c index d1f99609..aa1f5ae0 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -56,20 +56,18 @@ bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn) /* See TS 45.008 Sections 8.3 and 8.4 for a detailed descriptions of the rules * implemented here. We only implement the logic for Voice, not CSD */ + /* AMR is special, SID frames may be scheduled dynamically at any time */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + return false; + switch (lchan->type) { case GSM_LCHAN_TCH_F: switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_EFR: - if (trx_sched_is_sacch_fn(lchan->ts, fn, true)) - return true; if (ARRAY_CONTAINS(ts45008_83_tch_f, fn104)) return true; break; - case GSM48_CMODE_SPEECH_AMR: - if (trx_sched_is_sacch_fn(lchan->ts, fn, true)) - return true; - break; case GSM48_CMODE_SIGN: /* No DTX allowed; SUB=FULL, therefore measurements at all frame numbers are * SUB */ @@ -83,8 +81,6 @@ bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn) case GSM_LCHAN_TCH_H: switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_V1: - if (trx_sched_is_sacch_fn(lchan->ts, fn, true)) - return true; switch (lchan->nr) { case 0: if (ARRAY_CONTAINS(ts45008_83_tch_hs0, fn104)) @@ -98,10 +94,6 @@ bool ts45008_83_is_sub(struct gsm_lchan *lchan, uint32_t fn) OSMO_ASSERT(0); } break; - case GSM48_CMODE_SPEECH_AMR: - if (trx_sched_is_sacch_fn(lchan->ts, fn, true)) - return true; - break; case GSM48_CMODE_SIGN: /* No DTX allowed; SUB=FULL, therefore measurements at all frame numbers are * SUB */ |