aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-04-07 13:11:50 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2014-01-21 15:54:12 +0100
commitfc93e748d36902f69ff1fb5066d199af7d09c4eb (patch)
tree98423d614162a62251761adce14a8098d7e8cb9e
parent932d99b1fea9713a95f2b38c5d8e844797321899 (diff)
Allow one or more TRX to configure via VTY
-rw-r--r--include/osmo-bts/vty.h2
-rw-r--r--src/common/vty.c6
-rw-r--r--src/osmo-bts-sysmo/main.c2
-rw-r--r--src/osmo-bts-trx/main.c2
4 files changed, 7 insertions, 5 deletions
diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h
index 510abab1..9fcc5b5d 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, const struct log_info *cat);
+int bts_vty_init(struct gsm_bts *bts, int trx_num, 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 4daa92c3..6ce3b78a 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -153,8 +153,9 @@ static struct cmd_node trx_node = {
1,
};
+static char cfg_bts_trx_cmd_string[16];
DEFUN(cfg_bts_trx, cfg_bts_trx_cmd,
- "trx <0-0>",
+ cfg_bts_trx_cmd_string,
"Select a TRX to configure\n" "TRX number\n")
{
int trx_nr = atoi(argv[0]);
@@ -609,7 +610,7 @@ DEFUN(no_bts_t_t_l_loopback,
return CMD_SUCCESS;
}
-int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat)
+int bts_vty_init(struct gsm_bts *bts, int trx_num, const struct log_info *cat)
{
cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names,
"gsmtap-sapi (",
@@ -646,6 +647,7 @@ int bts_vty_init(struct gsm_bts *bts, 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 e01e6f40..d7af7604 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, &bts_log_info);
+ bts_vty_init(bts, 1, &bts_log_info);
handle_options(argc, argv);
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index e9b2bd97..b2e9717e 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, &bts_log_info);
+ bts_vty_init(bts, trx_num, &bts_log_info);
if (bts_init(bts) < 0) {
fprintf(stderr, "unable to to open bts\n");