Review at  https://gerrit.osmocom.org/2794

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
---
M openbsc/include/openbsc/gsm_data.h
M openbsc/src/libbsc/bsc_vty.c
M openbsc/src/libcommon/gsm_data.c
3 files changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/94/2794/1

diff --git a/openbsc/include/openbsc/gsm_data.h 
b/openbsc/include/openbsc/gsm_data.h
index 6d814c8..05d834e 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -562,7 +562,7 @@
                   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 3ad0b20..b911cc6 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -3582,7 +3582,7 @@
 {
        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;
@@ -3605,7 +3605,7 @@
        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 8ec0be5..2c7ea0a 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -199,11 +199,11 @@
 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 @@
        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)

-- 
To view, visit https://gerrit.osmocom.org/2794
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I97abdedbef568e0c2fbd37c110f7d658cf20e100
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>

Reply via email to