Simplify TS alloc: don't use PDCH for free TFI
Don't use PDCH from free TFI lookup routine. This allows for simpler
function which can be moved to mslot_class.c alongside with other
similar helpers.
Change-Id: Ie154866900453d232a890f7b9a30911b451525a1
Related: OS#2282
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 29e41f5..6791b03 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -62,23 +62,6 @@
return was_set;
}
-static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir)
-{
- uint32_t tfi_map = pdch->assigned_tfi(dir);
- int8_t tfi;
-
- if (tfi_map == NO_FREE_TFI)
- return -1;
-
- /* look for USF, don't use USF=7 */
- for (tfi = 0; tfi < 32; tfi++) {
- if (!(tfi_map & (1 << tfi)))
- return tfi;
- }
-
- return -1;
-}
-
static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask,
const char *mask_reason = NULL)
{
@@ -187,7 +170,7 @@
/* We have found a candidate */
/* Make sure that a TFI is available */
if (free_tfi) {
- tfi = find_free_tfi(pdch, dir);
+ tfi = find_free_tfi(pdch->assigned_tfi(dir));
if (tfi < 0) {
LOGP(DRLCMAC, LOGL_DEBUG,
"- Skipping TS %d, because "