dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/34134 )

Change subject: pcuif_proto: get rid of _DT, _dt (Direct TLLI)
......................................................................

pcuif_proto: get rid of _DT, _dt (Direct TLLI)

Since we now no longer refer to TLLI when we mean "message ID" (msg_id),
we should also remove the "_DT" / "_dt" suffix from structs and define
constants and replace it with "_2" if required.

Change-Id: If641b507dcb6b176109c99dce7cff2a7561364b0
Related: OS#5927
---
M include/osmocom/pcu/pcuif_proto.h
M src/bts.cpp
M src/gprs_rlcmac.c
M src/pcu_l1_if.cpp
M src/pcu_l1_if.h
5 files changed, 42 insertions(+), 28 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




diff --git a/include/osmocom/pcu/pcuif_proto.h 
b/include/osmocom/pcu/pcuif_proto.h
index f9465e4..bf49b06 100644
--- a/include/osmocom/pcu/pcuif_proto.h
+++ b/include/osmocom/pcu/pcuif_proto.h
@@ -18,7 +18,7 @@
 #define PCU_IF_MSG_SUSP_REQ    0x03    /* BTS forwards GPRS SUSP REQ to PCU */
 #define PCU_IF_MSG_APP_INFO_REQ        0x04    /* BTS asks PCU to transmit APP 
INFO via PACCH */
 #define PCU_IF_MSG_RTS_REQ     0x10    /* ready to send request */
-#define PCU_IF_MSG_DATA_CNF_DT 0x11    /* confirm (using message id) */
+#define PCU_IF_MSG_DATA_CNF_2  0x11    /* confirm (using message id) */
 #define PCU_IF_MSG_RACH_IND    0x22    /* receive RACH */
 #define PCU_IF_MSG_INFO_IND    0x32    /* retrieve BTS info */
 #define PCU_IF_MSG_E1_CCU_IND  0x33    /* retrieve E1 CCU comm. parameters */
@@ -41,7 +41,7 @@
 #define PCU_IF_SAPI_PDTCH      0x05    /* packet data/control/ccch block */
 #define PCU_IF_SAPI_PRACH      0x06    /* packet random access channel */
 #define PCU_IF_SAPI_PTCCH      0x07    /* packet TA control channel */
-#define PCU_IF_SAPI_PCH_DT     0x08    /* assignment on PCH (confirmed using 
message id) */
+#define PCU_IF_SAPI_PCH_2      0x08    /* assignment on PCH (confirmed using 
message id) */

 /* flags */
 #define PCU_IF_FLAG_ACTIVE     (1 << 0)/* BTS is active */
@@ -94,7 +94,7 @@
 } __attribute__ ((packed));

 /* data confirmation with message id (instead of raw mac block) */
