2018-02-14 16:26:44

by Jean-Pierre TOSONI

[permalink] [raw]
Subject: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

ath9k returns a wrong RSSI value for frames received in a 30ms time
window after a channel change. The correct value is typically 10dB
below the returned value.

This was found with a Atheros AR9300 Rev:3 chip (WLE350NX / JWX6083
cards), during offchannel scans.

Mark the signal value as invalid in this case.

Signed-off-by: Jean Pierre TOSONI <[email protected]>
---
V2: replace LEDE patch with due kernel patch (with excuses to Kalle Valo)

drivers/net/wireless/ath/ath9k/ani.c | 1 +
drivers/net/wireless/ath/ath9k/common.c | 10 ++++++++++
drivers/net/wireless/ath/ath9k/hw.h | 1 +
3 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/at=
h/ath9k/ani.c
index 5214dd7..a7e07ed 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -317,6 +317,7 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scannin=
g)
return;
=20
BUG_ON(aniState =3D=3D NULL);
+ ah->chan_stable_time =3D jiffies + (30*HZ)/1000; /* 30ms */
ah->stats.ast_ani_reset++;
=20
ofdm_nil =3D max_t(int, ATH9K_ANI_OFDM_DEF_LEVEL,
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless=
/ath/ath9k/common.c
index 099f3d4..7e5f7a3 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -221,6 +221,16 @@ void ath9k_cmn_process_rssi(struct ath_common *common,
int i, j;
=20
/*
+ * RSSI is not available before 30ms after reset on ath9k.
+ */
+ if (time_before(jiffies, ah->chan_stable_time)) {
+ ath_dbg(common, ANY, "early frame rssi=3D%d\n",rx_stats->rs_rssi);
+ rxs->flag |=3D RX_FLAG_NO_SIGNAL_VAL;
+ return;
+ }
+ ah->chan_stable_time =3D jiffies; /* advance stable time to cop with jiff=
ies wraparound */
+
+ /*
* RSSI is not available for subframes in an A-MPDU.
*/
if (rx_stats->rs_moreaggr) {
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath=
/ath9k/hw.h
index 9804a24..ec07da9 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -809,6 +809,7 @@ struct ath_hw {
=20
bool reset_power_on;
bool htc_reset_init;
+ unsigned long chan_stable_time;
=20
enum nl80211_iftype opmode;
enum ath9k_power_mode power_mode;
--=20
1.7.2.5


2018-02-15 07:21:33

by James Cameron

[permalink] [raw]
Subject: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

On Thu, Feb 15, 2018 at 07:51:28AM +0200, Kalle Valo wrote:
> James Cameron <[email protected]> writes:
>
> > On Wed, Feb 14, 2018 at 04:26:42PM +0000, Jean Pierre TOSONI wrote:
> >> ath9k returns a wrong RSSI value for frames received in a 30ms time
> >> window after a channel change. The correct value is typically 10dB
> >> below the returned value.
> >
> > How was your correct value determined?
> >
> >> This was found with a Atheros AR9300 Rev:3 chip (WLE350NX / JWX6083
> >> cards), during offchannel scans.
> >>
> >> Mark the signal value as invalid in this case.
> >
> > Why not adjust by 10dB?
> >
> > Speculating: in a typical card, RSSI is calculated by firmware from
> > readings of ADCs attached to the receiver. Firmware may average
> > several readings. Firmware may apply other offsets or calibrations,
> > based on frequency and temperature. This sounds like a firmware
> > problem.
>
> ath9k does not have firmware, only ath9k_htc has it.

Heh. s/firmware/silicon implementation/g

--
James Cameron
http://quozl.netrek.org/

2018-02-15 14:45:51

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

On 2018-02-14 17:26, Jean Pierre TOSONI wrote:
> ath9k returns a wrong RSSI value for frames received in a 30ms time
> window after a channel change. The correct value is typically 10dB
> below the returned value.
>
> This was found with a Atheros AR9300 Rev:3 chip (WLE350NX / JWX6083
> cards), during offchannel scans.
>
> Mark the signal value as invalid in this case.
>
> Signed-off-by: Jean Pierre TOSONI <[email protected]>
It seems that this will potentially cause a lot of scan results with
RSSI information missing, which I think may be worse than a 10 db
fluctuation.
Actually, it could also be that the hardware is reporting accurate RSSI
values (they're reported as SNR relative to the noise floor) and this is
just a blip caused by the fact that the hw is updating its internal
noise floor value based on running measurements.

Does the same fluctuation also happen if you set update = false for
calls to ath9k_hw_start_nfcal?

- Felix

2018-02-15 05:51:34

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

James Cameron <[email protected]> writes:

> On Wed, Feb 14, 2018 at 04:26:42PM +0000, Jean Pierre TOSONI wrote:
>> ath9k returns a wrong RSSI value for frames received in a 30ms time
>> window after a channel change. The correct value is typically 10dB
>> below the returned value.
>
> How was your correct value determined?
>
>> This was found with a Atheros AR9300 Rev:3 chip (WLE350NX / JWX6083
>> cards), during offchannel scans.
>>
>> Mark the signal value as invalid in this case.
>
> Why not adjust by 10dB?
>
> Speculating: in a typical card, RSSI is calculated by firmware from
> readings of ADCs attached to the receiver. Firmware may average
> several readings. Firmware may apply other offsets or calibrations,
> based on frequency and temperature. This sounds like a firmware
> problem.

ath9k does not have firmware, only ath9k_htc has it.

--
Kalle Valo

2018-02-15 08:48:39

by Jean-Pierre TOSONI

[permalink] [raw]
Subject: RE: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

PiAtLS0tLU1lc3NhZ2UgZCdvcmlnaW5lLS0tLS0NCj4gRGXCoDogc3RldmUuZGVyb3NpZXJAZ21h
aWwuY29tIFttYWlsdG86c3RldmUuZGVyb3NpZXJAZ21haWwuY29tXSBEZQ0KPiBsYSBwYXJ0IGRl
IFN0ZXZlIGRlUm9zaWVyDQo+IEVudm95w6nCoDogbWVyY3JlZGkgMTQgZsOpdnJpZXIgMjAxOCAx
OToxNg0KPiDDgMKgOiBKZWFuIFBpZXJyZSBUT1NPTkkNCj4gQ2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cGVuIGlmIHlvdSBzZXQg
dXBkYXRlID0gZmFsc2UgZm9yDQo+IGNhbGxzIHRvIGF0aDlrX2h3X3N0YXJ0X25mY2FsPw0KDQpU
aGFua3MgZm9yIHRoZSBoaW50LCBJIHdpbGwgaGF2ZSBhIGxvb2sgYXQgdGhhdCANCg0KPiANCj4g
LSBGZWxpeA0K

2018-02-15 08:52:58

by Jean-Pierre TOSONI

[permalink] [raw]
Subject: RE: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

> -----Message d'origine-----
> De=A0: [email protected] [mailto:[email protected]]
> Envoy=E9=A0: jeudi 15 f=E9vrier 2018 08:21
> =C0=A0: Kalle Valo
> Cc=A0: Jean Pierre TOSONI; [email protected]; ath9k-
> [email protected]
> Objet=A0: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received
> during channel setup
>=20
> On Thu, Feb 15, 2018 at 07:51:28AM +0200, Kalle Valo wrote:
> > James Cameron <[email protected]> writes:
> >
> >> On Wed, Feb 14, 2018 at 04:26:42PM +0000, Jean Pierre TOSONI
> wrote:
> >>> ath9k returns a wrong RSSI value for frames received
> >>> in a 30ms time window after a channel change. The
> >>> correct value is typically 10dB below the returned value.
> >>
> >> How was your correct value determined?
> >>

1) test setup:
Connecting the AP through coax and attenuators, then making 500 passive sca=
ns off-channel, then drawing an histogram of the beacon signals found by th=
e chip. The off-channel period is 108 ms. The probability of being in the 3=
0 ms window is 28%. The histogram shows 2 spikes, one large with the expect=
ed value, one small at around +10dB above.

2) value determination
Adjust the delay (CONFIG_HZ=3D250) by trial and error. 25ms was not enough =
to completely absorb the +10dB spike in the histogram, while 30ms was enoug=
h.

Do you think of a better approach? Maybe the guys at Qualcomm know the corr=
ect value?=20

> >>> This was found with a Atheros AR9300 Rev:3 chip (WLE350NX /
> >>> JWX6083 cards), during offchannel scans.
> >>>
> >>> Mark the signal value as invalid in this case.
> >>
> >> Why not adjust by 10dB?

I considered that also. But,=20
1) during how much time should I do this adjustment? Around 30 ms after cha=
nnel switch?
2) The histogram shows a scattering of the measures in a +/- 3dB range arou=
nd the mean value.
So I could not decide for sure if it needed -9dB, -10dB or -11dB?

> >>
> >> Speculating: in a typical card, RSSI is calculated by firmware
> from
> >> readings of ADCs attached to the receiver. Firmware may average
> >> several readings. Firmware may apply other offsets or
> calibrations,
> >> based on frequency and temperature. This sounds like a firmware
> >> problem.
> >
> > ath9k does not have firmware, only ath9k_htc has it.
>=20
> Heh. s/firmware/silicon implementation/g

Oh well, if it's silicon problem, then it's a hardware problem, and
I am right to correct it that way, since there is no other way :-)

