[VAMOS] common/oml: generalize checking BTS_FEAT_MULTI_TSC

Change-Id: Iaa5aced70e166963106c27ebdb09adaae22daea4
Related: SYS#4895, OS#4941
This commit is contained in:
Vadim Yanitskiy 2021-05-24 03:54:14 +02:00 committed by laforge
parent d8598005ce
commit dd3b7d469e
4 changed files with 7 additions and 44 deletions

View File

@ -962,6 +962,13 @@ static int oml_rx_set_chan_attr(struct gsm_bts_trx_ts *ts, struct msgb *msg)
/* 9.4.60 TSC */
if (TLVP_PRES_LEN(&tp, NM_ATT_TSC, 1)) {
ts->tsc_oml = ts->tsc = *TLVP_VAL(&tp, NM_ATT_TSC);
if (ts->tsc != BTS_TSC(bts) &&
!osmo_bts_has_feature(bts->features, BTS_FEAT_MULTI_TSC)) {
LOGPFOH(DOML, LOGL_ERROR, foh, "SET CHAN ATTR: this BTS model does not "
"support TSC %u != BSIC-BCC %u\n", ts->tsc, BTS_TSC(bts));
talloc_free(tp_merged);
return oml_fom_ack_nack(msg, NM_NACK_PARAM_RANGE);
}
} else {
/* If there is no TSC specified, use the BCC */
ts->tsc_oml = ts->tsc = BTS_TSC(bts);

View File

@ -1827,21 +1827,6 @@ int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type,
void *obj)
{
/* FIXME: more checks if the attributes are valid */
switch (msg_type) {
case NM_MT_SET_CHAN_ATTR:
/* our L1 only supports one global TSC for all channels
* one one TRX, so we need to make sure not to activate
* channels with a different TSC!! */
if (TLVP_PRESENT(new_attr, NM_ATT_TSC) &&
TLVP_LEN(new_attr, NM_ATT_TSC) >= 1 &&
*TLVP_VAL(new_attr, NM_ATT_TSC) != BTS_TSC(bts)) {
LOGP(DOML, LOGL_ERROR, "Channel TSC %u != BSIC-TSC %u\n",
*TLVP_VAL(new_attr, NM_ATT_TSC), BTS_TSC(bts));
return -NM_NACK_PARAM_RANGE;
}
break;
}
return 0;
}

View File

@ -1836,21 +1836,6 @@ int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type,
void *obj)
{
/* FIXME: more checks if the attributes are valid */
switch (msg_type) {
case NM_MT_SET_CHAN_ATTR:
/* our L1 only supports one global TSC for all channels
* one one TRX, so we need to make sure not to activate
* channels with a different TSC!! */
if (TLVP_PRESENT(new_attr, NM_ATT_TSC) &&
TLVP_LEN(new_attr, NM_ATT_TSC) >= 1 &&
*TLVP_VAL(new_attr, NM_ATT_TSC) != BTS_TSC(bts)) {
LOGP(DOML, LOGL_ERROR, "Channel TSC %u != BSIC-TSC %u\n",
*TLVP_VAL(new_attr, NM_ATT_TSC), BTS_TSC(bts));
return -NM_NACK_PARAM_RANGE;
}
break;
}
return 0;
}

View File

@ -1741,20 +1741,6 @@ int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type,
void *obj)
{
/* FIXME: more checks if the attributes are valid */
switch (msg_type) {
case NM_MT_SET_CHAN_ATTR:
/* our L1 only supports one global TSC for all channels
* one one TRX, so we need to make sure not to activate
* channels with a different TSC!! */
if (TLVP_PRES_LEN(new_attr, NM_ATT_TSC, 1) &&
*TLVP_VAL(new_attr, NM_ATT_TSC) != BTS_TSC(bts)) {
LOGP(DOML, LOGL_ERROR, "Channel TSC %u != BSIC-TSC %u\n",
*TLVP_VAL(new_attr, NM_ATT_TSC), BTS_TSC(bts));
return -NM_NACK_PARAM_RANGE;
}
break;
}
return 0;
}