aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-08-23 21:58:29 +0200
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:41:30 +0200
commitb2482a8574a3a7ce4e628237f411ea0a4cd25f1b (patch)
treefe67e53937549da09f87a5a302ed83484c78b56d
parent812fdd92c70679f4d5a46f9078a74e2a94cd74e4 (diff)
Allow TRX 0..254 at VTY, even if less TRX are available
Instead of limiting the number of TRX at VTY to the actual number of supported TRX, VTY allows to configure any possible number of TRX. If a TRX is configured, which is not supported by BTS model, an error message is returned, which states that the given TRX is not supported.
-rw-r--r--include/osmo-bts/vty.h2
-rw-r--r--src/common/vty.c9
-rw-r--r--src/osmo-bts-sysmo/main.c2
-rw-r--r--src/osmo-bts-trx/main.c2
4 files changed, 7 insertions, 8 deletions
diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h
index 9fcc5b5d..510abab1 100644
--- a/include/osmo-bts/vty.h
+++ b/include/osmo-bts/vty.h
@@ -15,7 +15,7 @@ extern struct cmd_element ournode_end_cmd;
enum node_type bts_vty_go_parent(struct vty *vty);
int bts_vty_is_config_node(struct vty *vty, int node);
-int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat);
+int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat);
extern struct vty_app_info bts_vty_info;
diff --git a/src/common/vty.c b/src/common/vty.c
index bca839bb..0d52dd76 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -140,9 +140,8 @@ static struct cmd_node trx_node = {
1,
};
-static char cfg_bts_trx_cmd_string[16];
DEFUN(cfg_bts_trx, cfg_bts_trx_cmd,
- cfg_bts_trx_cmd_string,
+ "trx <0-254>",
"Select a TRX to configure\n" "TRX number\n")
{
int trx_nr = atoi(argv[0]);
@@ -151,7 +150,8 @@ DEFUN(cfg_bts_trx, cfg_bts_trx_cmd,
trx = gsm_bts_trx_num(bts, trx_nr);
if (!trx) {
- vty_out(vty, "Unknown TRX %u%s", trx_nr, VTY_NEWLINE);
+ vty_out(vty, "Unknown TRX %u. Aavialable TRX are: 0..%d%s",
+ trx_nr, bts->num_trx - 1, VTY_NEWLINE);
return CMD_WARNING;
}
@@ -763,7 +763,7 @@ DEFUN(no_bts_t_t_l_loopback,
return CMD_SUCCESS;
}
-int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat)
+int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat)
{
cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names,
"gsmtap-sapi (",
@@ -803,7 +803,6 @@ int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat)
install_element(BTS_NODE, &cfg_trx_no_gsmtap_sapi_cmd);
/* add and link to TRX config node */
- sprintf(cfg_bts_trx_cmd_string, "trx <0-%d>", trx_num - 1);
install_element(BTS_NODE, &cfg_bts_trx_cmd);
install_node(&trx_node, config_write_dummy);
install_default(TRX_NODE);
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index 9913708f..bee5bda2 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -320,7 +320,7 @@ int main(int argc, char **argv)
bts = gsm_bts_alloc(tall_bts_ctx);
vty_init(&bts_vty_info);
e1inp_vty_init();
- bts_vty_init(bts, 1, &bts_log_info);
+ bts_vty_init(bts, &bts_log_info);
handle_options(argc, argv);
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 6ddc27e9..c4a4c601 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -310,7 +310,7 @@ int main(int argc, char **argv)
vty_init(&bts_vty_info);
e1inp_vty_init();
- bts_vty_init(bts, trx_num, &bts_log_info);
+ bts_vty_init(bts, &bts_log_info);
if (bts_init(bts) < 0) {
fprintf(stderr, "unable to to open bts\n");