summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-01-28 12:02:06 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-28 13:16:14 +0100
commit40fc52108899de210ed233d4014037c952453ecd (patch)
tree113662822f7cc852f21d7fdb2eecb946b6d0f5af
parenta6c98a79b29e964268ab2debd7ebd7fd2daf709d (diff)
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.
-rw-r--r--src/target/firmware/layer1/l23_api.c2
-rw-r--r--src/target/firmware/layer1/prim_pm.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index 58a093f4..2581b5bb 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -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);
}
diff --git a/src/target/firmware/layer1/prim_pm.c b/src/target/firmware/layer1/prim_pm.c
index c2d85ac7..07b72097 100644
--- a/src/target/firmware/layer1/prim_pm.c
+++ b/src/target/firmware/layer1/prim_pm.c
@@ -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;