* [PATCH ath-next 1/2] wifi: ath12k: Skip setting RX_FLAG_8023 for Ethernet-II (DIX) frames in monitor mode
2026-06-09 6:48 [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling Sushant Butta
@ 2026-06-09 6:48 ` Sushant Butta
2026-06-09 6:48 ` [PATCH ath-next 2/2] wifi: ath12k: Skip peer link info update in rx_status for monitor MSDUs Sushant Butta
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Sushant Butta @ 2026-06-09 6:48 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Sushant Butta
Monitor mode delivers raw 802.11 frames, not 802.3/Ethernet frames. Setting
RX_FLAG_8023 for monitor RX is incorrect and can break userspace capture and
analysis. Do not update this flag in the monitor path to ensure correct
handling of captured frames.
In the monitor path, RX_FLAG_ONLY_MONITOR is always set before decap
is evaluated, which forces decap to remain DP_RX_DECAP_TYPE_RAW.
As a result, the condition to set RX_FLAG_8023 can never be satisfied.
Hence, drop this unreachable code.
Also remove the unused hal_rx_mon_ppdu_info parameter from
ath12k_dp_mon_rx_deliver_msdu(), as it was passed but never used.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Sushant Butta <sushant.butta@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath12k/dp_mon.c | 16 +---------------
drivers/net/wireless/ath/ath12k/dp_mon.h | 4 +---
drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c | 7 +------
3 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index 44c5cff75f16..cfcfa93eeb44 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -493,9 +493,7 @@ EXPORT_SYMBOL(ath12k_dp_mon_update_radiotap);
void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
struct napi_struct *napi,
struct sk_buff *msdu,
- const struct hal_rx_mon_ppdu_info *ppduinfo,
- struct ieee80211_rx_status *status,
- u8 decap)
+ struct ieee80211_rx_status *status)
{
struct ath12k_dp *dp = dp_pdev->dp;
struct ath12k_base *ab = dp->ab;
@@ -511,7 +509,6 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
struct hal_rx_desc_data rx_info;
bool is_mcbc = rxcb->is_mcbc;
- bool is_eapol_tkip = rxcb->is_eapol;
struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)msdu->data;
u8 addr[ETH_ALEN] = {};
@@ -570,17 +567,6 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
rx_status = IEEE80211_SKB_RXCB(msdu);
*rx_status = *status;
- /* TODO: trace rx packet */
-
- /* PN for multicast packets are not validate in HW,
- * so skip 802.3 rx path
- * Also, fast_rx expects the STA to be authorized, hence
- * eapol packets are sent in slow path.
- */
- if (decap == DP_RX_DECAP_TYPE_ETHERNET2_DIX && !is_eapol_tkip &&
- !(is_mcbc && rx_status->flag & RX_FLAG_DECRYPTED))
- rx_status->flag |= RX_FLAG_8023;
-
ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), pubsta, msdu, napi);
}
EXPORT_SYMBOL(ath12k_dp_mon_rx_deliver_msdu);
diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.h b/drivers/net/wireless/ath/ath12k/dp_mon.h
index 167028d27513..162cdcaa57a7 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.h
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.h
@@ -112,9 +112,7 @@ void ath12k_dp_mon_update_radiotap(struct ath12k_pdev_dp *dp_pdev,
void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
struct napi_struct *napi,
struct sk_buff *msdu,
- const struct hal_rx_mon_ppdu_info *ppduinfo,
- struct ieee80211_rx_status *status,
- u8 decap);
+ struct ieee80211_rx_status *status);
struct sk_buff *
ath12k_dp_mon_rx_merg_msdus(struct ath12k_pdev_dp *dp_pdev,
struct dp_mon_mpdu *mon_mpdu,
diff --git a/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c b/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c
index 7dd4a49d64d5..67acaebdc605 100644
--- a/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c
@@ -2480,7 +2480,6 @@ ath12k_wifi7_dp_mon_rx_deliver(struct ath12k_pdev_dp *dp_pdev,
{
struct sk_buff *mon_skb, *skb_next, *header;
struct ieee80211_rx_status *rxs = &dp_pdev->rx_status;
- u8 decap = DP_RX_DECAP_TYPE_RAW;
mon_skb = ath12k_dp_mon_rx_merg_msdus(dp_pdev, mon_mpdu, ppduinfo, rxs);
if (!mon_skb)
@@ -2507,12 +2506,8 @@ ath12k_wifi7_dp_mon_rx_deliver(struct ath12k_pdev_dp *dp_pdev,
}
rxs->flag |= RX_FLAG_ONLY_MONITOR;
- if (!(rxs->flag & RX_FLAG_ONLY_MONITOR))
- decap = mon_mpdu->decap_format;
-
ath12k_dp_mon_update_radiotap(dp_pdev, ppduinfo, mon_skb, rxs);
- ath12k_dp_mon_rx_deliver_msdu(dp_pdev, napi, mon_skb, ppduinfo,
- rxs, decap);
+ ath12k_dp_mon_rx_deliver_msdu(dp_pdev, napi, mon_skb, rxs);
mon_skb = skb_next;
} while (mon_skb);
rxs->flag = 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH ath-next 2/2] wifi: ath12k: Skip peer link info update in rx_status for monitor MSDUs
2026-06-09 6:48 [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling Sushant Butta
2026-06-09 6:48 ` [PATCH ath-next 1/2] wifi: ath12k: Skip setting RX_FLAG_8023 for Ethernet-II (DIX) frames in monitor mode Sushant Butta
@ 2026-06-09 6:48 ` Sushant Butta
2026-06-29 2:05 ` [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling Baochen Qiang
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Sushant Butta @ 2026-06-09 6:48 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Sushant Butta
Do not populate peer and link_id in ieee80211_rx_status for monitor
MSDUs.
The monitor RX path is handled differently in mac80211 when
RX_FLAG_ONLY_MONITOR is set, and does not consume peer/link metadata.
As such, looking up the peer and updating link_id here is unnecessary.
Additionally, this metadata is not required for monitor mode delivery,
and performing the lookup/update introduces redundant work and the
potential for inconsistent rx_status state if multiple paths modify it.
Hence, remove the peer lookup and link_id update from the monitor MSDU
delivery path.
This also removes the per-MSDU debug logging in the monitor path,
slightly reducing debuggability, but avoids unnecessary overhead in the
monitor RX path.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Sushant Butta <sushant.butta@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath12k/dp_mon.c | 54 +-----------------------
1 file changed, 1 insertion(+), 53 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index cfcfa93eeb44..7d5be77b081f 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -495,8 +495,6 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
struct sk_buff *msdu,
struct ieee80211_rx_status *status)
{
- struct ath12k_dp *dp = dp_pdev->dp;
- struct ath12k_base *ab = dp->ab;
static const struct ieee80211_radiotap_he known = {
.data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN |
IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN),
@@ -504,13 +502,6 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
};
struct ieee80211_rx_status *rx_status;
struct ieee80211_radiotap_he *he = NULL;
- struct ieee80211_sta *pubsta = NULL;
- struct ath12k_dp_link_peer *peer;
- struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
- struct hal_rx_desc_data rx_info;
- bool is_mcbc = rxcb->is_mcbc;
- struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)msdu->data;
- u8 addr[ETH_ALEN] = {};
status->link_valid = 0;
@@ -521,53 +512,10 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
status->flag |= RX_FLAG_RADIOTAP_HE;
}
- ath12k_dp_extract_rx_desc_data(dp->hal, &rx_info, rx_desc, rx_desc);
-
- rcu_read_lock();
- spin_lock_bh(&dp->dp_lock);
- peer = ath12k_dp_rx_h_find_link_peer(dp_pdev, msdu, &rx_info);
- if (peer && peer->sta) {
- pubsta = peer->sta;
- memcpy(addr, peer->addr, ETH_ALEN);
- if (pubsta->valid_links) {
- status->link_valid = 1;
- status->link_id = peer->link_id;
- }
- }
-
- spin_unlock_bh(&dp->dp_lock);
- rcu_read_unlock();
-
- ath12k_dbg(ab, ATH12K_DBG_DATA,
- "rx skb %p len %u peer %pM %u %s %s%s%s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n",
- msdu,
- msdu->len,
- addr,
- rxcb->tid,
- (is_mcbc) ? "mcast" : "ucast",
- (status->encoding == RX_ENC_LEGACY) ? "legacy" : "",
- (status->encoding == RX_ENC_HT) ? "ht" : "",
- (status->encoding == RX_ENC_VHT) ? "vht" : "",
- (status->encoding == RX_ENC_HE) ? "he" : "",
- (status->bw == RATE_INFO_BW_40) ? "40" : "",
- (status->bw == RATE_INFO_BW_80) ? "80" : "",
- (status->bw == RATE_INFO_BW_160) ? "160" : "",
- (status->bw == RATE_INFO_BW_320) ? "320" : "",
- status->enc_flags & RX_ENC_FLAG_SHORT_GI ? "sgi " : "",
- status->rate_idx,
- status->nss,
- status->freq,
- status->band, status->flag,
- !!(status->flag & RX_FLAG_FAILED_FCS_CRC),
- !!(status->flag & RX_FLAG_MMIC_ERROR),
- !!(status->flag & RX_FLAG_AMSDU_MORE));
-
- ath12k_dbg_dump(ab, ATH12K_DBG_DP_RX, NULL, "dp rx msdu: ",
- msdu->data, msdu->len);
rx_status = IEEE80211_SKB_RXCB(msdu);
*rx_status = *status;
- ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), pubsta, msdu, napi);
+ ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), NULL, msdu, napi);
}
EXPORT_SYMBOL(ath12k_dp_mon_rx_deliver_msdu);
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling
2026-06-09 6:48 [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling Sushant Butta
2026-06-09 6:48 ` [PATCH ath-next 1/2] wifi: ath12k: Skip setting RX_FLAG_8023 for Ethernet-II (DIX) frames in monitor mode Sushant Butta
2026-06-09 6:48 ` [PATCH ath-next 2/2] wifi: ath12k: Skip peer link info update in rx_status for monitor MSDUs Sushant Butta
@ 2026-06-29 2:05 ` Baochen Qiang
2026-06-29 4:14 ` Rameshkumar Sundaram
2026-06-30 21:26 ` Jeff Johnson
4 siblings, 0 replies; 6+ messages in thread
From: Baochen Qiang @ 2026-06-29 2:05 UTC (permalink / raw)
To: Sushant Butta, ath12k; +Cc: linux-wireless
On 6/9/2026 2:48 PM, Sushant Butta wrote:
> This series fixes monitor-mode meta data handling in ath12k and trims dead code:
>
> Monitor mode delivers raw 802.11 frames should not set RX_FLAG_8023 flag,
> and populate peer/link metadata in ieee80211_rx_status for monitor MSDUs.
>
> Sushant Butta (2):
> wifi: ath12k: Skip setting RX_FLAG_8023 for Ethernet-II (DIX) frames
> in monitor mode
> wifi: ath12k: Skip peer link info update in rx_status for monitor
> MSDUs
>
> drivers/net/wireless/ath/ath12k/dp_mon.c | 70 +------------------
> drivers/net/wireless/ath/ath12k/dp_mon.h | 4 +-
> .../net/wireless/ath/ath12k/wifi7/dp_mon.c | 7 +-
> 3 files changed, 4 insertions(+), 77 deletions(-)
>
>
> base-commit: 38b2fb7d2df16f5801f7d88a4739942b95a5f6aa
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling
2026-06-09 6:48 [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling Sushant Butta
` (2 preceding siblings ...)
2026-06-29 2:05 ` [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling Baochen Qiang
@ 2026-06-29 4:14 ` Rameshkumar Sundaram
2026-06-30 21:26 ` Jeff Johnson
4 siblings, 0 replies; 6+ messages in thread
From: Rameshkumar Sundaram @ 2026-06-29 4:14 UTC (permalink / raw)
To: Sushant Butta, ath12k; +Cc: linux-wireless
On 6/9/2026 12:18 PM, Sushant Butta wrote:
> This series fixes monitor-mode meta data handling in ath12k and trims dead code:
>
> Monitor mode delivers raw 802.11 frames should not set RX_FLAG_8023 flag,
> and populate peer/link metadata in ieee80211_rx_status for monitor MSDUs.
>
> Sushant Butta (2):
> wifi: ath12k: Skip setting RX_FLAG_8023 for Ethernet-II (DIX) frames
> in monitor mode
> wifi: ath12k: Skip peer link info update in rx_status for monitor
> MSDUs
>
> drivers/net/wireless/ath/ath12k/dp_mon.c | 70 +------------------
> drivers/net/wireless/ath/ath12k/dp_mon.h | 4 +-
> .../net/wireless/ath/ath12k/wifi7/dp_mon.c | 7 +-
> 3 files changed, 4 insertions(+), 77 deletions(-)
>
>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling
2026-06-09 6:48 [PATCH ath-next 0/2] wifi: ath12k: correct monitor-mode RX metadata handling Sushant Butta
` (3 preceding siblings ...)
2026-06-29 4:14 ` Rameshkumar Sundaram
@ 2026-06-30 21:26 ` Jeff Johnson
4 siblings, 0 replies; 6+ messages in thread
From: Jeff Johnson @ 2026-06-30 21:26 UTC (permalink / raw)
To: ath12k, Sushant Butta; +Cc: linux-wireless
On Tue, 09 Jun 2026 12:18:54 +0530, Sushant Butta wrote:
> This series fixes monitor-mode meta data handling in ath12k and trims dead code:
>
> Monitor mode delivers raw 802.11 frames should not set RX_FLAG_8023 flag,
> and populate peer/link metadata in ieee80211_rx_status for monitor MSDUs.
>
> Sushant Butta (2):
> wifi: ath12k: Skip setting RX_FLAG_8023 for Ethernet-II (DIX) frames
> in monitor mode
> wifi: ath12k: Skip peer link info update in rx_status for monitor
> MSDUs
>
> [...]
Applied, thanks!
[1/2] wifi: ath12k: Skip setting RX_FLAG_8023 for Ethernet-II (DIX) frames in monitor mode
commit: 5a2b5d6a5a4a19b86d1c0698a3eb3d21f0b06401
[2/2] wifi: ath12k: Skip peer link info update in rx_status for monitor MSDUs
commit: 56f8f12c1a3c5312de0d7312b229d7bca03dbb81
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread