fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/15716


Change subject: L1SAP: there can be no DATA.ind primitives on PTCCH/U, reject 
them
......................................................................

L1SAP: there can be no DATA.ind primitives on PTCCH/U, reject them

Change-Id: Ib846a9b8e619c7da56b5f0a54d16f629913af80d
---
M src/common/l1sap.c
1 file changed, 19 insertions(+), 16 deletions(-)



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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 87ef01b..ffb638e 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1109,11 +1109,21 @@
        DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind chan_nr=%s link_id=0x%02x 
len=%d\n",
                 rsl_chan_nr_str(chan_nr), link_id, len);

+       /* Actually, there can be no DATA.ind on PTCCH/U (rather RACH.ind 
instead),
+        * but some BTS models with buggy implementation may still be sending 
them
+        * to us. Let's keep this for backwards compatibility. */
+       if (L1SAP_IS_CHAN_PDCH(chan_nr) && L1SAP_IS_PTCCH(fn)) {
+               LOGPGT(DL1P, LOGL_NOTICE, &g_time, "There can be no DATA.ind on 
PTCCH/U. "
+                      "This is probably a bug of the BTS model you're using, 
please fix!\n");
+               return -EINVAL;
+
+       }
+
        if (ts_is_pdch(&trx->ts[tn])) {
                lchan = get_lchan_by_chan_nr(trx, chan_nr);
                if (!lchan)
                        LOGPGT(DL1P, LOGL_ERROR, &g_time, "No lchan for 
chan_nr=%s\n", rsl_chan_nr_str(chan_nr));
-               if (lchan && lchan->loopback && !L1SAP_IS_PTCCH(fn)) {
+               if (lchan && lchan->loopback) {
                        /* we are in loopback mode (for BER testing)
                         * mode and need to enqeue the frame to be
                         * returned in downlink */
@@ -1128,21 +1138,14 @@
                /* don't send bad frames to PCU */
                if (len == 0)
                        return -EINVAL;
-               if (L1SAP_IS_PTCCH(fn)) {
-                       pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PTCCH, fn,
-                                       trx->arfcn, L1SAP_FN2PTCCHBLOCK(fn),
-                                       data, len, rssi, data_ind->ber10k,
-                                       data_ind->ta_offs_256bits/64,
-                                       data_ind->lqual_cb);
-               } else {
-                       /* drop incomplete UL block */
-                       if (pr_info != PRES_INFO_BOTH)
-                               return 0;
-                       /* PDTCH / PACCH frame handling */
-                       pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PDTCH, fn, 
trx->arfcn,
-                                       L1SAP_FN2MACBLOCK(fn), data, len, rssi, 
data_ind->ber10k,
-                                       data_ind->ta_offs_256bits/64, 
data_ind->lqual_cb);
-               }
+               /* drop incomplete UL block */
+               if (pr_info != PRES_INFO_BOTH)
+                       return 0;
+
+               /* PDTCH / PACCH frame handling */
+               pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PDTCH, fn, trx->arfcn,
+                               L1SAP_FN2MACBLOCK(fn), data, len, rssi, 
data_ind->ber10k,
+                               data_ind->ta_offs_256bits/64, 
data_ind->lqual_cb);
                return 0;
        }


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/15716
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib846a9b8e619c7da56b5f0a54d16f629913af80d
Gerrit-Change-Number: 15716
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilira...@gmail.com>
Gerrit-MessageType: newchange

Reply via email to