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>
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index e2ff439..f44611c 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -263,6 +263,9 @@
 			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 @@
 		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 @@
 	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 @@
 	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);