falconia has uploaded this change for review.

View Change

nokia: rename BTS model from nokia_site to nokia-e1

When Nokia BTS support was introduced into Osmocom in 2011, only
{Metro,Ultra,In}Site family was supported, and the name of this
BTS model in OsmoBSC was set to nokia_site. However, we now
also support Flexi Multiradio in E1 Abis configuration with the
same code, automatically applying Site-specific or Flexi-MR-
specific handling based on the type code returned by the BTS
itself - hence calling the BTS model nokia_site and referring
strictly to *Site in docs and vty help is now misleading.

At the same time, these newer BTS models support both E1 and IP
Abis options, and there is a desire to support IP Abis operation
at some point in the future. When/if Nokia IP support becomes a
reality, we will certainly need to know upfront which type of Abis
we are working with, similarly to how we currently distinguish
upfront between E1 and IPA types of BTS. Therefore, the new BTS
model name is set to nokia-e1, rather than just "nokia", with the
expectation that we will also have nokia-ip in the future.

bts_nokia_site.c source file name is deliberately left unchanged.
Source file renames make it difficult to follow changes, hence a
slightly outdated source file name is deemed to be a lesser evil.
This source file may also be split in the future as Nokia BTS
support code grows.

Change-Id: I3e993bda577964922e29dbbaf9554fa53bb2d445
---
M include/osmocom/bsc/bss.h
M include/osmocom/bsc/bts.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_init.c
M src/osmo-bsc/bts_nokia_site.c
M src/osmo-bsc/bts_vty.c
M src/osmo-bsc/osmo_bsc_main.c
8 files changed, 46 insertions(+), 31 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/29/42729/1
diff --git a/include/osmocom/bsc/bss.h b/include/osmocom/bsc/bss.h
index 199f981..05b4e94 100644
--- a/include/osmocom/bsc/bss.h
+++ b/include/osmocom/bsc/bss.h
@@ -15,6 +15,6 @@
extern int bts_model_bs11_init(void);
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_nokia_init(void);
extern int bts_model_osmobts_init(void);
#endif
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index f05f41c..b995752 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -242,7 +242,7 @@
GSM_BTS_TYPE_BS11,
GSM_BTS_TYPE_NANOBTS,
GSM_BTS_TYPE_RBS2000,
- GSM_BTS_TYPE_NOKIA_SITE,
+ GSM_BTS_TYPE_NOKIA_E1,
GSM_BTS_TYPE_OSMOBTS,
_NUM_GSM_BTS_TYPE
};
@@ -774,7 +774,7 @@
static inline bool is_nokia_bts(const struct gsm_bts *bts)
{
switch (bts->type) {
- case GSM_BTS_TYPE_NOKIA_SITE:
+ case GSM_BTS_TYPE_NOKIA_E1:
return true;
default:
break;
@@ -800,7 +800,7 @@
switch (bts->type) {
case GSM_BTS_TYPE_BS11:
case GSM_BTS_TYPE_RBS2000:
- case GSM_BTS_TYPE_NOKIA_SITE:
+ case GSM_BTS_TYPE_NOKIA_E1:
return true;
default:
break;
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 4627914..f0ba132 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1528,7 +1528,7 @@
mr->ms_l1.ta = val[1];
/* BS11, Nokia and RBS report TA shifted by 2 bits */
if (msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_BS11
- || msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_NOKIA_SITE
+ || msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_NOKIA_E1
|| msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_RBS2000)
mr->ms_l1.ta >>= 2;
/* store TA for handover decision, and for intra-cell re-assignment */
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index d295bfd..4b28df7 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -68,7 +68,7 @@
{ 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_NOKIA_E1, "nokia-e1" },
{ GSM_BTS_TYPE_OSMOBTS, "osmo-bts" },
{ 0, NULL }
};
@@ -78,7 +78,7 @@
{ GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" },
{ 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_NOKIA_E1, "Nokia BTS with E1 Abis" },
{ GSM_BTS_TYPE_OSMOBTS, "Osmocom Base Transceiver Station" },
{ 0, NULL }
};
@@ -742,7 +742,7 @@
INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups);
INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups);
break;
- case GSM_BTS_TYPE_NOKIA_SITE:
+ case GSM_BTS_TYPE_NOKIA_E1:
/* Set default BTS reset timer */
bts->nokia.bts_reset_timer_cnf = 15;
/* Enable Rx diversity by default, for backward compat */
diff --git a/src/osmo-bsc/bts_init.c b/src/osmo-bsc/bts_init.c
index 0e3debc..b931801 100644
--- a/src/osmo-bsc/bts_init.c
+++ b/src/osmo-bsc/bts_init.c
@@ -23,7 +23,7 @@
bts_model_bs11_init();
bts_model_rbs2k_init();
bts_model_nanobts_init();
- bts_model_nokia_site_init();
+ bts_model_nokia_init();
bts_model_osmobts_init();
/* Your new BTS here. */
return 0;
diff --git a/src/osmo-bsc/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c
index 9c1e5a1..be0fec3 100644
--- a/src/osmo-bsc/bts_nokia_site.c
+++ b/src/osmo-bsc/bts_nokia_site.c
@@ -140,7 +140,7 @@
switch (signal) {
case S_GLOBAL_BTS_CLOSE_OM:
bts = signal_data;
- if (bts->type == GSM_BTS_TYPE_NOKIA_SITE)
+ if (is_nokia_bts(bts))
shutdown_om(signal_data);
break;
}
@@ -166,7 +166,7 @@
case S_L_INP_TEI_UP:
switch (isd->link_type) {
case E1INP_SIGN_OML:
- if (isd->trx->bts->type != GSM_BTS_TYPE_NOKIA_SITE)
+ if (!is_nokia_bts(isd->trx->bts))
break;

if (isd->tei == isd->trx->bts->oml_tei)
@@ -193,7 +193,7 @@
static void nm_statechg_evt(unsigned int signal,
struct nm_statechg_signal_data *nsd)
{
- if (nsd->bts->type != GSM_BTS_TYPE_NOKIA_SITE)
+ if (!is_nokia_bts(nsd->bts))
return;
}

@@ -2180,24 +2180,24 @@
return rc;
}