>=20
> --
> James Cameron
> http://quozl.netrek.org/

2018-02-14 18:16:15

by Steve deRosier

[permalink] [raw]
Subject: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

On Wed, Feb 14, 2018 at 8:26 AM, Jean Pierre TOSONI <[email protected]> wrote:
> ath9k returns a wrong RSSI value for frames received in a 30ms time
> window after a channel change. The correct value is typically 10dB
> below the returned value.
>
> This was found with a Atheros AR9300 Rev:3 chip (WLE350NX / JWX6083
> cards), during offchannel scans.
>

Is this true for ALL ath9k chips or only for the specific device? If
it's not generally true, we shouldn't be adding code that applies to
all. Perhaps a quirk or keyed to a specific chip id or DT entry or
other way to guard it?

- Steve

2018-02-15 11:57:56

by James Cameron

[permalink] [raw]
Subject: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

On Thu, Feb 15, 2018 at 08:52:53AM +0000, Jean Pierre TOSONI wrote:
> > -----Message d'origine-----
> > De?: [email protected] [mailto:[email protected]]
> > Envoy??: jeudi 15 f?vrier 2018 08:21
> > ??: Kalle Valo
> > Cc?: Jean Pierre TOSONI; [email protected]; ath9k-
> > [email protected]
> > Objet?: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received
> > during channel setup
> >
> > On Thu, Feb 15, 2018 at 07:51:28AM +0200, Kalle Valo wrote:
> > > James Cameron <[email protected]> writes:
> > >
> > >> On Wed, Feb 14, 2018 at 04:26:42PM +0000, Jean Pierre TOSONI
> > wrote:
> > >>> ath9k returns a wrong RSSI value for frames received
> > >>> in a 30ms time window after a channel change. The
> > >>> correct value is typically 10dB below the returned value.
> > >>
> > >> How was your correct value determined?
> > >>
>
> 1) test setup:
> Connecting the AP through coax and attenuators, then making 500 passive scans off-channel, then drawing an histogram of the beacon signals found by the chip. The off-channel period is 108 ms. The probability of being in the 30 ms window is 28%. The histogram shows 2 spikes, one large with the expected value, one small at around +10dB above.
>
> 2) value determination
> Adjust the delay (CONFIG_HZ=250) by trial and error. 25ms was not enough to completely absorb the +10dB spike in the histogram, while 30ms was enough.
>
> Do you think of a better approach?

