From 5b7eeecac2ba02ccf482099b4f7269cfc1518206 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 15 Dec 2022 19:08:13 +0100 Subject: [PATCH] Pass gprc_rlcmac_pdch to tbf_set_polling Change-Id: I5ecc57c72e7f60e31e64e76e724d7a5a95968c40 --- src/nacc_fsm.c | 2 +- src/tbf.cpp | 15 +++++---------- src/tbf.h | 3 +-- src/tbf_dl.cpp | 2 +- src/tbf_dl_ass_fsm.c | 2 +- src/tbf_ul_ack_fsm.c | 2 +- src/tbf_ul_ass_fsm.c | 2 +- 7 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/nacc_fsm.c b/src/nacc_fsm.c index cc75238f..0719d2ca 100644 --- a/src/nacc_fsm.c +++ b/src/nacc_fsm.c @@ -202,7 +202,7 @@ static struct msgb *create_packet_cell_chg_continue(const struct nacc_fsm_ctx *c LOGP(DNACC, LOGL_DEBUG, "------------------------- TX : Packet Cell Change Continue -------------------------\n"); rate_ctr_inc(rate_ctr_group_get_ctr(bts_rate_counters(ms->bts), CTR_PKT_CELL_CHG_CONTINUE)); talloc_free(mac_control_block); - tbf_set_polling(tbf, *new_poll_fn, data->pdch->ts_no, PDCH_ULC_POLL_CELL_CHG_CONTINUE); + tbf_set_polling(tbf, data->pdch, *new_poll_fn, PDCH_ULC_POLL_CELL_CHG_CONTINUE); LOGPTBF(tbf, LOGL_DEBUG, "Scheduled 'Packet Cell Change Continue' polling on PACCH (FN=%d, TS=%d)\n", *new_poll_fn, data->pdch->ts_no); diff --git a/src/tbf.cpp b/src/tbf.cpp index 70e3e6c7..9e030890 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -458,14 +458,6 @@ void gprs_rlcmac_tbf::t_start(enum tbf_timers t, int T, const char *reason, bool osmo_timer_schedule(&Tarr[t], sec, microsec); } -void gprs_rlcmac_tbf::set_polling(uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason reason) -{ - /* schedule polling */ - if (pdch_ulc_reserve_tbf_poll(trx->pdch[ts].ulc, new_poll_fn, this, reason) < 0) - LOGPTBF(this, LOGL_ERROR, "Failed scheduling poll on PACCH (FN=%d, TS=%d)\n", - new_poll_fn, ts); -} - void gprs_rlcmac_tbf::poll_timeout(struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason) { gprs_rlcmac_ul_tbf *ul_tbf; @@ -843,9 +835,12 @@ int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcma return 0; } -void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t) +void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, uint32_t new_poll_fn, enum pdch_ulc_tbf_poll_reason t) { - return tbf->set_polling(new_poll_fn, ts, t); + /* schedule polling */ + if (pdch_ulc_reserve_tbf_poll(pdch->ulc, new_poll_fn, tbf, t) < 0) + LOGPTBF(tbf, LOGL_ERROR, "FN=%u Failed scheduling poll on PACCH %s\n", + new_poll_fn, pdch_name(pdch)); } void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason) diff --git a/src/tbf.h b/src/tbf.h index 1d5d4f15..b0335900 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -140,7 +140,7 @@ uint8_t tbf_tfi(const struct gprs_rlcmac_tbf *tbf); bool tbf_is_egprs_enabled(const struct gprs_rlcmac_tbf *tbf); void tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); int tbf_check_polling(const struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, uint32_t fn, uint32_t *poll_fn, unsigned int *rrbp); -void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, uint32_t new_poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason t); +void tbf_set_polling(struct gprs_rlcmac_tbf *tbf, const struct gprs_rlcmac_pdch *pdch, uint32_t new_poll_fn, enum pdch_ulc_tbf_poll_reason t); void tbf_poll_timeout(struct gprs_rlcmac_tbf *tbf, struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason); void tbf_update_state_fsm_name(struct gprs_rlcmac_tbf *tbf); const char* tbf_rlcmac_diag(const struct gprs_rlcmac_tbf *tbf); @@ -188,7 +188,6 @@ struct gprs_rlcmac_tbf { void t_stop(enum tbf_timers t, const char *reason); void t_start(enum tbf_timers t, int T, const char *reason, bool force, const char *file, unsigned line); - void set_polling(uint32_t poll_fn, uint8_t ts, enum pdch_ulc_tbf_poll_reason reason); void poll_timeout(struct gprs_rlcmac_pdch *pdch, uint32_t poll_fn, enum pdch_ulc_tbf_poll_reason reason); /** tlli handling */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 25aea483..f799cb02 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -805,7 +805,7 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block( rc = tbf_check_polling(this, pdch, fn, &new_poll_fn, &rrbp); if (rc >= 0) { - set_polling(new_poll_fn, pdch->ts_no, PDCH_ULC_POLL_DL_ACK); + tbf_set_polling(this, pdch, new_poll_fn, PDCH_ULC_POLL_DL_ACK); LOGPTBFDL(this, LOGL_DEBUG, "Scheduled DL Acknowledgement polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, pdch->ts_no); diff --git a/src/tbf_dl_ass_fsm.c b/src/tbf_dl_ass_fsm.c index 6a1bc92d..dec7042c 100644 --- a/src/tbf_dl_ass_fsm.c +++ b/src/tbf_dl_ass_fsm.c @@ -113,7 +113,7 @@ struct msgb *create_packet_dl_assign(const struct tbf_dl_ass_fsm_ctx *ctx, LOGP(DTBF, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); bts_do_rate_ctr_inc(ms->bts, CTR_PKT_DL_ASSIGNMENT); - tbf_set_polling(ctx->tbf, new_poll_fn, d->pdch->ts_no, PDCH_ULC_POLL_DL_ASS); + tbf_set_polling(ctx->tbf, d->pdch, new_poll_fn, PDCH_ULC_POLL_DL_ASS); LOGPTBF(ctx->tbf, LOGL_INFO, "Scheduled DL Assignment polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, d->pdch->ts_no); diff --git a/src/tbf_ul_ack_fsm.c b/src/tbf_ul_ack_fsm.c index a188b08c..e2299d47 100644 --- a/src/tbf_ul_ack_fsm.c +++ b/src/tbf_ul_ack_fsm.c @@ -93,7 +93,7 @@ static struct msgb *create_ul_ack_nack(const struct tbf_ul_ack_fsm_ctx *ctx, osmo_fsm_inst_dispatch(tbf_state_fi(ul_tbf_as_tbf(ctx->tbf)), TBF_EV_CONTENTION_RESOLUTION_MS_SUCCESS, NULL); if (final) { - tbf_set_polling(ul_tbf_as_tbf(tbf), new_poll_fn, d->pdch->ts_no, PDCH_ULC_POLL_UL_ACK); + tbf_set_polling(ul_tbf_as_tbf(tbf), d->pdch, new_poll_fn, PDCH_ULC_POLL_UL_ACK); LOGPTBFUL(tbf, LOGL_DEBUG, "Scheduled UL Acknowledgement polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, d->pdch->ts_no); diff --git a/src/tbf_ul_ass_fsm.c b/src/tbf_ul_ass_fsm.c index 8f2b70cd..e15f21c0 100644 --- a/src/tbf_ul_ass_fsm.c +++ b/src/tbf_ul_ass_fsm.c @@ -128,7 +128,7 @@ struct msgb *create_packet_ul_assign(const struct tbf_ul_ass_fsm_ctx *ctx, LOGP(DTBF, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); bts_do_rate_ctr_inc(ms->bts, CTR_PKT_UL_ASSIGNMENT); - tbf_set_polling(ctx->tbf, new_poll_fn, d->pdch->ts_no, PDCH_ULC_POLL_UL_ASS); + tbf_set_polling(ctx->tbf, d->pdch, new_poll_fn, PDCH_ULC_POLL_UL_ASS); LOGPTBF(ctx->tbf, LOGL_INFO, "Scheduled UL Assignment polling on PACCH (FN=%d, TS=%d)\n", new_poll_fn, d->pdch->ts_no);