bts_model_*_start: move set_feature calls to _init

With previous patch Idf2d933aa8b03b1f708e56a08707fe6c620a97aa, the
features get copied from the BTS model to the BTS. For rbs2000, bs11 and
nokia_site, an empty feature set was copied because the features weren't
set at this point. Fix this by moving the set_feature calls to _init().

Notably the set_feature calls had been moved for osmo-bts and nanobts
from _start to _init already in 2013 in the patch e84dd98d
("sysmobts: Avoid a crash when trying to look-up a BTS").

Fixes: 2d818b9f ("Always use reported features if available")
Related: SYS#5922, OS#5538
Change-Id: I43389ae48d5e0f01381602751f6bad902011b158
This commit is contained in:
Oliver Smith 2022-04-27 14:52:06 +02:00 committed by osmith
parent 3eb14ee7c7
commit 41aa1feb15
3 changed files with 22 additions and 23 deletions

View File

@ -212,6 +212,14 @@ static struct gsm_bts_model model_rbs2k = {
};
static int bts_model_rbs2k_start(struct gsm_network *net)
{
osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL);
return 0;
}
int bts_model_rbs2k_init(void)
{
model_rbs2k.features.data = &model_rbs2k._features_data[0];
model_rbs2k.features.data_len = sizeof(model_rbs2k._features_data);
@ -222,13 +230,5 @@ static int bts_model_rbs2k_start(struct gsm_network *net)
osmo_bts_set_feature(&model_rbs2k.features, BTS_FEAT_HSCSD);
osmo_bts_set_feature(&model_rbs2k.features, BTS_FEAT_MULTI_TSC);
osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL);
return 0;
}
int bts_model_rbs2k_init(void)
{
return gsm_bts_model_register(&model_rbs2k);
}

View File

@ -1759,14 +1759,6 @@ static struct gsm_network *my_net;
static int bts_model_nokia_site_start(struct gsm_network *net)
{
model_nokia_site.features.data = &model_nokia_site._features_data[0];
model_nokia_site.features.data_len =
sizeof(model_nokia_site._features_data);
osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HOPPING);
osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HSCSD);
osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_MULTI_TSC);
osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL);
osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL);
@ -1778,5 +1770,12 @@ static int bts_model_nokia_site_start(struct gsm_network *net)
int bts_model_nokia_site_init(void)
{
model_nokia_site.features.data = &model_nokia_site._features_data[0];
model_nokia_site.features.data_len = sizeof(model_nokia_site._features_data);
osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HOPPING);
osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HSCSD);
osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_MULTI_TSC);
return gsm_bts_model_register(&model_nokia_site);
}

View File

@ -604,13 +604,6 @@ static int inp_sig_cb(unsigned int subsys, unsigned int signal,
static int bts_model_bs11_start(struct gsm_network *net)
{
model_bs11.features.data = &model_bs11._features_data[0];
model_bs11.features.data_len = sizeof(model_bs11._features_data);
osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HOPPING);
osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HSCSD);
osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_MULTI_TSC);
osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL);
@ -619,5 +612,12 @@ static int bts_model_bs11_start(struct gsm_network *net)
int bts_model_bs11_init(void)
{
model_bs11.features.data = &model_bs11._features_data[0];
model_bs11.features.data_len = sizeof(model_bs11._features_data);
osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HOPPING);
osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_HSCSD);
osmo_bts_set_feature(&model_bs11.features, BTS_FEAT_MULTI_TSC);
return gsm_bts_model_register(&model_bs11);
}