[MERGED] osmo-bts[master]: l1sap: fix rach reason (ra) parsing

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Mar 15 13:37:56 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: l1sap: fix rach reason (ra) parsing
......................................................................


l1sap: fix rach reason (ra) parsing

The ra parameter indicates the reason for the received rach
request. osmo-bts uses the ra parameter to determine if the
received rach request is packet access related. If yes,
osmo-bts will forward the request to the PCU.

In order to determine if the ra is packet related or not,
the higher 4 bits must be equel to 0x7 and at least one of
the lower 4 bits must be zero.

The current method lacks checking of the lower 4 bits. It
would also accept 0b01111111, which is reserved for future
use. This commit extends the check to take also the last
4 bits into accound.

See also: 3GPP TS 04.08, Table 9.9

Change-Id: I5eb88c42a91e158d9bfa4105ec9636035baf8959
---
M include/osmo-bts/l1sap.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h
index dcebc1d..0e56406 100644
--- a/include/osmo-bts/l1sap.h
+++ b/include/osmo-bts/l1sap.h
@@ -24,7 +24,7 @@
 #define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) ((chan_nr & 0xf8) == 0x90)
 
 /* rach type from ra */
-#define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70)
+#define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f)
 
 /* CCCH block from frame number */
 #define L1SAP_FN2CCCHBLOCK(fn) ((fn % 51) / 5 - 1)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5eb88c42a91e158d9bfa4105ec9636035baf8959
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>



More information about the gerrit-log mailing list