keith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/29649 )
Change subject: osmo-bts-trx: respond to tx-attenuation config in real time. ......................................................................
osmo-bts-trx: respond to tx-attenuation config in real time.
Some osmo-bts varieties have a method to make an immediate change to TX power from the vty. In osmo-bts-trx there does not seem to be any way, so lets start the power ramp loop when the parameter osmotrx tx-attenution is changed on a running TRX.
Change-Id: I1fa5e8130202fb509593db4132863b762b0f40b7 --- M src/osmo-bts-trx/trx_vty.c 1 file changed, 10 insertions(+), 6 deletions(-)
Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 70e9b36..9cc9805 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -394,12 +394,13 @@ return CMD_SUCCESS; }
-DEFUN(cfg_phyinst_tx_atten, cfg_phyinst_tx_atten_cmd, - "osmotrx tx-attenuation (oml|<0-50>)", - OSMOTRX_STR - "Set the transmitter attenuation\n" - "Use NM_ATT_RF_MAXPOWR_R (max power reduction) from BSC via OML (default)\n" - "Fixed attenuation in dB, overriding OML (default)\n") +DEFUN_ATTR(cfg_phyinst_tx_atten, cfg_phyinst_tx_atten_cmd, + "osmotrx tx-attenuation (oml|<0-50>)", + OSMOTRX_STR + "Set the transmitter attenuation\n" + "Use NM_ATT_RF_MAXPOWR_R (max power reduction) from BSC via OML (default)\n" + "Fixed attenuation in dB, overriding OML (default)\n", + CMD_ATTR_IMMEDIATE) { struct phy_instance *pinst = vty->index; struct trx_l1h *l1h = pinst->u.osmotrx.hdl; @@ -409,6 +410,9 @@ else l1h->config.forced_max_power_red = atoi(argv[0]);
+ if (pinst->trx && pinst->trx->mo.nm_state.operational == NM_OPSTATE_ENABLED) + l1if_trx_start_power_ramp(pinst->trx, NULL); + return CMD_SUCCESS; }