fixeria has uploaded this change for review.

View Change

l1gprs: migrate to gsm0502_fn_compare()

Change-Id: I10261aa114b5dce3efee26ea84a1caa50c49a1d2
Depends: libosmocore.git I9590f2e836fc48650decf1564b6ab46306c4fe2d
Related: OS#5500
---
M src/shared/l1gprs.c
1 file changed, 12 insertions(+), 14 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/22/34522/1
diff --git a/src/shared/l1gprs.c b/src/shared/l1gprs.c
index bfbda59..5f45614 100644
--- a/src/shared/l1gprs.c
+++ b/src/shared/l1gprs.c
@@ -344,19 +344,6 @@
LOG_TBF_ARGS(preq), preq->start_fn);
}

-/* Check if the current TDMA Fn is past the start TDMA Fn.
- * Based on fn_cmp() implementation from osmo-pcu.git, simplified. */
-static bool l1gprs_check_fn(uint32_t current, uint32_t start)
-{
- const uint32_t thresh = GSM_TDMA_HYPERFRAME / 2;
-
- if ((current < start && (start - current) < thresh) ||
- (current > start && (current - start) > thresh))
- return false;
-
- return true;
-}
-
/* Check the list of pending TBFs and move those with expired Fn to the active list */
static void l1gprs_check_pending_tbfs(struct l1gprs_state *gprs, uint32_t fn)
{
@@ -364,7 +351,7 @@
struct l1gprs_tbf *tbf;

llist_for_each_entry_safe(preq, tmp, &gprs->tbf_list_pending, list) {
- if (!l1gprs_check_fn(fn, preq->start_fn))
+ if (gsm0502_fn_compare(fn, preq->start_fn) < 0)
continue;

LOGP_GPRS(gprs, LOGL_INFO,

To view, visit change 34522. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I10261aa114b5dce3efee26ea84a1caa50c49a1d2
Gerrit-Change-Number: 34522
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-MessageType: newchange