aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-07-22 20:03:10 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-07-22 20:06:18 +0200
commit81db7334da9a716321ad49c946c33dbf7f8985e5 (patch)
tree29e40d9962ecf54e619b4da927dd16e989abe074
parent890de986ce99079877f3c7202db5e0405309ff60 (diff)
tbf: Drop impossible paths in create_dl_ass()
create_dl_ass() is only called in gprs_rlcmac_sched.cpp on tbf_cand->dl_ass pointer, which is always assigned under the guard "!tbf->is_control_ts(pdch->ts_no)", since we only send CTRL messages for a TBF on its control TS. Hence, condition "!is_control_ts(ts)" in create_dl_ass will always be false, and as a result poll_ass_dl will always be 1. So we can drop different code paths. Change-Id: Ibea4100a5dc8bd49303cb6a3d02417038c3d3887
-rw-r--r--src/tbf.cpp40
1 files changed, 13 insertions, 27 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp
index e83f4723..fcad879f 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -852,29 +852,24 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn, uint8_t ts)
struct msgb *msg;
struct gprs_rlcmac_dl_tbf *new_dl_tbf = NULL;
RlcMacDownlink_t *mac_control_block = NULL;
- int poll_ass_dl = 1;
+ const int poll_ass_dl = 1;
unsigned int rrbp = 0;
uint32_t new_poll_fn = 0;
int rc;
bool old_tfi_is_valid = is_tfi_assigned();
- if (direction == GPRS_RLCMAC_DL_TBF && !is_control_ts(ts)) {
- LOGPTBF(this, LOGL_NOTICE,
- "Cannot poll for downlink assignment, because MS cannot reply. (TS=%d, first common TS=%d)\n",
- ts, first_common_ts);
- poll_ass_dl = 0;
- }
- if (poll_ass_dl) {
- if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK)
- {
- LOGPTBF(this, LOGL_DEBUG,
- "Polling is already scheduled, so we must wait for the uplink assignment...\n");
- return NULL;
- }
- rc = check_polling(fn, ts, &new_poll_fn, &rrbp);
- if (rc < 0)
- return NULL;
+ /* We only use this function in control TS (PACCH) so that MS can always answer the poll */
+ OSMO_ASSERT(is_control_ts(ts));
+
+ if (ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK)
+ {
+ LOGPTBF(this, LOGL_DEBUG,
+ "Polling is already scheduled, so we must wait for the uplink assignment...\n");
+ return NULL;
}
+ rc = check_polling(fn, ts, &new_poll_fn, &rrbp);
+ if (rc < 0)
+ return NULL;
/* on uplink TBF we get the downlink TBF to be assigned. */
if (direction == GPRS_RLCMAC_UL_TBF) {
@@ -938,16 +933,7 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn, uint8_t ts)
LOGP(DTBF, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n");
bts_do_rate_ctr_inc(bts, CTR_PKT_DL_ASSIGNMENT);
- if (poll_ass_dl) {
- set_polling(new_poll_fn, ts, PDCH_ULC_POLL_DL_ASS);
- } else {
- dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE;
- TBF_SET_STATE(new_dl_tbf, TBF_ST_FLOW);
- tbf_assign_control_ts(new_dl_tbf);
- /* stop pending assignment timer */
- new_dl_tbf->t_stop(T0, "assignment (DL-TBF)");
-
- }
+ set_polling(new_poll_fn, ts, PDCH_ULC_POLL_DL_ASS);
talloc_free(mac_control_block);
return msg;