fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/29954 )
Change subject: trxcon: drop sched->clock_cb(), expose l1sched_trigger() ......................................................................
trxcon: drop sched->clock_cb(), expose l1sched_trigger()
It does not make sense to call function sched_frame_clck_cb() via a configurable pointer in the l1sched_state. Make this function public (thus rename) and call it directly. Remove the .clock_cb.
Having l1sched_trigger() globally available makes it possible to call this function directly, bypassing the internal timer driven clock module. This is needed for the integration with osmo-trx-ms.
Change-Id: Ied0eed6d514acabb94d819b2f9485868390c0f24 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, 9 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/54/29954/1
diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h index 9686562..3eadbbf 100644 --- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h @@ -372,8 +372,6 @@ uint32_t fn_counter_lost; /*! Frame callback timer */ struct osmo_timer_list clock_timer; - /*! Frame callback */ - void (*clock_cb)(struct l1sched_state *sched); /*! List of timeslots maintained by this scheduler */ struct l1sched_ts *ts[TRX_TS_COUNT]; /*! SACCH cache (common for all lchans) */ @@ -490,8 +488,10 @@ void l1sched_lchan_meas_push(struct l1sched_lchan_state *lchan, const struct l1sched_meas_set *meas); void l1sched_lchan_meas_avg(struct l1sched_lchan_state *lchan, unsigned int n);
+/* 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);
/* 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 f08156c..ccafd7b 100644 --- a/src/host/trxcon/src/sched_clck.c +++ b/src/host/trxcon/src/sched_clck.c @@ -81,9 +81,8 @@
GSM_TDMA_FN_INC(sched->fn_counter_proc);
- /* Call frame callback */ - if (sched->clock_cb) - sched->clock_cb(sched); + /* Trigger the scheduler */ + l1sched_trigger(sched); }
osmo_timer_schedule(&sched->clock_timer, 0, @@ -95,9 +94,8 @@ { sched->fn_counter_proc = fn;
- /* Call frame callback */ - if (sched->clock_cb) - sched->clock_cb(sched); + /* Trigger the scheduler */ + l1sched_trigger(sched);
/* Schedule first FN clock */ sched->clock = *tv_now; @@ -177,9 +175,8 @@ while (fn != sched->fn_counter_proc) { GSM_TDMA_FN_INC(sched->fn_counter_proc);
- /* Call frame callback */ - if (sched->clock_cb) - sched->clock_cb(sched); + /* Trigger the scheduler */ + l1sched_trigger(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 be1f820..c36b7de 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);
-static void sched_frame_clck_cb(struct l1sched_state *sched) +void l1sched_trigger(struct l1sched_state *sched) { struct l1sched_burst_req br[TRX_TS_COUNT]; const struct l1sched_tdma_frame *frame; @@ -199,7 +199,6 @@
*sched = (struct l1sched_state) { /* .clock_timer is set up in l1sched_clck_correct() */ - .clock_cb = &sched_frame_clck_cb, .fn_counter_advance = cfg->fn_advance, .priv = priv, };