[MERGED] osmo-bts[master]: TRX / VIRT-PHY: Make check for BCCH/CCCH more specific

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
Sun Jul 30 16:46:38 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: TRX / VIRT-PHY: Make check for BCCH/CCCH more specific
......................................................................


TRX / VIRT-PHY: Make check for BCCH/CCCH more specific

In bts_model_l1sap_down() we want to identify BCCH/CCCH channel numbers,
but our check is a bit non-specific.  Let's make the check more specific
to only cover the BCCH, Uplink CCCH and Downlink CCCH C-bits as defined
n 3GPP TS 08.58 Section 9.3.1

Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67
---
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-virtual/l1_if.c
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 37a399f..f69e587 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -555,7 +555,7 @@
 			chan_nr = l1sap->u.info.u.act_req.chan_nr;
 			lchan = get_lchan_by_chan_nr(trx, chan_nr);
 			if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) {
-				if ((chan_nr & 0x80)) {
+				if ((chan_nr & 0xE0) == 0x80) {
 					LOGP(DL1C, LOGL_ERROR, "Cannot activate"
 						" chan_nr 0x%02x\n", chan_nr);
 					break;
@@ -605,7 +605,7 @@
 				break;
 			}
 			/* here, type == PRIM_INFO_DEACTIVATE */
-			if ((chan_nr & 0x80)) {
+			if ((chan_nr & 0xE0) == 0x80) {
 				LOGP(DL1C, LOGL_ERROR, "Cannot deactivate "
 					"chan_nr 0x%02x\n", chan_nr);
 				break;
diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c
index 4fe1ec8..bdbf2a7 100644
--- a/src/osmo-bts-virtual/l1_if.c
+++ b/src/osmo-bts-virtual/l1_if.c
@@ -370,7 +370,7 @@
 			/* we receive a channel activation request from the BSC,
 			 * e.g. as a response to a channel req on RACH */
 			if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) {
-				if ((chan_nr & 0x80)) {
+				if ((chan_nr & 0xE0) == 0x80) {
 					LOGP(DL1C, LOGL_ERROR, "Cannot activate"
 						" chan_nr 0x%02x\n", chan_nr);
 					break;
@@ -419,7 +419,7 @@
 					0);
 				break;
 			}
-			if ((chan_nr & 0x80)) {
+			if ((chan_nr & 0xE0) == 0x80) {
 				LOGP(DL1C, LOGL_ERROR, "Cannot deactivate "
 					"chan_nr 0x%02x\n", chan_nr);
 				break;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list