aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2011-10-17 14:04:55 +0200
committerSylvain Munaut <tnt@246tNt.com>2011-10-18 21:51:02 +0200
commitc9519466918157245f8aae93c5be11a7c28b65a3 (patch)
treea351b58d7a189101c84b48dd4b89301b2e6ce5dd /openbsc
parent67c0c7f8aa9b6e4e49290a81d3e796651b60fede (diff)
libbsc/nokia_site: Fix reset procedure and add option to skip it.
do_reset was not initialized anywhere anymore, so the reset was never triggered. It's now fixed and we add an option to skip it in the config so that when in production, you can restart without config changes quickly. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h3
-rw-r--r--openbsc/src/libbsc/bsc_vty.c24
-rw-r--r--openbsc/src/libbsc/bts_nokia_site.c11
3 files changed, 33 insertions, 5 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index ceb53983d..f7a85a38b 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -511,7 +511,8 @@ struct gsm_bts {
struct {
uint8_t bts_type;
int configured:1,
- do_reset:1,
+ skip_reset:1,
+ did_reset:1,
wait_reset:1;
struct osmo_timer_list reset_timer;
} nokia;
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index e2ff43996..f44611c9e 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -263,6 +263,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
bts->oml_tei, VTY_NEWLINE);
else if (bts->type == GSM_BTS_TYPE_HSL_FEMTO)
vty_out(vty, " Serial Number: %lu%s", bts->hsl.serno, VTY_NEWLINE);
+ else if (bts->type == GSM_BTS_TYPE_NOKIA_SITE)
+ vty_out(vty, " Skip Reset: %d%s",
+ bts->nokia.skip_reset, VTY_NEWLINE);
vty_out(vty, " NM State: ");
net_dump_nmstate(vty, &bts->mo.nm_state);
vty_out(vty, " Site Mgr NM State: ");
@@ -522,6 +525,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " oml hsl line %u%s",
bts->oml_e1_link.e1_nr, VTY_NEWLINE);
break;
+ case GSM_BTS_TYPE_NOKIA_SITE:
+ vty_out(vty, " nokia_site skip-reset %d%s", bts->nokia.skip_reset, VTY_NEWLINE);
+ break;
default:
config_write_e1_link(vty, &bts->oml_e1_link, " oml ");
vty_out(vty, " oml e1 tei %u%s", bts->oml_tei, VTY_NEWLINE);
@@ -1527,6 +1533,23 @@ DEFUN(cfg_bts_serno,
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_nokia_site_skip_reset,
+ cfg_bts_nokia_site_skip_reset_cmd,
+ "nokia_site skip-reset (0|1)",
+ "Skip the reset step during bootstrap process of this BTS\n")
+{
+ struct gsm_bts *bts = vty->index;
+
+ if (bts->type != GSM_BTS_TYPE_NOKIA_SITE) {
+ vty_out(vty, "%% BTS is not of Nokia *Site type%s", VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ bts->nokia.skip_reset = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
#define OML_STR "Organization & Maintenance Link\n"
#define IPA_STR "ip.access Specific Options\n"
@@ -2669,6 +2692,7 @@ int bsc_vty_init(const struct log_info *cat)
install_element(BTS_NODE, &cfg_bts_bsic_cmd);
install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
install_element(BTS_NODE, &cfg_bts_serno_cmd);
+ install_element(BTS_NODE, &cfg_bts_nokia_site_skip_reset_cmd);
install_element(BTS_NODE, &cfg_bts_stream_id_cmd);
install_element(BTS_NODE, &cfg_bts_hsl_oml_cmd);
install_element(BTS_NODE, &cfg_bts_oml_e1_cmd);
diff --git a/openbsc/src/libbsc/bts_nokia_site.c b/openbsc/src/libbsc/bts_nokia_site.c
index c43eb5fde..dfe4c0347 100644
--- a/openbsc/src/libbsc/bts_nokia_site.c
+++ b/openbsc/src/libbsc/bts_nokia_site.c
@@ -57,8 +57,11 @@ static void bootstrap_om_bts(struct gsm_bts *bts)
{
LOGP(DNM, LOGL_NOTICE, "bootstrapping OML for BTS %u\n", bts->nr);
- if (bts->nokia.do_reset)
- abis_nm_reset(bts, 1);
+ if (!bts->nokia.skip_reset) {
+ if (!bts->nokia.did_reset)
+ abis_nm_reset(bts, 1);
+ } else
+ bts->nokia.did_reset = 1;
}
static void bootstrap_om_trx(struct gsm_bts_trx *trx)
@@ -1543,8 +1546,8 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
/* TODO: the assumption for the following is that no NACK was received */
/* ACK for reset message ? */
- if (bts->nokia.do_reset != 0) {
- bts->nokia.do_reset = 0;
+ if (!bts->nokia.did_reset) {
+ bts->nokia.did_reset = 1;
/*
TODO: For the InSite processing the received data is