aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-02-16 20:58:24 +0100
committerdexter <pmaier@sysmocom.de>2021-02-16 22:28:18 +0000
commitda084794a66327bcf55877b7a7cabfdddcf4f1e6 (patch)
treee3844dbd25004d6ca89701423f22c54dbd600151 /src/common/rsl.c
parentf8f806ff2a30c91b521d45cc373551d65ccd59f6 (diff)
gsm_data: handle l1_info with structs
in struct gsm_lchan and also in other places l1_info is handled in its binary form. Libosmocore now offers structs to handle l1 info, so lets use those structs to get rid of all the manual decoding of l1_info. Depends: libosmocore I23c1890b89d5a0574eb05dace9f64cc59d6f6df7 Change-Id: I5eb516d7849750f3dd174d48c9f07dabf2c80515
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 3023ffa1..525b6373 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -3202,8 +3202,8 @@ int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, const stru
lchan->meas.ul_res.sub.rx_lev,
lchan->meas.ul_res.full.rx_qual,
lchan->meas.ul_res.sub.rx_qual,
- lchan->meas.l1_info[0],
- lchan->meas.l1_info[1], l3_len, ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE);
+ lchan->meas.l1_info.ms_pwr,
+ lchan->meas.l1_info.ta, l3_len, ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE);
msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++);
size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res,
@@ -3222,7 +3222,7 @@ int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, const stru
* to know the total propagation time between MS and BTS, we need to add
* the actual TA value applied by the MS plus the respective toa256 value in
* 1/256 symbol periods. */
- int16_t ta256 = lchan_get_ta(lchan) * 256;
+ int16_t ta256 = lchan->meas.l1_info.ta * 256;
smi->toa256_mean = htons(ta256 + lchan->meas.ms_toa256);
smi->toa256_min = htons(ta256 + lchan->meas.ext.toa256_min);
smi->toa256_max = htons(ta256 + lchan->meas.ext.toa256_max);
@@ -3234,7 +3234,7 @@ int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, const stru
}
msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->bs_power_ctrl.current / 2);
if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {
- msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info);
+ msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, sizeof(lchan->meas.l1_info), (uint8_t*)&lchan->meas.l1_info);
lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
}