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: 3c1151f945
Change-Id: I49fc7e35acb44ecc4f37ae71acd4c684248548e7
This commit is contained in:
Pau Espin 2021-09-16 20:36:54 +02:00 committed by pespin
parent 300e31ed13
commit ddd357f3e3
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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,