diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-06-17 05:08:54 +0700 |
---|---|---|
committer | fixeria <vyanitskiy@sysmocom.de> | 2020-06-25 18:02:10 +0000 |
commit | 2f18578dcc82b73ea06464dc59e215874eaf1e0b (patch) | |
tree | a4c767914900838f8e75a40a04c92c9bc26716dd /src/common/l1sap.c | |
parent | 7a7168f0a86431a082836f59288cac683c485004 (diff) |
Use libosmocore's TDMA frame number API (constatns & arithmetic)
Depends: (libosmocore) Ic291fd3644f34964374227a191c7045d79d77e0d
Change-Id: I61c97a62bd5dbbb4a984921ebdfc10ad6ed00f2a
Diffstat (limited to 'src/common/l1sap.c')
-rw-r--r-- | src/common/l1sap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c index dad1b494..17a6c5d4 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -621,7 +621,7 @@ static int l1sap_info_time_ind(struct gsm_bts *bts, /* increment number of RACH slots that have passed by since the * last time indication */ for (i = 0; i < frames_expired; i++) { - uint32_t fn = (info_time_ind->fn + GSM_HYPERFRAME - i) % GSM_HYPERFRAME; + uint32_t fn = GSM_TDMA_FN_SUB(info_time_ind->fn, i); bts->load.rach.total += calc_exprd_rach_frames(bts, fn); } @@ -891,7 +891,7 @@ int32_t bts_get_avg_fn_advance(struct gsm_bts *bts) static void l1sap_update_fnstats(struct gsm_bts *bts, uint32_t rts_fn) { - int32_t delta = (rts_fn + GSM_HYPERFRAME - bts->gsm_time.fn) % GSM_HYPERFRAME; + int32_t delta = GSM_TDMA_FN_SUB(rts_fn, bts->gsm_time.fn); if (delta < bts->fn_stats.min) bts->fn_stats.min = delta; |