wifi: ath12k: fix incorrect HT/VHT/HE/EHT MCS reporting in monitor mode
PATCH v3 1/1 wifi: ath12k: fix incorrect HT/VHT/HE/EHT MCS reporting in monitor mode
From: Kwan Lai Chee Hou <[email protected]>
In monitor mode, the driver incorrectly assigns the legacy rate to the rate_idx field of the radiotap header for HT/VHT/HE/EHT frames, ignoring the actual MCS value parsed from the hardware.
This causes packet analyzers (like Wireshark) to display incorrect MCS values (e.g., legacy base rates instead of the true MCS).
Fix this by assigning ppdu_info->mcs as the default rate_mcs in ath12k_dp_mon_fill_rx_rate(), and remove rate_idx assignments in ath12k_dp_mon_update_radiotap() to preserve
the previously calculated MCS values (including the HT NSS offset).
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ
---
v3:
- Simplify rate_mcs assignment logic in ath12k_dp_mon_fill_rx_rate.
- remove rate_idx assignments in ath12k_dp_mon_update_radiotap to avoid overwriting the HT (802.11n) MCS calculated earlier.
v2: Fix indentation and formatting issues in v1.
--- drivers/net/wireless/ath/ath12k/dp_mon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath12k/dp_mon.c +2 -4
@@ -1910,13 +1910,14 @@ ath12k_dp_mon_fill_rx_rate(struct ath12k *ar,bool is_cck; pkt_type = ppdu_info->preamble_type; - rate_mcs = ppdu_info->rate; + rate_mcs = ppdu_info->mcs; nss = ppdu_info->nss; sgi = ppdu_info->gi;switch (pkt_type) {case RX_MSDU_START_PKT_TYPE_11A :case RX_MSDU_START_PKT_TYPE_11B : + rate_mcs = ppdu_info->rate; is_cck = (pkt_type ==RX_MSDU_START_PKT_TYPE_11B );if (rx_status->band <NUM_NL80211_BANDS ) { sband = &ar->mac.sbands[rx_status->band];
@@ -2259,13 +2260,10 @@ static void ath12k_dp_mon_update_radiotap(struct ath12k *ar, rxs->encoding =RX_ENC_HE ; ptr =skb_push (mon_skb,sizeof (struct ieee80211_radiotap_he ));ath12k_dp_mon_rx_update_radiotap_he (ppduinfo, ptr); - rxs->rate_idx = ppduinfo->rate; }else if (ppduinfo->vht_flags) { rxs->encoding =RX_ENC_VHT ; - rxs->rate_idx = ppduinfo->rate; }else if (ppduinfo->ht_flags) { rxs->encoding =RX_ENC_HT ; - rxs->rate_idx = ppduinfo->rate; }else { rxs->encoding =RX_ENC_LEGACY ; sband = &ar->mac.sbands[rxs->band];
Signature · 1 line
2.34.1
Quoted 9 lines · On 5/7/2026 9:53 AM, kwan1996 wrote:
From: Kwan Lai Chee Hou <[email protected]>
In monitor mode, the driver incorrectly assigns the legacy rate to the
rate_idxfield of the radiotap header for HT/VHT/HE/EHT frames, ignoring the actual MCS value parsed from the hardware.This causes packet analyzers (like Wireshark) to display incorrect MCS values (e.g., legacy base rates instead of the true MCS).
Quoted 9 lines
Fix this by assigning
ppdu_info->mcsas the defaultrate_mcsinath12k_dp_mon_fill_rx_rate(), and removerate_idxassignments inath12k_dp_mon_update_radiotap()to preserve
the previously calculated MCS values (including the HT NSS offset).Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ
Quoted 36 lines
Signed-off-by Kwan Lai Chee Hou <[email protected]>---
v3:
- Simplifyrate_mcsassignment logic inath12k_dp_mon_fill_rx_rate.
- removerate_idxassignments inath12k_dp_mon_update_radiotapto avoid overwriting the HT (802.11n) MCS calculated earlier.v2: Fix indentation and formatting issues in v1.
--- drivers/net/wireless/ath/ath12k/dp_mon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/net/wireless/ath/ath12k/dp_mon.c +2
-1@@ -1910,13 +1910,14 @@ ath12k_dp_mon_fill_rx_rate(struct ath12k *ar,bool is_cck; pkt_type = ppdu_info->preamble_type; - rate_mcs = ppdu_info->rate; + rate_mcs = ppdu_info->mcs; nss = ppdu_info->nss; sgi = ppdu_info->gi;switch (pkt_type) {case RX_MSDU_START_PKT_TYPE_11A :case RX_MSDU_START_PKT_TYPE_11B : + rate_mcs = ppdu_info->rate; is_cck = (pkt_type ==RX_MSDU_START_PKT_TYPE_11B );if (rx_status->band <NUM_NL80211_BANDS ) { sband = &ar->mac.sbands[rx_status->band];@@ -2259,13 +2260,10 @@ static void ath12k_dp_mon_update_radiotap(struct ath12k *ar, rxs->encoding =RX_ENC_HE ; ptr =skb_push (mon_skb,sizeof (struct ieee80211_radiotap_he ));ath12k_dp_mon_rx_update_radiotap_he (ppduinfo, ptr);
drivers/net/wireless/ath/ath12k/dp_mon.c static void ath12k_dp_mon_update_radiotap(struct ath12k *ar, · line 2269
Quoted 10 lines
drivers/net/wireless/ath/ath12k/dp_mon.c +0
-3- rxs->rate_idx = ppduinfo->rate; }else if (ppduinfo->vht_flags) { rxs->encoding =RX_ENC_VHT ; - rxs->rate_idx = ppduinfo->rate; }else if (ppduinfo->ht_flags) { rxs->encoding =RX_ENC_HT ; - rxs->rate_idx = ppduinfo->rate; }else { rxs->encoding =RX_ENC_LEGACY ; sband = &ar->mac.sbands[rxs->band];
Quoted 14 lines · On 5/7/2026 7:23 AM, kwan1996 wrote:
From: Kwan Lai Chee Hou <[email protected]>
In monitor mode, the driver incorrectly assigns the legacy rate to the
rate_idxfield of the radiotap header for HT/VHT/HE/EHT frames, ignoring the actual MCS value parsed from the hardware.This causes packet analyzers (like Wireshark) to display incorrect MCS values (e.g., legacy base rates instead of the true MCS).
Fix this by assigning
ppdu_info->mcsas the defaultrate_mcsinath12k_dp_mon_fill_rx_rate(), and removerate_idxassignments inath12k_dp_mon_update_radiotap()to preserve
the previously calculated MCS values (including the HT NSS offset).
Quoted 5 lines
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ
Signed-off-by Kwan Lai Chee Hou <[email protected]>
Jeff Johnson
AppliedQuoted 8 lines · On Thu, 07 May 2026 09:53:35 +0800, kwan1996 wrote:
In monitor mode, the driver incorrectly assigns the legacy rate to the
rate_idxfield of the radiotap header for HT/VHT/HE/EHT frames, ignoring the actual MCS value parsed from the hardware.This causes packet analyzers (like Wireshark) to display incorrect MCS values (e.g., legacy base rates instead of the true MCS).
[...]
Applied, thanks!
[1/1] wifi: ath12k: fix incorrect HT/VHT/HE/EHT MCS reporting in monitor mode
commit: 10085a654a4c2331d5f0cdc20bfc839a49fbb886
Best regards,
Signature · 1 line
Jeff Johnson <[email protected]>