diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index 774384f1d..54d9cdde4 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -615,6 +615,13 @@ struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) int gsm_set_bts_model(struct gsm_bts *bts, struct gsm_bts_model *model) { bts->model = model; + + /* Copy hardcoded feature list from BTS model. For some BTS we support + * reporting features at runtime (as of writing nanobts, OsmoBTS), + * which will then replace this list. */ + if (model) + memcpy(bts->_features_data, bts->model->_features_data, sizeof(bts->_features_data)); + return 0; } @@ -683,11 +690,11 @@ int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) { if (mode != BTS_GPRS_NONE && - !osmo_bts_has_feature(&bts->model->features, BTS_FEAT_GPRS)) { + !osmo_bts_has_feature(&bts->features, BTS_FEAT_GPRS)) { return 0; } if (mode == BTS_GPRS_EGPRS && - !osmo_bts_has_feature(&bts->model->features, BTS_FEAT_EGPRS)) { + !osmo_bts_has_feature(&bts->features, BTS_FEAT_EGPRS)) { return 0; } diff --git a/src/osmo-bsc/bts_trx_vty.c b/src/osmo-bsc/bts_trx_vty.c index 39584a5c1..27bba2cae 100644 --- a/src/osmo-bsc/bts_trx_vty.c +++ b/src/osmo-bsc/bts_trx_vty.c @@ -317,7 +317,7 @@ DEFUN_USRATTR(cfg_ts_tsc, { struct gsm_bts_trx_ts *ts = vty->index; - if (!osmo_bts_has_feature(&ts->trx->bts->model->features, BTS_FEAT_MULTI_TSC)) { + if (!osmo_bts_has_feature(&ts->trx->bts->features, BTS_FEAT_MULTI_TSC)) { vty_out(vty, "%% This BTS does not support a TSC != BCC, " "falling back to BCC%s", VTY_NEWLINE); ts->tsc = -1; @@ -341,7 +341,7 @@ DEFUN_USRATTR(cfg_ts_hopping, struct gsm_bts_trx_ts *ts = vty->index; int enabled = atoi(argv[0]); - if (enabled && !osmo_bts_has_feature(&ts->trx->bts->model->features, BTS_FEAT_HOPPING)) { + if (enabled && !osmo_bts_has_feature(&ts->trx->bts->features, BTS_FEAT_HOPPING)) { vty_out(vty, "%% BTS model does not seem to support freq. hopping%s", VTY_NEWLINE); /* Allow enabling frequency hopping anyway, because the BTS might not have * connected yet (thus not sent the feature vector), so we cannot know for diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index 187678df5..48f745359 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -1270,8 +1270,7 @@ static int generate_si13(enum osmo_sysinfo_type t, struct gsm_bts *bts) si13_info.cell_opts.ext_info.ccn_active = bts->gprs.ccn.forced_vty ? bts->gprs.ccn.active : - osmo_bts_has_feature(&bts->model->features, - BTS_FEAT_CCN); + osmo_bts_has_feature(&bts->features, BTS_FEAT_CCN); ret = osmo_gsm48_rest_octets_si13_encode(si13->rest_octets, &si13_info); if (ret < 0)