aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-08-23 21:58:29 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2014-04-06 08:58:22 +0200
commite6df0536adb6438dd85f38d203da1a3d486390bd (patch)
tree0775ebfbc99a2795c39ce6837f56d217ce40b743 /src
parentc26d3b7ab92985355dfb88ed944883fe373d999c (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.
Diffstat (limited to 'src')
-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
3 files changed, 6 insertions, 7 deletions
diff --git a/src/common/vty.c b/src/common/vty.c
index fc3545ba..c3c9614c 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -155,9 +155,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]);
@@ -166,7 +165,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;
}
@@ -661,7 +661,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 (",
@@ -700,7 +700,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 70ba0bc5..b8c062f5 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
bts = gsm_bts_alloc(tall_bts_ctx);
vty_init(&bts_vty_info);
- 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 8f917369..a551d369 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -309,7 +309,7 @@ int main(int argc, char **argv)
}
vty_init(&bts_vty_info);
- 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");