-struct gsm_pcu_if_data_cnf_dt {
+struct gsm_pcu_if_data_cnf {
        uint8_t         sapi;
        uint32_t        msg_id;
 } __attribute__ ((packed));
@@ -263,8 +263,8 @@
 } __attribute__ ((packed));

 /* Struct to send a (confirmed) IMMEDIATE ASSIGNMENT message via PCH. The 
struct is sent as a data request
- * (data_req) under SAPI PCU_IF_SAPI_PCH_DT. */
-struct gsm_pcu_if_pch_dt {
+ * (data_req) under SAPI PCU_IF_SAPI_PCH_2. */
+struct gsm_pcu_if_pch {
        /* message id as reference for confirmation */
        uint32_t msg_id;
        /* IMSI (to derive paging group) */
@@ -282,7 +282,7 @@
        union {
                struct gsm_pcu_if_data          data_req;
                struct gsm_pcu_if_data          data_cnf;
-               struct gsm_pcu_if_data_cnf_dt   data_cnf_dt;
+               struct gsm_pcu_if_data_cnf      data_cnf2;
                struct gsm_pcu_if_data          data_ind;
                struct gsm_pcu_if_susp_req      susp_req;
                struct gsm_pcu_if_rts_req       rts_req;
diff --git a/src/bts.cpp b/src/bts.cpp
index 6bc415f..497c2ce 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -1129,7 +1129,7 @@
        if (plen >= 0) {
                bts_do_rate_ctr_inc(bts, CTR_IMMEDIATE_ASSIGN_DL_TBF);
                if (the_pcu->pcu_if_version >= 0x0b)
-                       pcu_l1if_tx_pch_dt(bts, immediate_assignment, plen, 
tbf->imsi(), tbf->tlli());
+                       pcu_l1if_tx_pch2(bts, immediate_assignment, plen, 
tbf->imsi(), tbf->tlli());
                else
                        pcu_l1if_tx_pch(bts, immediate_assignment, plen, 
tbf->imsi());
        }
diff --git a/src/gprs_rlcmac.c b/src/gprs_rlcmac.c
index 88fcc59..40fdfaf 100644
--- a/src/gprs_rlcmac.c
+++ b/src/gprs_rlcmac.c
@@ -45,7 +45,7 @@
        bts_do_rate_ctr_inc(bts, CTR_PCH_REQUESTS);

        if (the_pcu->pcu_if_version >= 0x0b)
-               pcu_l1if_tx_pch_dt(bts, paging_request, plen, imsi, 
GSM_RESERVED_TMSI);
+               pcu_l1if_tx_pch2(bts, paging_request, plen, imsi, 
GSM_RESERVED_TMSI);
        else
                pcu_l1if_tx_pch(bts, paging_request, plen, imsi);

diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index a022647..654063e 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -281,7 +281,7 @@
         * Hence, pgroup 000 is taken "randomly" to send it over it. This of
         * course not optimal since it can actually be sent on any CCCH blocks,
         * so we are delaying the ImmAss for no good reason. But anyway,
-        * pcu_l1if_tx_pch() is deprecated and pcu_l1if_tx_pch_dt() should be
+        * pcu_l1if_tx_pch() is deprecated and pcu_l1if_tx_pch2() should be
         * used instead, which doesn't suffer from this problem.
         */

@@ -300,26 +300,26 @@
 /* Send a MAC block via the paging channel. This will (obviously) only work 
for MAC blocks that contain an
  * IMMEDIATE ASSIGNMENT or a PAGING COMMAND message. In case the MAC block 
contains an IMMEDIATE ASSIGNMENT
  * message, the receiving end is required to confirm when the IMMEDIATE 
ASSIGNMENT has been sent. */
-void pcu_l1if_tx_pch_dt(struct gprs_rlcmac_bts *bts, struct bitvec *block, int 
plen, const char *imsi, uint32_t msg_id)
+void pcu_l1if_tx_pch2(struct gprs_rlcmac_bts *bts, struct bitvec *block, int 
plen, const char *imsi, uint32_t msg_id)
 {
-       struct gsm_pcu_if_pch_dt pch_dt = { 0 };
+       struct gsm_pcu_if_pch pch = { 0 };

-       pch_dt.msg_id = msg_id;
+       pch.msg_id = msg_id;
        if (imsi)
-               OSMO_STRLCPY_ARRAY(pch_dt.imsi, imsi);
-       /* OS#6097: if strlen(pch_dt.imsi) == 0: We assume the MS is in non-DRX
+               OSMO_STRLCPY_ARRAY(pch.imsi, imsi);
+       /* OS#6097: if strlen(pch.imsi) == 0: We assume the MS is in non-DRX
         * mode (TS 44.060 5.5.1.5) and hence it is listening on all CCCH blocks
         * (TS 45.002 6.5.3, 6.5.6).
         */

-       pch_dt.data[0] = (plen << 2) | 0x01;
-       bitvec_pack(block, pch_dt.data + 1);
+       pch.data[0] = (plen << 2) | 0x01;
+       bitvec_pack(block, pch.data + 1);

        if (the_pcu->gsmtap_categ_mask & (1 << PCU_GSMTAP_C_DL_PCH))
                gsmtap_send(the_pcu->gsmtap, 0, 0, GSMTAP_CHANNEL_PCH, 0, 0, 0, 
0,
-                           pch_dt.data, GSM_MACBLOCK_LEN);
+                           pch.data, GSM_MACBLOCK_LEN);

-       pcu_tx_data_req(bts, 0, 0, PCU_IF_SAPI_PCH_DT, 0, 0, 0, 
(uint8_t*)&pch_dt, sizeof(pch_dt));
+       pcu_tx_data_req(bts, 0, 0, PCU_IF_SAPI_PCH_2, 0, 0, 0, (uint8_t*)&pch, 
sizeof(pch));
 }

 int pcu_tx_neigh_addr_res_req(struct gprs_rlcmac_bts *bts, const struct 
neigh_cache_entry_key *neigh_key)
@@ -551,18 +551,18 @@
        return rc;
 }

-static int pcu_rx_data_cnf_dt(struct gprs_rlcmac_bts *bts, struct 
gsm_pcu_if_data_cnf_dt *data_cnf_dt)
+static int pcu_rx_data_cnf2(struct gprs_rlcmac_bts *bts, struct 
gsm_pcu_if_data_cnf *data_cnf)
 {
        int rc = 0;

-       LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d\n", 
data_cnf_dt->sapi);
+       LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d\n", 
data_cnf->sapi);

-       switch (data_cnf_dt->sapi) {
-       case PCU_IF_SAPI_PCH_DT:
-               bts_rcv_imm_ass_cnf(bts, NULL, data_cnf_dt->msg_id);
+       switch (data_cnf->sapi) {
+       case PCU_IF_SAPI_PCH_2:
+               bts_rcv_imm_ass_cnf(bts, NULL, data_cnf->msg_id);
                break;
        default:
-               LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with 
unsupported sapi %d\n", data_cnf_dt->sapi);
+               LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with 
unsupported sapi %d\n", data_cnf->sapi);
                rc = -EINVAL;
        }

@@ -1272,9 +1272,9 @@
                CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.data_cnf);
                rc = pcu_rx_data_cnf(bts, &pcu_prim->u.data_cnf);
                break;
-       case PCU_IF_MSG_DATA_CNF_DT:
-               CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.data_cnf_dt);
-               rc = pcu_rx_data_cnf_dt(bts, &pcu_prim->u.data_cnf_dt);
+       case PCU_IF_MSG_DATA_CNF_2:
+               CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.data_cnf2);
+               rc = pcu_rx_data_cnf2(bts, &pcu_prim->u.data_cnf2);
                break;
        case PCU_IF_MSG_RTS_REQ:
                CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.rts_req);
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index 3ff17dc..19ec60a 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -156,7 +156,7 @@

 int pcu_tx_neigh_addr_res_req(struct gprs_rlcmac_bts *bts, const struct 
neigh_cache_entry_key *neigh_key);
 void pcu_l1if_tx_pch(struct gprs_rlcmac_bts *bts, struct bitvec *block, int 
plen, const char *imsi);
-void pcu_l1if_tx_pch_dt(struct gprs_rlcmac_bts *bts, struct bitvec *block, int 
plen, const char *imsi, uint32_t msg_id);
+void pcu_l1if_tx_pch2(struct gprs_rlcmac_bts *bts, struct bitvec *block, int 
plen, const char *imsi, uint32_t msg_id);

 int pcu_rx(struct gsm_pcu_if *pcu_prim, size_t pcu_prim_length);
 int pcu_l1if_open(void);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: If641b507dcb6b176109c99dce7cff2a7561364b0
Gerrit-Change-Number: 34134
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to