aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-06 20:30:52 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-02-05 22:32:47 +0100
commit579651bf300de002731dfd3bd39985c9fd15616c (patch)
treed18f7557c3ab371bec1b30159bab0ebaf12db1a1 /src/common/rsl.c
parent0d6946741c7b5697a58e7650b6e60d495a6cfb32 (diff)
power/sysmobts: Add a manual ms power level control
Currently the DSP is instructed to achieve a given uplink power target but there are circumstances (e.g. EMV testing) where we need more control over it. The "manual/software/osmo" power control can only be implemented per TRX and not per lchan. Add a very very basic control that checks the MS Power used by the phone, the actual receive level and then adjust the power. The code doesn't take the history into account, if the phone can not reach the requested power level the code will be stuck (e.g. no timeout based on multiframes). It has a mode for a fixed power control but no way to set it yet. The change of the mode requires a restart of the software.
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index ff9833d4..80940a4e 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -735,6 +735,11 @@ static int rsl_rx_chan_activ(struct msgb *msg)
return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL);
}
+ /* Initialize channel defaults */
+ lchan->ms_power = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0);
+ lchan->ms_power_ctrl.current = lchan->ms_power;
+ lchan->ms_power_ctrl.fixed = 0;
+
rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg));
/* 9.3.3 Activation Type */
@@ -774,8 +779,11 @@ static int rsl_rx_chan_activ(struct msgb *msg)
if (TLVP_PRESENT(&tp, RSL_IE_BS_POWER))
lchan->bs_power = *TLVP_VAL(&tp, RSL_IE_BS_POWER);
/* 9.3.13 MS Power */
- if (TLVP_PRESENT(&tp, RSL_IE_MS_POWER))
+ if (TLVP_PRESENT(&tp, RSL_IE_MS_POWER)) {
lchan->ms_power = *TLVP_VAL(&tp, RSL_IE_MS_POWER);
+ lchan->ms_power_ctrl.current = lchan->ms_power;
+ lchan->ms_power_ctrl.fixed = 0;
+ }
/* 9.3.24 Timing Advance */
if (TLVP_PRESENT(&tp, RSL_IE_TIMING_ADVANCE))
lchan->rqd_ta = *TLVP_VAL(&tp, RSL_IE_TIMING_ADVANCE);