No, I think your approach is fine. I was curious. Thanks for explaining.

> Maybe the guys at Qualcomm know the correct value?

Yes, that seems likely.

> > >>> This was found with a Atheros AR9300 Rev:3 chip (WLE350NX /
> > >>> JWX6083 cards), during offchannel scans.
> > >>>
> > >>> Mark the signal value as invalid in this case.
> > >>
> > >> Why not adjust by 10dB?
>
> I considered that also. But,
> 1) during how much time should I do this adjustment? Around 30 ms after channel switch?

Yes. If RSSI is so critical for your application, you'll do what you
can to get a real RSSI rather than drop it.

> 2) The histogram shows a scattering of the measures in a +/- 3dB range around the mean value.

Perhaps a sampling error by the device.

> So I could not decide for sure if it needed -9dB, -10dB or -11dB?
>
> > >>
> > >> Speculating: in a typical card, RSSI is calculated by firmware
> > from
> > >> readings of ADCs attached to the receiver. Firmware may average
> > >> several readings. Firmware may apply other offsets or
> > calibrations,
> > >> based on frequency and temperature. This sounds like a firmware
> > >> problem.
> > >
> > > ath9k does not have firmware, only ath9k_htc has it.
> >
> > Heh. s/firmware/silicon implementation/g
>
> Oh well, if it's silicon problem, then it's a hardware problem, and
> I am right to correct it that way, since there is no other way :-)

Yes, if it can be reproduced by every ath9k.

--
James Cameron
http://quozl.netrek.org/

2018-02-14 21:30:36

by James Cameron

[permalink] [raw]
Subject: Re: [PATCH v2] ath9k: mark RSSI as invalid if frame received during channel setup

On Wed, Feb 14, 2018 at 04:26:42PM +0000, Jean Pierre TOSONI wrote:
> ath9k returns a wrong RSSI value for frames received in a 30ms time
> window after a channel change. The correct value is typically 10dB
> below the returned value.

How was your correct value determined?

> This was found with a Atheros AR9300 Rev:3 chip (WLE350NX / JWX6083
> cards), during offchannel scans.
>
> Mark the signal value as invalid in this case.

Why not adjust by 10dB?

Speculating: in a typical card, RSSI is calculated by firmware from
readings of ADCs attached to the receiver. Firmware may average
several readings. Firmware may apply other offsets or calibrations,
based on frequency and temperature. This sounds like a firmware
problem.

> Signed-off-by: Jean Pierre TOSONI <[email protected]>
> [...]

--
James Cameron
http://quozl.netrek.org/