Skip to content

cfg80211: Add station statistics in STA/P2P client mode - #367

Merged
CGarces merged 1 commit into
Mange:realtek-4.4.xfrom
pbrochart:realtek-4.4.x
Jul 4, 2026
Merged

cfg80211: Add station statistics in STA/P2P client mode#367
CGarces merged 1 commit into
Mange:realtek-4.4.xfrom
pbrochart:realtek-4.4.x

Conversation

@pbrochart

@pbrochart pbrochart commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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():

  • RX bitrate
  • RX bytes
  • TX bytes

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.

Netspeed_before

After:

iw dev <interface_name> station dump
returns the associated AP entry together with:

  • signal level
  • inactive time
  • RX/TX bitrate
  • RX/TX packet counters
  • RX/TX byte counters
  • TX failure counters
Netspeed_after

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.

@CGarces
CGarces merged commit 0877138 into Mange:realtek-4.4.x Jul 4, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants