diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-05-29 13:29:00 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-06-03 17:33:14 +0000 |
commit | dbc837206431dc1ef7fe1f2d245a975c92c727a2 (patch) | |
tree | 009f2a0689962600f51a6c59ec4f6d60bfde9040 /src/osmo-bts-trx/trx_vty.c | |
parent | 9daa67d0e7f3294918aa632d0a6eb237b2cd87f8 (diff) |
bts-trx: vty: Add 'nominal-tx-power' cmd
This value will be soon acquired automatically by osmo-bts-trx by asking
over TRXC to new versions of osmo-trx which is the nominal tx power for a given trx.
However, to still be able to work correctly against older versions of
osmo-trx or other TRX implementation (older or current) not supporting
this new TRX comamnd, let's allow the user to force a given value
through VTY for Tx power to work correctly.
Change-Id: Ib1b6f80d3b54afc42db9d358a79582cc619c6ce4
Diffstat (limited to 'src/osmo-bts-trx/trx_vty.c')
-rw-r--r-- | src/osmo-bts-trx/trx_vty.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 9c67a7f0..6dddfe20 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -160,6 +160,36 @@ DEFUN(show_phy, show_phy_cmd, "show phy", return CMD_SUCCESS; } +DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd, + "nominal-tx-power <-10-100>", + "Manually set (force) the nominal transmit output power in dBm\n" + "Nominal transmit output power level in dBm\n") +{ + struct gsm_bts_trx *trx = vty->index; + struct phy_instance *pinst = trx_phy_instance(trx); + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + int val = atoi(argv[0]); + + trx->nominal_power = val; + l1h->config.nominal_power_set_by_vty = true; + + return CMD_SUCCESS; +} + +DEFUN(cfg_trx_no_nominal_power, cfg_trx_no_nominal_power_cmd, + "no nominal-tx-power", + NO_STR + "Manually set (force) the nominal transmit output power; ask the TRX instead (default)\n") +{ + struct gsm_bts_trx *trx = vty->index; + struct phy_instance *pinst = trx_phy_instance(trx); + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + l1h->config.nominal_power_set_by_vty = false; + + return CMD_SUCCESS; +} + DEFUN_DEPRECATED(cfg_phy_ms_power_loop, cfg_phy_ms_power_loop_cmd, "osmotrx ms-power-loop <-127-127>", OSMOTRX_STR "Enable MS power control loop\nTarget RSSI value (transceiver specific, " @@ -574,6 +604,12 @@ void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) { + struct phy_instance *pinst = trx_phy_instance(trx); + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + if (l1h->config.nominal_power_set_by_vty) + vty_out(vty, " nominal-tx-power %d%s", trx->nominal_power, + VTY_NEWLINE); } int bts_model_vty_init(struct gsm_bts *bts) @@ -583,6 +619,9 @@ int bts_model_vty_init(struct gsm_bts *bts) install_element_ve(&show_transceiver_cmd); install_element_ve(&show_phy_cmd); + install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); + install_element(TRX_NODE, &cfg_trx_no_nominal_power_cmd); + install_element(PHY_NODE, &cfg_phy_ms_power_loop_cmd); install_element(PHY_NODE, &cfg_phy_no_ms_power_loop_cmd); install_element(PHY_NODE, &cfg_phy_timing_advance_loop_cmd); |