* [PATCH 1/2] wifi: mt76: mt7927: set band index for sniffer mode
From: Sean Wang @ 2026-06-13 22:51 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi; +Cc: linux-wireless, linux-mediatek, Sean Wang
From: Sean Wang <sean.wang@mediatek.com>
Use the active channel context to select the SNIFFER command band index on
MT7927, and fall back to the PHY chandef when no channel context is
available.
Also pass the same band index to the sniffer channel configuration. This
keeps monitor setup on the correct band, especially when multiple PHY band
contexts are present.
Fixes: 35a5dcc71735 ("wifi: mt76: mt7925: add MT7927 PCIe support")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index e94fa544ff20..17bc7204f02a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@ -2174,6 +2174,8 @@ int mt7925_get_txpwr_info(struct mt792x_dev *dev, u8 band_idx, struct mt7925_txp
int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,
bool enable)
{
+ struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+ struct ieee80211_chanctx_conf *ctx = mvif->bss_conf.mt76.ctx;
struct {
struct {
u8 band_idx;
@@ -2196,6 +2198,15 @@ int mt7925_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,
},
};
+ if (is_mt7927(&dev->mt76)) {
+ struct ieee80211_channel *chan;
+
+ chan = ctx ? ctx->def.chan : mvif->phy->mt76->chandef.chan;
+
+ if (chan)
+ req.hdr.band_idx = mt7927_band_idx(chan->band);
+ }
+
return mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(SNIFFER), &req, sizeof(req),
true);
}
@@ -2255,6 +2266,9 @@ int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,
},
};
+ if (is_mt7927(mphy->dev))
+ req.hdr.band_idx = mt7927_band_idx(chandef->chan->band);
+
if (chandef->chan->band < ARRAY_SIZE(ch_band))
req.tlv.ch_band = ch_band[chandef->chan->band];
if (chandef->width < ARRAY_SIZE(ch_width))
--
2.43.0
^ permalink raw reply related
* [PATCH 2/2] wifi: mt76: mt7927: use real monitor vifs for dual-band monitors
From: Sean Wang @ 2026-06-13 22:51 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi; +Cc: linux-wireless, linux-mediatek, Sean Wang
In-Reply-To: <20260613225144.2414283-1-sean.wang@kernel.org>
From: Sean Wang <sean.wang@mediatek.com>
MT7927 needs monitor interfaces to be passed to the driver as real vifs
so each monitor interface can be configured with its own band context.
This is required to support concurrent 2 GHz and 5 GHz monitor operation
on the same hw.
Keep the existing virtual monitor behavior for older chips.
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt792x_core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_core.c b/drivers/net/wireless/mediatek/mt76/mt792x_core.c
index b50825eccdaf..16afc90b7422 100644
--- a/drivers/net/wireless/mediatek/mt76/mt792x_core.c
+++ b/drivers/net/wireless/mediatek/mt76/mt792x_core.c
@@ -724,7 +724,10 @@ int mt792x_init_wiphy(struct ieee80211_hw *hw)
ieee80211_hw_set(hw, HAS_RATE_CONTROL);
ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
- ieee80211_hw_set(hw, WANT_MONITOR_VIF);
+ if (is_mt7927(&dev->mt76))
+ ieee80211_hw_set(hw, NO_VIRTUAL_MONITOR);
+ else
+ ieee80211_hw_set(hw, WANT_MONITOR_VIF);
ieee80211_hw_set(hw, SUPPORTS_PS);
ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
--
2.43.0
^ permalink raw reply related
* [PATCH wireless-next v2 0/5] wifi: cfg80211: Add fragmented per-link station stats in MLO
From: P Praneesh @ 2026-06-14 5:17 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, ath12k, praneesh.p
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=yes, Size: 10811 bytes --]
This series introduces fragmentation support for Multi-Link Operation
(MLO) station statistics in nl80211.
The current nl80211_dump_station() implementation works well for legacy
(single-link) stations, but it does not scale for MLO peers. With
multiple links per station, dumping all per-link information in a single
netlink message can exceed size limits, resulting in -EMSGSIZE errors
and incomplete dumps.
With 802.11be (Wi-Fi 7), a single station may have multiple links, each
with its own statistics. To address this, this series introduces a
stateful dump mechanism that splits station information into multiple
messages when required.
The dump is performed in two phases:
- Phase 0: Aggregated (station-level) statistics
- Phase 1: Per-link statistics sent in separate messages
This ensures:
- Reliable delivery of complete station information for MLO peers
- Backward compatibility for legacy stations
- A scalable design for future extensions
Summary of changes:
- Drop unused per-link stats handling from nl80211_send_station()
- Introduce a helper to pack common station-level STA_INFO attributes
- Refactor nl80211_dump_station() to use a stateful dump context
- Implement per-link stats fragmentation using a two-phase approach
- Add optional MAC address filtering for per-link station dumps
Message Layout Examples:
Aggregated Stats (Phase 0)
NL80211_CMD_NEW_STATION
├─ NL80211_ATTR_IFINDEX
├─ NL80211_ATTR_MAC
├─ NL80211_ATTR_GENERATION
└─ NL80211_ATTR_STA_INFO
├─ <aggregated station attributes>
└─ ...
Note: No NL80211_ATTR_MLO_LINKS is included in this phase.
Per-link stats are sent in Phase 1.
Per-Link Stats (Phase 1) - one message per link
NL80211_CMD_NEW_STATION
├─ NL80211_ATTR_IFINDEX
├─ NL80211_ATTR_MAC (MLO MAC)
├─ NL80211_ATTR_GENERATION
└─ NL80211_ATTR_STA_INFO (empty - present for parser compat)
└─ NL80211_ATTR_MLO_LINKS
└─ [linkN]
├─ NL80211_ATTR_MLO_LINK_ID = N
├─ NL80211_ATTR_MAC = <linkN MAC>
└─ NL80211_ATTR_STA_INFO
├─ NL80211_STA_INFO_RX_BYTES
├─ NL80211_STA_INFO_TX_BYTES
└─ ... more linkN stats ..
Testing:
- Verified using "iw station dump" on a 3-link MLO station
- iw requires some updates to parse fragmented per-link stats
(e.g., NL80211_ATTR_MLO_LINKS handling). Those changes will be
submitted separately.
Sample station dump output:
Single link EHT STA:
~~~~~~~~~~~~~~~~~~~
Station ff:ff:ff:0f:f8:64 (on wlan0)
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: yes
TDLS peer: no
inactive time: 182068 ms
rx bytes: 1567
rx packets: 15
tx bytes: 1083
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 0
signal: -30 dBm
signal avg: -27 dBm
tx bitrate: 6.0 MBit/s
tx duration: 3136 us
rx bitrate: 1441.3 MBit/s 80MHz EHT-MCS 7 EHT-NSS 4 EHT-GI 0
rx duration: 0 us
last ack signal:-31 dBm
avg ack signal: -31 dBm
DTIM period: 2
beacon interval:100
connected time: 185 seconds
associated at [boottime]: 157.326s
associated at: 157326 ms
current time: 342408 ms
Link 0:
address: ff:ff:ff:0f:f8:64
inactive time: 182068 ms
rx bytes: 1567
rx packets: 15
tx bytes: 1083
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 0
signal: -30 dBm
signal avg: -29 dBm
tx bitrate: 6.0 MBit/s
tx duration: 1568 us
rx duration: 0 us
last ack signal:-31 dBm
avg ack signal: -31 dBm
DTIM period: 2
beacon interval:100
3 link MLO EHT STA:
~~~~~~~~~~~~~~~~~~
Station ff:ff:ff:ff:5f:23 (on wlan0)
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: yes
TDLS peer: no
inactive time: 173476 ms
rx bytes: 1036
rx packets: 9
tx bytes: 1694
tx packets: 6
tx retries: 1
tx failed: 1
rx drop misc: 0
signal: -20 dBm
signal avg: -22 dBm
tx bitrate: 6.0 MBit/s
tx duration: 2476 us
rx duration: 0 us
last ack signal:-22 dBm
avg ack signal: -22 dBm
DTIM period: 2
beacon interval:100
connected time: 174 seconds
associated at [boottime]: 168.236s
associated at: 168236 ms
current time: 342412 ms
Link 0:
address: ff:ff:ff:ff:5f:23
inactive time: 173476 ms
rx bytes: 138
rx packets: 3
tx bytes: 0
tx packets: 0
tx retries: 0
tx failed: 0
rx drop misc: 0
signal: -27 dBm
signal avg: -28 dBm
tx duration: 0 us
rx duration: 0 us
DTIM period: 2
beacon interval:100
Link 1:
address: ff:ff:ff:ff:5f:24
inactive time: 173976 ms
rx bytes: 898
rx packets: 6
tx bytes: 1694
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 0
signal: -20 dBm
signal avg: -22 dBm
tx bitrate: 6.0 MBit/s
tx duration: 2476 us
rx bitrate: 6.0 MBit/s
rx duration: 0 us
last ack signal:-22 dBm
avg ack signal: -22 dBm
DTIM period: 2
beacon interval:100
Link 2:
address: ff:ff:ff:ff:5f:25
inactive time: 174188 ms
rx bytes: 0
rx packets: 0
tx bytes: 0
tx packets: 0
tx retries: 1
tx failed: 1
rx drop misc: 0
signal: -30 dBm
signal avg: -31 dBm
tx bitrate: 12.0 MBit/s
tx duration: 1920 us
rx duration: 0 us
DTIM period: 2
beacon interval:100
With HE AP and STA:
~~~~~~~~~~~~~~~~~~
Station ff:ff:ff:f1:f8:f4 (on wlan0)
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: yes
TDLS peer: no
inactive time: 10176 ms
rx bytes: 968
rx packets: 10
tx bytes: 856
tx packets: 6
tx retries: 0
tx failed: 0
rx drop misc: 0
signal: -24 dBm
signal avg: -27 dBm
tx bitrate: 6.0 MBit/s
tx duration: 1300 us
rx bitrate: 1297.1 MBit/s 80MHz HE-MCS 6 HE-NSS 4
rx duration: 0 us
last ack signal:-30 dBm
avg ack signal: -30 dBm
DTIM period: 2
beacon interval:100
short slot time:yes
connected time: 11 seconds
associated at [boottime]: 69.552s
associated at: 69530 ms
current time: 80780 ms
---
v2:
- In patch 1/5, Narrowed the scope: only drops the link stats from
nl80211_send_station() (formerly also deleted nl80211_fill_link_station();
that function is now moved to patch 4/5 and reused there). Also fix
the nla_put_failure label indentation (spurious leading space).
- In patch 2/5, Fix all nla_nest_start_noflag() calls in
nl80211_send_station() for nested attribute types (STA_INFO,
BSS_PARAM, TID_STATS, per-tid) to use nla_nest_start() so that
NLA_F_NESTED is set correctly.
- In patch 3/5, Drop nl80211_dump_station_cb wrapper struct and
nl80211_send_accumulated_station() helper; store the context pointer
directly at cb->args[2] following the nl80211_dump_wiphy pattern.
Build the common netlink header inline in the dump loop instead of
delegating to a helper. Add documentation explaining why
memset(&ctx->sinfo) is required after cfg80211_sinfo_release_content()
to prevent a double-free in nl80211_dump_station_done().
- In patch 4/5, Restructure the dump loop around a switch statement so
one netlink message is produced per iteration with header construction
in a single place. Replace nl80211_send_link_station() helper with a
leaner nl80211_put_link_station_payload() that only fills the
NL80211_ATTR_MLO_LINKS nest, leaving header assembly to the caller.
Fix all nla_nest_start_noflag() calls in nl80211_fill_link_station()
to use nla_nest_start(). Fix the AGGREGATED phase to propagate the
real error from nl80211_put_sta_info_common() instead of returning
skb->len, which would cause an infinite re-invocation loop on
-EMSGSIZE. Use __free(kfree) for attrbuf to avoid scattered manual
kfree() calls.
- In patch 5/5, Rename local mac_addr pointer to mac to avoid shadowing
the outer ctx->mac_addr field. Set cb->args[2] = 0 on the MAC
validation error path to prevent nl80211_dump_station_done() from
attempting to free a partially initialised context.
---
P Praneesh (5):
wifi: cfg80211: Drop unused link stats handling in
nl80211_send_station()
wifi: cfg80211: Add helper to pack station-level STA_INFO
wifi: cfg80211: Refactor nl80211_dump_station() to prepare for
per-link stats
wifi: cfg80211: Fragment per-link station stats in
nl80211_dump_station()
wifi: cfg80211: support MAC address filtering in station dump for link
stats
include/uapi/linux/nl80211.h | 19 ++
net/wireless/nl80211.c | 402 ++++++++++++++++++++++++-----------
2 files changed, 297 insertions(+), 124 deletions(-)
base-commit: 972c4dd19cb92e03d75b66c426cfade07582a1ba
--
2.43.0
^ permalink raw reply
* [PATCH wireless-next v2 1/5] wifi: cfg80211: Drop unused link stats handling in nl80211_send_station()
From: P Praneesh @ 2026-06-14 5:17 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, ath12k, praneesh.p
In-Reply-To: <20260614051739.3979947-1-praneesh.p@oss.qualcomm.com>
Remove the link level statistics handling from
nl80211_send_station() and drop the unused link_stats parameter
from its signature and callers. The removed code iterated over
each MLO link and attempted to send link specific station data
through NL80211_ATTR_MLO_LINKS, but this logic was never used
because link_stats was always false.
This logic was introduced during early work on link level station
statistics with the intention of reporting information for each
link. Due to message size concerns when a station has multiple
links, the feature was disabled behind the link_stats flag and
remained unused.
The link level reporting block in nl80211_send_station() is dead
code and cannot support larger messages, so remove it. This
cleanup also prepares for proper link level statistics reporting
in nl80211_dump_station() in a later patch, where fragmentation
allows safe transmission of multi link data.
Also fix label indentation: the nla_put_failure label had an
erroneous leading space.
Signed-off-by: P Praneesh <praneesh.p@oss.qualcomm.com>
---
net/wireless/nl80211.c | 50 +++++-------------------------------------
1 file changed, 6 insertions(+), 44 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 53b4b3f76697..98548e69b5fc 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -8033,14 +8033,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
u32 seq, int flags,
struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
- const u8 *mac_addr, struct station_info *sinfo,
- bool link_stats)
+ const u8 *mac_addr, struct station_info *sinfo)
{
void *hdr;
struct nlattr *sinfoattr, *bss_param;
- struct link_station_info *link_sinfo;
- struct nlattr *links, *link;
- int link_id;
hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
if (!hdr) {
@@ -8258,45 +8254,11 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
goto nla_put_failure;
}
- if (link_stats && sinfo->valid_links) {
- links = nla_nest_start(msg, NL80211_ATTR_MLO_LINKS);
- if (!links)
- goto nla_put_failure;
-
- for_each_valid_link(sinfo, link_id) {
- link_sinfo = sinfo->links[link_id];
-
- if (WARN_ON_ONCE(!link_sinfo))
- continue;
-
- if (!is_valid_ether_addr(link_sinfo->addr))
- continue;
-
- link = nla_nest_start(msg, link_id + 1);
- if (!link)
- goto nla_put_failure;
-
- if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID,
- link_id))
- goto nla_put_failure;
-
- if (nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN,
- link_sinfo->addr))
- goto nla_put_failure;
-
- if (nl80211_fill_link_station(msg, rdev, link_sinfo))
- goto nla_put_failure;
-
- nla_nest_end(msg, link);
- }
- nla_nest_end(msg, links);
- }
-
cfg80211_sinfo_release_content(sinfo);
genlmsg_end(msg, hdr);
return 0;
- nla_put_failure:
+nla_put_failure:
cfg80211_sinfo_release_content(sinfo);
genlmsg_cancel(msg, hdr);
return -EMSGSIZE;
@@ -8549,7 +8511,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
rdev, wdev, mac_addr,
- &sinfo, false) < 0)
+ &sinfo) < 0)
goto out;
sta_idx++;
@@ -8613,7 +8575,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION,
info->snd_portid, info->snd_seq, 0,
- rdev, wdev, mac_addr, &sinfo, false) < 0) {
+ rdev, wdev, mac_addr, &sinfo) < 0) {
nlmsg_free(msg);
return -ENOBUFS;
}
@@ -21635,7 +21597,7 @@ void cfg80211_new_sta(struct wireless_dev *wdev, const u8 *mac_addr,
return;
if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, 0, 0, 0,
- rdev, wdev, mac_addr, sinfo, false) < 0) {
+ rdev, wdev, mac_addr, sinfo) < 0) {
nlmsg_free(msg);
return;
}
@@ -21665,7 +21627,7 @@ void cfg80211_del_sta_sinfo(struct wireless_dev *wdev, const u8 *mac_addr,
}
if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0,
- rdev, wdev, mac_addr, sinfo, false) < 0) {
+ rdev, wdev, mac_addr, sinfo) < 0) {
nlmsg_free(msg);
return;
}
--
2.43.0
^ permalink raw reply related
* [PATCH wireless-next v2 2/5] wifi: cfg80211: Add helper to pack station-level STA_INFO
From: P Praneesh @ 2026-06-14 5:17 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, ath12k, praneesh.p
In-Reply-To: <20260614051739.3979947-1-praneesh.p@oss.qualcomm.com>
Add a helper function nl80211_put_sta_info_common() to pack the
station-level (aggregated) STA information into a netlink message.
This prepares the code for future enhancements such as supporting
fragmented link statistics in nl80211_dump_station.
Signed-off-by: P Praneesh <praneesh.p@oss.qualcomm.com>
---
net/wireless/nl80211.c | 66 +++++++++++++++++++++++++-----------------
1 file changed, 39 insertions(+), 27 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 98548e69b5fc..66f19bfc030a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -8029,32 +8029,15 @@ static int nl80211_fill_link_station(struct sk_buff *msg,
return -EMSGSIZE;
}
-static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
- u32 seq, int flags,
- struct cfg80211_registered_device *rdev,
- struct wireless_dev *wdev,
- const u8 *mac_addr, struct station_info *sinfo)
+static int nl80211_put_sta_info_common(struct sk_buff *msg,
+ struct cfg80211_registered_device *rdev,
+ struct station_info *sinfo)
{
- void *hdr;
struct nlattr *sinfoattr, *bss_param;
- hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
- if (!hdr) {
- cfg80211_sinfo_release_content(sinfo);
- return -1;
- }
-
- if ((wdev->netdev &&
- nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex)) ||
- nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev),
- NL80211_ATTR_PAD) ||
- nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) ||
- nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation))
- goto nla_put_failure;
-
- sinfoattr = nla_nest_start_noflag(msg, NL80211_ATTR_STA_INFO);
+ sinfoattr = nla_nest_start(msg, NL80211_ATTR_STA_INFO);
if (!sinfoattr)
- goto nla_put_failure;
+ return -EMSGSIZE;
#define PUT_SINFO(attr, memb, type) do { \
BUILD_BUG_ON(sizeof(type) == sizeof(u64)); \
@@ -8145,8 +8128,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
PUT_SINFO_U64(T_OFFSET, t_offset);
if (sinfo->filled & BIT_ULL(NL80211_STA_INFO_BSS_PARAM)) {
- bss_param = nla_nest_start_noflag(msg,
- NL80211_STA_INFO_BSS_PARAM);
+ bss_param = nla_nest_start(msg, NL80211_STA_INFO_BSS_PARAM);
if (!bss_param)
goto nla_put_failure;
@@ -8188,8 +8170,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
struct nlattr *tidsattr;
int tid;
- tidsattr = nla_nest_start_noflag(msg,
- NL80211_STA_INFO_TID_STATS);
+ tidsattr = nla_nest_start(msg, NL80211_STA_INFO_TID_STATS);
if (!tidsattr)
goto nla_put_failure;
@@ -8202,7 +8183,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
if (!tidstats->filled)
continue;
- tidattr = nla_nest_start_noflag(msg, tid + 1);
+ tidattr = nla_nest_start(msg, tid + 1);
if (!tidattr)
goto nla_put_failure;
@@ -8232,6 +8213,37 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
}
nla_nest_end(msg, sinfoattr);
+ return 0;
+
+nla_put_failure:
+ nla_nest_cancel(msg, sinfoattr);
+ return -EMSGSIZE;
+}
+
+static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
+ u32 seq, int flags,
+ struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ const u8 *mac_addr, struct station_info *sinfo)
+{
+ void *hdr;
+
+ hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
+ if (!hdr) {
+ cfg80211_sinfo_release_content(sinfo);
+ return -1;
+ }
+
+ if ((wdev->netdev &&
+ nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex)) ||
+ nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev),
+ NL80211_ATTR_PAD) ||
+ nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr) ||
+ nla_put_u32(msg, NL80211_ATTR_GENERATION, sinfo->generation))
+ goto nla_put_failure;
+
+ if (nl80211_put_sta_info_common(msg, rdev, sinfo))
+ goto nla_put_failure;
if (sinfo->assoc_req_ies_len &&
nla_put(msg, NL80211_ATTR_IE, sinfo->assoc_req_ies_len,
--
2.43.0
^ permalink raw reply related
* [PATCH wireless-next v2 3/5] wifi: cfg80211: Refactor nl80211_dump_station() to prepare for per-link stats
From: P Praneesh @ 2026-06-14 5:17 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, ath12k, praneesh.p
In-Reply-To: <20260614051739.3979947-1-praneesh.p@oss.qualcomm.com>
Currently, nl80211_dump_station() relies on the netlink callback's generic
args array (cb->args[2]) to track the station index during dumps. It also
processes the entire sinfo structure and transmits it to userspace
immediately in a single pass.
This approach creates a bottleneck for MLO. When an MLD station has
multiple active links, the aggregated station information, combined
with the individual per-link statistics, can easily exceed the
maximum netlink message size limits. The current monolithic dump
iteration cannot pause and resume mid-station to fragment these large
per-link statistics across multiple netlink messages.
Introduce a stateful context structure (struct nl80211_dump_station_ctx)
allocated during the dump to track the iteration state. Store the context
pointer directly at cb->args[2], following the same pattern as
nl80211_dump_wiphy which stores its state pointer at cb->args[0].
Move the station index (sta_idx) tracking and the sinfo payload into this
context. The per-station netlink message is built inline in the loop:
common header attributes are assembled directly, then
nl80211_put_sta_info_common() adds the STA_INFO payload.
Furthermore, move the NL80211_CMD_GET_STATION command definition from
genl_small_ops to genl_ops to natively support the .done callback.
Implement nl80211_dump_station_done() to ensure the newly allocated state
context and its deeply allocated sinfo payload are safely freed when the
dump concludes or is aborted prematurely by userspace.
Note that the previous dump path used nl80211_send_station(), which
included NL80211_ATTR_IE and NL80211_ATTR_RESP_IE. These attributes are
not carried forward in this implementation. As documented, association
response IEs (assoc_resp_ies) are only relevant at station creation time
(e.g. via cfg80211_new_sta()) to notify userspace about association
details, and are not expected to be part of get_station()/dump_station()
callbacks. Aligning with this expectation, these IEs are intentionally
omitted here.
This refactoring maintains the existing netlink batching performance while
laying the stateful foundation required for per-link statistics
fragmentation in subsequent patches.
At out_err_release, cfg80211_sinfo_release_content() frees any
dynamically allocated sub-fields inside ctx->sinfo (including per-link
pointers in sinfo.links[]). Without the subsequent memset, those
pointers remain non-NULL in the embedded sinfo. When the dump concludes
or is aborted, nl80211_dump_station_done() calls
cfg80211_sinfo_release_content() a second time on the same ctx->sinfo,
which would free the already-released link memory. The
memset(&ctx->sinfo, 0, sizeof(ctx->sinfo)) zeroes all pointers so the
second release call hits kfree(NULL), which is a harmless no-op.
Signed-off-by: P Praneesh <praneesh.p@oss.qualcomm.com>
---
net/wireless/nl80211.c | 129 +++++++++++++++++++++++++++--------------
1 file changed, 85 insertions(+), 44 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 66f19bfc030a..b4c4406d77bf 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -8464,16 +8464,19 @@ static void cfg80211_sta_set_mld_sinfo(struct station_info *sinfo)
sinfo->filled &= ~BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL_AVG);
}
+struct nl80211_dump_station_ctx {
+ int sta_idx;
+ u8 mac_addr[ETH_ALEN];
+ struct station_info sinfo;
+};
+
static int nl80211_dump_station(struct sk_buff *skb,
struct netlink_callback *cb)
{
- struct station_info sinfo;
struct cfg80211_registered_device *rdev;
struct wireless_dev *wdev;
- u8 mac_addr[ETH_ALEN];
- int sta_idx = cb->args[2];
- bool sinfo_alloc = false;
- int err, i;
+ struct nl80211_dump_station_ctx *ctx = (void *)cb->args[2];
+ int err;
err = nl80211_prepare_wdev_dump(cb, &rdev, &wdev, NULL);
if (err)
@@ -8481,6 +8484,15 @@ static int nl80211_dump_station(struct sk_buff *skb,
/* nl80211_prepare_wdev_dump acquired it in the successful case */
__acquire(&rdev->wiphy.mtx);
+ if (!ctx) {
+ ctx = kzalloc_obj(*ctx);
+ if (!ctx) {
+ err = -ENOMEM;
+ goto out_err;
+ }
+ cb->args[2] = (long)ctx;
+ }
+
if (!wdev->netdev && wdev->iftype != NL80211_IFTYPE_NAN) {
err = -EINVAL;
goto out_err;
@@ -8491,55 +8503,83 @@ static int nl80211_dump_station(struct sk_buff *skb,
goto out_err;
}
- while (1) {
- memset(&sinfo, 0, sizeof(sinfo));
+ while (true) {
+ void *hdr;
- for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
- sinfo.links[i] =
- kzalloc_obj(*sinfo.links[0]);
- if (!sinfo.links[i]) {
+ memset(&ctx->sinfo, 0, sizeof(ctx->sinfo));
+ for (int i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
+ ctx->sinfo.links[i] =
+ kzalloc_obj(*ctx->sinfo.links[0]);
+ if (!ctx->sinfo.links[i]) {
err = -ENOMEM;
- goto out_err;
+ goto out_err_release;
}
- sinfo_alloc = true;
}
- err = rdev_dump_station(rdev, wdev, sta_idx,
- mac_addr, &sinfo);
- if (err == -ENOENT)
- break;
+ err = rdev_dump_station(rdev, wdev, ctx->sta_idx,
+ ctx->mac_addr, &ctx->sinfo);
+ if (err == -ENOENT) {
+ err = skb->len;
+ goto out_err_release;
+ }
if (err)
- goto out_err;
+ goto out_err_release;
- if (sinfo.valid_links)
- cfg80211_sta_set_mld_sinfo(&sinfo);
+ if (ctx->sinfo.valid_links)
+ cfg80211_sta_set_mld_sinfo(&ctx->sinfo);
- /* reset the sinfo_alloc flag as nl80211_send_station()
- * always releases sinfo
- */
- sinfo_alloc = false;
+ hdr = nl80211hdr_put(skb, NETLINK_CB(cb->skb).portid,
+ cb->nlh->nlmsg_seq, NLM_F_MULTI,
+ NL80211_CMD_NEW_STATION);
+ if (!hdr) {
+ err = skb->len;
+ goto out_err_release;
+ }
- if (nl80211_send_station(skb, NL80211_CMD_NEW_STATION,
- NETLINK_CB(cb->skb).portid,
- cb->nlh->nlmsg_seq, NLM_F_MULTI,
- rdev, wdev, mac_addr,
- &sinfo) < 0)
- goto out;
+ if ((wdev->netdev &&
+ nla_put_u32(skb, NL80211_ATTR_IFINDEX,
+ wdev->netdev->ifindex)) ||
+ nla_put_u64_64bit(skb, NL80211_ATTR_WDEV,
+ wdev_id(wdev), NL80211_ATTR_PAD) ||
+ nla_put(skb, NL80211_ATTR_MAC, ETH_ALEN, ctx->mac_addr) ||
+ nla_put_u32(skb, NL80211_ATTR_GENERATION,
+ ctx->sinfo.generation)) {
+ genlmsg_cancel(skb, hdr);
+ err = skb->len;
+ goto out_err_release;
+ }
- sta_idx++;
+ if (nl80211_put_sta_info_common(skb, rdev, &ctx->sinfo)) {
+ genlmsg_cancel(skb, hdr);
+ err = skb->len;
+ goto out_err_release;
+ }
+
+ genlmsg_end(skb, hdr);
+ cfg80211_sinfo_release_content(&ctx->sinfo);
+ ctx->sta_idx++;
}
- out:
- cb->args[2] = sta_idx;
- err = skb->len;
- out_err:
- if (sinfo_alloc)
- cfg80211_sinfo_release_content(&sinfo);
+out_err_release:
+ cfg80211_sinfo_release_content(&ctx->sinfo);
+ memset(&ctx->sinfo, 0, sizeof(ctx->sinfo));
+out_err:
wiphy_unlock(&rdev->wiphy);
return err;
}
+static int nl80211_dump_station_done(struct netlink_callback *cb)
+{
+ struct nl80211_dump_station_ctx *ctx = (void *)cb->args[2];
+
+ if (ctx) {
+ cfg80211_sinfo_release_content(&ctx->sinfo);
+ kfree(ctx);
+ }
+ return 0;
+}
+
static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
@@ -19504,6 +19544,14 @@ static const struct genl_ops nl80211_ops[] = {
/* can be retrieved by unprivileged users */
.internal_flags = IFLAGS(NL80211_FLAG_NEED_WIPHY),
},
+ {
+ .cmd = NL80211_CMD_GET_STATION,
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+ .doit = nl80211_get_station,
+ .dumpit = nl80211_dump_station,
+ .done = nl80211_dump_station_done,
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV),
+ },
};
static const struct genl_small_ops nl80211_small_ops[] = {
@@ -19603,13 +19651,6 @@ static const struct genl_small_ops nl80211_small_ops[] = {
.internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_MLO_VALID_LINK_ID),
},
- {
- .cmd = NL80211_CMD_GET_STATION,
- .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
- .doit = nl80211_get_station,
- .dumpit = nl80211_dump_station,
- .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV),
- },
{
.cmd = NL80211_CMD_SET_STATION,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
--
2.43.0
^ permalink raw reply related
* Re: [PATCH 0/5] wifi: mt76: add USB RX aggregation support
From: Lorenzo Bianconi @ 2026-06-14 9:26 UTC (permalink / raw)
To: Sean Wang; +Cc: Felix Fietkau, linux-wireless, linux-mediatek
In-Reply-To: <20260613224655.2405686-1-sean.wang@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2292 bytes --]
> This series adds optional USB RX aggregation support to mt76 and enables
> it on mt7927u.
>
> RX aggregation allows multiple RX frames to be received from one USB URB,
> reducing USB completion overhead and improving RX efficiency for
> high-throughput RX traffic and monitor capture.
Hi Sean,
MT76 usb already supports Scatter-Gather (SG) for RX urbs in order to receive
multiple buffers in the same urb. Since this approach has a better memory
footprint, can we reuse this approach?
Moreover, can you please provide some performance comparison? (e.g. throughput
and memory usage).
Regards,
Lorenzo
>
> The common USB support remains opt-in, so existing USB drivers keep the
> current behavior unless they explicitly enable RX aggregation. The same
> settings work for both mt7927u and mt7925u, but this series enables the
> feature only on mt7927u for now.
>
> This series does the following:
>
> - size RX page-pool pages from the queue buffer size
> - support out-of-order RX URB completion
> - add optional USB RX aggregation parsing
> - add debugfs stats to verify aggregation behavior
> - enable USB RX aggregation on mt7927u
>
> The series is based on wireless-next commit:
>
> 21352612198c ("b43: add RF power offset for N-PHY r8 + radio 2057 r8")
>
> It also cherry-picks the following patch from patchwork as a dependency:
>
> wifi: mt76: mt76u: use a threaded NAPI for the RX path
> Link: https://lore.kernel.org/all/20260609105301.196302-1-phial@phiality.com/
>
> Sean Wang (5):
> wifi: mt76: usb: size RX page-pool pages from queue buffer
> wifi: mt76: usb: support out-of-order RX URB completion
> wifi: mt76: usb: add optional RX aggregation support
> wifi: mt76: usb: add debugfs aggregation stats
> wifi: mt76: mt7927u: enable USB RX aggregation
>
> drivers/net/wireless/mediatek/mt76/debugfs.c | 35 +++
> drivers/net/wireless/mediatek/mt76/mac80211.c | 3 +
> drivers/net/wireless/mediatek/mt76/mt76.h | 38 ++-
> .../net/wireless/mediatek/mt76/mt7925/usb.c | 18 +-
> .../net/wireless/mediatek/mt76/mt792x_usb.c | 23 +-
> drivers/net/wireless/mediatek/mt76/usb.c | 251 ++++++++++++++++--
> 6 files changed, 335 insertions(+), 33 deletions(-)
>
> --
> 2.43.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* Re: [PATCH 1/5] wifi: mt76: usb: size RX page-pool pages from queue buffer
From: Lorenzo Bianconi @ 2026-06-14 9:28 UTC (permalink / raw)
To: Sean Wang; +Cc: Felix Fietkau, linux-wireless, linux-mediatek, Sean Wang
In-Reply-To: <20260613224655.2405686-2-sean.wang@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1134 bytes --]
> From: Sean Wang <sean.wang@mediatek.com>
>
> Use the RX queue buffer size to select the page-pool allocation order.
> This lets USB devices use larger RX buffers without silently allocating
> undersized order-0 pages.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mac80211.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
> index 13c4e8abe281..6ff1eada6d09 100644
> --- a/drivers/net/wireless/mediatek/mt76/mac80211.c
> +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
> @@ -628,6 +628,9 @@ int mt76_create_page_pool(struct mt76_dev *dev, struct mt76_queue *q)
> if (!is_qrx && !mt76_queue_is_wed_tx_free(q))
> return 0;
>
> + if (q->buf_size > PAGE_SIZE)
> + pp_params.order = get_order(q->buf_size);
I guess you are interested just in usb devices here, right? Moreover, are you
interested just in MT_RXQ_MAIN queue?
Regards,
Lorenzo
> +
> switch (idx) {
> case MT_RXQ_MAIN:
> case MT_RXQ_BAND1:
> --
> 2.43.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply
* [PATCH rtw-next 0/3] wifi: rtlwifi: fix ASPM AER flooding on RTL8723BE devices
From: William Hansen-Baird @ 2026-06-14 13:55 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless, linux-kernel, William Hansen-Baird
This flood of AER error messages for the RTL8723BE is not unique to
subsystem ID 17aa:b736.
Commit 77a6407c6ab2 ("wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723")
targets the same issue for subsystem ID 11ad:1723.
The fix applied in that commit, however, does not correctly
disable ASPM. It merely disables driver control of ASPM.
Patch 1 fixes the previous commit such that it properly disables ASPM for
subsystem ID 11ad:1723.
Patch 2 converts the if-statement check of subsystem IDs to a
pci_device_id table matched with pci_match_id() such that future
subsystem IDs can easily be added if they have the same error.
Patch 3 adds the subsystem ID 17aa:b736 to the pci_device_id table
to disable ASPM for it. Testing on a Razer Blade 14 2017 showed this
stops the AER error message flood and wifi works as it should.
William Hansen-Baird (3):
wifi: rtlwifi: fix disabling of ASPM for RTL8723BE with AER flooding
wifi: rtlwifi: convert pci if-statement to ID table
wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 17aa:b736
drivers/net/wireless/realtek/rtlwifi/pci.c | 27 ++++++++++++++--------
1 file changed, 18 insertions(+), 9 deletions(-)
--
2.54.0
^ permalink raw reply
* [PATCH rtw-next 1/3] wifi: rtlwifi: fix disabling of ASPM for RTL8723BE with AER flooding
From: William Hansen-Baird @ 2026-06-14 13:55 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless, linux-kernel, William Hansen-Baird
In-Reply-To: <20260614135508.70307-1-william.hansen.baird@gmail.com>
Commit 77a6407c6ab2 ("wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723")
adds code which sets ppsc->support_aspm to false in
_rtl_pci_update_default_setting() in order to disable ASPM.
This does not, however, disable ASPM. Rather, it disables driver
control of ASPM, and blocks calls to rtl_pci_enable_aspm()
and rtl_pci_disable_aspm().
In some cases, the pci device supplied to the probe function has
ASPM enabled. The code would therefore not disable ASPM, as it means to,
but rather just leave it enabled.
This was discovered through testing on a Razer Blade 14 2017, where ASPM
was enabled by default for the pci device.
Move the code added in the previous commit to rtl_pci_init_aspm() to
allow the adding of a call to rtl_pci_disable_aspm(hw) prior to disabling
ppsc->pci_support. This makes sure ASPM is disabled before disabling
driver control of ASPM to block it from being enabled later.
Fixes: 77a6407c6ab2 ("wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723")
Signed-off-by: William Hansen-Baird <william.hansen.baird@gmail.com>
---
drivers/net/wireless/realtek/rtlwifi/pci.c | 23 +++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 73018a0498b4..4ef1faf649e9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -156,15 +156,6 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
PCI_EXP_LNKCTL_ASPM_L1 | PCI_EXP_LNKCTL_CCC))
ppsc->support_aspm = false;
- /* RTL8723BE found on some ASUSTek laptops, such as F441U and
- * X555UQ with subsystem ID 11ad:1723 are known to output large
- * amounts of PCIe AER errors during and after boot up, causing
- * heavy lags, poor network throughput, and occasional lock-ups.
- */
- if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8723BE &&
- (rtlpci->pdev->subsystem_vendor == 0x11ad &&
- rtlpci->pdev->subsystem_device == 0x1723))
- ppsc->support_aspm = false;
}
static bool _rtl_pci_platform_switch_device_pci_aspm(
@@ -330,10 +321,24 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev,
static void rtl_pci_init_aspm(struct ieee80211_hw *hw)
{
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
+ struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
_rtl_pci_update_default_setting(hw);
+ /* RTL8723BE found on some ASUSTek laptops, such as F441U and
+ * X555UQ with subsystem ID 11ad:1723 are known to output large
+ * amounts of PCIe AER errors during and after boot up, causing
+ * heavy lags, poor network throughput, and occasional lock-ups.
+ */
+ if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8723BE &&
+ (rtlpci->pdev->subsystem_vendor == 0x11ad &&
+ rtlpci->pdev->subsystem_device == 0x1723)) {
+ rtl_pci_disable_aspm(hw);
+ ppsc->support_aspm = false;
+ }
+
if (ppsc->reg_rfps_level & RT_RF_PS_LEVEL_ALWAYS_ASPM) {
/*Always enable ASPM & Clock Req. */
rtl_pci_enable_aspm(hw);
--
2.54.0
^ permalink raw reply related
* [PATCH rtw-next 2/3] wifi: rtlwifi: convert pci ID if-statement to table
From: William Hansen-Baird @ 2026-06-14 13:55 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless, linux-kernel, William Hansen-Baird
In-Reply-To: <20260614135508.70307-1-william.hansen.baird@gmail.com>
Refactor the ASUSTek quirk logic from an if-statement to a standard
pci_device_id table. This allows future devices with the same quirk
to be added more easily and avoiding a large if-chain.
Signed-off-by: William Hansen-Baird <william.hansen.baird@gmail.com>
---
drivers/net/wireless/realtek/rtlwifi/pci.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 4ef1faf649e9..03b743809258 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -31,6 +31,11 @@ static const u8 ac_to_hwq[] = {
BK_QUEUE
};
+static const struct pci_device_id rtl8723be_aspm_quirks[] = {
+ { PCI_DEVICE_SUB(PCI_ANY_ID, PCI_ANY_ID, 0x11ad, 0x1723) },
+ { 0 }
+};
+
static u8 _rtl_mac_to_hwqueue(struct ieee80211_hw *hw, struct sk_buff *skb)
{
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -327,14 +332,12 @@ static void rtl_pci_init_aspm(struct ieee80211_hw *hw)
_rtl_pci_update_default_setting(hw);
- /* RTL8723BE found on some ASUSTek laptops, such as F441U and
- * X555UQ with subsystem ID 11ad:1723 are known to output large
+ /* RTL8723BE with certain subsytem IDs are known to output large
* amounts of PCIe AER errors during and after boot up, causing
* heavy lags, poor network throughput, and occasional lock-ups.
*/
if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8723BE &&
- (rtlpci->pdev->subsystem_vendor == 0x11ad &&
- rtlpci->pdev->subsystem_device == 0x1723)) {
+ pci_match_id(rtl8723be_aspm_quirks, rtlpci->pdev)) {
rtl_pci_disable_aspm(hw);
ppsc->support_aspm = false;
}
--
2.54.0
^ permalink raw reply related
* [PATCH rtw-next 3/3] wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 17aa:b736
From: William Hansen-Baird @ 2026-06-14 13:55 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless, linux-kernel, William Hansen-Baird
In-Reply-To: <20260614135508.70307-1-william.hansen.baird@gmail.com>
RTL8723BE outputs a large amount of PCIe AER errors during and
after boot, even before probe and when driver is never loaded.
This causes significant system slowdown.
The errors are the same as reported by
commit 77a6407c6ab2 ("wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723")
Add the subsystem ID 17aa:b736 to the rtl8723be quirk table to stop
the AER errors. AER errors can still be present prior to pci probe,
as the device by default may have ASPM enabled.
Testing on a Razer Blade 14 2017 which shipped from the
OEM equipped with an RTL8723BE card with this subsystem ID
confirms that this patch resolves the AER flood and allows the
wireless card to function normally once the driver takes over.
Signed-off-by: William Hansen-Baird <william.hansen.baird@gmail.com>
---
drivers/net/wireless/realtek/rtlwifi/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 03b743809258..bbcd1922acb2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -33,6 +33,7 @@ static const u8 ac_to_hwq[] = {
static const struct pci_device_id rtl8723be_aspm_quirks[] = {
{ PCI_DEVICE_SUB(PCI_ANY_ID, PCI_ANY_ID, 0x11ad, 0x1723) },
+ { PCI_DEVICE_SUB(PCI_ANY_ID, PCI_ANY_ID, 0x17aa, 0xb736) },
{ 0 }
};
--
2.54.0
^ permalink raw reply related
page: | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox