diff options
author | Max <msuraev@sysmocom.de> | 2017-05-16 16:10:45 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-05-26 07:55:52 +0000 |
commit | 9dabfa2c2b882bf4ce72c941f021f7a439de041a (patch) | |
tree | 6f060cdd5d071f9b156b5cbaafd1e167a4b3b71f /src/tbf.cpp | |
parent | 356ac618f1f4b455e411507c4be4c9909fe927bb (diff) |
Cleanup FN scheduling
* replace magic number with defined constant
* move copy-pasted code to inline functions
* remove unused code
Change-Id: I6fee0714453d0c3c3f3f875f88daea2d9c477331
Related: OS#1524
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 70b8d61e..48e8289b 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -566,8 +566,7 @@ void gprs_rlcmac_tbf::stop_timer() int gprs_rlcmac_tbf::check_polling(uint32_t fn, uint8_t ts, uint32_t *poll_fn_, unsigned int *rrbp_) { - uint32_t fn_offs = 13; - uint32_t new_poll_fn = (fn + fn_offs) % 2715648; + uint32_t new_poll_fn = next_fn(fn, 13); if (!is_control_ts(ts)) { LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be " @@ -581,7 +580,7 @@ int gprs_rlcmac_tbf::check_polling(uint32_t fn, uint8_t ts, name()); return -EBUSY; } - if (bts->sba()->find(trx->trx_no, ts, (fn + 13) % 2715648)) { + if (bts->sba()->find(trx->trx_no, ts, next_fn(fn, 13))) { LOGP(DRLCMAC, LOGL_DEBUG, "%s: Polling is already scheduled " "for single block allocation at FN %d TS %d ...\n", name(), new_poll_fn, ts); |