diff options
author | Max <msuraev@sysmocom.de> | 2017-05-31 12:15:54 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-05-31 12:15:54 +0200 |
commit | aef68387ae6d78df948a6b2b3a61050c4f192c5e (patch) | |
tree | 0283039df254655af5b961184800ebb2494618e1 /openbsc/src | |
parent | 71d082bec770b9664be5cf59e2723db09a645902 (diff) |
Add remote BTS feature storage and helpers
In addition to compile-time defined BTS model features we also need
run-time BTS features reported by BTS via OML. This should be shared by
BSC and BTS. To accommodate for this, add following:
* features bitvec to gsm_bts struct
* features descriptions
* comments to avoid confusion between 2 feature sets
* helper functions to set/query particular feature
* upper boundary on number of supported features and assertion for it
Change-Id: I02bd317097ba66585c50ebd4e8fc348f6dc3dad9
Related: OS#1614
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/libcommon/gsm_data.c | 2 | ||||
-rw-r--r-- | openbsc/src/libcommon/gsm_data_shared.c | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 2c7ea0a94..8830ce144 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -225,11 +225,13 @@ struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); return bitvec_set_bit_pos(&model->features, feat, 1); } bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) { + OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); return bitvec_get_bit_pos(&model->features, feat); } diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index f40436342..7743b6902 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -106,6 +106,19 @@ const char *btstype2str(enum gsm_bts_type type) return get_value_string(bts_type_names, type); } +const struct value_string gsm_bts_features_descs[] = { + { BTS_FEAT_HSCSD, "HSCSD" }, + { BTS_FEAT_GPRS, "GPRS" }, + { BTS_FEAT_EGPRS, "EGPRS" }, + { BTS_FEAT_ECSD, "ECSD" }, + { BTS_FEAT_HOPPING, "Frequency Hopping" }, + { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, + { BTS_FEAT_OML_ALERTS, "OML Alerts" }, + { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, + { BTS_FEAT_CBCH, "CBCH" }, + { 0, NULL } +}; + const struct value_string gsm_chreq_descs[] = { { GSM_CHREQ_REASON_EMERG, "emergency call" }, { GSM_CHREQ_REASON_PAG, "answer to paging" }, @@ -343,6 +356,8 @@ struct gsm_bts *gsm_bts_alloc(void *ctx) bts->rach_b_thresh = -1; bts->rach_ldavg_slots = -1; bts->paging.free_chans_need = -1; + bts->features.data = &bts->_features_data[0]; + bts->features.data_len = sizeof(bts->_features_data); /* si handling */ bts->bcch_change_mark = 1; |