diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-06-25 21:18:12 +0700 |
---|---|---|
committer | fixeria <vyanitskiy@sysmocom.de> | 2020-06-25 18:02:10 +0000 |
commit | f28dc5197e3e07578ea3036ae821ccff7b95b7c5 (patch) | |
tree | 4eaf220a23d60f7a50626aa5f7cc23b41a3dd310 | |
parent | 2f18578dcc82b73ea06464dc59e215874eaf1e0b (diff) |
osmo-bts-trx: fix trx_sched_fn(): properly advance frame number
In trx_sched_fn() we schedule Downlink bursts in advance, in order
to give the transceiver some time to process them. This function
handles all timeslots of all transceivers in a loop. The problem
is that the given frame number is overwritten on each iteration.
Let's say we have 4 transceivers, each with default fn-advance 20.
The given frame number N will be advanced 4 times, so the resulting
frame number for 4-th transceiver would be (N + 4 * 20) instead of
(N + 20) as expected. Therefore, all additional transceivers would
be served more and more in the future (depending on their position).
Change-Id: Ie3ab544eac81a675266df09cd2b7740e4183188e
-rw-r--r-- | src/osmo-bts-trx/scheduler_trx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 3936124c..47cc4b5f 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -56,10 +56,11 @@ int tx_idle_fn(struct l1sched_trx *l1t, enum trx_chan_type chan, } /* schedule all frames of all TRX for given FN */ -static int trx_sched_fn(struct gsm_bts *bts, uint32_t fn) +static int trx_sched_fn(struct gsm_bts *bts, const uint32_t fn) { struct trx_dl_burst_req br; struct gsm_bts_trx *trx; + uint32_t sched_fn; uint8_t tn; /* send time indication */ @@ -74,7 +75,7 @@ static int trx_sched_fn(struct gsm_bts *bts, uint32_t fn) /* advance frame number, so the transceiver has more * time until it must be transmitted. */ - fn = GSM_TDMA_FN_SUM(fn, plink->u.osmotrx.clock_advance); + sched_fn = GSM_TDMA_FN_SUM(fn, plink->u.osmotrx.clock_advance); /* we don't schedule, if power is off */ if (!trx_if_powered(l1h)) @@ -83,11 +84,12 @@ static int trx_sched_fn(struct gsm_bts *bts, uint32_t fn) /* process every TS of TRX */ for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) { /* ready-to-send */ - _sched_rts(l1t, tn, GSM_TDMA_FN_SUM(fn, plink->u.osmotrx.rts_advance)); + _sched_rts(l1t, tn, GSM_TDMA_FN_SUM(sched_fn, plink->u.osmotrx.rts_advance)); /* All other parameters to be set by _sched_dl_burst() */ br = (struct trx_dl_burst_req) { - .fn = fn, .tn = tn, + .fn = sched_fn, + .tn = tn, }; /* get burst for FN */ |