summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-14 15:26:25 +0200
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-16 15:05:51 +0200
commitc652349b4a771189f8787e11764a41916e3004b5 (patch)
treedb5186f23a9641d498b224ebf86e24300f8c41bd
parente4d5bbccf9ff6e922cc2e32df1c3b626e6232eed (diff)
trxcon/scheduler: cosmetic: move TDMA frame number calculation
-rw-r--r--src/host/trxcon/sched_trx.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 0025e0cc..91310c09 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -50,9 +50,13 @@ static void sched_frame_clck_cb(struct trx_sched *sched)
enum trx_lchan_type chan;
uint8_t offset, bid;
struct trx_ts *ts;
- uint32_t fn;
int i;
+ /* Advance TDMA frame number in order to give the transceiver
+ * more time to handle the burst before the actual transmission. */
+ const uint32_t fn = GSM_TDMA_FN_SUM(sched->fn_counter_proc,
+ sched->fn_counter_advance);
+
/* Iterate over timeslot list */
for (i = 0; i < TRX_TS_COUNT; i++) {
/* Timeslot is not allocated */
@@ -64,12 +68,6 @@ static void sched_frame_clck_cb(struct trx_sched *sched)
if (ts->mf_layout == NULL)
continue;
- /**
- * Advance frame number, giving the transceiver more
- * time until a burst must be transmitted...
- */
- fn = GSM_TDMA_FN_SUM(sched->fn_counter_proc, sched->fn_counter_advance);
-
/* Get frame from multiframe */
offset = fn % ts->mf_layout->period;
frame = ts->mf_layout->frames + offset;