Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11427 )

Change subject: Convert lchan CCCH_LCHAN to chan_nr BCCH and viceversa
......................................................................

Convert lchan CCCH_LCHAN to chan_nr BCCH and viceversa

Before this patch it was being coded as SDCCH4 TS0 SS 0, and as a
result the state LCHAN_REL_ACT_OML applied in opstart_compl in abused
SDCCH4 TS0 SS 4 was not being checked when deciding whether to send a
Chan Act ACK in rsl_tx_chan_act_acknack.

Fixes: OS#3513
Change-Id: I1641960c9ffbb3ed0de74ab5b53e24e5b4ff3397
---
M include/osmo-bts/l1sap.h
M src/common/gsm_data_shared.c
2 files changed, 8 insertions(+), 4 deletions(-)

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



diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h
index e2c92fa..3cf0ea5 100644
--- a/include/osmo-bts/l1sap.h
+++ b/include/osmo-bts/l1sap.h
@@ -12,6 +12,7 @@
 #define L1SAP_CHAN2SS_TCHH(chan_nr) ((chan_nr >> 3) & 1)
 #define L1SAP_CHAN2SS_SDCCH4(chan_nr) ((chan_nr >> 3) & 3)
 #define L1SAP_CHAN2SS_SDCCH8(chan_nr) ((chan_nr >> 3) & 7)
+#define L1SAP_CHAN2SS_BCCH(chan_nr) (CCCH_LCHAN)

 /* logical channel from chan_nr + link_id */
 #define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == LID_SACCH)
@@ -48,6 +49,8 @@
 /* subslot from any chan_nr */
 static inline uint8_t l1sap_chan2ss(uint8_t chan_nr)
 {
+       if (L1SAP_IS_CHAN_BCCH(chan_nr))
+                return L1SAP_CHAN2SS_BCCH(chan_nr);
        if (L1SAP_IS_CHAN_SDCCH8(chan_nr))
                return L1SAP_CHAN2SS_SDCCH8(chan_nr);
        if (L1SAP_IS_CHAN_SDCCH4(chan_nr))
diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c
index 8c3229c..588d0fd 100644
--- a/src/common/gsm_data_shared.c
+++ b/src/common/gsm_data_shared.c
@@ -622,11 +622,12 @@
                 * See osmo-bts-xxx/oml.c:opstart_compl().
                 */
                if (lchan_nr == CCCH_LCHAN)
-                       lchan_nr = 0;
-               else
+                       cbits = 0x10; /* BCCH */
+               else {
                        OSMO_ASSERT(lchan_nr < 4);
-               cbits = 0x04;
-               cbits += lchan_nr;
+                       cbits = 0x04;
+                       cbits += lchan_nr;
+               }
                break;
        case GSM_PCHAN_SDCCH8_SACCH8C:
        case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:

--
To view, visit https://gerrit.osmocom.org/11427
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1641960c9ffbb3ed0de74ab5b53e24e5b4ff3397
Gerrit-Change-Number: 11427
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)

Reply via email to