From ae07288cdb1a3150efc7dcb106445ee5de82cf42 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 21 Oct 2020 16:49:08 +0200 Subject: measurement: count measurements for FACCH/H twice. The FACCH/H replaces to voice frames in TCH/H. This means during the transmission of a FACCH one measurement value less is handed up to the higher layers. This needs to be compensated by adding a the FAACH/H measurement twice (as if it were from two voice frames). Change-Id: Id533bb3207bac40d00d77b484619f66ea5c0774d Related: OS#4799 --- include/osmo-bts/gsm_data.h | 3 +++ src/common/l1sap.c | 16 ++++++++++++++++ src/common/measurement.c | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 1c1c5d44..45a131c8 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -111,6 +111,9 @@ struct bts_ul_meas { uint8_t is_sub:1; /* RSSI in dBm * -1 */ uint8_t inv_rssi; + /* weight of the measurement report: 2 for FACCH on TCH/H, 1 for all + * other channels types. */ + uint8_t weight; }; struct amr_mode { diff --git a/src/common/l1sap.c b/src/common/l1sap.c index c9ec9bf0..f7e0451c 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -730,6 +730,22 @@ static void process_l1sap_meas_data(struct gsm_bts_trx *trx, ulm.inv_rssi = inv_rssi; ulm.is_sub = is_sub; + /* TCH channels are multiplexed with a FACCH channel. In the case of + * TCH/F the FACCH has the same length (spread over 8 TDMA frames) + * as a regular voice TDMA frames. This means that we either get + * one voice frame or a SACCH frame every 4 bursts. For TCH/H the + * seizes are different. A voice frame spreads over 4 TDMA frames + * and a SACCH over 6 TDMA frames. This means we either get 2 voice + * frames every 4 bursts or we end up with a single SACCH frame. Since + * measurement results are trsamitted to l1sap together with the actual + * data. The data of one TCH/H SACCH frame actually covers the period + * of two voice frames, which means a TCH/H SACCH measurement has a + * weight of two. */ + if (lchan->type == GSM_LCHAN_TCH_H && ind_type == PRIM_PH_DATA) + ulm.weight = 2; + else + ulm.weight = 1; + /* we assume that symbol period is 1 bit: */ set_ms_to_data(lchan, ta_offs_256bits / 256, true); diff --git a/src/common/measurement.c b/src/common/measurement.c index 22f783df..f73f43b7 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -739,7 +739,9 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) * interval. */ int lchan_meas_process_measurement(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn) { - lchan_new_ul_meas(lchan, ulm, fn); + unsigned int i; + for (i = 0; i < ulm->weight; i++) + lchan_new_ul_meas(lchan, ulm, fn); return lchan_meas_check_compute(lchan, fn); } -- cgit v1.2.3