OSDN Git Service

mwifiex: add NL80211_STA_INFO_RX_BITRATE support
authorBrian Norris <briannorris@chromium.org>
Fri, 7 Dec 2018 00:12:49 +0000 (16:12 -0800)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 13 Dec 2018 14:55:05 +0000 (16:55 +0200)
commited0b2b067bad9d923842ac4c68c6b652b5885b84
tree50cf6cccb88b52fc024850b4ae0fb255588454d8
parenta256707fbd4b1d153d0152c502aa5b87837aeb6c
mwifiex: add NL80211_STA_INFO_RX_BITRATE support

Comparing the existing TX_BITRATE parsing code (in
mwifiex_parse_htinfo()) with the RX bitrate histograms in debugfs.c, it
appears that the rxpd_rate and rxpd_htinfo fields have the same format.
At least, they give reasonable results when I parse them this way.

So this patch adds support for RX_BITRATE to our station info dump.

Along the way, I add legacy bitrate parsing into the same function,
using the debugfs code (mwifiex_histogram_read() and
mwifiex_adjust_data_rate()) as reference.

Additionally, to satisfy the requirements of
NL80211_STA_INFO_RX_BITRATE, I skip logging the bitrate of multicast
packets. This shouldn't add a lot of overhead to the RX path, as there
are already several similar 802.3 header checks in this same codepath.
We can also bias the branch behavior to favor unicast, as that's the
common performance-sensitive case.

I'd consider this support somewhat experimental, as I have zero
documentation from Marvell. But the existing driver code gives me good
reason to think this is correct.

I've tested this on a few different 802.11{a,b,g,n,ac} networks, and the
reported bitrates look good to me.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/cfg80211.c
drivers/net/wireless/marvell/mwifiex/sta_rx.c