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
This commit is contained in:
Philipp Maier 2023-08-08 16:06:57 +02:00
parent 88de4d6789
commit bbb3a1ed17
5 changed files with 15 additions and 15 deletions

View File

@ -86,7 +86,7 @@ int paging_add_identity(struct paging_state *ps, uint8_t paging_group,
/* 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,

View File

@ -23,7 +23,7 @@ int pcu_tx_rach_ind(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
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);

View File

@ -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 @@ struct gsm_pcu_if_data {
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 gsm_pcu_if_container {
/* 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) */

View File

@ -65,7 +65,7 @@ struct paging_record {
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 @@ static uint16_t convert_imsi_to_decimal(const char *imsi)
/* 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 @@ int paging_add_macblock(struct paging_state *ps, uint32_t tlli, const char *imsi
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 @@ int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *g
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;
}

View File

@ -618,7 +618,7 @@ int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed)
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 @@ int pcu_tx_pch_data_cnf(uint32_t fn, uint32_t tlli)
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 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
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;
}