diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-12-01 18:29:28 +0100 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-12-08 13:10:46 +0100 |
commit | 75162427ad26b9834433757b790a29f4995b9b60 (patch) | |
tree | b064ee88a1f5d6c33fa9066034ddbb21766415eb | |
parent | power_control: clarify units in 'struct lchan_power_ctrl_state' (diff) | |
download | OsmoBTS-75162427ad26b9834433757b790a29f4995b9b60.tar.xz OsmoBTS-75162427ad26b9834433757b790a29f4995b9b60.zip |
rsl: properly initialize MS/BS Power Control state
struct lchan_power_ctrl_state actually contains more fields,
which also must be initialized on CHANnel ACTIVation.
Change-Id: Id9719088fc6e9479c13e9b327a3466d9e2810a3a
Related: SYS#4918
-rw-r--r-- | src/common/rsl.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c index 2ebfb323..30fa2591 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1154,14 +1154,18 @@ static int rsl_rx_chan_activ(struct msgb *msg) gsm_lchans_name(lchan->state)); /* Initialize MS Power Control defaults */ - 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.fixed = true; + lchan->ms_power_ctrl = (struct lchan_power_ctrl_state) { + .max = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, 0), + .current = lchan->ms_power_ctrl.max, + .fixed = true, + }; /* Initialize BS Power Control defaults */ - lchan->bs_power_ctrl.max = 2 * 15; - lchan->bs_power_ctrl.current = 0; - lchan->bs_power_ctrl.fixed = true; + lchan->bs_power_ctrl = (struct lchan_power_ctrl_state) { + .max = 2 * 15, /* maximum defined in 9.3.4 */ + .current = 0, + .fixed = true, + }; rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)); |