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

Change subject: pcuif_proto: rename tlli to msg_id
......................................................................

pcuif_proto: rename tlli to msg_id

To confirm downlink IMMEDIATE ASSIGNMENT messages, we use the TLLI as an
identifier and the related struct member is also called "tlli".
Unfortunately this is misleading since the message identifier does not
necessarly have to be a TLLI. It is just an implementation detail that
osmo-pcu uses the TLLI as a message identifier.

To make that clear, lets rename the tlli member (and variable and
parameter names where it is passed on) to "msg_id".

(Since this change only renames variables and struct members it will not
break compatibility with other programs that use the PCUIF)

Related: OS#5927
Depends: osmo-pcu.git I4a25039dfe329e68879bc68936e49c4b190625e6
Change-Id: Ie6b34d5df64f4bed6b14581c7957dcba6af44136
---
M include/osmo-bts/paging.h
M include/osmo-bts/pcu_if.h
M include/osmo-bts/pcuif_proto.h
M src/common/paging.c
M src/common/pcu_sock.c
5 files changed, 38 insertions(+), 15 deletions(-)

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




diff --git a/include/osmo-bts/paging.h b/include/osmo-bts/paging.h
index 93e7b38..e74ba3c 100644
--- a/include/osmo-bts/paging.h
+++ b/include/osmo-bts/paging.h
@@ -86,7 +86,7 @@

 /* Add a ready formatted MAC block message to the paging queue, this can be an 
IMMEDIATE ASSIGNMENT, or a
  * PAGING COMMAND (from the PCU) */
-int paging_add_macblock(struct paging_state *ps, uint32_t tlli, const char 
*imsi, bool confirm, const uint8_t *macblock);
+int paging_add_macblock(struct paging_state *ps, uint32_t msg_id, const char 
*imsi, bool confirm, const uint8_t *macblock);

 /* Paging rest octests */
 void append_p1_rest_octets(struct bitvec *bv, const struct p1_rest_octets 
*p1ro,
diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index d6e5d24..59e1d3d 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -23,7 +23,7 @@
 int pcu_tx_time_ind(uint32_t fn);
 int pcu_tx_interf_ind(const struct gsm_bts_trx *trx, uint32_t fn);
 int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed);
-int pcu_tx_pch_data_cnf(uint32_t fn, uint32_t tlli);
+int pcu_tx_pch_data_cnf(uint32_t fn, uint32_t msg_id);
 int pcu_tx_susp_req(struct gsm_lchan *lchan, uint32_t tlli, const uint8_t 
*ra_id, uint8_t cause);
 int pcu_sock_send(struct msgb *msg);

diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h
index bae6cda..3e3d6cc 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 (with direct tlli) */
+#define PCU_IF_MSG_DATA_CNF_DT 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 
TLLI) */
+#define PCU_IF_SAPI_PCH_DT     0x08    /* assignment on PCH (confirmed using 
message id) */
 
 /* flags */
 #define PCU_IF_FLAG_ACTIVE     (1 << 0)/* BTS is active */
@@ -87,10 +87,10 @@
        int16_t         lqual_cb;       /* !< \brief Link quality in centiBel */
 } __attribute__ ((packed));

-/* data confirmation with direct tlli (instead of raw mac block with tlli) */
+/* data confirmation with message id (instead of raw mac block) */
 struct gsm_pcu_if_data_cnf_dt {
        uint8_t         sapi;
-       uint32_t        tlli;
+       uint32_t        msg_id;
        uint32_t        fn;
        uint16_t        arfcn;
        uint8_t         trx_nr;
@@ -233,8 +233,8 @@
 /* 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 {
-       /* TLLI as reference for confirmation */
-       uint32_t tlli;
+       /* message id as reference for confirmation */
+       uint32_t msg_id;
        /* IMSI (to derive paging group) */
        char imsi[OSMO_IMSI_BUF_SIZE];
        /* GSM mac-block (with immediate assignment message) */
diff --git a/src/common/paging.c b/src/common/paging.c
index 914a4b5..ebfb84b 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -65,7 +65,7 @@
                struct {
                        uint8_t msg[GSM_MACBLOCK_LEN];
                        bool confirm;
-                       uint32_t tlli; /* used as identifier for confirmation */
+                       uint32_t msg_id; /* used as identifier for confirmation 
*/
                } macblock;
        } u;
 };
@@ -293,7 +293,7 @@

 /* Add a ready formatted MAC block message to the paging queue, this can be an 
IMMEDIATE ASSIGNMENT, or a
  * PAGING COMMAND (from the PCU) */
-int paging_add_macblock(struct paging_state *ps, uint32_t tlli, const char 
*imsi, bool confirm, const uint8_t *macblock)
+int paging_add_macblock(struct paging_state *ps, uint32_t msg_id, const char 
*imsi, bool confirm, const uint8_t *macblock)
 {
        struct llist_head *group_q;
        struct paging_record *pr;
@@ -322,7 +322,7 @@
                paging_group);
        memcpy(pr->u.macblock.msg, macblock, GSM_MACBLOCK_LEN);
        pr->u.macblock.confirm = confirm;
-       pr->u.macblock.tlli = tlli;
+       pr->u.macblock.msg_id = msg_id;

        /* enqueue the new message to the HEAD of the queue */
        llist_add(&pr->list, group_q);
@@ -734,7 +734,7 @@
                                                        GSM_MACBLOCK_LEN);
                        /* send a confirmation back (if required) */
                        if (pr[num_pr]->u.macblock.confirm)
-                               pcu_tx_pch_data_cnf(gt->fn, 
pr[num_pr]->u.macblock.tlli);
+                               pcu_tx_pch_data_cnf(gt->fn, 
pr[num_pr]->u.macblock.msg_id);
                        talloc_free(pr[num_pr]);
                        return GSM_MACBLOCK_LEN;
                }
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 9e34fe8..ad645a0 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -618,7 +618,7 @@
        return pcu_sock_send(msg);
 }

-int pcu_tx_pch_data_cnf(uint32_t fn, uint32_t tlli)
+int pcu_tx_pch_data_cnf(uint32_t fn, uint32_t msg_id)
 {
        struct gsm_bts *bts;
        struct msgb *msg;
@@ -635,7 +635,7 @@
        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,
-               .tlli = tlli,
+               .msg_id = msg_id,
                .fn = fn,
        };

@@ -689,7 +689,7 @@
                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;
                confirm = (gsm48_imm_ass->msg_type == GSM48_MT_RR_IMM_ASS);
-               rc = paging_add_macblock(bts->paging_state, 
gsm_pcu_if_pch_dt->tlli,
+               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);
                break;
        }

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie6b34d5df64f4bed6b14581c7957dcba6af44136
Gerrit-Change-Number: 34103
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to