aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-25 09:22:00 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-25 09:22:00 +0200
commit68b9b376cf6d3a983cc6b06d7aef189c30b952f2 (patch)
tree3baa3595d2b41618042c8472aac0193bb8d17c3f
parentd0866fe4773918381c80c7362ef2d043845ebf54 (diff)
make use of libosmocore 'gsm_meas_rep_unidir'
Back in March 2013, some structures and defines related to decoded measurement reports have been moved from openbsc to libosmocore (libosmocore e128f4663104ed64e33e362cff2566f36d65e658) so that they can be used also from osmo-bts. This finally follows up on that. You need openbsc 7ff4f0e0fc692bfab829da50edb104e58b271e7e or later.
-rw-r--r--src/common/measurement.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/common/measurement.c b/src/common/measurement.c
index f32adda6..f497e40e 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -132,6 +132,7 @@ static uint8_t ber10k_to_rxqual(uint32_t ber10k)
static int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
{
+ struct gsm_meas_rep_unidir *mru;
uint32_t ber_full_sum = 0;
uint32_t irssi_full_sum = 0;
uint32_t ber_sub_sum = 0;
@@ -183,10 +184,11 @@ static int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
irssi_sub_sum);
/* store results */
- lchan->meas.res.rxlev_full = dbm2rxlev((int)irssi_full_sum * -1);
- lchan->meas.res.rxlev_sub = dbm2rxlev((int)irssi_sub_sum * -1);
- lchan->meas.res.rxqual_full = ber10k_to_rxqual(ber_full_sum);
- lchan->meas.res.rxqual_sub = ber10k_to_rxqual(ber_sub_sum);
+ mru = &lchan->meas.ul_res;
+ mru->full.rx_lev = dbm2rxlev((int)irssi_full_sum * -1);
+ mru->sub.rx_lev = dbm2rxlev((int)irssi_sub_sum * -1);
+ mru->full.rx_qual = ber10k_to_rxqual(ber_full_sum);
+ mru->sub.rx_qual = ber10k_to_rxqual(ber_sub_sum);
lchan->meas.flags |= LC_UL_M_F_RES_VALID;
lchan->meas.num_ul_meas = 0;
@@ -199,10 +201,10 @@ static int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
/* build the 3 byte RSL uplinke measurement IE content */
int lchan_build_rsl_ul_meas(struct gsm_lchan *lchan, uint8_t *buf)
{
- buf[0] = (lchan->meas.res.rxlev_full & 0x3f); /* FIXME: DTXu support */
- buf[1] = (lchan->meas.res.rxlev_sub & 0x3f);
- buf[2] = ((lchan->meas.res.rxqual_full & 7) << 3) |
- (lchan->meas.res.rxqual_sub & 7);
+ struct gsm_meas_rep_unidir *mru = &lchan->meas.ul_res;
+ buf[0] = (mru->full.rx_lev & 0x3f); /* FIXME: DTXu support */
+ buf[1] = (mru->sub.rx_lev & 0x3f);
+ buf[2] = ((mru->full.rx_qual & 7) << 3) | (mru->sub.rx_qual & 7);
return 3;
}