-static int bts_model_nokia_site_start(struct gsm_network *net);
+static int bts_model_nokia_e1_start(struct gsm_network *net);

-static void bts_model_nokia_site_e1line_bind_ops(struct e1inp_line *line)
+static void bts_model_nokia_e1line_bind_ops(struct e1inp_line *line)
{
e1inp_line_bind_ops(line, &bts_isdn_e1inp_line_ops);
}

-static struct gsm_bts_model model_nokia_site = {
- .type = GSM_BTS_TYPE_NOKIA_SITE,
- .name = "nokia_site",
- .start = bts_model_nokia_site_start,
+static struct gsm_bts_model model_nokia_e1 = {
+ .type = GSM_BTS_TYPE_NOKIA_E1,
+ .name = "nokia-e1",
+ .start = bts_model_nokia_e1_start,
.oml_rcvmsg = &abis_nokia_rcvmsg,
- .e1line_bind_ops = &bts_model_nokia_site_e1line_bind_ops,
+ .e1line_bind_ops = &bts_model_nokia_e1line_bind_ops,
};

static struct gsm_network *my_net;

-static int bts_model_nokia_site_start(struct gsm_network *net)
+static int bts_model_nokia_e1_start(struct gsm_network *net)
{
osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL);
@@ -2208,14 +2208,14 @@
return 0;
}

