bsc: Add code to send ip.access reboot command to nanoBTS

The nanoBTS continues to be buggy and seems to have broken BSSGP
when changing SIs across new OML connections. Add an easy command
to force the reboot of the system through OML.
This commit is contained in:
Holger Hans Peter Freyther 2016-03-16 13:45:23 +01:00
parent 3a38ee6c3d
commit 740e65fb7b
1 changed files with 39 additions and 0 deletions

View File

@ -3596,6 +3596,44 @@ DEFUN(drop_bts,
return CMD_SUCCESS;
}
DEFUN(restart_bts, restart_bts_cmd,
"restart-bts <0-65535>",
"Restart ip.access nanoBTS through OML\n"
"BTS Number\n")
{
struct gsm_network *gsmnet;
struct gsm_bts_trx *trx;
struct gsm_bts *bts;
unsigned int bts_nr;
gsmnet = gsmnet_from_vty(vty);
bts_nr = atoi(argv[0]);
if (bts_nr >= gsmnet->num_bts) {
vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s",
gsmnet->num_bts, bts_nr, VTY_NEWLINE);
return CMD_WARNING;
}
bts = gsm_bts_num(gsmnet, bts_nr);
if (!bts) {
vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE);
return CMD_WARNING;
}
if (!is_ipaccess_bts(bts) || is_sysmobts_v2(bts)) {
vty_out(vty, "This command only works for ipaccess nanoBTS.%s",
VTY_NEWLINE);
return CMD_WARNING;
}
/* go from last TRX to c0 */
llist_for_each_entry_reverse(trx, &bts->trx_list, list)
abis_nm_ipaccess_restart(trx);
return CMD_SUCCESS;
}
DEFUN(smscb_cmd, smscb_cmd_cmd,
"bts <0-255> smscb-command <1-4> HEXSTRING",
"BTS related commands\n" "BTS Number\n"
@ -3895,6 +3933,7 @@ int bsc_vty_init(const struct log_info *cat)
install_element(TS_NODE, &cfg_ts_e1_subslot_cmd);
install_element(ENABLE_NODE, &drop_bts_cmd);
install_element(ENABLE_NODE, &restart_bts_cmd);
install_element(ENABLE_NODE, &pdch_act_cmd);
install_element(ENABLE_NODE, &smscb_cmd_cmd);