aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-03-24 12:40:18 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2021-03-24 17:12:01 +0100
commit4bab867d9fc983ee9c9ed1ab97cfe0e9e30b42b6 (patch)
treed0488d839ee909d29c3bf68d93f6ddd3731a3530
parent107e94c9f8f2e4205fbf7ce89aec886d42dcc401 (diff)
sched: Simplify usf selection code
Simply use the UL TBF pointer all along until the end, instead of setting both the UL TBF pointer plus the usf var. This commit is also a preparation for next commit which also selects UL TBF when a poll is available, to set its USF in the DL message instead of "USF_UNUSED". Change-Id: I3aa3886932ef87db18ed7ff6991ea315f481990b
-rw-r--r--src/gprs_rlcmac_sched.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index c54f533f..25a3766e 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -421,7 +421,7 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts,
struct gprs_rlcmac_pdch *pdch;
struct tbf_sched_candidates tbf_cand = {0};
struct gprs_rlcmac_tbf *poll_tbf;
- struct gprs_rlcmac_ul_tbf *usf_tbf;
+ struct gprs_rlcmac_ul_tbf *usf_tbf = NULL;
struct gprs_rlcmac_sba *sba;
uint8_t usf;
struct msgb *msg = NULL;
@@ -468,27 +468,19 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts,
"TS=%d FN=%d block_nr=%d scheduling free USF for "
"polling at FN=%d of %s\n", trx, ts, fn,
block_nr, poll_fn, tbf_name(poll_tbf));
- usf = USF_UNUSED;
/* else. check for sba */
} else if ((sba = pdch_ulc_get_sba(pdch->ulc, poll_fn))) {
LOGPDCH(pdch, DRLCMACSCHED, LOGL_DEBUG, "Received RTS for PDCH: "
"FN=%d block_nr=%d scheduling free USF for "
"single block allocation at FN=%d\n", fn, block_nr, sba->fn);
- usf = USF_UNUSED;
/* else, we search for uplink resource */
} else {
usf_tbf = sched_select_uplink(trx, ts, fn, block_nr, pdch, require_gprs_only);
- if (usf_tbf) {
- usf = usf_tbf->m_usf[ts];
- /* If MS selected for USF is GPRS-only, then it will
- * only be able to read USF if dl block uses GMSK
- * (CS1-4, MCS1-4)
- */
- if (req_mcs_kind == EGPRS && ms_mode(usf_tbf->ms()) != EGPRS)
+ /* If MS selected for USF is GPRS-only, then it will only be
+ * able to read USF if dl block uses GMSK * (CS1-4, MCS1-4)
+ */
+ if (usf_tbf && req_mcs_kind == EGPRS && ms_mode(usf_tbf->ms()) != EGPRS)
req_mcs_kind = EGPRS_GMSK;
- } else {
- usf = USF_UNUSED;
- }
}
get_tbf_candidates(bts, trx, ts, &tbf_cand);
@@ -521,6 +513,7 @@ int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts,
/* set USF */
OSMO_ASSERT(msgb_length(msg) > 0);
+ usf = usf_tbf ? usf_tbf->m_usf[ts] : USF_UNUSED;
msg->data[0] = (msg->data[0] & 0xf8) | usf;
/* Used to measure the leak rate, count all blocks */