cfg80211: Add station statistics in STA/P2P client mode - #367
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The driver does not return any station entry through cfg80211_rtw_dump_station()
when operating in STA or P2P client mode.
As a result, commands such as:
iw dev wlan0 station dump
return no station information even when the interface is associated.
Several userspace applications rely on station dump statistics to obtain
traffic counters and link information. For example, MATE's netspeed applet
cannot retrieve RX/TX counters from rtl8192eu when the interface operates
as a client.
Solution
Add support for STA/P2P client mode in cfg80211_rtw_dump_station() by
returning information for the currently associated access point.
Since a station interface is associated with a single peer, only index 0
is considered valid. Requests for subsequent station indices return
-ENOENT.
The patch also exposes additional statistics through both
cfg80211_rtw_dump_station() and cfg80211_rtw_get_station():
The driver currently does not provide a dedicated RX bitrate value.
Therefore, the RX bitrate field is populated using the same value returned
by rtw_get_cur_max_rate() that is already used for the TX bitrate field.
This makes station statistics available through cfg80211 in a way that is
consistent with other wireless drivers and allows userspace applications
to obtain traffic and link information while operating in STA/P2P client
mode.
Testing
Tested on Realtek RTL8111/8168/8411 in infrastructure mode.
Before:
iw dev <interface_name> station dump
returned no entries.
After:
iw dev <interface_name> station dump
returns the associated AP entry together with:
This allows applications such as MATE netspeed and other tools relying on
cfg80211 station statistics to retrieve traffic and link information while
the interface is associated as a client.