summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-05-30 15:03:38 +0200
committerMax <msuraev@sysmocom.de>2017-05-31 12:14:17 +0200
commit71d082bec770b9664be5cf59e2723db09a645902 (patch)
tree79be8746ccb67778cca54c5240e514698eb1985a
parent8254cf75bf818e715201c670c7fb81b9a23dec0b (diff)
Adjust BTS model feature check
Rename gsm_bts_has_feature() -> gsm_btsmodel_has_feature() and adjust type signature to match gsm_btsmodel_set_feature() function and avoid confusion with upcoming functions to check/set BTS features reported over OML. Change-Id: I97abdedbef568e0c2fbd37c110f7d658cf20e100 Related: OS#1614
-rw-r--r--openbsc/include/openbsc/gsm_data.h2
-rw-r--r--openbsc/src/libbsc/bsc_vty.c4
-rw-r--r--openbsc/src/libcommon/gsm_data.c12
3 files changed, 9 insertions, 9 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 6d814c8e7..05d834e31 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -562,7 +562,7 @@ void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr,
uint8_t e1_ts, uint8_t e1_ts_ss);
void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked);
-int gsm_bts_has_feature(struct gsm_bts *bts, enum gsm_bts_features feat);
+bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat);
struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr);
int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx);
int gsm_bts_set_system_infos(struct gsm_bts *bts);
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index f17bde604..0ee23907f 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -3607,7 +3607,7 @@ DEFUN(cfg_ts_tsc,
{
struct gsm_bts_trx_ts *ts = vty->index;
- if (!gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_MULTI_TSC)) {
+ if (!gsm_btsmodel_has_feature(ts->trx->bts->model, 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;
@@ -3630,7 +3630,7 @@ DEFUN(cfg_ts_hopping,
struct gsm_bts_trx_ts *ts = vty->index;
int enabled = atoi(argv[0]);
- if (enabled && !gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_HOPPING)) {
+ if (enabled && !gsm_btsmodel_has_feature(ts->trx->bts->model, BTS_FEAT_HOPPING)) {
vty_out(vty, "BTS model does not support hopping%s",
VTY_NEWLINE);
return CMD_WARNING;
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index 8ec0be55a..2c7ea0a94 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -199,11 +199,11 @@ const char *bts_gprs_mode_name(enum bts_gprs_mode mode)
int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode)
{
if (mode != BTS_GPRS_NONE &&
- !gsm_bts_has_feature(bts, BTS_FEAT_GPRS)) {
+ !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) {
return 0;
}
if (mode == BTS_GPRS_EGPRS &&
- !gsm_bts_has_feature(bts, BTS_FEAT_EGPRS)) {
+ !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) {
return 0;
}
@@ -223,14 +223,14 @@ struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan)
return meas_rep;
}
-int gsm_btsmodel_set_feature(struct gsm_bts_model *bts, enum gsm_bts_features feat)
+int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat)
{
- return bitvec_set_bit_pos(&bts->features, feat, 1);
+ return bitvec_set_bit_pos(&model->features, feat, 1);
}
-int gsm_bts_has_feature(struct gsm_bts *bts, enum gsm_bts_features feat)
+bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat)
{
- return bitvec_get_bit_pos(&bts->model->features, feat);
+ return bitvec_get_bit_pos(&model->features, feat);
}
int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type)