diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-11-10 18:02:13 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-11-10 18:02:13 +0100 |
commit | a066e334dd458d671f9c36fbc4fca57d4f9bc731 (patch) | |
tree | e23411da5acc7a814a11c2cbd8ae44d79dbab9f6 | |
parent | dd4b8a250723cb528deb7d2a2c242bc38641ecee (diff) |
Measurement: Correctly report L1 SACCH uplink header in RSL
For whatever reason, the order of fields in the L1 SACCH header is
different from 04.04 (Um) and 08.58 (A-bis). Please note that it's not
just a different bit order, but actually logically re-ordering the
fields within the byte, while keeping the bit-order/-endian.
We now correctly report the L1 transmit power up the stack.
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index b9c16c9a..f09de6af 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -663,7 +663,12 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i /* save the SACCH L1 header in the lchan struct for RSL MEAS RES */ if (data_ind->msgUnitParam.u8Size < 2) break; - lchan->meas.l1_info[0] = data_ind->msgUnitParam.u8Buffer[0]; + /* Some brilliant engineer decided that the ordering of + * fields on the Um interface is different from the + * order of fields in RLS. See TS 04.04 (Chapter 7.2) + * vs. TS 08.58 (Chapter 9.3.10). */ + lchan->meas.l1_info[0] = data_ind->msgUnitParam.u8Buffer[0] << 3; + lchan->meas.l1_info[0] |= ((data_ind->msgUnitParam.u8Buffer[0] >> 5) & 1) << 2; lchan->meas.l1_info[1] = data_ind->msgUnitParam.u8Buffer[1]; lchan->meas.flags |= LC_UL_M_F_L1_VALID; /* fall-through */ |