Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18616 )


Change subject: Split GSM_BTS_TYPE_OSMOBTS to individual BTS types
......................................................................

Split GSM_BTS_TYPE_OSMOBTS to individual BTS types

Change-Id: I00a815cfa6daab126742d27843e700c07c1db183
---
M doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M doc/manuals/vty/bsc_vty_reference.xml
M include/osmocom/bsc/bss.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/abis_nm.c
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_init.c
A src/osmo-bsc/bts_osmobts.c
D src/osmo-bsc/bts_sysmobts.c
M src/osmo-bsc/e1_config.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/system_information.c
M tests/neighbor_ident.vty
17 files changed, 160 insertions(+), 155 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/18616/1

diff --git a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg 
b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
index b8cd78d..30eadcc 100644
--- a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
@@ -2,7 +2,8 @@
  network country code 901
  mobile network code 70
  bts 0
-  type sysmobts
+  ! Change this to your specific model (e.g. osmo-bts-sysmo)
+  type osmo-bts
   band GSM-1800
   location_area_code 23
   ipa unit-id 1800 0
diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 57000ae..7b3438a 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -20,7 +20,8 @@
  dyn_ts_allow_tch_f 0
  periodic location update 30
  bts 0
-  type sysmobts
+  ! Change this to your specific model (e.g. osmo-bts-sysmo)
+  type osmo-bts
   band DCS1800
   cell_identity 6969
   location_area_code 1
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index c250fac..e6977f2 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -19,7 +19,8 @@
  dyn_ts_allow_tch_f 0
  periodic location update 30
  bts 0
-  type sysmobts
+  ! Change this to your specific model (e.g. osmo-bts-sysmo)
+  type osmo-bts
   band DCS1800
   cell_identity 0
   location_area_code 1
diff --git a/doc/manuals/vty/bsc_vty_reference.xml 
b/doc/manuals/vty/bsc_vty_reference.xml
index 8f3edf9..f3f67c6 100644
--- a/doc/manuals/vty/bsc_vty_reference.xml
+++ b/doc/manuals/vty/bsc_vty_reference.xml
@@ -3025,7 +3025,7 @@
   </node>
   <node id='config-net-bts'>
     <name>config-net-bts</name>
-    <command id='type (unknown|bs11|nanobts|rbs2000|nokia_site|sysmobts)'>
+    <command id='type 
(unknown|bs11|nanobts|rbs2000|nokia_site|osmo-bts|osmo-bts-lc15|osmo-bts-octphy|osmo-bts-sysmo|osmo-bts-trx)'>
       <params>
         <param name='type' doc='BTS Vendor/Type' />
         <param name='unknown' doc='Unknown BTS Type' />
@@ -3033,7 +3033,11 @@
         <param name='nanobts' doc='ip.access nanoBTS or compatible' />
         <param name='rbs2000' doc='Ericsson RBS2000 Series' />
         <param name='nokia_site' doc='Nokia {Metro,Ultra,In}Site' />
-        <param name='sysmobts' doc='sysmocom sysmoBTS' />
+        <param name='osmo-bts' doc='Osmocom family (generic profile)' />
+        <param name='osmo-bts-lc15' doc='Osmocom family (NuRAN LiteCell15 
PHY)' />
+        <param name='osmo-bts-octphy' doc='Osmocom family (Octasic OCTSDR 
PHY)' />
+        <param name='osmo-bts-sysmo' doc='Osmocom family (Sysmocom sysmoBTS 
PHY)' />
+        <param name='osmo-bts-trx' doc='Osmocom family (OsmoTRX SDR PHY)' />
       </params>
     </command>
     <command id='description .TEXT'>
diff --git a/include/osmocom/bsc/bss.h b/include/osmocom/bsc/bss.h
index b8945db..0de4423 100644
--- a/include/osmocom/bsc/bss.h
+++ b/include/osmocom/bsc/bss.h
@@ -16,5 +16,5 @@
 extern int bts_model_rbs2k_init(void);
 extern int bts_model_nanobts_init(void);
 extern int bts_model_nokia_site_init(void);
