]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath12k: use different packet offset for WCN7850
authorKang Yang <kang.yang@oss.qualcomm.com>
Mon, 21 Apr 2025 02:34:43 +0000 (10:34 +0800)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Fri, 16 May 2025 19:38:56 +0000 (12:38 -0700)
In ath12k_dp_mon_rx_merg_msdus(), will set packet offset to 8. This is a
right value for QCN9274.

But WCN7850 use different hardware rings for monitor mode because it
doesn't have RX MON component. So the packet offset is different. With
current offset, upper-layer application will failed to parse the payload
correctly.

Should use different value for those who don't have RX MON component.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: Kang Yang <kang.yang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250421023444.1778-13-kang.yang@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_mon.c

index 7e0dc4d0327cfe73c333f6d48be7571e53af970e..28cadc4167f7875e56eb80407b35cb97d4b19ad2 100644 (file)
@@ -1948,6 +1948,24 @@ ath12k_dp_mon_fill_rx_rate(struct ath12k *ar,
        }
 }
 
+static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k *ar,
+                                              struct sk_buff *head_msdu,
+                                              struct sk_buff *tail_msdu)
+{
+       u32 rx_pkt_offset, l2_hdr_offset, total_offset;
+
+       rx_pkt_offset = ar->ab->hal.hal_desc_sz;
+       l2_hdr_offset =
+               ath12k_dp_rx_h_l3pad(ar->ab, (struct hal_rx_desc *)tail_msdu->data);
+
+       if (ar->ab->hw_params->rxdma1_enable)
+               total_offset = ATH12K_MON_RX_PKT_OFFSET;
+       else
+               total_offset = rx_pkt_offset + l2_hdr_offset;
+
+       skb_pull(head_msdu, total_offset);
+}
+
 static struct sk_buff *
 ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
                            struct dp_mon_mpdu *mon_mpdu,
@@ -1956,7 +1974,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
 {
        struct ath12k_base *ab = ar->ab;
        struct sk_buff *msdu, *mpdu_buf, *prev_buf, *head_frag_list;
-       struct sk_buff *head_msdu;
+       struct sk_buff *head_msdu, *tail_msdu;
        struct hal_rx_desc *rx_desc;
        u8 *hdr_desc, *dest, decap_format = mon_mpdu->decap_format;
        struct ieee80211_hdr_3addr *wh;
@@ -1966,8 +1984,9 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
 
        mpdu_buf = NULL;
        head_msdu = mon_mpdu->head;
+       tail_msdu = mon_mpdu->tail;
 
-       if (!head_msdu)
+       if (!head_msdu || !tail_msdu)
                goto err_merge_fail;
 
        ath12k_dp_mon_fill_rx_stats_info(ar, ppdu_info, rxs);
@@ -1995,14 +2014,14 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
        ath12k_dp_mon_fill_rx_rate(ar, ppdu_info, rxs);
 
        if (decap_format == DP_RX_DECAP_TYPE_RAW) {
-               skb_pull(head_msdu, ATH12K_MON_RX_PKT_OFFSET);
+               ath12k_dp_mon_rx_msdus_set_payload(ar, head_msdu, tail_msdu);
 
                prev_buf = head_msdu;
                msdu = head_msdu->next;
                head_frag_list = NULL;
 
                while (msdu) {
-                       skb_pull(msdu, ATH12K_MON_RX_PKT_OFFSET);
+                       ath12k_dp_mon_rx_msdus_set_payload(ar, head_msdu, tail_msdu);
 
                        if (!head_frag_list)
                                head_frag_list = msdu;
@@ -2037,7 +2056,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
                msdu = head_msdu;
 
                while (msdu) {
-                       skb_pull(msdu, ATH12K_MON_RX_PKT_OFFSET);
+                       ath12k_dp_mon_rx_msdus_set_payload(ar, head_msdu, tail_msdu);
                        if (qos_pkt) {
                                dest = skb_push(msdu, sizeof(__le16));
                                if (!dest)