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


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.

Depends: osmo-pcu.git If641b507dcb6b176109c99dce7cff2a7561364b0
Change-Id: Icf85f60ae86fbe1f3b98e1457c0598bb09cb08c5
Related: OS#5927
---
M include/osmo-bts/pcuif_proto.h
M src/common/pcu_sock.c
2 files changed, 32 insertions(+), 17 deletions(-)



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

diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index b93822d..d584ba4 100644
--- a/include/osmo-bts/pcuif_proto.h
+++ b/include/osmo-bts/pcuif_proto.h
@@ -17,7 +17,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_ACT_REQ     0x40    /* activate/deactivate PDCH */
@@ -35,7 +35,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 */
@@ -88,7 +88,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));
@@ -222,8 +222,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) */
@@ -241,7 +241,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/common/pcu_sock.c b/src/common/pcu_sock.c
index 67958f6..2431e85 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -59,7 +59,7 @@
        [PCU_IF_SAPI_PDTCH] =   "PDTCH",
        [PCU_IF_SAPI_PRACH] =   "PRACH",
        [PCU_IF_SAPI_PTCCH] =   "PTCCH",
-       [PCU_IF_SAPI_PCH_DT] =  "PCH_DT",
+       [PCU_IF_SAPI_PCH_2] =   "PCH_2",
 };

 /*
@@ -629,12 +629,12 @@

        LOGP(DPCU, LOGL_DEBUG, "Sending PCH confirm\n");

-       msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_CNF_DT, bts->nr);
+       msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_CNF_2, bts->nr);
        if (!msg)
                return -ENOMEM;
        pcu_prim = (struct gsm_pcu_if *) msg->data;
-       pcu_prim->u.data_cnf_dt = (struct gsm_pcu_if_data_cnf_dt) {
-               .sapi = PCU_IF_SAPI_PCH_DT,
+       pcu_prim->u.data_cnf2 = (struct gsm_pcu_if_data_cnf) {
+               .sapi = PCU_IF_SAPI_PCH_2,
                .msg_id = msg_id,
        };

@@ -673,23 +673,23 @@
                osmo_hexdump(data_req->data, data_req->len));

        switch (data_req->sapi) {
-       case PCU_IF_SAPI_PCH_DT:
+       case PCU_IF_SAPI_PCH_2:
        {
-               const struct gsm_pcu_if_pch_dt *gsm_pcu_if_pch_dt;
+               const struct gsm_pcu_if_pch *gsm_pcu_if_pch;
                const struct gsm48_imm_ass *gsm48_imm_ass;
                bool confirm;

-               if (OSMO_UNLIKELY(data_req->len != sizeof(*gsm_pcu_if_pch_dt))) 
{
+               if (OSMO_UNLIKELY(data_req->len != sizeof(*gsm_pcu_if_pch))) {
                        LOGP(DPCU, LOGL_ERROR, "Rx malformed DATA.req for 
PCH\n");
                        rc = -EINVAL;
                        break;
                }

-               gsm_pcu_if_pch_dt = (struct gsm_pcu_if_pch_dt *)data_req->data;
-               gsm48_imm_ass = (struct gsm48_imm_ass *)gsm_pcu_if_pch_dt->data;
+               gsm_pcu_if_pch = (struct gsm_pcu_if_pch *)data_req->data;
+               gsm48_imm_ass = (struct gsm48_imm_ass *)gsm_pcu_if_pch->data;
                confirm = (gsm48_imm_ass->msg_type == GSM48_MT_RR_IMM_ASS);
-               rc = paging_add_macblock(bts->paging_state, 
gsm_pcu_if_pch_dt->msg_id,
-                                        gsm_pcu_if_pch_dt->imsi, confirm, 
gsm_pcu_if_pch_dt->data);
+               rc = paging_add_macblock(bts->paging_state, 
gsm_pcu_if_pch->msg_id,
+                                        gsm_pcu_if_pch->imsi, confirm, 
gsm_pcu_if_pch->data);
                break;
        }
        case PCU_IF_SAPI_AGCH:

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icf85f60ae86fbe1f3b98e1457c0598bb09cb08c5
Gerrit-Change-Number: 34137
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-MessageType: newchange

Reply via email to