fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/28834 )
Change subject: trxcon: move L1 params from struct trx_instance to trxcon_inst ......................................................................
trxcon: move L1 params from struct trx_instance to trxcon_inst
Change-Id: Ifbd9bb17d63ab1d8712d0c8022a62117a48c6384 Related: OS#5599 --- M src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h M src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h M src/host/trxcon/src/sched_prim.c M src/host/trxcon/src/trxcon.c M src/host/trxcon/src/trxcon_fsm.c 5 files changed, 23 insertions(+), 19 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve
diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h index 18d71cc..1faa610 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h @@ -39,9 +39,6 @@ /* GSM L1 specific */ uint16_t pm_band_arfcn_start; uint16_t pm_band_arfcn_stop; - uint16_t band_arfcn; - uint8_t tx_power; - int8_t ta; };
struct trx_ctrl_msg { diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h index b982193..7b459ec 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h @@ -139,6 +139,13 @@ /* L1/L2 interfaces */ struct trx_instance *trx; struct l1ctl_client *l1c; + + /* L1 parameters */ + struct { + uint16_t band_arfcn; + uint8_t tx_power; + int8_t ta; + } l1p; };
struct trxcon_inst *trxcon_inst_alloc(void *ctx, unsigned int id); diff --git a/src/host/trxcon/src/sched_prim.c b/src/host/trxcon/src/sched_prim.c index 33d48de..9b6d28d 100644 --- a/src/host/trxcon/src/sched_prim.c +++ b/src/host/trxcon/src/sched_prim.c @@ -186,7 +186,7 @@ * decide whether to update the cached L1 SACCH header here. */ if (!cached) { -#warning "FIXME: no direct access to trx->{tx_power,ta}" +#warning "FIXME: no direct access to trxcon->l1p.{tx_power,ta}" #if 0 prim->payload[0] = lchan->ts->sched->trx->tx_power; prim->payload[1] = lchan->ts->sched->trx->ta; diff --git a/src/host/trxcon/src/trxcon.c b/src/host/trxcon/src/trxcon.c index d4f4214..fe3d663 100644 --- a/src/host/trxcon/src/trxcon.c +++ b/src/host/trxcon/src/trxcon.c @@ -180,7 +180,7 @@
if (data != NULL && data_len > 0) { trxcon_gsmtap_send(lchan_desc, meas->fn, lchan->ts->index, - trxcon->trx->band_arfcn, meas->rssi, 0, + trxcon->l1p.band_arfcn, meas->rssi, 0, data, data_len); }
@@ -205,7 +205,7 @@ .chan_nr = lchan_desc->chan_nr | lchan->ts->index, .link_id = lchan_desc->link_id, .frame_nr = htonl(fn), - .band_arfcn = htons(trxcon->trx->band_arfcn), + .band_arfcn = htons(trxcon->l1p.band_arfcn), };
switch (dt) { @@ -226,7 +226,7 @@
rach = (struct l1sched_ts_prim_rach *)lchan->prim->payload;
- rc = l1ctl_tx_rach_conf(trxcon->l1c, trxcon->trx->band_arfcn, fn); + rc = l1ctl_tx_rach_conf(trxcon->l1c, trxcon->l1p.band_arfcn, fn); if (lchan->prim->type == L1SCHED_PRIM_RACH11) { ra_buf[0] = (uint8_t)(rach->ra >> 3); ra_buf[1] = (uint8_t)(rach->ra & 0x07); @@ -247,7 +247,7 @@ }
trxcon_gsmtap_send(lchan_desc, fn, lchan->ts->index, - trxcon->trx->band_arfcn | ARFCN_UPLINK, + trxcon->l1p.band_arfcn | ARFCN_UPLINK, 0, 0, data, data_len);
return rc; diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c index 1d3b515..0f06c29 100644 --- a/src/host/trxcon/src/trxcon_fsm.c +++ b/src/host/trxcon/src/trxcon_fsm.c @@ -65,10 +65,10 @@ { const struct trxcon_param_set_config_req *req = data;
- if (trxcon->trx->ta != req->timing_advance) + if (trxcon->l1p.ta != req->timing_advance) trx_if_cmd_setta(trxcon->trx, req->timing_advance); - trxcon->trx->tx_power = req->tx_power; - trxcon->trx->ta = req->timing_advance; + trxcon->l1p.tx_power = req->tx_power; + trxcon->l1p.ta = req->timing_advance; break; } default: @@ -82,7 +82,7 @@
switch (fi->state) { case TRXCON_ST_FBSB_SEARCH: - l1ctl_tx_fbsb_fail(trxcon->l1c, trxcon->trx->band_arfcn); + l1ctl_tx_fbsb_fail(trxcon->l1c, trxcon->l1p.band_arfcn); osmo_fsm_inst_state_chg(fi, TRXCON_ST_RESET, 0, 0); return 0; default: @@ -105,9 +105,9 @@ l1sched_configure_ts(trxcon->sched, 0, req->pchan_config);
/* Only if current ARFCN differs */ - if (trxcon->trx->band_arfcn != req->band_arfcn) { + if (trxcon->l1p.band_arfcn != req->band_arfcn) { /* Update current ARFCN */ - trxcon->trx->band_arfcn = req->band_arfcn; + trxcon->l1p.band_arfcn = req->band_arfcn;
/* Tune transceiver to required ARFCN */ trx_if_cmd_rxtune(trxcon->trx, req->band_arfcn); @@ -160,7 +160,7 @@ case TRXCON_EV_FBSB_SEARCH_RES: osmo_fsm_inst_state_chg(fi, TRXCON_ST_BCCH_CCCH, 0, 0); l1ctl_tx_fbsb_conf(trxcon->l1c, - trxcon->trx->band_arfcn, + trxcon->l1p.band_arfcn, trxcon->sched->bsic); break; default: @@ -238,7 +238,7 @@ return;
/* Set current ARFCN to an invalid value */ - trxcon->trx->band_arfcn = 0xffff; + trxcon->l1p.band_arfcn = 0xffff; } else { /* Tune transceiver to required ARFCN */ if (trx_if_cmd_rxtune(trxcon->trx, req->h0.band_arfcn)) @@ -247,7 +247,7 @@ return;
/* Update current ARFCN */ - trxcon->trx->band_arfcn = req->h0.band_arfcn; + trxcon->l1p.band_arfcn = req->h0.band_arfcn; }
rc = l1sched_configure_ts(trxcon->sched, req->chan_nr & 0x07, config); @@ -275,7 +275,7 @@ .chan_nr = ind->chan_nr, .link_id = ind->link_id, .frame_nr = htonl(ind->frame_nr), - .band_arfcn = htons(trxcon->trx->band_arfcn), + .band_arfcn = htons(trxcon->l1p.band_arfcn), .fire_crc = ind->data_len > 0 ? 0 : 2, .rx_level = dbm2rxlev(ind->rssi), .num_biterr = ind->n_errors, @@ -370,7 +370,7 @@ .chan_nr = ind->chan_nr, .link_id = ind->link_id, .frame_nr = htonl(ind->frame_nr), - .band_arfcn = htons(trxcon->trx->band_arfcn), + .band_arfcn = htons(trxcon->l1p.band_arfcn), .fire_crc = ind->data_len > 0 ? 0 : 2, .rx_level = dbm2rxlev(ind->rssi), .num_biterr = ind->n_errors,