diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-07-26 00:39:28 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-07-26 00:50:26 +0700 |
commit | cdc764d475120526588b5b9e7a97d5ead9bb083e (patch) | |
tree | 8225574a21e0341d0f80db9afc903805e7fa8467 | |
parent | 029c9297a01b7c361a1c76cabb728a14bfc02d27 (diff) |
trxcon: pass fn_advance param via struct l1sched_cfg
-rw-r--r-- | src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h | 5 | ||||
-rw-r--r-- | src/host/trxcon/src/sched_trx.c | 5 | ||||
-rw-r--r-- | src/host/trxcon/src/trxcon.c | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h index f5c45e27..d2cc2ebe 100644 --- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h @@ -350,6 +350,8 @@ struct l1sched_ts_prim_rach { struct l1sched_cfg { /*! Logging context (used as prefix for messages) */ const char *log_prefix; + /*! TDMA frame-number advance */ + uint32_t fn_advance; }; /*! One scheduler instance */ @@ -384,8 +386,7 @@ const struct l1sched_tdma_multiframe *l1sched_mframe_layout( /* Scheduler management functions */ void l1sched_logging_init(int log_cat_common, int log_cat_data); -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 d44c1bac..556fe6ab 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -160,8 +160,7 @@ void l1sched_logging_init(int log_cat_common, int log_cat_data) l1sched_log_cat_data = log_cat_data; } -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; @@ -172,7 +171,7 @@ struct l1sched_state *l1sched_alloc(void *ctx, const struct l1sched_cfg *cfg, *sched = (struct l1sched_state) { /* .clock_timer is set up in l1sched_clck_correct() */ .clock_cb = &sched_frame_clck_cb, - .fn_counter_advance = fn_advance, + .fn_counter_advance = cfg->fn_advance, .priv = priv, }; diff --git a/src/host/trxcon/src/trxcon.c b/src/host/trxcon/src/trxcon.c index 86d4c491..5740d934 100644 --- a/src/host/trxcon/src/trxcon.c +++ b/src/host/trxcon/src/trxcon.c @@ -348,10 +348,11 @@ struct trxcon_inst *trxcon_inst_alloc(void *ctx) /* Init scheduler */ const struct l1sched_cfg sched_cfg = { + .fn_advance = app_data.trx_fn_advance, .log_prefix = trxcon->log_prefix, }; - 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; |