summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2020-03-04 05:40:08 +0700
committerlaforge <laforge@osmocom.org>2020-03-08 22:50:54 +0000
commit03f220ecae6d87a05b69d9255ca86cef66c51b5e (patch)
treedef883c2f365b814f62f6ada3e73b849acb3a930
parenta1be0a6b62bb1b121df6084cb15c8e025310c460 (diff)
trxcon/scheduler: make TDMA_FN_INC(fn) behave like ++fn
-rw-r--r--src/host/trxcon/sched_clck.c4
-rw-r--r--src/host/trxcon/sched_trx.c4
-rw-r--r--src/host/trxcon/scheduler.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/host/trxcon/sched_clck.c b/src/host/trxcon/sched_clck.c
index 66477b24..7c814dc0 100644
--- a/src/host/trxcon/sched_clck.c
+++ b/src/host/trxcon/sched_clck.c
@@ -82,7 +82,7 @@ static void sched_clck_tick(void *data)
timespecadd(tv_clock, &frame_duration, tv_clock);
elapsed_us -= FRAME_DURATION_uS;
- sched->fn_counter_proc = TDMA_FN_INC(sched->fn_counter_proc);
+ TDMA_FN_INC(&sched->fn_counter_proc);
/* Call frame callback */
if (sched->clock_cb)
@@ -178,7 +178,7 @@ int sched_clck_handle(struct trx_sched *sched, uint32_t fn)
/* Transmit what we still need to transmit */
while (fn != sched->fn_counter_proc) {
- sched->fn_counter_proc = TDMA_FN_INC(sched->fn_counter_proc);
+ TDMA_FN_INC(&sched->fn_counter_proc);
/* Call frame callback */
if (sched->clock_cb)
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 6bb662db..b7914b62 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -640,7 +640,7 @@ int sched_trx_handle_rx_burst(struct trx_instance *trx, uint8_t tn,
* start counting from last fn + 1
*/
if (elapsed < 10)
- fn = TDMA_FN_INC(ts->mf_last_fn);
+ fn = TDMA_FN_SUM(ts->mf_last_fn, 1);
else
fn = burst_fn;
@@ -682,7 +682,7 @@ next_frame:
if (fn == burst_fn)
break;
- fn = TDMA_FN_INC(fn);
+ TDMA_FN_INC(&fn);
}
/* Set last processed frame number */
diff --git a/src/host/trxcon/scheduler.h b/src/host/trxcon/scheduler.h
index 7ab17ab5..36c64e5b 100644
--- a/src/host/trxcon/scheduler.h
+++ b/src/host/trxcon/scheduler.h
@@ -16,7 +16,7 @@
#define TDMA_FN_SUB(a, b) \
((a + GSM_HYPERFRAME - b) % GSM_HYPERFRAME)
#define TDMA_FN_INC(fn) \
- TDMA_FN_SUM(fn, 1)
+ (*fn = TDMA_FN_SUM(*fn, 1))
#define TDMA_FN_MIN(a, b) \
(a < b ? a : b)
#define TDMA_FN_DIFF(a, b) \