[PATCH] Fix: Stop RADIO LINK TIMEOUT couter S from counting, if it has reached 0

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/OpenBSC@lists.osmocom.org/.

Andreas Eversberg jolly at eversberg.eu
Thu Mar 14 06:25:56 UTC 2013


In case that the counter S reached 0, it will stay 0. Subsequent received
good and bad SACCH frames must not cause to trigger radio link failure
again. Once the BSC has been indicated about link failure, it will release
channel.

This patch will ensure that the link failure is indicated only once. But
even if the link failure would be sent multiple times, the BSC should
ignore it. The BSC releases the channel and may only reuse it after confirm
from BTS. (There cannot be any link failure indications after confirm of
channel release.)

The minimum timeout value is 4, as defined in TS 05.08, so if the BSC
sends an attribute with a value < 4, this (wrong) value is ignored and the
default value of 32 is used.
---
 src/common/oml.c           |    6 +++---
 src/osmo-bts-sysmo/l1_if.c |    7 +++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/common/oml.c b/src/common/oml.c
index 4e2dead..afedefd 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -447,10 +447,10 @@ static int oml_rx_set_bts_attr(struct gsm_bts *bts, struct msgb *msg)
 
 	/* 9.4.14 Connection Failure Criterion */
 	if (TLVP_PRESENT(&tp, NM_ATT_CONN_FAIL_CRIT) &&
-	    (TLVP_LEN(&tp, NM_ATT_CONN_FAIL_CRIT) >= 2) &&
-	    *TLVP_VAL(&tp, NM_ATT_CONN_FAIL_CRIT) == 0x01) {
+	    (TLVP_LEN(&tp, NM_ATT_CONN_FAIL_CRIT) >= 2)) {
 		const uint8_t *val = TLVP_VAL(&tp, NM_ATT_CONN_FAIL_CRIT);
-		btsb->radio_link_timeout = val[1];
+		if (val[0] == 0x01 && val[1] >= 4)
+			btsb->radio_link_timeout = val[1];
 	}
 	/* if val[0] != 0x01: can be 'operator dependent' and needs to
 	 * be parsed by bts driver */
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index df660c5..5728df0 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -681,8 +681,11 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
 
 	switch (data_ind->sapi) {
 	case GsmL1_Sapi_Sacch:
-		/* process radio link timeout coniter S */
+		/* process radio link timeout counter S */
 		if (data_ind->msgUnitParam.u8Size == 0) {
+			/* if link loss criterion already reached */
+			if (lchan->s == 0)
+				break;
 			/* count down radio link counter S */
 			lchan->s--;
 			DEBUGP(DMEAS, "counting down radio link counter S=%d\n",
@@ -692,7 +695,7 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
 					RSL_ERR_RADIO_LINK_FAIL);
 			break;
 		}
-		if (lchan->s < btsb->radio_link_timeout) {
+		if (lchan->s > 0 && lchan->s < btsb->radio_link_timeout) {
 			/* count up radio link counter S */
 			lchan->s += 2;
 			if (lchan->s > btsb->radio_link_timeout)
-- 
1.7.3.4


--------------050806080900000401040704--




More information about the OpenBSC mailing list