pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/41794?usp=email )
Change subject: bs_power_control: Apply defaults during reset ......................................................................
bs_power_control: Apply defaults during reset
lchan_bs_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: I00d9205d114b2d507c1048375693de4aa06bebbe --- M src/common/power_control.c M src/common/rsl.c 2 files changed, 4 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/41794/1
diff --git a/src/common/power_control.c b/src/common/power_control.c index 0520ed8..bf310c6 100644 --- a/src/common/power_control.c +++ b/src/common/power_control.c @@ -325,9 +325,12 @@ struct lchan_power_ctrl_state *state = &lchan->bs_power_ctrl;
/* This below implicitly sets: + * state->current = 0 (it's safer to start from 0 unless told differently). * 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)); + + state->max = 2 * 15; /* maximum defined in 9.3.4 */ }
/*! compute the new Downlink attenuation value for the given logical channel. diff --git a/src/common/rsl.c b/src/common/rsl.c index cb13977..863167e 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1989,8 +1989,6 @@ } }
- /* Initialize MS/BS Power Control state */ - lchan_bs_pwr_ctrl_reset(lchan); lchan_ms_pwr_ctrl_reset(lchan);
/* 9.3.6 Channel Mode */ @@ -2028,6 +2026,7 @@ }
/* 9.3.4 BS Power */ + lchan_bs_pwr_ctrl_reset(lchan); if (TLVP_PRES_LEN(&tp, RSL_IE_BS_POWER, 1)) { if (*TLVP_VAL(&tp, RSL_IE_BS_POWER) & (1 << 4)) { LOGPLCHAN(lchan, DRSL, LOGL_NOTICE, @@ -2048,9 +2047,6 @@
LOGPLCHAN(lchan, DRSL, LOGL_DEBUG, "BS Power attenuation %u dB\n", lchan->bs_power_ctrl.current); - } else { - lchan->bs_power_ctrl.max = 2 * 15; /* maximum defined in 9.3.4 */ - lchan->bs_power_ctrl.current = 0; }
/* 9.3.13 MS Power */ @@ -2096,9 +2092,6 @@ LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "Failed to parse BS Power Parameters IE\n"); return rsl_tx_chan_act_nack(lchan, RSL_ERR_IE_CONTENT); } - - /* NOTE: it's safer to start from 0 */ - lchan->bs_power_ctrl.current = 0; lchan->bs_power_ctrl.dpc_params = params; }