diff options
author | Oliver Smith <osmith@sysmocom.de> | 2022-04-22 12:48:29 +0200 |
---|---|---|
committer | osmith <osmith@sysmocom.de> | 2022-04-26 12:06:47 +0000 |
commit | 2d818b9f2e2d27e8fbd055800fe00115da5aa8a4 (patch) | |
tree | 4f75eef1c13656c01d1c3066925d95701f95eb0b /src/osmo-bsc/bts.c | |
parent | d05549307159437ef25db51a05a88ccc08e89437 (diff) |
Always use reported features if available
Instead of sometimes checking against hardcoded BTS model features, and
sometimes against features reported at runtime (which only some BTS
models do):
* copy the hardcoded BTS model features to BTS features initially
* do all checks against BTS features
Related: SYS#5922, OS#5538
Change-Id: Idf2d933aa8b03b1f708e56a08707fe6c620a97aa
Diffstat (limited to 'src/osmo-bsc/bts.c')
-rw-r--r-- | src/osmo-bsc/bts.c | 11 |
1 files changed, 9 insertions, 2 deletions
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; } |