-extern int bts_model_sysmobts_init(void);
+extern int osmo_bts_model_init(enum gsm_bts_type type);
 #endif
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1e7e88f..6f6c279 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -782,19 +782,14 @@
        GSM_BTS_TYPE_NANOBTS,
        GSM_BTS_TYPE_RBS2000,
        GSM_BTS_TYPE_NOKIA_SITE,
-       GSM_BTS_TYPE_OSMOBTS,
+       GSM_BTS_TYPE_OSMOBTS_GENERIC,   /* osmo-bts-{virtual,omldummy} */
+       GSM_BTS_TYPE_OSMOBTS_LC15,
+       GSM_BTS_TYPE_OSMOBTS_OCTPHY,
+       GSM_BTS_TYPE_OSMOBTS_SYSMO,
+       GSM_BTS_TYPE_OSMOBTS_TRX,
        _NUM_GSM_BTS_TYPE
 };

-enum gsm_bts_type_variant {
-       BTS_UNKNOWN,
-       BTS_OSMO_LITECELL15,
-       BTS_OSMO_OCTPHY,
-       BTS_OSMO_SYSMO,
-       BTS_OSMO_TRX,
-       _NUM_BTS_VARIANT
-};
-
 /* Used by OML layer for BTS Attribute reporting */
 enum bts_attribute {
        BTS_TYPE_VARIANT,
@@ -808,7 +803,6 @@
        struct llist_head list;

        enum gsm_bts_type type;
-       enum gsm_bts_type_variant variant;
        const char *name;

        bool started;
@@ -1024,7 +1018,6 @@
        uint8_t bsic;
        /* type of BTS */
        enum gsm_bts_type type;
-       enum gsm_bts_type_variant variant;
        struct gsm_bts_model *model;
        enum gsm_band band;
        char version[MAX_VERSION_LENGTH];
@@ -1309,9 +1302,6 @@
 enum bts_attribute str2btsattr(const char *s);
 const char *btsatttr2str(enum bts_attribute v);

-enum gsm_bts_type_variant str2btsvariant(const char *arg);
-const char *btsvariant2str(enum gsm_bts_type_variant v);
-
 extern const struct value_string gsm_chreq_descs[];
 extern const struct value_string gsm_pchant_names[];
 extern const struct value_string gsm_pchant_descs[];
@@ -1726,12 +1716,31 @@

 extern void *tall_bsc_ctx;

+static inline int is_osmo_bts(const struct gsm_bts *bts)
+{
+       switch (bts->type) {
+       case GSM_BTS_TYPE_OSMOBTS_GENERIC:
+       case GSM_BTS_TYPE_OSMOBTS_LC15:
+       case GSM_BTS_TYPE_OSMOBTS_OCTPHY:
+       case GSM_BTS_TYPE_OSMOBTS_SYSMO:
+       case GSM_BTS_TYPE_OSMOBTS_TRX:
+               return 1;
+       default:
+               break;
+       }
+       return 0;
+}
+
 /* this actually refers to the IPA transport, not the BTS model */
 static inline int is_ipaccess_bts(const struct gsm_bts *bts)
 {
        switch (bts->type) {
        case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       case GSM_BTS_TYPE_OSMOBTS_GENERIC:
+       case GSM_BTS_TYPE_OSMOBTS_LC15:
+       case GSM_BTS_TYPE_OSMOBTS_OCTPHY:
+       case GSM_BTS_TYPE_OSMOBTS_SYSMO:
+       case GSM_BTS_TYPE_OSMOBTS_TRX:
                return 1;
        default:
                break;
@@ -1742,7 +1751,7 @@
 static inline int is_sysmobts_v2(const struct gsm_bts *bts)
 {
        switch (bts->type) {
-       case GSM_BTS_TYPE_OSMOBTS:
+       case GSM_BTS_TYPE_OSMOBTS_SYSMO:
                return 1;
        default:
                break;
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 51e0e7f9..fe9eef1 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -49,7 +49,7 @@
        bts_ipaccess_nanobts_omlattr.c \
        bts_nokia_site.c \
        bts_siemens_bs11.c \
-       bts_sysmobts.c \
+       bts_osmobts.c \
        bts_unknown.c \
        chan_alloc.c \
        codec_pref.c \
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index 4ed0602..d1c4046 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -981,19 +981,15 @@
 {
        int rc;
        struct e1inp_sign_link *sign_link = mb->dst;
-       int bts_type = sign_link->trx->bts->type;
+       const struct gsm_bts *bts = sign_link->trx->bts;

-       switch (bts_type) {
-       case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       if (is_ipaccess_bts(bts)) {
                rc = abis_nm_rx_ipacc(mb);
                abis_nm_queue_send_next(sign_link->trx->bts);
-               break;
-       default:
+       } else {
                LOGP(DNM, LOGL_ERROR, "don't know how to parse OML for this "
-                    "BTS type (%u)\n", bts_type);
+                    "BTS type (%u)\n", bts->type); /* TODO: use btstype2str() 
*/
                rc = 0;
-               break;
        }

        return rc;
@@ -1760,7 +1756,7 @@
        struct abis_om_hdr *oh;
        struct msgb *msg;

-       if (bts->type != GSM_BTS_TYPE_OSMOBTS && bts->type != 
GSM_BTS_TYPE_NANOBTS) {
+       if (!is_osmo_bts(bts) && bts->type != GSM_BTS_TYPE_NANOBTS) {
                LOGPC(DNM, LOGL_NOTICE, "Getting attributes from BTS%d type %s 
is not supported.\n",
                      bts->nr, btstype2str(bts->type));
                return -EINVAL;
@@ -1974,9 +1970,6 @@
                }
                *reason = "Unknown combination";
                return -EINVAL;
-       case GSM_BTS_TYPE_OSMOBTS:
-               /* no known restrictions */
-               return 0;
        default:
                /* unknown BTS type */
                return 0;
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 4a1d314..c0311ff 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -313,7 +313,7 @@

        msgb_tv_put(msg, RSL_IE_MS_POWER, lchan->ms_power);
        /* indicate MS power control to be performed by BTS: */
-       if (bts->type == GSM_BTS_TYPE_OSMOBTS)
+       if (is_osmo_bts(bts))
                msgb_tl_put(msg, RSL_IE_MS_POWER_PARAM);
        /* else: Since IE MS_POWER_PARAM content is operator dependent, it's not
           known if non-osmocom BTS models will support an empty IE, so let's
@@ -546,7 +546,7 @@
        msgb_tv_put(msg, RSL_IE_MS_POWER, lchan->ms_power);
        msgb_tv_put(msg, RSL_IE_TIMING_ADVANCE, ta);
        /* indicate MS power control to be performed by BTS: */
-       if (bts->type == GSM_BTS_TYPE_OSMOBTS)
+       if (is_osmo_bts(bts))
                msgb_tl_put(msg, RSL_IE_MS_POWER_PARAM);
        /* else: Since IE MS_POWER_PARAM content is operator dependent, it's not
           known if non-osmocom BTS models will support an empty IE, so let's
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 80658ec..eb28e48 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -970,9 +970,14 @@
                bts->early_classmark_allowed ? "allowed" : "forbidden", 
VTY_NEWLINE);
        vty_out(vty, "  early-classmark-sending-3g %s%s",
                bts->early_classmark_allowed_3g ? "allowed" : "forbidden", 
VTY_NEWLINE);
+
        switch (bts->type) {
        case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       case GSM_BTS_TYPE_OSMOBTS_GENERIC:
+       case GSM_BTS_TYPE_OSMOBTS_LC15:
+       case GSM_BTS_TYPE_OSMOBTS_OCTPHY:
+       case GSM_BTS_TYPE_OSMOBTS_SYSMO:
+       case GSM_BTS_TYPE_OSMOBTS_TRX:
                vty_out(vty, "  ipa unit-id %u %u%s",
                        bts->ip_access.site_id, bts->ip_access.bts_id, 
VTY_NEWLINE);
                if (bts->ip_access.rsl_ip) {
@@ -2099,6 +2104,24 @@
        return CMD_SUCCESS;
 }

+DEFUN_DEPRECATED(cfg_bts_type_sysmo,
+                cfg_bts_type_sysmo_cmd,
+                "type sysmobts",
+                ".HIDDEN\n" "Obsolete\n")
+{
+       struct gsm_bts *bts = vty->index;
+       int rc;
+
+       vty_out(vty, "%% Command 'type sysmobts' is deprecated, use "
+               "'type osmo-bts-sysmo' instead%s", VTY_NEWLINE);
+
+       rc = gsm_set_bts_type(bts, GSM_BTS_TYPE_OSMOBTS_SYSMO);
+       if (rc < 0)
+               return CMD_WARNING;
+
+       return CMD_SUCCESS;
+}
+
 DEFUN(cfg_bts_type,
       cfg_bts_type_cmd,
       "type TYPE", /* dynamically created */
@@ -2826,7 +2849,7 @@
 {
        struct gsm_bts *bts = vty->index;

-       if (bts->type != GSM_BTS_TYPE_OSMOBTS) {
+       if (!is_osmo_bts(bts)) {
                vty_out(vty, "%% infinite radio link timeout not supported by 
this BTS%s", VTY_NEWLINE);
                return CMD_WARNING;
        }
@@ -5404,6 +5427,7 @@
        install_element(GSMNET_NODE, &cfg_bts_cmd);
        install_node(&bts_node, config_write_bts);
        install_element(BTS_NODE, &cfg_bts_type_cmd);
+       install_element(BTS_NODE, &cfg_bts_type_sysmo_cmd);
        install_element(BTS_NODE, &cfg_description_cmd);
        install_element(BTS_NODE, &cfg_no_description_cmd);
        install_element(BTS_NODE, &cfg_bts_band_cmd);
diff --git a/src/osmo-bsc/bts_init.c b/src/osmo-bsc/bts_init.c
index 18f1ed4..6c6a081 100644
--- a/src/osmo-bsc/bts_init.c
+++ b/src/osmo-bsc/bts_init.c
@@ -24,7 +24,14 @@
        bts_model_rbs2k_init();
        bts_model_nanobts_init();
        bts_model_nokia_site_init();
-       bts_model_sysmobts_init();
+
+       /* Osmocom family (see 
https://osmocom.org/projects/osmobts/wiki#Backends-Hardware-support) */
+       osmo_bts_model_init(GSM_BTS_TYPE_OSMOBTS_GENERIC);
+       osmo_bts_model_init(GSM_BTS_TYPE_OSMOBTS_LC15);
+       osmo_bts_model_init(GSM_BTS_TYPE_OSMOBTS_OCTPHY);
+       osmo_bts_model_init(GSM_BTS_TYPE_OSMOBTS_SYSMO);
+       osmo_bts_model_init(GSM_BTS_TYPE_OSMOBTS_TRX);
+
        /* Your new BTS here. */
        return 0;
 }
diff --git a/src/osmo-bsc/bts_osmobts.c b/src/osmo-bsc/bts_osmobts.c
new file mode 100644
index 0000000..5aaa1af
--- /dev/null
+++ b/src/osmo-bsc/bts_osmobts.c
@@ -0,0 +1,56 @@
+/* Osmocom family BTS model definition */
+
+/* (C) 2010-2012 by Harald Welte <lafo...@gnumonks.org>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <osmocom/gsm/bts_features.h>
+#include <osmocom/bsc/gsm_data.h>
+
+extern struct gsm_bts_model bts_model_nanobts;
+
+int osmo_bts_model_init(enum gsm_bts_type type)
+{
+       struct gsm_bts_model *model;
+
+       /* Allocate a new BTS model on heap */
+       model = talloc(tall_bsc_ctx, struct gsm_bts_model);
+       if (!model)
+               return -ENOMEM;
+
+       /* Inherit a new model from nanoBTS */
+       *model = bts_model_nanobts;
+       model->name = btstype2str(type);
+       model->type = type;
+
+       /* Unlike nanoBTS, osmo-bts supports SI2bis and SI2ter fine */
+       model->force_combined_si = false;
+
+       /* Initialize the vector of supported features */
+       memset(&model->_features_data[0], 0, sizeof(model->_features_data));
+       model->features = (struct bitvec) {
+               .data_len = sizeof(model->_features_data),
+               .data = &model->_features_data[0],
+       };
+
+       /* The following features are common to all osmo-bts-* models */
+       osmo_bts_set_feature(&model->features, BTS_FEAT_GPRS);
+       osmo_bts_set_feature(&model->features, BTS_FEAT_EGPRS);
+
+       return gsm_bts_model_register(model);
+}
diff --git a/src/osmo-bsc/bts_sysmobts.c b/src/osmo-bsc/bts_sysmobts.c
deleted file mode 100644
index ad12733..0000000
--- a/src/osmo-bsc/bts_sysmobts.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* sysmocom sysmoBTS specific code */
-
-/* (C) 2010-2012 by Harald Welte <lafo...@gnumonks.org>
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <arpa/inet.h>
-
-#include <osmocom/gsm/tlv.h>
-
-#include <osmocom/bsc/gsm_data.h>
-#include <osmocom/bsc/signal.h>
-#include <osmocom/bsc/abis_nm.h>
-#include <osmocom/abis/e1_input.h>
-#include <osmocom/gsm/tlv.h>
-#include <osmocom/core/msgb.h>
-#include <osmocom/core/talloc.h>
-#include <osmocom/bsc/gsm_data.h>
-#include <osmocom/bsc/abis_nm.h>
-#include <osmocom/bsc/abis_rsl.h>
-#include <osmocom/bsc/debug.h>
-#include <osmocom/abis/subchan_demux.h>
-#include <osmocom/abis/ipaccess.h>
-#include <osmocom/core/logging.h>
-
-extern struct gsm_bts_model bts_model_nanobts;
-
-static struct gsm_bts_model model_sysmobts;
-
-int bts_model_sysmobts_init(void)
-{
-       model_sysmobts = bts_model_nanobts;
-       model_sysmobts.name = "sysmobts";
-       model_sysmobts.type = GSM_BTS_TYPE_OSMOBTS;
-
-       /* Unlike nanoBTS, sysmoBTS supports SI2bis and SI2ter fine */
-       model_sysmobts.force_combined_si = false;
-
-       model_sysmobts.features.data = &model_sysmobts._features_data[0];
-       model_sysmobts.features.data_len =
-                               sizeof(model_sysmobts._features_data);
-       memset(model_sysmobts.features.data, 0, 
model_sysmobts.features.data_len);
-
-        osmo_bts_set_feature(&model_sysmobts.features, BTS_FEAT_GPRS);
-       osmo_bts_set_feature(&model_sysmobts.features, BTS_FEAT_EGPRS);
-
-       return gsm_bts_model_register(&model_sysmobts);
-}
diff --git a/src/osmo-bsc/e1_config.c b/src/osmo-bsc/e1_config.c
index 4389f66..8e90a54 100644
--- a/src/osmo-bsc/e1_config.c
+++ b/src/osmo-bsc/e1_config.c
@@ -174,8 +174,7 @@
                bts->model->e1line_bind_ops(line);

        /* skip signal link initialization, this is done later for these BTS. */
-       if (bts->type == GSM_BTS_TYPE_NANOBTS ||
-           bts->type == GSM_BTS_TYPE_OSMOBTS)
+       if (bts->type == GSM_BTS_TYPE_NANOBTS || is_osmo_bts(bts))
                return e1inp_line_update(line);

        /* OML link */
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 46e26ac..08e8ccb 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -85,7 +85,11 @@
        { GSM_BTS_TYPE_NANOBTS,         "ip.access nanoBTS or compatible" },
        { GSM_BTS_TYPE_RBS2000,         "Ericsson RBS2000 Series" },
        { GSM_BTS_TYPE_NOKIA_SITE,      "Nokia {Metro,Ultra,In}Site" },
-       { GSM_BTS_TYPE_OSMOBTS,         "sysmocom sysmoBTS" },
+       { GSM_BTS_TYPE_OSMOBTS_GENERIC, "Osmocom family (generic profile)" },
+       { GSM_BTS_TYPE_OSMOBTS_LC15,    "Osmocom family (NuRAN LiteCell15 PHY)" 
},
+       { GSM_BTS_TYPE_OSMOBTS_OCTPHY,  "Osmocom family (Octasic OCTSDR PHY)" },
+       { GSM_BTS_TYPE_OSMOBTS_SYSMO,   "Osmocom family (Sysmocom sysmoBTS 
PHY)" },
+       { GSM_BTS_TYPE_OSMOBTS_TRX,     "Osmocom family (OsmoTRX SDR PHY)" },
        { 0,                            NULL }
 };

@@ -184,7 +188,11 @@

        switch (bts->type) {
        case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       case GSM_BTS_TYPE_OSMOBTS_GENERIC:
+       case GSM_BTS_TYPE_OSMOBTS_LC15:
+       case GSM_BTS_TYPE_OSMOBTS_OCTPHY:
+       case GSM_BTS_TYPE_OSMOBTS_SYSMO:
+       case GSM_BTS_TYPE_OSMOBTS_TRX:
                /* Set the default OML Stream ID to 0xff */
                bts->oml_tei = 0xff;
                bts->c0->nominal_power = 23;
@@ -413,32 +421,17 @@
        return get_value_string(bts_attribute_names, v);
 }

-const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = {
-       { BTS_UNKNOWN,          "unknown" },
-       { BTS_OSMO_LITECELL15,  "osmo-bts-lc15" },
-       { BTS_OSMO_OCTPHY,      "osmo-bts-octphy" },
-       { BTS_OSMO_SYSMO,       "osmo-bts-sysmo" },
-       { BTS_OSMO_TRX,         "omso-bts-trx" },
-       { 0, NULL }
-};
-
-enum gsm_bts_type_variant str2btsvariant(const char *arg)
-{
-       return get_string_value(osmo_bts_variant_names, arg);
-}
-
-const char *btsvariant2str(enum gsm_bts_type_variant v)
-{
-       return get_value_string(osmo_bts_variant_names, v);
-}
-
 const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = {
        { GSM_BTS_TYPE_UNKNOWN,         "unknown" },
        { GSM_BTS_TYPE_BS11,            "bs11" },
        { GSM_BTS_TYPE_NANOBTS,         "nanobts" },
        { GSM_BTS_TYPE_RBS2000,         "rbs2000" },
        { GSM_BTS_TYPE_NOKIA_SITE,      "nokia_site" },
-       { GSM_BTS_TYPE_OSMOBTS,         "sysmobts" },
+       { GSM_BTS_TYPE_OSMOBTS_GENERIC, "osmo-bts" },
+       { GSM_BTS_TYPE_OSMOBTS_LC15,    "osmo-bts-lc15" },
+       { GSM_BTS_TYPE_OSMOBTS_OCTPHY,  "osmo-bts-octphy" },
+       { GSM_BTS_TYPE_OSMOBTS_SYSMO,   "osmo-bts-sysmo" },
+       { GSM_BTS_TYPE_OSMOBTS_TRX,     "osmo-bts-trx" },
        { 0, NULL }
 };

diff --git a/src/osmo-bsc/system_information.c 
b/src/osmo-bsc/system_information.c
index d5be3f2..4ee73fa 100644
--- a/src/osmo-bsc/system_information.c
+++ b/src/osmo-bsc/system_information.c
@@ -995,14 +995,9 @@
        memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN);

        /* ip.access nanoBTS needs l2_plen!! */
-       switch (bts->type) {
-       case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       if (bts->type == GSM_BTS_TYPE_NANOBTS || is_osmo_bts(bts)) {
                *output++ = GSM48_LEN2PLEN(l2_plen);
                l2_plen++;
-               break;
-       default:
-               break;
        }

        si5 = (struct gsm48_system_information_type_5 *) output;
@@ -1031,14 +1026,9 @@
        memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN);

        /* ip.access nanoBTS needs l2_plen!! */
-       switch (bts->type) {
-       case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       if (bts->type == GSM_BTS_TYPE_NANOBTS || is_osmo_bts(bts)) {
                *output++ = GSM48_LEN2PLEN(l2_plen);
                l2_plen++;
-               break;
-       default:
-               break;
        }

        si5b = (struct gsm48_system_information_type_5bis *) output;
@@ -1075,14 +1065,9 @@
        memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN);

        /* ip.access nanoBTS needs l2_plen!! */
-       switch (bts->type) {
-       case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       if (bts->type == GSM_BTS_TYPE_NANOBTS || is_osmo_bts(bts)) {
                *output++ = GSM48_LEN2PLEN(l2_plen);
                l2_plen++;
-               break;
-       default:
-               break;
        }

        si5t = (struct gsm48_system_information_type_5ter *) output;
@@ -1113,14 +1098,9 @@
        memset(output, GSM_MACBLOCK_PADDING, GSM_MACBLOCK_LEN);

        /* ip.access nanoBTS needs l2_plen!! */
-       switch (bts->type) {
-       case GSM_BTS_TYPE_NANOBTS:
-       case GSM_BTS_TYPE_OSMOBTS:
+       if (bts->type == GSM_BTS_TYPE_NANOBTS || is_osmo_bts(bts)) {
                *output++ = GSM48_LEN2PLEN(l2_plen);
                l2_plen++;
-               break;
-       default:
-               break;
        }

        si6 = (struct gsm48_system_information_type_6 *) output;
diff --git a/tests/neighbor_ident.vty b/tests/neighbor_ident.vty
index ce414e1..250da89 100644
--- a/tests/neighbor_ident.vty
+++ b/tests/neighbor_ident.vty
@@ -15,7 +15,7 @@
 OsmoBSC(config)# network

 OsmoBSC(config-net)# bts 0
-OsmoBSC(config-net-bts)# type sysmobts
+OsmoBSC(config-net-bts)# type osmo-bts
 OsmoBSC(config-net-bts)# base_station_id_code 10
 OsmoBSC(config-net-bts)# location_area_code 20
 OsmoBSC(config-net-bts)# cell_identity 30
@@ -25,7 +25,7 @@
 OsmoBSC(config-net-bts)# exit

 OsmoBSC(config-net)# bts 1
-OsmoBSC(config-net-bts)# type sysmobts
+OsmoBSC(config-net-bts)# type osmo-bts
 OsmoBSC(config-net-bts)# base_station_id_code 11
 OsmoBSC(config-net-bts)# location_area_code 21
 OsmoBSC(config-net-bts)# cell_identity 31
@@ -35,7 +35,7 @@
 OsmoBSC(config-net-bts)# exit

 OsmoBSC(config-net)# bts 2
-OsmoBSC(config-net-bts)# type sysmobts
+OsmoBSC(config-net-bts)# type osmo-bts
 OsmoBSC(config-net-bts)# base_station_id_code 12
 OsmoBSC(config-net-bts)# location_area_code 22
 OsmoBSC(config-net-bts)# cell_identity 65535

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18616
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I00a815cfa6daab126742d27843e700c07c1db183
Gerrit-Change-Number: 18616
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to