]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath12k: fix incorrect HT/VHT/HE/EHT MCS reporting in monitor mode
authorKwan Lai Chee Hou <laicheehou9@gmail.com>
Thu, 7 May 2026 01:53:35 +0000 (09:53 +0800)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 1 Jun 2026 16:58:03 +0000 (09:58 -0700)
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

Fixes: 5393dcb45209 ("wifi: ath12k: change the status update in the monitor Rx")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220864
Signed-off-by: Kwan Lai Chee Hou <laicheehou9@gmail.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260507015336.14636-1-laicheehou9@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_mon.c

index 737287a9aa4629cb4def348e23ef8616cc424044..44c5cff75f16959515327365476cf8f0c6f8c074 100644 (file)
@@ -115,13 +115,14 @@ ath12k_dp_mon_fill_rx_rate(struct ath12k_pdev_dp *dp_pdev,
        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) {
                        struct ath12k *ar = ath12k_pdev_dp_to_ar(dp_pdev);
@@ -471,13 +472,10 @@ void ath12k_dp_mon_update_radiotap(struct ath12k_pdev_dp *dp_pdev,
                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 {
                struct ath12k *ar;