pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bts/+/41795?usp=email )
Change subject: ms_power_control: Apply defaults during reset
......................................................................
ms_power_control: Apply defaults during reset
lchan_ms_pwr_ctrl_reset() is already called furhter above in
rsl_rx_chan_activ(), so simplify mode the default values there and no
need to re-apply them twice.
Change-Id: I5c0137ba8bf1e057abdc1911716e3d1bf8c61ea3
---
M src/common/power_control.c
M src/common/rsl.c
2 files changed, 8 insertions(+), 6 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/src/common/power_control.c b/src/common/power_control.c
index bf310c6..c4ff5e6 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -145,6 +145,10 @@
* state->dpc_params = NULL (static mode).
* state->skip_block_num = 0, so that 1st power input is taken into
account. */
memset(state, 0, sizeof(*state));
+
+ /* XXX: should we use the maximum power level instead of 0 dBm? */
+ state->max = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0);
+ state->current = state->max;
}
/* Shall we skip current block based on configured interval? */
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 863167e..e620545 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1989,8 +1989,6 @@
}
}
- lchan_ms_pwr_ctrl_reset(lchan);
-
/* 9.3.6 Channel Mode */
if (type != RSL_ACT_OSMO_PDCH) {
if (rsl_handle_chan_mod_ie(lchan, &tp, &cause) != 0)
@@ -2050,11 +2048,11 @@
}
/* 9.3.13 MS Power */
- if (TLVP_PRES_LEN(&tp, RSL_IE_MS_POWER, 1))
+ lchan_ms_pwr_ctrl_reset(lchan);
+ if (TLVP_PRES_LEN(&tp, RSL_IE_MS_POWER, 1)) {
lchan->ms_power_ctrl.max = *TLVP_VAL(&tp, RSL_IE_MS_POWER) &
0x1F;
- else /* XXX: should we use the maximum power level instead of 0 dBm? */
- lchan->ms_power_ctrl.max =
ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0);
- lchan->ms_power_ctrl.current = lchan->ms_power_ctrl.max;
+ lchan->ms_power_ctrl.current = lchan->ms_power_ctrl.max;
+ }
/* 9.3.24 Timing Advance */
if (TLVP_PRES_LEN(&tp, RSL_IE_TIMING_ADVANCE, 1))
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41795?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I5c0137ba8bf1e057abdc1911716e3d1bf8c61ea3
Gerrit-Change-Number: 41795
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>