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
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 70b8d61..48e8289 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -566,8 +566,7 @@
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 @@
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);