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>
This commit is contained in:
parent
99118d3144
commit
cb8e8432b7
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue