layer1: Retry fist power measurement, if it seems to fail
In some cases (e.g. after a call with TCH) the first power measurement after a full reset will always return 0 (-110dbm). In this case the measurment is repeated once again. This is just a workarround, and it will not fix the actual cause.
This commit is contained in:
parent
d1d796a4ce
commit
95dc4911e0
|
@ -101,6 +101,7 @@ struct l1s_state {
|
|||
struct {
|
||||
/* power measurement l1 task */
|
||||
unsigned int mode;
|
||||
unsigned int first;
|
||||
union {
|
||||
struct {
|
||||
uint16_t arfcn_start;
|
||||
|
|
|
@ -419,6 +419,7 @@ static void l1ctl_rx_pm_req(struct msgb *msg)
|
|||
|
||||
switch (pm_req->type) {
|
||||
case 1:
|
||||
l1s.pm.first = 1;
|
||||
l1s.pm.mode = 1;
|
||||
l1s.pm.range.arfcn_start =
|
||||
ntohs(pm_req->range.band_arfcn_from);
|
||||
|
|
|
@ -94,6 +94,15 @@ static int l1s_pm_resp(uint8_t num_meas, __unused uint8_t p2,
|
|||
printf("PM MEAS: ARFCN=%u, %-4d dBm at baseband, %-4d dBm at RF\n",
|
||||
arfcn, pm_level[0]/8, agc_inp_dbm8_by_pm(pm_level[0])/8);
|
||||
|
||||
/* If the first measurement seems to fail, try once again */
|
||||
if (l1s.pm.first) {
|
||||
l1s.pm.first = 0;
|
||||
if (pm_level[0] == 0) {
|
||||
l1s_pm_test(1, l1s.pm.range.arfcn_next);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
printd("PM MEAS: %-4d dBm, %-4d dBm ARFCN=%u\n",
|
||||
agc_inp_dbm8_by_pm(pm_level[0])/8,
|
||||
agc_inp_dbm8_by_pm(pm_level[1])/8, arfcn);
|
||||
|
|
Loading…
Reference in New Issue