Change in osmo-bts[master]: measurement: ignore lost FACCH/H uplink measurements

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Oct 29 23:25:41 UTC 2020


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/20980 )


Change subject: measurement: ignore lost FACCH/H uplink measurements
......................................................................

measurement: ignore lost FACCH/H uplink measurements

When a FACCH channel ist transmitted on a TCH/H, it wil be spread over 6
blocks and takes out two TCH/H voice blocks. This means that we will end
up with one uplink measurement sample less. When the measurement result
is calculated missing uplink measurements will be replaced with dummy
values. In the case of a FACCH transmission no uplink measurement is
missing, so in this case the calculation needs to expect less uplink
measurement values in total.

Change-Id: Ibf693aede8fffa6432cdcdcf5d52910493a1104b
Related: OS#4799
---
M include/osmo-bts/gsm_data.h
M src/common/l1sap.c
M src/common/measurement.c
3 files changed, 24 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/20980/1

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 1c1c5d4..a39d027 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -111,6 +111,9 @@
 	uint8_t is_sub:1;
 	/* RSSI in dBm * -1 */
 	uint8_t inv_rssi;
+	/* FACCH/H requires special handling because it takes out two voice
+	 * blocks and the second voice block could be a sub frame. */
+	bool is_facch_h;
 };
 
 struct amr_mode {
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index c9ec9bf..1a0af17 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -658,6 +658,7 @@
 	struct info_meas_ind_param *info_meas_ind;
 	struct ph_data_param *ph_data_ind;
 	struct ph_tch_param *ph_tch_ind;
+	uint8_t link_id = 0;
 	uint8_t chan_nr;
 	uint32_t fn;
 	uint8_t inv_rssi;
@@ -694,6 +695,7 @@
 		ph_data_ind = &l1sap->u.data;
 		if (ph_data_ind->rssi == 0)
 			return;
+		link_id = ph_data_ind->link_id;
 		chan_nr = ph_data_ind->chan_nr;
 		fn = ph_data_ind->fn;
 		inv_rssi = abs(ph_data_ind->rssi);
@@ -730,6 +732,14 @@
 	ulm.inv_rssi = inv_rssi;
 	ulm.is_sub = is_sub;
 
+	/* FACCH/H requires special handling in measurement.c because in half
+	 * rate one FACCH frame takes out two voice blocks, where the second
+	 * one might be a SUB frame. */
+	if (ind_type == PRIM_PH_DATA && lchan->type == GSM_LCHAN_TCH_H && !L1SAP_IS_LINK_SACCH(link_id))
+		ulm.is_facch_h = true;
+	else
+		ulm.is_facch_h = false;
+
 	/* 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 a388847..72ac076 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -341,9 +341,9 @@
 	if (!ulm->is_sub)
 		ulm->is_sub = ts45008_83_is_sub(lchan, fn);
 
-	DEBUGPFN(DMEAS, fn, "%s adding measurement (ber10k=%u, ta_offs=%d, ci=%0.2f, is_sub=%u, rssi=-%u), num_ul_meas=%d, fn_mod=%u\n",
+	DEBUGPFN(DMEAS, fn, "%s adding measurement (ber10k=%u, ta_offs=%d, ci=%0.2f, is_sub=%u, rssi=-%u, is_facch_h=%u), num_ul_meas=%d, fn_mod=%u\n",
 		 gsm_lchan_name(lchan), ulm->ber10k, ulm->ta_offs_256bits,
-		 ulm->c_i, ulm->is_sub, ulm->inv_rssi, lchan->meas.num_ul_meas,
+		 ulm->c_i, ulm->is_sub, ulm->inv_rssi, ulm->is_facch_h, lchan->meas.num_ul_meas,
 		 fn_mod);
 
 	memcpy(&lchan->meas.uplink[lchan->meas.num_ul_meas++], ulm,
@@ -570,6 +570,7 @@
 	unsigned int num_ul_meas_subst = 0;
 	unsigned int num_ul_meas_expect;
 	unsigned int num_ul_meas_excess = 0;
+	unsigned int num_ul_meas_facch = 0;
 	int i;
 
 	/* if measurement period is not complete, abort */
@@ -634,6 +635,11 @@
 			ta256b_sum += m->ta_offs_256bits;
 
 			num_ul_meas_actual++;
+
+			if (m->is_facch_h) {
+				num_ul_meas_facch++;
+				num_ul_meas--;
+			}
 		} else {
 			m = &measurement_dummy;
 
@@ -660,6 +666,9 @@
 		}
 	}
 
+	if (num_ul_meas_facch)
+		LOGPLCHAN(lchan, DMEAS, LOGL_DEBUG, "Lost %u UL measurements to FACCH/H\n", num_ul_meas_facch);
+
 	if (lchan->tch_mode != GSM48_CMODE_SPEECH_AMR) {
 		LOGPLCHAN(lchan, DMEAS, LOGL_DEBUG,
 			  "Received UL measurements contain %u SUB measurements, expected %u\n",

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20980
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibf693aede8fffa6432cdcdcf5d52910493a1104b
Gerrit-Change-Number: 20980
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201029/d15a6059/attachment.htm>


More information about the gerrit-log mailing list