rlcmac/sched: use TDMA Fn macros from libosmogsm

Change-Id: I536a0d2ae9b5dabcd3976f5aeb15069bd03e6aa9
This commit is contained in:
Vadim Yanitskiy 2023-03-02 22:06:05 +07:00 committed by fixeria
parent 42f302a4f9
commit eb622ef09c
1 changed files with 3 additions and 7 deletions

View File

@ -21,6 +21,7 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/gsm0502.h>
#include <osmocom/gprs/rlcmac/rlcmac_private.h>
#include <osmocom/gprs/rlcmac/sched.h>
@ -39,11 +40,6 @@ struct tbf_sched_ctrl_candidates {
struct gprs_rlcmac_ul_tbf *ul_ass;
};
static inline uint32_t next_fn(uint32_t fn, uint32_t offset)
{
return (fn + offset) % GSM_MAX_FN;
}
static inline bool fn_valid(uint32_t fn)
{
uint32_t f = fn % 13;
@ -62,10 +58,10 @@ uint32_t rrbp2fn(uint32_t cur_fn, uint8_t rrbp)
OSMO_ASSERT(rrbp < ARRAY_SIZE(rrbp_list));
poll_fn = next_fn(cur_fn, rrbp_list[rrbp]);
poll_fn = GSM_TDMA_FN_SUM(cur_fn, rrbp_list[rrbp]);
if (!fn_valid(poll_fn)) {
/* 17 -> 18, 21 -> 22: */
poll_fn = next_fn(poll_fn, 1);
GSM_TDMA_FN_INC(poll_fn);
OSMO_ASSERT(fn_valid(poll_fn));
}
return poll_fn;