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


Change subject: [HACK] l1sap: send all TCH.{ind,req} as RLP frames over GSMTAP
......................................................................

[HACK] l1sap: send all TCH.{ind,req} as RLP frames over GSMTAP

Change-Id: I284ab83d86181ba906e5b8bc569fec38e3429be3
---
M src/common/l1sap.c
1 file changed, 43 insertions(+), 2 deletions(-)



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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 13d271e..4e7481a 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -468,6 +468,32 @@
                return 0;

        switch (OSMO_PRIM_HDR(&l1sap->oph)) {
+       case OSMO_PRIM(PRIM_TCH, PRIM_OP_REQUEST):
+               uplink = 0;
+               /* fall through */
+       case OSMO_PRIM(PRIM_TCH, PRIM_OP_INDICATION):
+       {
+               uint8_t rlp[240 / 8];
+
+               if (l1sap->oph.msg == NULL)
+                       return 0;
+               if (msgb_l2(l1sap->oph.msg) == NULL)
+                       return 0;
+               if (msgb_l2len(l1sap->oph.msg) != 240)
+                       return 0;
+
+               fn = l1sap->u.tch.fn;
+               tn = L1SAP_CHAN2TS(l1sap->u.tch.chan_nr);
+               signal_dbm = l1sap->u.tch.rssi;
+
+               osmo_ubit2pbit_ext(&rlp[0], 0, msgb_l2(l1sap->oph.msg), 0, 240, 
1);
+               gsmtap_send_ex(inst, GSMTAP_TYPE_GSM_RLP,
+                              trx->arfcn | uplink, tn,
+                              GSMTAP_CHANNEL_TCH_F, // XXX
+                              0, fn, signal_dbm, 0,
+                              &rlp[0], sizeof(rlp));
+               return 0;
+       }
        case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST):
                uplink = 0;
                /* fall through */
@@ -2181,6 +2207,7 @@
                rc = l1sap_ph_data_ind(trx, l1sap, &l1sap->u.data);
                break;
        case OSMO_PRIM(PRIM_TCH, PRIM_OP_INDICATION):
+               to_gsmtap(trx, l1sap);
                rc = l1sap_tch_ind(trx, l1sap, &l1sap->u.tch);
                break;
        case OSMO_PRIM(PRIM_PH_RACH, PRIM_OP_INDICATION):
@@ -2210,9 +2237,14 @@
        l1sap_log_ctx_sapi = get_common_sapi_by_trx_prim(trx, l1sap);
        log_set_context(LOG_CTX_L1_SAPI, &l1sap_log_ctx_sapi);

-       if (OSMO_PRIM_HDR(&l1sap->oph) ==
-                                OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST))
+       switch (OSMO_PRIM_HDR(&l1sap->oph)) {
+       case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST):
+       case OSMO_PRIM(PRIM_TCH, PRIM_OP_REQUEST):
                to_gsmtap(trx, l1sap);
+               break;
+       default:
+               break;
+       }

        return bts_model_l1sap_down(trx, l1sap);
 }

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I284ab83d86181ba906e5b8bc569fec38e3429be3
Gerrit-Change-Number: 34014
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to