fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/28745 )
Change subject: trxcon: move fn_counter_advance to struct l1sched_cfg ......................................................................
trxcon: move fn_counter_advance to struct l1sched_cfg
Change-Id: I733761e46ffe03473f03f76f7612a548c9723d99 Related: OS#5599, OS#3761 --- M src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h M src/host/trxcon/src/sched_trx.c M src/host/trxcon/src/trxcon.c 3 files changed, 9 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/28745/1
diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h index 60cd63f..d9fccdc 100644 --- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h @@ -354,6 +354,9 @@ int log_cat_common; /*! Logging category for data messages */ int log_cat_data; + + /*! TDMA frame-number advance */ + uint32_t fn_advance; };
/*! One scheduler instance */ @@ -364,8 +367,6 @@ struct timespec clock; /*! Count of processed frames */ uint32_t fn_counter_proc; - /*! Local frame counter advance */ - uint32_t fn_counter_advance; /*! Count of lost frames */ uint32_t fn_counter_lost; /*! Frame callback timer */ @@ -387,8 +388,7 @@ enum gsm_phys_chan_config config, int tn);
/* Scheduler management functions */ -struct l1sched_state *l1sched_alloc(void *ctx, const struct l1sched_cfg *cfg, - uint32_t fn_advance, void *priv); +struct l1sched_state *l1sched_alloc(void *ctx, const struct l1sched_cfg *cfg, void *priv); void l1sched_reset(struct l1sched_state *sched, bool reset_clock); void l1sched_free(struct l1sched_state *sched);
diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index 2e7890e..152fdc3 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -66,7 +66,7 @@ /* 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); + sched->cfg.fn_advance);
/* Iterate over timeslot list */ for (tn = 0; tn < ARRAY_SIZE(br); tn++) { @@ -150,8 +150,7 @@ l1sched_handle_burst_req(sched, &br[tn]); }
-struct l1sched_state *l1sched_alloc(void *ctx, const struct l1sched_cfg *cfg, - uint32_t fn_advance, void *priv) +struct l1sched_state *l1sched_alloc(void *ctx, const struct l1sched_cfg *cfg, void *priv) { struct l1sched_state *sched;
@@ -164,7 +163,6 @@ *sched = (struct l1sched_state) { /* .clock_timer is set up in l1sched_clck_correct() */ .clock_cb = &sched_frame_clck_cb, - .fn_counter_advance = fn_advance, .priv = priv, .cfg = *cfg, }; diff --git a/src/host/trxcon/src/trxcon.c b/src/host/trxcon/src/trxcon.c index 05b51a3..ebe997e 100644 --- a/src/host/trxcon/src/trxcon.c +++ b/src/host/trxcon/src/trxcon.c @@ -355,14 +355,15 @@ return NULL; }
- static const struct l1sched_cfg sched_cfg = { + const struct l1sched_cfg sched_cfg = { + .fn_advance = app_data.trx_fn_advance, .log_ctx_cb = &sched_logging_ctx_cb, .log_cat_common = DSCH, .log_cat_data = DSCHD, };
/* Init scheduler */ - trxcon->sched = l1sched_alloc(trxcon, &sched_cfg, app_data.trx_fn_advance, trxcon); + trxcon->sched = l1sched_alloc(trxcon, &sched_cfg, trxcon); if (trxcon->sched == NULL) { trxcon_inst_free(trxcon); return NULL;