diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-16 20:36:54 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2021-09-23 11:09:15 +0000 |
commit | ddd357f3e3926d5515cbe130b4206ce155626428 (patch) | |
tree | ba0f5dfe25930194f6a2b66bf75771b7993ada2a | |
parent | 300e31ed135c674cd44526b7503d4664a45a9ec3 (diff) |
bts-trx: Avoid race condition configuring TS-specific TSC values
In OML, if Set Attributes comes first for Channel object and then for
BTS object, BSIC will still not be set. Hence, when applying Channel
(TS) specific TSC, the code would compare against an unset value,
enabling use of TRXC extensions (which osmo-trx doesn't support)
without need for it, since actually the TSC of the TS matches the BSIC
of the BTS once both are set.
In order to fix it, don't check for the BSIC when receiving the OML
messages, but rather later when we apply the settings to the the lower
layers once trx_provision_fsm allows for it.
Fixes: 3c1151f9456bdf0d7348c27c0cabbb41e84fcbbc
Change-Id: I49fc7e35acb44ecc4f37ae71acd4c684248548e7
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-trx/trx_if.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 9b210eb8..df2531e4 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -292,7 +292,7 @@ static uint8_t trx_set_ts_as_pchan(struct gsm_bts_trx_ts *ts, struct trx_prov_ev_cfg_ts_data data = { .tn = tn, .slottype = slottype }; - if (ts->tsc_set != 0 || ts->tsc != BTS_TSC(ts->trx->bts)) { + if (ts->tsc_set != 0) { /* On TRXC we use 3GPP compliant numbering, so +1 */ data.tsc_set = ts->tsc_set + 1; data.tsc_val = ts->tsc; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index c4b00fd4..1a920476 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -332,8 +332,10 @@ int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, trx_if_cmd_setslot_cb *cb) { const struct trx_config *cfg = &l1h->config; + const struct phy_instance *pinst = l1h->phy_inst; - if (cfg->setslot[tn].tsc_valid) { /* PHY is instructed to use a custom TSC */ + if (cfg->setslot[tn].tsc_valid && cfg->setslot[tn].tsc_val != BTS_TSC(pinst->trx->bts)) { + /* PHY is instructed to use a custom TSC */ return trx_ctrl_cmd_cb(l1h, 1, cb, "SETSLOT", "%u %u C%u/S%u", tn, cfg->setslot[tn].slottype, cfg->setslot[tn].tsc_val, |