aboutsummaryrefslogtreecommitdiffstats
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
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.
-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 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");