aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--include/osmo-bts/vty.h3
-rw-r--r--src/common/vty.c24
-rw-r--r--src/osmo-bts-litecell15/lc15bts_vty.c26
-rw-r--r--src/osmo-bts-octphy/octphy_vty.c5
-rw-r--r--src/osmo-bts-sysmo/sysmobts_vty.c26
5 files changed, 27 insertions, 57 deletions
diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h
index f91f5e78..d27acb5f 100644
--- a/include/osmo-bts/vty.h
+++ b/include/osmo-bts/vty.h
@@ -17,6 +17,9 @@ enum bts_vty_node {
extern struct cmd_element ournode_exit_cmd;
extern struct cmd_element ournode_end_cmd;
+extern struct cmd_element cfg_bts_auto_band_cmd;
+extern struct cmd_element cfg_bts_no_auto_band_cmd;
+
struct phy_instance *vty_get_phy_instance(struct vty *vty, int phy_nr, int inst_nr);
int bts_vty_go_parent(struct vty *vty);
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);
diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c
index 2f624c8d..d0288ab7 100644
--- a/src/osmo-bts-litecell15/lc15bts_vty.c
+++ b/src/osmo-bts-litecell15/lc15bts_vty.c
@@ -67,28 +67,6 @@ static struct gsm_bts *vty_bts;
/* configuration */
-DEFUN(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;
-}
-
-DEFUN(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_phy_cal_path, cfg_phy_cal_path_cmd,
"trx-calibration-path PATH",
"Set the path name to TRX calibration data\n" "Path name\n")
@@ -323,10 +301,6 @@ DEFUN(no_loopback, no_loopback_cmd,
void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
{
- struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
-
- if (btsb->auto_band)
- vty_out(vty, " auto-band%s", VTY_NEWLINE);
}
void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
diff --git a/src/osmo-bts-octphy/octphy_vty.c b/src/osmo-bts-octphy/octphy_vty.c
index 6e58ad42..3ea576cb 100644
--- a/src/osmo-bts-octphy/octphy_vty.c
+++ b/src/osmo-bts-octphy/octphy_vty.c
@@ -210,11 +210,6 @@ void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
{
- struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
-
- if (btsb->auto_band)
- vty_out(vty, " auto-band%s", VTY_NEWLINE);
-
}
void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
diff --git a/src/osmo-bts-sysmo/sysmobts_vty.c b/src/osmo-bts-sysmo/sysmobts_vty.c
index 11e3e8fa..d2857520 100644
--- a/src/osmo-bts-sysmo/sysmobts_vty.c
+++ b/src/osmo-bts-sysmo/sysmobts_vty.c
@@ -63,28 +63,6 @@ static struct gsm_bts *vty_bts;
/* configuration */
-DEFUN(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;
-}
-
-DEFUN(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_phy_clkcal_eeprom, cfg_phy_clkcal_eeprom_cmd,
"clock-calibration eeprom",
"Use the eeprom clock calibration value\n")
@@ -457,10 +435,6 @@ DEFUN(no_loopback, no_loopback_cmd,
void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
{
- struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
-
- if (btsb->auto_band)
- vty_out(vty, " auto-band%s", VTY_NEWLINE);
}
void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)