diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-11-01 05:44:23 +0700 |
---|---|---|
committer | fixeria <vyanitskiy@sysmocom.de> | 2020-11-02 18:08:24 +0000 |
commit | 5c7b7090271fb5b88e68066bb681ce6cda88dc9f (patch) | |
tree | 26807c24d8d5902c265bca4a1167e737d9349e1c /src/osmo-bts-trx/trx_vty.c | |
parent | 484952a3e5e6453510840b2a15fe8f5fe8a7ea65 (diff) |
vty: call bts_model_vty_init() from bts_vty_init()
Similar to bts_vty_init(), BTS specific bts_model_vty_init()
requires a pointer to 'struct gsm_bts'. Not only it's used
as a parent talloc context, but also stored locally, so then
it can be used by some VTY commands.
Let's expose the global 'struct gsm_bts' from main, and pass
the application's talloc context like was done in [1].
This finally makes the BTS model specific options appear in
the automatically generated VTY reference (--vty-ref-xml).
[1] Ic356a950da85de02c82e9882a5fbadaaa6929680
Change-Id: Iee7fee6747dd1e7c0af36f9b27326f651ae37aaf
Related: SYS#4937, OS#3036
Diffstat (limited to 'src/osmo-bts-trx/trx_vty.c')
-rw-r--r-- | src/osmo-bts-trx/trx_vty.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 6dc28f62..ceca3309 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -52,16 +52,13 @@ #define OSMOTRX_STR "OsmoTRX Transceiver configuration\n" -static struct gsm_bts *vty_bts; - DEFUN(show_transceiver, show_transceiver_cmd, "show transceiver", SHOW_STR "Display information about transceivers\n") { - struct gsm_bts *bts = vty_bts; struct gsm_bts_trx *trx; struct trx_l1h *l1h; - llist_for_each_entry(trx, &bts->trx_list, list) { + llist_for_each_entry(trx, &g_bts->trx_list, list) { struct phy_instance *pinst = trx_phy_instance(trx); struct phy_link *plink = pinst->phy_link; char *sname = osmo_sock_get_name(NULL, plink->u.osmotrx.trx_ofd_clk.fd); @@ -201,7 +198,7 @@ DEFUN_DEPRECATED(cfg_phy_ms_power_loop, cfg_phy_ms_power_loop_cmd, { vty_out (vty, "'osmotrx ms-power-loop' is deprecated, use 'uplink-power-target' instead%s", VTY_NEWLINE); - vty_bts->ul_power_target = atoi(argv[0]); + g_bts->ul_power_target = atoi(argv[0]); return CMD_SUCCESS; } @@ -599,10 +596,8 @@ void bts_model_config_write_trx(struct vty *vty, const struct gsm_bts_trx *trx) VTY_NEWLINE); } -int bts_model_vty_init(struct gsm_bts *bts) +int bts_model_vty_init(void *ctx) { - vty_bts = bts; - install_element_ve(&show_transceiver_cmd); install_element_ve(&show_phy_cmd); |