bts: get rid of fn parameter in bts_rcv_imm_ass_cnf

The function bts_rcv_imm_ass_cnf, which processes the confirmation
message from osmo-bts or osmo-bsc has an fn (frame number) parameter.
This parameter not used for anything other than logging. The source of
this frame number parameter is the conformation message that comes from
osmo-pcu or osmo-bsc. In the case of osmo-bsc the frame number is always
0, since osmo-bsc uses RSL and can not know the exact frame numbers.

since we do not really need the frame number for the confirmation, lets
remove the fn parameter entirely.

Related: OS#5927
Change-Id: I35bc99eaec5d0287ae3916bc668f0babaddfd6ce
This commit is contained in:
Philipp Maier 2023-08-08 16:25:33 +02:00
parent fa96a767d1
commit 02ea46eff9
3 changed files with 14 additions and 18 deletions

View File

@ -666,7 +666,7 @@ int bts_tfi_find_free(const struct gprs_rlcmac_bts *bts, enum gprs_rlcmac_tbf_di
return best_first_tfi;
}
static int tlli_from_imm_ass(uint32_t *tlli, const uint8_t *data, uint32_t fn)
static int tlli_from_imm_ass(uint32_t *tlli, const uint8_t *data)
{
const struct gsm48_imm_ass *imm_ass = (struct gsm48_imm_ass *)data;
uint8_t plen;
@ -680,9 +680,9 @@ static int tlli_from_imm_ass(uint32_t *tlli, const uint8_t *data, uint32_t fn)
data += 1 + plen;
if ((*data & 0xf0) != 0xd0) {
LOGP(DTBFDL, LOGL_ERROR, "FN=%u Got IMM.ASS confirm, but rest "
LOGP(DTBFDL, LOGL_ERROR, "Got IMM.ASS confirm, but rest "
"octets do not start with bit sequence 'HH01' "
"(Packet Downlink Assignment)\n", fn);
"(Packet Downlink Assignment)\n");
return -EINVAL;
}
@ -696,7 +696,7 @@ static int tlli_from_imm_ass(uint32_t *tlli, const uint8_t *data, uint32_t fn)
return 0;
}
int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32_t tlli, uint32_t fn)
int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32_t tlli)
{
struct gprs_rlcmac_dl_tbf *dl_tbf;
GprsMs *ms;
@ -710,30 +710,30 @@ int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32
/* Extract TLLI from the presented IMMEDIATE ASSIGNMENT
* (if present and only when TLLI that is supplied as function parameter is valid.) */
if (data && tlli == GSM_RESERVED_TMSI) {
rc = tlli_from_imm_ass(&tlli, data, fn);
rc = tlli_from_imm_ass(&tlli, data);
if (rc != 0)
return -EINVAL;
}
/* Make sure TLLI is valid */
if (tlli == GSM_RESERVED_TMSI) {
LOGP(DTBFDL, LOGL_ERROR, "FN=%u Got IMM.ASS confirm, but TLLI is invalid!\n", fn);
LOGP(DTBFDL, LOGL_ERROR, "Got IMM.ASS confirm, but TLLI is invalid!\n");
return -EINVAL;
}
/* Find related TBF and send confirmation signal to FSM */
ms = bts_get_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI);
if (!ms) {
LOGP(DTBFDL, LOGL_ERROR, "FN=%u Got IMM.ASS confirm for unknown MS with TLLI=%08x\n", fn, tlli);
LOGP(DTBFDL, LOGL_ERROR, "Got IMM.ASS confirm for unknown MS with TLLI=%08x\n", tlli);
return -EINVAL;
}
dl_tbf = ms_dl_tbf(ms);
if (!dl_tbf) {
LOGPMS(ms, DTBFDL, LOGL_ERROR, "FN=%u Got IMM.ASS confirm, but MS has no DL TBF!\n", fn);
LOGPMS(ms, DTBFDL, LOGL_ERROR, "Got IMM.ASS confirm, but MS has no DL TBF!\n");
return -EINVAL;
}
LOGPTBFDL(dl_tbf, LOGL_DEBUG, "FN=%u Got IMM.ASS confirm\n", fn);
LOGPTBFDL(dl_tbf, LOGL_DEBUG, "Got IMM.ASS confirm\n");
osmo_fsm_inst_dispatch(dl_tbf->state_fi, TBF_EV_ASSIGN_PCUIF_CNF, NULL);
return 0;

View File

@ -307,7 +307,7 @@ int bts_tfi_find_free(const struct gprs_rlcmac_bts *bts, enum gprs_rlcmac_tbf_di
int bts_rcv_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip);
int bts_rcv_ptcch_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip);
int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32_t tlli, uint32_t fn);
int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32_t tlli);
void bts_send_gsmtap(struct gprs_rlcmac_bts *bts,
enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no,

View File

@ -534,15 +534,13 @@ static int pcu_rx_data_ind(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data *
static int pcu_rx_data_cnf(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data *data_cnf)
{
int rc = 0;
int current_fn = bts_current_frame_number(bts);
LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d fn=%d cur_fn=%d\n",
data_cnf->sapi, data_cnf->fn, current_fn);
LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d\n", data_cnf->sapi);
switch (data_cnf->sapi) {
case PCU_IF_SAPI_PCH:
if (data_cnf->data[2] == GSM48_MT_RR_IMM_ASS)
bts_rcv_imm_ass_cnf(bts, data_cnf->data, GSM_RESERVED_TMSI, data_cnf->fn);
bts_rcv_imm_ass_cnf(bts, data_cnf->data, GSM_RESERVED_TMSI);
break;
default:
LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with "
@ -556,14 +554,12 @@ static int pcu_rx_data_cnf(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data *
static int pcu_rx_data_cnf_dt(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data_cnf_dt *data_cnf_dt)
{
int rc = 0;
int current_fn = bts_current_frame_number(bts);
LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d fn=%d cur_fn=%d\n",
data_cnf_dt->sapi, data_cnf_dt->fn, current_fn);
LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d\n", data_cnf_dt->sapi);
switch (data_cnf_dt->sapi) {
case PCU_IF_SAPI_PCH_DT:
bts_rcv_imm_ass_cnf(bts, NULL, data_cnf_dt->msg_id, data_cnf_dt->fn);
bts_rcv_imm_ass_cnf(bts, NULL, data_cnf_dt->msg_id);
break;
default:
LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with unsupported sapi %d\n", data_cnf_dt->sapi);