aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-20 23:06:30 +0100
committerHarald Welte <laforge@gnumonks.org>2016-02-15 14:27:43 +0100
commitc6723c82064caec54faeec80b0afd8159140c96d (patch)
treed7068a72c19537c4e9a90c1b6c2edceafea04077 /src/common
parent3b4d9e7c076df65257183c313a7f436fd6e66ca8 (diff)
move auto-band configuration commands to common/vty.c
It remains up to the individual BTS hardware models to decide whether or not to register those commands (depending on whether they support the feature) via cfg_bts_auto_band_cmd / cfg_bts_no_auto_band_cmd
Diffstat (limited to 'src/common')
-rw-r--r--src/common/vty.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index 62751772..383fa3c3 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -183,6 +183,28 @@ static struct cmd_node trx_node = {
1,
};
+gDEFUN(cfg_bts_auto_band, cfg_bts_auto_band_cmd,
+ "auto-band",
+ "Automatically select band for ARFCN based on configured band\n")
+{
+ struct gsm_bts *bts = vty->index;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+ btsb->auto_band = 1;
+ return CMD_SUCCESS;
+}
+
+gDEFUN(cfg_bts_no_auto_band, cfg_bts_no_auto_band_cmd,
+ "no auto-band",
+ NO_STR "Automatically select band for ARFCN based on configured band\n")
+{
+ struct gsm_bts *bts = vty->index;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+ btsb->auto_band = 0;
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_bts_trx, cfg_bts_trx_cmd,
"trx <0-254>",
@@ -243,6 +265,8 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
if (bts->description)
vty_out(vty, " description %s%s", bts->description, VTY_NEWLINE);
vty_out(vty, " band %s%s", gsm_band_name(bts->band), VTY_NEWLINE);
+ if (btsb->auto_band)
+ vty_out(vty, " auto-band%s", VTY_NEWLINE);
vty_out(vty, " ipa unit-id %u %u%s",
bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE);
vty_out(vty, " oml remote-ip %s%s", btsb->bsc_oml_host, VTY_NEWLINE);