-int bts_model_nokia_site_init(void)
+int bts_model_nokia_init(void)
{
- model_nokia_site.features.data = &model_nokia_site._features_data[0];
- model_nokia_site.features.data_len = sizeof(model_nokia_site._features_data);
+ model_nokia_e1.features.data = &model_nokia_e1._features_data[0];
+ model_nokia_e1.features.data_len = sizeof(model_nokia_e1._features_data);

- osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HOPPING);
- osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_HSCSD);
- osmo_bts_set_feature(&model_nokia_site.features, BTS_FEAT_MULTI_TSC);
+ osmo_bts_set_feature(&model_nokia_e1.features, BTS_FEAT_HOPPING);
+ osmo_bts_set_feature(&model_nokia_e1.features, BTS_FEAT_HSCSD);
+ osmo_bts_set_feature(&model_nokia_e1.features, BTS_FEAT_MULTI_TSC);

- return gsm_bts_model_register(&model_nokia_site);
+ return gsm_bts_model_register(&model_nokia_e1);
}
diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index 3afa0cc..33629a8 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -178,6 +178,20 @@
return cfg_bts_type(self, vty, 1, args);
}

+DEFUN_DEPRECATED(cfg_bts_type_nokia_site,
+ cfg_bts_type_nokia_site_cmd,
+ "type nokia_site",
+ "Set the BTS type\n"
+ "Deprecated alias for 'nokia-e1'\n")
+{
+ const char *args[] = { "nokia-e1" };
+
+ vty_out(vty, "%% BTS type 'nokia_site' is deprecated, "
+ "use 'type nokia-e1' instead.%s", VTY_NEWLINE);
+
+ return cfg_bts_type(self, vty, 1, args);
+}
+
DEFUN_USRATTR(cfg_bts_band,
cfg_bts_band_cmd,
X(BSC_VTY_ATTR_RESTART_ABIS_OML_LINK),
@@ -4170,7 +4184,7 @@
vty_out(vty, " Unit ID: %u/%u/0, OML Stream ID 0x%02x%s",
bts->ip_access.site_id, bts->ip_access.bts_id,
bts->oml_tei, VTY_NEWLINE);
- else if (bts->type == GSM_BTS_TYPE_NOKIA_SITE)
+ else if (is_nokia_bts(bts))
vty_out(vty, " Skip Reset: %d%s",
bts->nokia.skip_reset, VTY_NEWLINE);
vty_out(vty, " NM State: ");
@@ -4734,7 +4748,7 @@
vty_out(vty, " oml ipa stream-id %u line %u%s",
bts->oml_tei, bts->oml_e1_link.e1_nr, VTY_NEWLINE);
break;
- case GSM_BTS_TYPE_NOKIA_SITE:
+ case GSM_BTS_TYPE_NOKIA_E1:
vty_out(vty, " nokia_site skip-reset %d%s", bts->nokia.skip_reset, VTY_NEWLINE);
vty_out(vty, " nokia_site no-local-rel-conf %d%s",
bts->nokia.no_loc_rel_cnf, VTY_NEWLINE);
@@ -4950,6 +4964,7 @@
install_node(&bts_node, config_write_bts);
install_element(BTS_NODE, &cfg_bts_type_cmd);
install_element(BTS_NODE, &cfg_bts_type_sysmobts_cmd);
+ install_element(BTS_NODE, &cfg_bts_type_nokia_site_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/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index f4a4c4c..714ca96 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -322,7 +322,7 @@
trx->arfcn, osmo_plmn_name(&bsc_gsmnet->plmn),
bts->location_area_code, bts->cell_identity, bts->bsic);

- if (bts->type == GSM_BTS_TYPE_NOKIA_SITE) {
+ if (is_nokia_bts(bts)) {
rsl_nokia_si_begin(trx);
}

@@ -339,7 +339,7 @@
return;
}

- if (bts->type == GSM_BTS_TYPE_NOKIA_SITE) {
+ if (is_nokia_bts(bts)) {
/* channel unspecific, power reduction in 2 dB steps */
rsl_bs_power_control(trx, 0xFF, trx->max_power_red / 2);
rsl_nokia_si_end(trx);

To view, visit change 42729. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3e993bda577964922e29dbbaf9554fa53bb2d445
Gerrit-Change-Number: 42729
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon@freecalypso.org>