[PATCH] osmo-bts[master]: common/l1sap.c: also check BER and ToA for handover RACH

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon Mar 5 01:03:18 UTC 2018


Review at  https://gerrit.osmocom.org/7080

common/l1sap.c: also check BER and ToA for handover RACH

Both BER and ToA values are currently used to filter out possible
noise, interference or ghosts. Previously this filtering was only
performed for non-handover bursts, so let's fix this.

Change-Id: I08277e215c4c16ac91ebd3533172a8f861d6eb46
---
M src/common/l1sap.c
1 file changed, 43 insertions(+), 28 deletions(-)


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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 85f8830..6e3f1d8 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1175,40 +1175,18 @@
 
 #define RACH_MIN_TOA256 -2 * 256
 
-/* RACH received from bts model */
-static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
-	 struct osmo_phsap_prim *l1sap, struct ph_rach_ind_param *rach_ind)
+static bool rach_pass_filter(struct ph_rach_ind_param *rach_ind,
+	struct gsm_bts_role_bts *btsb)
 {
-	struct gsm_bts *bts = trx->bts;
-	struct gsm_bts_role_bts *btsb = bts->role;
-	struct lapdm_channel *lc;
 	int16_t toa256 = rach_ind->acc_delay_256bits;
 
-	DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind");
-
-	/* check for handover access burst on dedicated channels */
-	if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr)) {
-		rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_HO);
-		return l1sap_handover_rach(trx, l1sap, rach_ind);
-	}
-
-	rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_RCVD);
-
-	/* increment number of busy RACH slots, if required */
-	if (rach_ind->rssi >= btsb->load.rach.busy_thresh)
-		btsb->load.rach.busy++;
-
-	/* check for RACH exceeding BER threshold (ghost RACH) */
+	/* Check for RACH exceeding BER threshold (ghost RACH) */
 	if (rach_ind->ber10k > btsb->max_ber10k_rach) {
-		DEBUGPFN(DL1C, rach_ind->fn, "ignoring RACH request: %u > %u (max BER)\n",
+		LOGPFN(DL1C, LOGL_INFO, rach_ind->fn, "Ignoring RACH request: "
+			"BER10k(%u) > BER10k_MAX(%u)\n",
 			rach_ind->ber10k, btsb->max_ber10k_rach);
-		return 0;
+		return false;
 	}
-
-	/* increment number of RACH slots with valid non-handover RACH burst */
-	btsb->load.rach.access++;
-
-	lc = &trx->ts[0].lchan[CCCH_LCHAN].lapdm_ch;
 
 	/**
 	 * Make sure that ToA (Timing of Arrival) is acceptable.
@@ -1219,10 +1197,47 @@
 		LOGPFN(DL1C, LOGL_INFO, rach_ind->fn, "Ignoring RACH request: "
 			"ToA(%d) exceeds the allowed range (%d..%d)\n",
 			toa256, RACH_MIN_TOA256, btsb->max_ta * 256);
+		return false;
+	}
+
+	/* All checks passed */
+	return true;
+}
+
+/* RACH received from bts model */
+static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
+	 struct osmo_phsap_prim *l1sap, struct ph_rach_ind_param *rach_ind)
+{
+	struct gsm_bts *bts = trx->bts;
+	struct gsm_bts_role_bts *btsb = bts->role;
+	struct lapdm_channel *lc;
+
+	DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind");
+
+	/* Increase counters */
+	rate_ctr_inc2(trx->bts->ctrs,
+		L1SAP_IS_CHAN_RACH(rach_ind->chan_nr) ?
+			BTS_CTR_RACH_RCVD : BTS_CTR_RACH_HO);
+
+	/* Filter out noise / interference / ghosts */
+	if (!rach_pass_filter(rach_ind, btsb)) {
 		rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_DROP);
 		return 0;
 	}
 
+	/* check for handover access burst on dedicated channels */
+	if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr))
+		return l1sap_handover_rach(trx, l1sap, rach_ind);
+
+	/* increment number of busy RACH slots, if required */
+	if (rach_ind->rssi >= btsb->load.rach.busy_thresh)
+		btsb->load.rach.busy++;
+
+	/* increment number of RACH slots with valid non-handover RACH burst */
+	btsb->load.rach.access++;
+
+	lc = &trx->ts[0].lchan[CCCH_LCHAN].lapdm_ch;
+
 	/* According to 3GPP TS 48.058 § 9.3.17 Access Delay is expressed same way as TA (number of symbols) */
 	set_ms_to_data(get_lchan_by_chan_nr(trx, rach_ind->chan_nr),
 		rach_ind->acc_delay, false);

-- 
To view, visit https://gerrit.osmocom.org/7080
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08277e215c4c16ac91ebd3533172a8f861d6eb46
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list