]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath12k: fix struct hal_rx_ppdu_start
authorKang Yang <quic_kangyang@quicinc.com>
Tue, 22 Oct 2024 11:08:26 +0000 (19:08 +0800)
committerJeff Johnson <quic_jjohnson@quicinc.com>
Wed, 23 Oct 2024 17:16:00 +0000 (10:16 -0700)
Current struct hal_rx_ppdu_start in hal_rx.h is not matched with
hardware descriptor definition. This hardware descriptor definition
is determined by hardware. Host shall follow it.

So update struct hal_rx_ppdu_start and related code.

Both QCN9274 and WCN7850 need this modification.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1

Signed-off-by: Kang Yang <quic_kangyang@quicinc.com>
Link: https://patch.msgid.link/20241022110831.974-4-quic_kangyang@quicinc.com
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c
drivers/net/wireless/ath/ath12k/dp_mon.c
drivers/net/wireless/ath/ath12k/hal_rx.h

index 8833c83d02920bdb0f6c590695f382a13ada8f07..3bf31ee5b9fa4722a54e2b866c1ce0eb049eef15 100644 (file)
@@ -95,6 +95,14 @@ static inline enum wme_ac ath12k_tid_to_ac(u32 tid)
                WME_AC_VO);
 }
 
+static inline u64 ath12k_le32hilo_to_u64(__le32 hi, __le32 lo)
+{
+       u64 hi64 = le32_to_cpu(hi);
+       u64 lo64 = le32_to_cpu(lo);
+
+       return (hi64 << 32) | lo64;
+}
+
 enum ath12k_skb_flags {
        ATH12K_SKB_HW_80211_ENCAP = BIT(0),
        ATH12K_SKB_CIPHER_SET = BIT(1),
index 799b865b89e54df77b7afcf05b10660b24bdc0e2..c9980c0193d1d78c0a0796cf99f7390fadfc7b3a 100644 (file)
@@ -2542,14 +2542,6 @@ ath12k_htt_print_pdev_obss_pd_stats_tlv(const void *tag_buf, u16 tag_len,
        stats_req->buf_len = len;
 }
 
-static u64 ath12k_le32hilo_to_u64(__le32 hi, __le32 lo)
-{
-       u64 hi64 = le32_to_cpu(hi);
-       u64 lo64 = le32_to_cpu(lo);
-
-       return (hi64 << 32) | lo64;
-}
-
 static void
 ath12k_htt_print_dmac_reset_stats_tlv(const void *tag_buf, u16 tag_len,
                                      struct debug_htt_stats_req *stats_req)
index 6174a612102039446387f47e66137f37f0de6bb3..7d01c0021f8f5d1f85481607ba3e5b7962e9c988 100644 (file)
@@ -590,12 +590,20 @@ ath12k_dp_mon_rx_parse_status_tlv(struct ath12k_base *ab,
                struct hal_rx_ppdu_start *ppdu_start =
                        (struct hal_rx_ppdu_start *)tlv_data;
 
+               u64 ppdu_ts = ath12k_le32hilo_to_u64(ppdu_start->ppdu_start_ts_63_32,
+                                                    ppdu_start->ppdu_start_ts_31_0);
+
                info[0] = __le32_to_cpu(ppdu_start->info0);
 
-               ppdu_info->ppdu_id =
-                       u32_get_bits(info[0], HAL_RX_PPDU_START_INFO0_PPDU_ID);
-               ppdu_info->chan_num = __le32_to_cpu(ppdu_start->chan_num);
-               ppdu_info->ppdu_ts = __le32_to_cpu(ppdu_start->ppdu_start_ts);
+               ppdu_info->ppdu_id = u32_get_bits(info[0],
+                                                 HAL_RX_PPDU_START_INFO0_PPDU_ID);
+
+               info[1] = __le32_to_cpu(ppdu_start->info1);
+               ppdu_info->chan_num = u32_get_bits(info[1],
+                                                  HAL_RX_PPDU_START_INFO1_CHAN_NUM);
+               ppdu_info->freq = u32_get_bits(info[1],
+                                              HAL_RX_PPDU_START_INFO1_CHAN_FREQ);
+               ppdu_info->ppdu_ts = ppdu_ts;
 
                if (ppdu_info->ppdu_id != ppdu_info->last_ppdu_id) {
                        ppdu_info->last_ppdu_id = ppdu_info->ppdu_id;
index 837ba4adba88be6d38a48416bc38330961feb405..6ab33d5f1b2ac4ad28a15f065aabaa03ab2ea11f 100644 (file)
@@ -156,6 +156,7 @@ struct hal_rx_mon_ppdu_info {
        u32 preamble_type;
        u32 mpdu_len;
        u16 chan_num;
+       u16 freq;
        u16 tcp_msdu_count;
        u16 tcp_ack_msdu_count;
        u16 udp_msdu_count;
@@ -232,12 +233,16 @@ struct hal_rx_mon_ppdu_info {
        u8 medium_prot_type;
 };
 
-#define HAL_RX_PPDU_START_INFO0_PPDU_ID                GENMASK(15, 0)
+#define HAL_RX_PPDU_START_INFO0_PPDU_ID                        GENMASK(15, 0)
+#define HAL_RX_PPDU_START_INFO1_CHAN_NUM               GENMASK(15, 0)
+#define HAL_RX_PPDU_START_INFO1_CHAN_FREQ              GENMASK(31, 16)
 
 struct hal_rx_ppdu_start {
        __le32 info0;
-       __le32 chan_num;
-       __le32 ppdu_start_ts;
+       __le32 info1;
+       __le32 ppdu_start_ts_31_0;
+       __le32 ppdu_start_ts_63_32;
+       __le32 rsvd[2];
 } __packed;
 
 #define HAL_RX_PPDU_END_USER_STATS_INFO0_MPDU_CNT_FCS_ERR      GENMASK(26, 16)