aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2020-10-21 16:49:08 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2020-10-21 16:53:11 +0200
commitae07288cdb1a3150efc7dcb106445ee5de82cf42 (patch)
tree4f9d57739549adae1e3afa3cb4d8161cc8617c70
parent6e27523d11f7447804d747278ee8a2327cdc69a1 (diff)
measurement: count measurements for FACCH/H twice.pmaier/hacks
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
-rw-r--r--include/osmo-bts/gsm_data.h3
-rw-r--r--src/common/l1sap.c16
-rw-r--r--src/common/measurement.c4
3 files changed, 22 insertions, 1 deletions
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);
}