Harald Welte has submitted this change and it was merged.

Change subject: Adjust BTS model feature check
......................................................................


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(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 f17bde6..0ee2390 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -3607,7 +3607,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;
@@ -3630,7 +3630,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: merged
Gerrit-Change-Id: I97abdedbef568e0c2fbd37c110f7d658cf20e100
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to