fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30238 )
Change subject: trxcon: make l1sched_trigger() accept the [advanced] TDMA Fn ......................................................................
trxcon: make l1sched_trigger() accept the [advanced] TDMA Fn
Change-Id: Icc9127bfacfbb78ab9d74103b2db03be850f3d4f Related: OS#5599 --- M src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h M src/host/trxcon/src/sched_clck.c M src/host/trxcon/src/sched_trx.c 3 files changed, 11 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/38/30238/1
diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h index 3dfafb3..eb95c85 100644 --- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h @@ -490,7 +490,7 @@ /* Clock and Downlink scheduling trigger */ int l1sched_clck_handle(struct l1sched_state *sched, uint32_t fn); void l1sched_clck_reset(struct l1sched_state *sched); -void l1sched_trigger(struct l1sched_state *sched); +void l1sched_trigger(struct l1sched_state *sched, uint32_t fn);
/* External L1 API, must be implemented by the API user */ int l1sched_handle_config_req(struct l1sched_state *sched, diff --git a/src/host/trxcon/src/sched_clck.c b/src/host/trxcon/src/sched_clck.c index ccafd7b..5862d0a 100644 --- a/src/host/trxcon/src/sched_clck.c +++ b/src/host/trxcon/src/sched_clck.c @@ -42,6 +42,12 @@ #define MAX_FN_SKEW 50 #define TRX_LOSS_FRAMES 400
+/* Advance TDMA frame number in order to give the transceiver + * more time to handle the burst before the actual transmission. */ +#define l1sched_trigger_advance(sched) \ + l1sched_trigger((sched), GSM_TDMA_FN_SUM((sched)->fn_counter_proc, \ + (sched)->fn_counter_advance)) + static void l1sched_clck_tick(void *data) { struct l1sched_state *sched = (struct l1sched_state *) data; @@ -82,7 +88,7 @@ GSM_TDMA_FN_INC(sched->fn_counter_proc);
/* Trigger the scheduler */ - l1sched_trigger(sched); + l1sched_trigger_advance(sched); }
osmo_timer_schedule(&sched->clock_timer, 0, @@ -95,7 +101,7 @@ sched->fn_counter_proc = fn;
/* Trigger the scheduler */ - l1sched_trigger(sched); + l1sched_trigger_advance(sched);
/* Schedule first FN clock */ sched->clock = *tv_now; @@ -176,7 +182,7 @@ GSM_TDMA_FN_INC(sched->fn_counter_proc);
/* Trigger the scheduler */ - l1sched_trigger(sched); + l1sched_trigger_advance(sched); }
/* Schedule next FN to be transmitted */ diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index c36b7de..bef8cc2 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -85,7 +85,7 @@ static void l1sched_a5_burst_enc(struct l1sched_lchan_state *lchan, struct l1sched_burst_req *br);
-void l1sched_trigger(struct l1sched_state *sched) +void l1sched_trigger(struct l1sched_state *sched, uint32_t fn) { struct l1sched_burst_req br[TRX_TS_COUNT]; const struct l1sched_tdma_frame *frame; @@ -96,11 +96,6 @@ struct l1sched_ts *ts; unsigned int tn;
- /* 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 (tn = 0; tn < ARRAY_SIZE(br); tn++) { /* Initialize the buffer for this timeslot */