From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
wcn36xx@lists.infradead.org, linux-arm-msm@vger.kernel.org
Cc: loic.poulain@linaro.org, benl@squareup.com, bryan.odonoghue@linaro.org
Subject: [PATCH v3 0/4] wcn36xx: Add spectrum survey reporting
Date: Sat, 15 Jan 2022 00:16:42 +0000 [thread overview]
Message-ID: <20220115001646.3981501-1-bryan.odonoghue@linaro.org> (raw)
V3:
- Fixes an indexing bug in get_survey()
We use an array to track snr and rssi. This array is organised so that
the index value passed in get_survey() references the array directly.
We also want to know the index into the frequency band tables which are
divided into two parts for 2 GHz and 5 GHz.
The previous patch modified the index to dereference the band instead of
taking a copy of the index and modifying the copy to reference the band
table.
In other words the same index couldn't be used for both the array and the
band index.
Fixes by way of separating the two indices into idx and band_idx.
V2:
- Fixes typo "ret -= ENOMEM" => "ret = -ENOMEM" - kernel test bot
- Makes get_survey() static - kernel test bot
- Ignores riscv warnings since none apply to code in this patch - bod
V1:
This series enables get_survey() on wcn36xx. Tested with wcn3620 and
wcn3680b.
wcn36xx reports RSSI and SNR in the buffer descriptor of each delivered
frame wcn36xx -> host. Thus far we have only extracted RSSI but, extracting
the SNR lets us also report the noise-floor.
Adding in some background tracking of the current tuned channel lets us
flag which channel is currently in use when running "iw wlan0 survey dump"
For both wcn3620 and wcn3680b I have verified both the STA and AP's view of
RSSI and noise.
Example wcn3620:
AP Asus RT-AX88U
SSID: "linaro-test"
noise: -78 dBm Channel: 8
BSSID: 04:D4:C4:AA:BB:CC
MAC RSSI
02:00:16:qq:xx:yy -35dBm
STA
root@linaro-developer:~# iw wlan0 link
Connected to 04:d4:c4:aa:bb:cc (on wlan0)
SSID: linaro-test
freq: 2447
RX: 768377 bytes (4250 packets)
TX: 8136 bytes (97 packets)
signal: -37 dBm
root@linaro-developer:~# iw wlan0 survey dump
Survey data from wlan0
frequency: 2412 MHz
Survey data from wlan0
frequency: 2417 MHz
noise: -12 dBm
Survey data from wlan0
frequency: 2422 MHz
noise: -82 dBm
Survey data from wlan0
frequency: 2427 MHz
noise: -76 dBm
Survey data from wlan0
frequency: 2432 MHz
noise: -78 dBm
Survey data from wlan0
frequency: 2437 MHz
noise: -100 dBm
Survey data from wlan0
frequency: 2442 MHz
noise: -41 dBm
Survey data from wlan0
frequency: 2447 MHz [in use]
noise: -75 dBm
Example wcn3680b:
AP Asus RT-AX88U:
SSID: "linaro-test"
noise: -80 dBm Channel: 60/160
BSSID: 04:D4:C4:DD:EE:FF
MAC RSSI
E2:C0:10:YY:XX:QQ -31dBm
STA:
root@linaro-developer:~# iw wlan0 link
Connected to 04:d4:c4:dd:ee:ff (on wlan0)
SSID: linaro-test
freq: 5300
RX: 5999294 bytes (32764 packets)
TX: 35443 bytes (493 packets)
signal: -27 dBm
rx bitrate: 433.3 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 1
tx bitrate: 6.0 MBit/s
bss flags: short-slot-time
dtim period: 3
beacon int: 100
root@linaro-developer:~# iw wlan0 survey dump
Survey data from wlan0
frequency: 2412 MHz
noise: -63 dBm
Survey data from wlan0
frequency: 2417 MHz
noise: -57 dBm
Survey data from wlan0
frequency: 2422 MHz
noise: -74 dBm
Survey data from wlan0
frequency: 2427 MHz
noise: -90 dBm
Survey data from wlan0
frequency: 2432 MHz
noise: -72 dBm
Survey data from wlan0
frequency: 2437 MHz
noise: -33 dBm
Survey data from wlan0
frequency: 2442 MHz
noise: -72 dBm
Survey data from wlan0
frequency: 2447 MHz
noise: -68 dBm
Survey data from wlan0
frequency: 2452 MHz
noise: -33 dBm
Survey data from wlan0
frequency: 2457 MHz
noise: -33 dBm
Survey data from wlan0
frequency: 2462 MHz
noise: -36 dBm
Survey data from wlan0
frequency: 2467 MHz
noise: -68 dBm
Survey data from wlan0
frequency: 2472 MHz
noise: -34 dBm
Survey data from wlan0
frequency: 5180 MHz
noise: -63 dBm
Survey data from wlan0
frequency: 5200 MHz
noise: -57 dBm
Survey data from wlan0
frequency: 5220 MHz
noise: -74 dBm
Survey data from wlan0
frequency: 5240 MHz
noise: -90 dBm
Survey data from wlan0
frequency: 5260 MHz
noise: -72 dBm
Survey data from wlan0
frequency: 5280 MHz
noise: -33 dBm
Survey data from wlan0
frequency: 5300 MHz [in use]
noise: -72 dBm
Bryan O'Donoghue (4):
wcn36xx: Implement get_snr()
wcn36xx: Track the band and channel we are tuned to
wcn36xx: Track SNR and RSSI for each RX frame
wcn36xx: Add SNR reporting via get_survey()
drivers/net/wireless/ath/wcn36xx/main.c | 83 ++++++++++++++++++++++
drivers/net/wireless/ath/wcn36xx/txrx.c | 36 ++++++++++
drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 13 ++++
3 files changed, 132 insertions(+)
--
2.33.0
next reply other threads:[~2022-01-15 0:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-15 0:16 Bryan O'Donoghue [this message]
2022-01-15 0:16 ` [PATCH v3 1/4] wcn36xx: Implement get_snr() Bryan O'Donoghue
2022-01-15 14:19 ` Loic Poulain
2022-01-17 12:13 ` Kalle Valo
2022-01-19 8:49 ` Kalle Valo
2022-01-15 0:16 ` [PATCH v3 2/4] wcn36xx: Track the band and channel we are tuned to Bryan O'Donoghue
2022-01-15 0:16 ` [PATCH v3 3/4] wcn36xx: Track SNR and RSSI for each RX frame Bryan O'Donoghue
2022-01-15 0:16 ` [PATCH v3 4/4] wcn36xx: Add SNR reporting via get_survey() Bryan O'Donoghue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220115001646.3981501-1-bryan.odonoghue@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=benl@squareup.com \
--cc=kvalo@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=wcn36xx@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).