From 592239630b6d5b971c4a6e86ded2009b08b27bc3 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 18 Oct 2021 12:24:38 +0200 Subject: [PATCH] pdch: Simplify code path allocating UL TBF There's no real need to pass a tlli per separate, the information is already contained in the MS. Furthermore, when doing so, it becomes clear the TLLI was only passed to set it again on the MS, so actually that ms_update() can be totally dropped since it will act as a no-op. Change-Id: Ie761c3c7c222458ab0514117ae637ad3267139a0 --- src/pdch.cpp | 4 ++-- src/tbf_ul.cpp | 5 +---- src/tbf_ul.h | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pdch.cpp b/src/pdch.cpp index 68bc69df..7d70958e 100644 --- a/src/pdch.cpp +++ b/src/pdch.cpp @@ -119,7 +119,7 @@ static inline void sched_ul_ass_or_rej(struct gprs_rlcmac_bts *bts, struct gprs_ bts_do_rate_ctr_inc(bts, CTR_CHANNEL_REQUEST_DESCRIPTION); /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul_pacch(bts, tbf->ms(), tbf->trx->trx_no, tbf->tlli()); + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul_pacch(bts, tbf->ms(), tbf->trx->trx_no); /* schedule uplink assignment or reject */ if (ul_tbf) { @@ -707,7 +707,7 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, ms_set_egprs_ms_class(ms, egprs_ms_class); } - ul_tbf = tbf_alloc_ul_pacch(bts(), ms, trx_no(), tlli); + ul_tbf = tbf_alloc_ul_pacch(bts(), ms, trx_no()); if (!ul_tbf) { handle_tbf_reject(bts(), ms, trx_no(), ts_no); goto return_unref; diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index d4f2093a..74b2636b 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -152,8 +152,7 @@ struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs } /* Alloc a UL TBF to be assigned over PACCH */ -gprs_rlcmac_ul_tbf *tbf_alloc_ul_pacch(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, - uint32_t tlli) +gprs_rlcmac_ul_tbf *tbf_alloc_ul_pacch(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx) { struct gprs_rlcmac_ul_tbf *tbf; @@ -165,8 +164,6 @@ gprs_rlcmac_ul_tbf *tbf_alloc_ul_pacch(struct gprs_rlcmac_bts *bts, GprsMs *ms, } tbf->m_contention_resolution_done = 1; osmo_fsm_inst_dispatch(tbf->state_fsm.fi, TBF_EV_ASSIGN_ADD_PACCH, NULL); - tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - OSMO_ASSERT(tbf->ms()); return tbf; } diff --git a/src/tbf_ul.h b/src/tbf_ul.h index defdfba8..0dc2336d 100644 --- a/src/tbf_ul.h +++ b/src/tbf_ul.h @@ -126,8 +126,7 @@ inline uint16_t gprs_rlcmac_ul_tbf::window_size() const } struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, bool single_slot); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_pacch(struct gprs_rlcmac_bts *bts, GprsMs *ms, - int8_t use_trx, uint32_t tlli); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_pacch(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx); struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_ccch(struct gprs_rlcmac_bts *bts, struct GprsMs *ms); struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, uint8_t trx_no, uint8_t ts_no);