aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/sysmobts_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-06-20 17:18:38 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-06-24 08:17:12 +0200
commitf169a75fc41c2474bb0602d5f6b6401213f03633 (patch)
tree84917f00cda01e84bf5ee476accbd5e230c52293 /src/osmo-bts-sysmo/sysmobts_vty.c
parent43b4176f0e0e4d1e73463e9ff21a69e6e2848215 (diff)
sysmobts: Introduce an auto-band config to ease DCS/DCS, PCS/PCS changes
During development one switches from GSM900 to GSM1800 and GSM850 to GSM1900. This commit attempts to make this switch more easy. GSM1800 and GSM1900 have overlapping ARFCNs. This means that the mapping from bands to arfcn is not injective. Because of that I removed the code to deduce the band from the ARFCN. This was done in commit 8c3d807b3fc785ffb18aeb97355150c92221e8a0. The auto-band option allows to move between GSM900/GSM1800 and GSM850/GSM1900. Add a simple testcase with these auto-band configurations.
Diffstat (limited to 'src/osmo-bts-sysmo/sysmobts_vty.c')
-rw-r--r--src/osmo-bts-sysmo/sysmobts_vty.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/sysmobts_vty.c b/src/osmo-bts-sysmo/sysmobts_vty.c
index 4993c51d..558dcd97 100644
--- a/src/osmo-bts-sysmo/sysmobts_vty.c
+++ b/src/osmo-bts-sysmo/sysmobts_vty.c
@@ -1,7 +1,7 @@
/* VTY interface for sysmoBTS */
/* (C) 2011 by Harald Welte <laforge@gnumonks.org>
- * (C) 2012 by Holger Hans Peter Freyther
+ * (C) 2012,2013 by Holger Hans Peter Freyther
*
* All Rights Reserved
*
@@ -57,6 +57,28 @@ 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_trx_gsmtap_sapi, cfg_trx_gsmtap_sapi_cmd,
"HIDDEN", "HIDDEN")
{
@@ -412,6 +434,10 @@ 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);
}
/* FIXME: move to libosmocore ? */
@@ -515,6 +541,9 @@ int bts_model_vty_init(struct gsm_bts *bts)
install_element(ENABLE_NODE, &loopback_cmd);
install_element(ENABLE_NODE, &no_loopback_cmd);
+ install_element(BTS_NODE, &cfg_bts_auto_band_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd);
+
install_element(TRX_NODE, &cfg_trx_clkcal_cmd);
install_element(TRX_NODE, &cfg_trx_clkcal_def_cmd);
install_element(TRX_NODE, &cfg_trx_clksrc_cmd);