layer1: Fixed power measurement, adding ARFCN wrapping

Power measurement returned the first measurement result twice, now it is
returned only once.

Wrapping of ARFCN allows to measure the E-band en block. After measuring the
ARFCN 1023, the ARFCN wraps to 0. Special flags like ARFCN_UPLINK or
ARFCN_PCS are preserved while wrapping.
This commit is contained in:
Andreas Eversberg 2012-01-28 12:02:06 +01:00 committed by Harald Welte
parent a6c98a79b2
commit 40fc521088
2 changed files with 4 additions and 3 deletions

View File

@ -404,7 +404,7 @@ static void l1ctl_rx_pm_req(struct msgb *msg)
l1s.pm.range.arfcn_start, l1s.pm.range.arfcn_end);
break;
}
l1s_reset_hw(); /* must reset, otherwise measurement results are delayed */
l1s_pm_test(1, l1s.pm.range.arfcn_next);
}

View File

@ -118,10 +118,11 @@ static int l1s_pm_resp(uint8_t num_meas, __unused uint8_t p2,
pmr->pm[1] = 0;
if (l1s.pm.mode == 1) {
if (l1s.pm.range.arfcn_next <= l1s.pm.range.arfcn_end) {
if (l1s.pm.range.arfcn_next != l1s.pm.range.arfcn_end) {
/* schedule PM for next ARFCN in range */
l1s.pm.range.arfcn_next =
(l1s.pm.range.arfcn_next+1) & 0xfbff;
l1s_pm_test(1, l1s.pm.range.arfcn_next);
l1s.pm.range.arfcn_next++;
} else {
/* we have finished, flush the msgb to L2 */
struct l1ctl_hdr *l1h = l1s.pm.msg->l1h;