From 7f2b1c3dfa1e5aabcb82567d0315d9107edf73b6 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Sat, 9 Mar 2024 11:31:54 -0500 Subject: [PATCH] ath11k_nss: Revert setting fw_mem_mode for IPQ807x Leave it set to '0', as it will kernel panic with 2K skb patch. This flag was incorrectly assumed to save memory on 1G platforms. ath11k_nss: remove leftover max_tx_ring it was not removed when applying patch to replace it with 'max_tx_ring = DP_TCL_NUM_RING_MAX +1' ath11k_nss: Import bugfix patches ath11k_nss: Experimental build for IPQ6018 This will require setting the correct `ATH11K_MEM_PROFILE_XXX` for your platform. Setting it to value lower/higher than physically available will cause NULL virtual address kernel panics. I believe this setting was not originally meant to reduce memory footprint of 1G+ platforms, but to account for platforms that were 512M or less. Will require tweaking to allow for the old behvaior on 1G+ IPQ807x, while still saving memory for platforms <= 512M. --- ...207-ath11k-Enable-256_512MB-profiles.patch | 41 +- ...11k-Disable-rx_header-tlv-for-2K-SKB.patch | 1016 +++++++++++++++++ ...pport-for-WDS-offload-in-NSS-offload.patch | 24 +- ...-dynamic-VLAN-support-in-NSS-offload.patch | 16 +- ...ow-fast-rx-by-bypassing-stats-update.patch | 4 +- ...ow-fast-rx-by-bypassing-stats-update.patch | 46 +- .../nss/ath11k/244-ath11k-dp-tx-perf.patch | 26 +- .../300-ath11k-nss-mesh-offload-support.patch | 20 +- ...lookup-failure-in-mgmt-tx-completion.patch | 2 +- ...e-free-of-peer-rx_tid-during-reo-cmd.patch | 2 +- ...TCL_DATA_CMD_INFO2_TID_OVERWRITE-con.patch | 2 +- ...ing-rx-stats-with-monitor-vif-enable.patch | 8 +- ...1k-skip-status-ring-entry-processing.patch | 8 +- ...356-ath11k-invalid-desc-sanity-check.patch | 6 +- ...-fix-tkip-encryption-traffic-failure.patch | 2 +- ...Fix-ppdu_id-from-firmware-PPDU-stats.patch | 8 +- ...Add-retry-mechanism-for-update_rx_qu.patch | 18 +- ...ix-mutex-dead-lock-and-q6-dump-crash.patch | 59 + ...agement-frames-to-firmware-before-wa.patch | 43 + ...th11k-Advertise-TX_QUEUE-mac-hw-flag.patch | 2 +- ...oid-memset-of-ppdu-info-for-next-skb.patch | 6 +- ...a_map_single-to-virt_to_phys-in-rx-r.patch | 66 ++ ...11k-remove-invalid-peer-create-logic.patch | 4 +- ...th11k-rename-ath11k_start_vdev_delay.patch | 2 +- ...ation-of-ath11k_mac_start_vdev_delay.patch | 2 +- ...ailure-due-to-unexpected-peer-delete.patch | 16 +- ...k-make-debugfs-sta-htt-stats-modular.patch | 8 +- .../999-336-0002-ath11k-Use-idr_replace.patch | 264 +++++ 28 files changed, 1601 insertions(+), 120 deletions(-) create mode 100644 package/kernel/mac80211/patches/nss/ath11k/233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch create mode 100644 package/kernel/mac80211/patches/nss/ath11k/401-ath11k-Fix-mutex-dead-lock-and-q6-dump-crash.patch create mode 100644 package/kernel/mac80211/patches/nss/ath11k/453-ath11k-flush-management-frames-to-firmware-before-wa.patch create mode 100644 package/kernel/mac80211/patches/nss/ath11k/669-ath11k-change-dma_map_single-to-virt_to_phys-in-rx-r.patch create mode 100644 package/kernel/mac80211/patches/nss/ath11k/999-336-0002-ath11k-Use-idr_replace.patch diff --git a/package/kernel/mac80211/patches/nss/ath11k/207-ath11k-Enable-256_512MB-profiles.patch b/package/kernel/mac80211/patches/nss/ath11k/207-ath11k-Enable-256_512MB-profiles.patch index d89b500015fc33..75e0bf1b79b844 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/207-ath11k-Enable-256_512MB-profiles.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/207-ath11k-Enable-256_512MB-profiles.patch @@ -228,15 +228,6 @@ Signed-off-by: Ramya Gnanasekar static struct ath11k_hw_params ath11k_hw_params[] = { { .hw_rev = ATH11K_HW_IPQ8074, -@@ -95,7 +97,7 @@ static struct ath11k_hw_params ath11k_hw - .coldboot_cal_mm = false, - .coldboot_cal_ftm = false, - .cbcal_restart_fw = true, -- .fw_mem_mode = 0, -+ .fw_mem_mode = ATH11K_QMI_TARGET_MEM_MODE, - .num_vdevs = 16 + 1, - .num_peers = 512, - .supports_suspend = false, @@ -127,6 +129,7 @@ static struct ath11k_hw_params ath11k_hw .tcl_ring_retry = true, .tx_ring_size = DP_TCL_DATA_RING_SIZE, @@ -254,7 +245,15 @@ Signed-off-by: Ramya Gnanasekar .num_vdevs = 16 + 1, .num_peers = 512, .supports_suspend = false, -@@ -259,7 +262,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -210,6 +213,7 @@ static struct ath11k_hw_params ath11k_hw + .tx_ring_size = DP_TCL_DATA_RING_SIZE, + .smp2p_wow_exit = false, + .support_fw_mac_sequence = false, ++ .num_vdevs_peers = ath11k_vdevs_peers, + }, + { + .name = "qca6390 hw2.0", +@@ -259,7 +263,7 @@ static struct ath11k_hw_params ath11k_hw .coldboot_cal_mm = false, .coldboot_cal_ftm = false, .cbcal_restart_fw = false, @@ -263,7 +262,7 @@ Signed-off-by: Ramya Gnanasekar .num_vdevs = 16 + 1, .num_peers = 512, .supports_suspend = true, -@@ -426,7 +429,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -426,7 +430,7 @@ static struct ath11k_hw_params ath11k_hw .coldboot_cal_mm = false, .coldboot_cal_ftm = false, .cbcal_restart_fw = false, @@ -272,7 +271,7 @@ Signed-off-by: Ramya Gnanasekar .num_vdevs = 16 + 1, .num_peers = 512, .supports_suspend = true, -@@ -462,6 +465,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -462,6 +466,7 @@ static struct ath11k_hw_params ath11k_hw .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = true, @@ -280,7 +279,7 @@ Signed-off-by: Ramya Gnanasekar }, { .name = "wcn6855 hw2.1", -@@ -509,7 +513,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -509,7 +514,7 @@ static struct ath11k_hw_params ath11k_hw .coldboot_cal_mm = false, .coldboot_cal_ftm = false, .cbcal_restart_fw = false, @@ -289,7 +288,7 @@ Signed-off-by: Ramya Gnanasekar .num_vdevs = 16 + 1, .num_peers = 512, .supports_suspend = true, -@@ -545,6 +549,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -545,6 +550,7 @@ static struct ath11k_hw_params ath11k_hw .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = true, @@ -297,7 +296,7 @@ Signed-off-by: Ramya Gnanasekar }, { .name = "wcn6750 hw1.0", -@@ -593,7 +598,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -593,7 +599,7 @@ static struct ath11k_hw_params ath11k_hw .coldboot_cal_mm = true, .coldboot_cal_ftm = true, .cbcal_restart_fw = false, @@ -306,7 +305,15 @@ Signed-off-by: Ramya Gnanasekar .num_vdevs = 16 + 1, .num_peers = 512, .supports_suspend = false, -@@ -672,7 +677,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -626,6 +632,7 @@ static struct ath11k_hw_params ath11k_hw + .tx_ring_size = DP_TCL_DATA_RING_SIZE_WCN6750, + .smp2p_wow_exit = true, + .support_fw_mac_sequence = true, ++ .num_vdevs_peers = ath11k_vdevs_peers, + }, + { + .hw_rev = ATH11K_HW_IPQ5018_HW10, +@@ -672,7 +679,7 @@ static struct ath11k_hw_params ath11k_hw .supports_monitor = false, .supports_sta_ps = false, .supports_shadow_regs = false, @@ -315,7 +322,7 @@ Signed-off-by: Ramya Gnanasekar .num_vdevs = 16 + 1, .num_peers = 512, .supports_regdb = false, -@@ -707,6 +712,22 @@ static struct ath11k_hw_params ath11k_hw +@@ -707,6 +714,22 @@ static struct ath11k_hw_params ath11k_hw .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = false, diff --git a/package/kernel/mac80211/patches/nss/ath11k/233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch b/package/kernel/mac80211/patches/nss/ath11k/233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch new file mode 100644 index 00000000000000..7b7673953bd4fe --- /dev/null +++ b/package/kernel/mac80211/patches/nss/ath11k/233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch @@ -0,0 +1,1016 @@ +From 30f54666ae15128f26fbad787a35253885a10513 Mon Sep 17 00:00:00 2001 +From: Ramya Gnanasekar +Date: Fri, 25 Dec 2020 16:11:06 +0530 +Subject: [PATCH] ath11k: Disable rx_header tlv for 2K SKB + +On low memory platform hdr_status in hal_rx_desc is not subscribed to +get a savings of 128bytes in skb. This is required to reduce the skb +size from 4K to 2K. Use HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message +to unsubscribe rx_pkt_header tlv for rxdma ring. + +Signed-off-by: Ramya Gnanasekar + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -668,6 +668,7 @@ static ssize_t ath11k_write_extd_rx_stat + } + + ar->debug.rx_filter = tlv_filter.rx_filter; ++ tlv_filter.offset_valid = false; + + for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { + ring_id = ar->dp.rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; +@@ -1129,6 +1130,7 @@ static ssize_t ath11k_write_pktlog_filte + } + + /* Clear rx filter set for monitor mode and rx status */ ++ tlv_filter.offset_valid = false; + for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { + ring_id = ar->dp.rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; + ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, ar->dp.mac_id, +--- a/drivers/net/wireless/ath/ath11k/dp.h ++++ b/drivers/net/wireless/ath/ath11k/dp.h +@@ -219,7 +219,8 @@ struct ath11k_pdev_dp { + #define DP_REO_CMD_RING_SIZE 256 + #define DP_REO_STATUS_RING_SIZE 2048 + #define DP_RXDMA_BUF_RING_SIZE 4096 +-#define DP_RXDMA_REFILL_RING_SIZE 2048 ++#define DP_RXDMA_REFILL_RING_SIZE ATH11K_DP_RXDMA_REFILL_RING_SIZE ++#define DP_RXDMA_NSS_REFILL_RING_SIZE ATH11K_DP_RXDMA_NSS_REFILL_RING_SIZE + #define DP_RXDMA_ERR_DST_RING_SIZE 1024 + #define DP_RXDMA_MON_STATUS_RING_SIZE ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE + #define DP_RXDMA_MONITOR_BUF_RING_SIZE ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE +@@ -648,7 +649,7 @@ enum htt_stats_internal_ppdu_frametype { + * + * |31 26|25|24|23 16|15 8|7 0| + * |-----------------+----------------+----------------+---------------| +- * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type | ++ * | rsvd1|OV|PS|SS| ring_id | pdev_id | msg_type | + * |-------------------------------------------------------------------| + * | rsvd2 | ring_buffer_size | + * |-------------------------------------------------------------------| +@@ -662,6 +663,14 @@ enum htt_stats_internal_ppdu_frametype { + * |-------------------------------------------------------------------| + * | tlv_filter_in_flags | + * |-------------------------------------------------------------------| ++ * | rx_header_offset | rx_packet_offset | ++ * |-------------------------------------------------------------------| ++ * | rx_mpdu_start_offset | rx_mpdu_end_offset | ++ * |-------------------------------------------------------------------| ++ * | rx_msdu_start_offset | rx_msdu_end_offset | ++ * |-------------------------------------------------------------------| ++ * | rsvd3 | rx_attention_offset | ++ * |-------------------------------------------------------------------| + * Where: + * PS = pkt_swap + * SS = status_swap +@@ -675,7 +684,10 @@ enum htt_stats_internal_ppdu_frametype { + * More details can be got from enum htt_srng_ring_id + * b'24 - status_swap: 1 is to swap status TLV + * b'25 - pkt_swap: 1 is to swap packet TLV +- * b'26:31 - rsvd1: reserved for future use ++ * b'26 - rx_offset_valid (OV): flag to indicate rx offsets ++ * configuration fields are valid ++ * ++ * b'27:31 - rsvd1: reserved for future use + * dword1 - b'0:16 - ring_buffer_size: size of buffers referenced by rx ring, + * in byte units. + * Valid only for HW_TO_SW_RING and SW_TO_HW_RING +@@ -704,6 +716,42 @@ enum htt_stats_internal_ppdu_frametype { + * dword6 - b'0:31 - tlv_filter_in_flags: + * Filter in Attention/MPDU/PPDU/Header/User tlvs + * Refer to CFG_TLV_FILTER_IN_FLAG defs ++ * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_1 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rx_header_offset: rx_header_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_1 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_2 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_2 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_3 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_3 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units ++ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING ++ * A value of 0 will be considered as ignore this config. ++ * Refer to BUF_RING_CFG_4 defs within HW .h files, ++ * e.g. wmac_top_reg_seq_hwioreg.h ++ * - b'16:31 - rsvd3 for future use + */ + + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_MSG_TYPE GENMASK(7, 0) +@@ -711,8 +759,16 @@ enum htt_stats_internal_ppdu_frametype { + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_RING_ID GENMASK(23, 16) + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_SS BIT(24) + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PS BIT(25) ++#define HTT_RX_RING_SELECTION_CFG_CMD_OFFSET_VALID BIT(26) + + #define HTT_RX_RING_SELECTION_CFG_CMD_INFO1_BUF_SIZE GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET GENMASK(31, 16) ++#define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET GENMASK(31, 16) ++#define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET GENMASK(15, 0) ++#define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET GENMASK(31, 16) ++#define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET GENMASK(15, 0) + + enum htt_rx_filter_tlv_flags { + HTT_RX_FILTER_TLV_FLAGS_MPDU_START = BIT(0), +@@ -1016,6 +1072,14 @@ enum htt_rx_data_pkt_filter_tlv_flasg3 { + HTT_RX_FILTER_TLV_FLAGS_PER_MSDU_HEADER | \ + HTT_RX_FILTER_TLV_FLAGS_ATTENTION) + ++#define HTT_RX_RXDMA_FILTER_TLV_FLAGS_BUF_RING \ ++ (HTT_RX_FILTER_TLV_FLAGS_MPDU_START | \ ++ HTT_RX_FILTER_TLV_FLAGS_MSDU_START | \ ++ HTT_RX_FILTER_TLV_FLAGS_RX_PACKET | \ ++ HTT_RX_FILTER_TLV_FLAGS_MSDU_END | \ ++ HTT_RX_FILTER_TLV_FLAGS_MPDU_END | \ ++ HTT_RX_FILTER_TLV_FLAGS_ATTENTION) ++ + struct htt_rx_ring_selection_cfg_cmd { + u32 info0; + u32 info1; +@@ -1024,6 +1088,10 @@ struct htt_rx_ring_selection_cfg_cmd { + u32 pkt_type_en_flags2; + u32 pkt_type_en_flags3; + u32 rx_filter_tlv; ++ u32 rx_packet_offset; ++ u32 rx_mpdu_offset; ++ u32 rx_msdu_offset; ++ u32 rx_attn_offset; + } __packed; + + struct htt_rx_ring_tlv_filter { +@@ -1032,6 +1100,14 @@ struct htt_rx_ring_tlv_filter { + u32 pkt_filter_flags1; /* MGMT */ + u32 pkt_filter_flags2; /* CTRL */ + u32 pkt_filter_flags3; /* DATA */ ++ bool offset_valid; ++ u16 rx_packet_offset; ++ u16 rx_header_offset; ++ u16 rx_mpdu_end_offset; ++ u16 rx_mpdu_start_offset; ++ u16 rx_msdu_end_offset; ++ u16 rx_msdu_start_offset; ++ u16 rx_attn_offset; + }; + + #define HTT_RX_FULL_MON_MODE_CFG_CMD_INFO0_MSG_TYPE GENMASK(7, 0) +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -70,6 +70,12 @@ static inline bool ath11k_dp_rx_h_mpdu_s + return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); + } + ++static u16 ath11k_dp_rxdesc_get_mpdu_frame_ctrl(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) ++{ ++ return ab->hw_params.hw_ops->rx_desc_get_mpdu_frame_ctl(desc); ++} ++ + static inline bool ath11k_dp_rx_h_mpdu_start_more_frags(struct ath11k_base *ab, + struct sk_buff *skb) + { +@@ -306,6 +312,35 @@ static u8 *ath11k_dp_rxdesc_mpdu_start_a + return ab->hw_params.hw_ops->rx_desc_mpdu_start_addr2(desc); + } + ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static void ath11k_dp_get_rx_header_offset(struct ath11k_base *ab, ++ struct htt_rx_ring_tlv_filter *tlv_filter) ++{ ++ ab->hw_params.hw_ops->rx_desc_get_offset(tlv_filter); ++} ++#endif ++ ++static bool ath11k_dp_rx_desc_dot11_hdr_fields_valid(struct ath11k_base *ab, ++ struct hal_rx_desc *desc) ++{ ++ return ab->hw_params.hw_ops->rx_desc_dot11_hdr_fields_valid(desc); ++} ++ ++static void ath11k_dp_rx_desc_get_dot11_hdr(struct ath11k_base *ab, ++ struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr) ++{ ++ ab->hw_params.hw_ops->rx_desc_get_dot11_hdr(desc, hdr); ++} ++ ++static void ath11k_dp_rx_desc_get_crypto_header(struct ath11k_base *ab, ++ struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype) ++{ ++ ab->hw_params.hw_ops->rx_desc_get_crypto_header(desc, crypto_hdr, enctype); ++} ++ + static void ath11k_dp_service_mon_ring(struct timer_list *t) + { + struct ath11k_base *ab = from_timer(ab, t, mon_reap_timer); +@@ -2134,6 +2169,49 @@ int ath11k_dp_rx_crypto_icv_len(struct a + return 0; + } + ++static void ath11k_get_dot11_hdr_from_rx_desc(struct ath11k *ar, ++ struct sk_buff *msdu, ++ struct ath11k_skb_rxcb *rxcb, ++ struct ieee80211_rx_status *status, ++ enum hal_encrypt_type enctype) ++{ ++ struct hal_rx_desc *rx_desc = rxcb->rx_desc; ++ struct ath11k_base *ab = ar->ab; ++ size_t hdr_len, crypto_len; ++ struct ieee80211_hdr *hdr; ++ u16 fc, qos_ctl = 0; ++ u8 *crypto_hdr; ++ ++ if (!(status->flag & RX_FLAG_IV_STRIPPED)) { ++ crypto_len = ath11k_dp_rx_crypto_param_len(ar, enctype); ++ crypto_hdr = skb_push(msdu, crypto_len); ++ ath11k_dp_rx_desc_get_crypto_header(ab, rx_desc, crypto_hdr, enctype); ++ } ++ ++ fc = ath11k_dp_rxdesc_get_mpdu_frame_ctrl(ab, rx_desc); ++ hdr_len = ieee80211_hdrlen(fc); ++ skb_push(msdu, hdr_len); ++ hdr = (struct ieee80211_hdr *)msdu->data; ++ hdr->frame_control = fc; ++ ++ /* Get wifi header from rx_desc */ ++ ath11k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, hdr); ++ ++ if (rxcb->is_mcbc) ++ status->flag &= ~RX_FLAG_PN_VALIDATED; ++ ++ /* Add QOS header */ ++ if (ieee80211_is_data_qos(hdr->frame_control)) { ++ qos_ctl = rxcb->tid; ++ if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ab, rx_desc)) ++ qos_ctl |= IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT; ++ ++ /* TODO Add other QoS ctl fields when required */ ++ memcpy(msdu->data + (hdr_len - IEEE80211_QOS_CTL_LEN), ++ &qos_ctl, IEEE80211_QOS_CTL_LEN); ++ } ++} ++ + static void ath11k_dp_rx_h_undecap_nwifi(struct ath11k *ar, + struct sk_buff *msdu, + u8 *first_hdr, +@@ -2147,7 +2225,8 @@ static void ath11k_dp_rx_h_undecap_nwifi + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + u16 qos_ctl = 0; +- u8 *qos; ++ u8 *qos, *crypto_hdr; ++ bool add_qos_ctrl = false; + + /* copy SA & DA and pull decapped header */ + hdr = (struct ieee80211_hdr *)msdu->data; +@@ -2156,7 +2235,7 @@ static void ath11k_dp_rx_h_undecap_nwifi + ether_addr_copy(sa, ieee80211_get_SA(hdr)); + skb_pull(msdu, ieee80211_hdrlen(hdr->frame_control)); + +- if (rxcb->is_first_msdu) { ++ if (rxcb->is_first_msdu && first_hdr) { + /* original 802.11 header is valid for the first msdu + * hence we can reuse the same header + */ +@@ -2186,16 +2265,23 @@ static void ath11k_dp_rx_h_undecap_nwifi + + /* copy decap header before overwriting for reuse below */ + memcpy(decap_hdr, (uint8_t *)hdr, hdr_len); ++ add_qos_ctrl = true; + } + + if (!(status->flag & RX_FLAG_IV_STRIPPED)) { +- memcpy(skb_push(msdu, +- ath11k_dp_rx_crypto_param_len(ar, enctype)), +- (void *)hdr + hdr_len, +- ath11k_dp_rx_crypto_param_len(ar, enctype)); ++ if (first_hdr) { ++ memcpy(skb_push(msdu, ++ ath11k_dp_rx_crypto_param_len(ar, enctype)), ++ (void *)hdr + hdr_len, ++ ath11k_dp_rx_crypto_param_len(ar, enctype)); ++ } else { ++ crypto_hdr = skb_push(msdu, ath11k_dp_rx_crypto_param_len(ar, enctype)); ++ ath11k_dp_rx_desc_get_crypto_header(ar->ab, ++ rxcb->rx_desc, crypto_hdr, enctype); ++ } + } + +- if (!rxcb->is_first_msdu) { ++ if (!rxcb->is_first_msdu || add_qos_ctrl) { + memcpy(skb_push(msdu, + IEEE80211_QOS_CTL_LEN), &qos_ctl, + IEEE80211_QOS_CTL_LEN); +@@ -2311,6 +2397,20 @@ static void ath11k_dp_rx_h_undecap_eth(s + u8 da[ETH_ALEN]; + u8 sa[ETH_ALEN]; + void *rfc1042; ++ struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); ++ struct ath11k_dp_rfc1042_hdr rfc = {0xaa, 0xaa, 0x03, {0x00, 0x00, 0x00}}; ++ ++ if (!first_hdr) { ++ eth = (struct ethhdr *)msdu->data; ++ ether_addr_copy(da, eth->h_dest); ++ ether_addr_copy(sa, eth->h_source); ++ rfc.snap_type = eth->h_proto; ++ skb_pull(msdu, sizeof(struct ethhdr)); ++ memcpy(skb_push(msdu, sizeof(struct ath11k_dp_rfc1042_hdr)), &rfc, ++ sizeof(struct ath11k_dp_rfc1042_hdr)); ++ ath11k_get_dot11_hdr_from_rx_desc(ar, msdu, rxcb, status, enctype); ++ goto exit; ++ } + + rfc1042 = ath11k_dp_rx_h_find_rfc1042(ar, msdu, enctype); + if (WARN_ON_ONCE(!rfc1042)) +@@ -2339,6 +2439,7 @@ static void ath11k_dp_rx_h_undecap_eth(s + + memcpy(skb_push(msdu, hdr_len), hdr, hdr_len); + ++exit: + /* original 802.11 header has a different DA and in + * case of 4addr it may also have different SA + */ +@@ -2357,6 +2458,7 @@ static void ath11k_dp_rx_h_undecap_snap( + size_t hdr_len; + u8 l3_pad_bytes; + struct hal_rx_desc *rx_desc; ++ struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); + + /* Delivered decapped frame: + * [amsdu header] <-- replaced with 802.11 hdr +@@ -2370,6 +2472,11 @@ static void ath11k_dp_rx_h_undecap_snap( + skb_put(msdu, l3_pad_bytes); + skb_pull(msdu, sizeof(struct ath11k_dp_amsdu_subframe_hdr) + l3_pad_bytes); + ++ if (!first_hdr) { ++ ath11k_get_dot11_hdr_from_rx_desc(ar, msdu, rxcb, status, enctype); ++ return; ++ } ++ + hdr = (struct ieee80211_hdr *)first_hdr; + hdr_len = ieee80211_hdrlen(hdr->frame_control); + +@@ -2766,6 +2873,20 @@ static int ath11k_dp_rx_process_msdu(str + goto free_out; + } + ++ hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); ++ /* wifi hdr fields validation for 512M:: ++ * Mcast packets in ethernet frame mode ++ * will need wifi hdr in msdu to validate PN. ++ * Header will be added in undecap routine. ++ * Validation on wifi hdr fields from rx_desc. ++ */ ++ if (!hdr_status && ath11k_dp_rx_h_attn_is_mcbc(ab, rx_desc) && ++ !ath11k_dp_rx_desc_dot11_hdr_fields_valid(ab, rx_desc)) { ++ ath11k_warn(ab, "One or more invalid dot11 header fields\n"); ++ ret = -EIO; ++ goto free_out; ++ } ++ + rxcb = ATH11K_SKB_RXCB(msdu); + rxcb->rx_desc = rx_desc; + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ab, rx_desc); +@@ -2778,8 +2899,9 @@ static int ath11k_dp_rx_process_msdu(str + hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); + ret = -EINVAL; + ath11k_warn(ab, "invalid msdu len %u\n", msdu_len); +- ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, +- sizeof(struct ieee80211_hdr)); ++ if (hdr_status) ++ ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, ++ sizeof(struct ieee80211_hdr)); + ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", rx_desc, + sizeof(struct hal_rx_desc)); + goto free_out; +@@ -3649,6 +3771,7 @@ static int ath11k_dp_rx_h_verify_tkip_mi + + hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); + hdr_len = ieee80211_hdrlen(hdr->frame_control); ++ + head_len = hdr_len + hal_rx_desc_sz + IEEE80211_TKIP_IV_LEN; + tail_len = IEEE80211_CCMP_MIC_LEN + IEEE80211_TKIP_ICV_LEN + FCS_LEN; + +@@ -3929,8 +4052,8 @@ static void ath11k_dp_rx_h_sort_frags(st + + static u64 ath11k_dp_rx_h_get_pn(struct ath11k *ar, struct sk_buff *skb) + { +- struct ieee80211_hdr *hdr; + u64 pn = 0; ++ struct ieee80211_hdr *hdr; + u8 *ehdr; + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; + +@@ -4160,8 +4283,9 @@ ath11k_dp_process_rx_err_buf(struct ath1 + if ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE) { + hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); + ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); +- ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, +- sizeof(struct ieee80211_hdr)); ++ if (hdr_status) ++ ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, ++ sizeof(struct ieee80211_hdr)); + ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, + sizeof(struct hal_rx_desc)); + dev_kfree_skb_any(msdu); +@@ -4784,6 +4908,47 @@ void ath11k_dp_rx_pdev_free(struct ath11 + ath11k_dp_rxdma_pdev_buf_free(ar); + } + ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static int ath11k_dp_rxdma_ring_sel_config(struct ath11k *ar) ++{ ++ struct ath11k_pdev_dp *dp = &ar->dp; ++ struct htt_rx_ring_tlv_filter tlv_filter = {0}; ++ u32 ring_id; ++ int ret; ++ u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; ++ ++ ring_id = dp->rx_refill_buf_ring.refill_buf_ring.ring_id; ++ ++ tlv_filter.rx_filter = HTT_RX_RXDMA_FILTER_TLV_FLAGS_BUF_RING; ++ tlv_filter.pkt_filter_flags2 = HTT_RX_FP_CTRL_PKT_FILTER_TLV_FLAGS2_BAR; ++ tlv_filter.pkt_filter_flags3 = HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_MCAST | ++ HTT_RX_FP_DATA_PKT_FILTER_TLV_FLASG3_UCAST; ++ tlv_filter.offset_valid = true; ++ tlv_filter.rx_packet_offset = hal_rx_desc_sz; ++ tlv_filter.rx_header_offset = 0; ++ ++ ath11k_dp_get_rx_header_offset(ar->ab, &tlv_filter); ++ ++ if (!ar->ab->nss.enabled) ++ ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, dp->mac_id, ++ HAL_RXDMA_BUF, ++ DP_RXDMA_REFILL_RING_SIZE, ++ &tlv_filter); ++ else ++ ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, dp->mac_id, ++ HAL_RXDMA_BUF, ++ DP_RXDMA_NSS_REFILL_RING_SIZE, ++ &tlv_filter); ++ ++ return ret; ++} ++#else ++static int ath11k_dp_rxdma_ring_sel_config(struct ath11k *ar) ++{ ++ return 0; ++} ++#endif ++ + int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int mac_id) + { + struct ath11k *ar = ab->pdevs[mac_id].ar; +@@ -4877,6 +5042,12 @@ config_refill_ring: + } + } + ++ ret = ath11k_dp_rxdma_ring_sel_config(ar); ++ if (ret) { ++ ath11k_warn(ab, "failed to setup rxdma ring selection config\n"); ++ return ret; ++ } ++ + return 0; + } + +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -1183,6 +1183,8 @@ int ath11k_dp_tx_htt_rx_filter_setup(str + !!(params.flags & HAL_SRNG_FLAGS_MSI_SWAP)); + cmd->info0 |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_INFO0_PS, + !!(params.flags & HAL_SRNG_FLAGS_DATA_TLV_SWAP)); ++ cmd->info0 |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_OFFSET_VALID, ++ tlv_filter->offset_valid); + + cmd->info1 = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_CMD_INFO1_BUF_SIZE, + rx_buf_size); +@@ -1192,6 +1194,26 @@ int ath11k_dp_tx_htt_rx_filter_setup(str + cmd->pkt_type_en_flags3 = tlv_filter->pkt_filter_flags3; + cmd->rx_filter_tlv = tlv_filter->rx_filter; + ++ if (tlv_filter->offset_valid) { ++ cmd->rx_packet_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, ++ tlv_filter->rx_packet_offset); ++ cmd->rx_packet_offset |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, ++ tlv_filter->rx_header_offset); ++ ++ cmd->rx_mpdu_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, ++ tlv_filter->rx_mpdu_end_offset); ++ cmd->rx_mpdu_offset |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, ++ tlv_filter->rx_mpdu_start_offset); ++ ++ cmd->rx_msdu_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, ++ tlv_filter->rx_msdu_end_offset); ++ cmd->rx_msdu_offset |= FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, ++ tlv_filter->rx_msdu_start_offset); ++ ++ cmd->rx_attn_offset = FIELD_PREP(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, ++ tlv_filter->rx_attn_offset); ++ } ++ + ret = ath11k_htc_send(&ab->htc, ab->dp.eid, skb); + if (ret) + goto err_free; +@@ -1270,6 +1292,7 @@ int ath11k_dp_tx_htt_monitor_mode_ring_c + } + + ring_id = dp->rxdma_mon_buf_ring.refill_buf_ring.ring_id; ++ tlv_filter.offset_valid = false; + + if (!reset) { + tlv_filter.rx_filter = HTT_RX_MON_FILTER_TLV_FLAGS_MON_BUF_RING; +--- a/drivers/net/wireless/ath/ath11k/hw.c ++++ b/drivers/net/wireless/ath/ath11k/hw.c +@@ -260,7 +260,11 @@ static u8 ath11k_hw_ipq8074_rx_desc_get_ + + static u8 *ath11k_hw_ipq8074_rx_desc_get_hdr_status(struct hal_rx_desc *desc) + { ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + return desc->u.ipq8074.hdr_status; ++#else ++ return NULL; ++#endif + } + + static bool ath11k_hw_ipq8074_rx_desc_encrypt_valid(struct hal_rx_desc *desc) +@@ -395,26 +399,132 @@ static void ath11k_hw_ipq8074_rx_desc_se + desc->u.ipq8074.msdu_start.info1 = __cpu_to_le32(info); + } + ++static ++struct rx_attention *ath11k_hw_ipq8074_rx_desc_get_attention(struct hal_rx_desc *desc) ++{ ++ return &desc->u.ipq8074.attention; ++} ++ ++static u8 *ath11k_hw_ipq8074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) ++{ ++ return &desc->u.ipq8074.msdu_payload[0]; ++} ++ ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static void ath11k_hw_ipq8074_rx_desc_get_offset(struct htt_rx_ring_tlv_filter *tlv_filter) ++{ ++ tlv_filter->rx_mpdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, mpdu_end_tag)); ++ tlv_filter->rx_mpdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, mpdu_start_tag)); ++ tlv_filter->rx_msdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, msdu_end_tag)); ++ tlv_filter->rx_msdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, msdu_start_tag)); ++ tlv_filter->rx_attn_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_ipq8074, rx_attn_tag)); ++} ++#endif ++ ++static u16 ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl(struct hal_rx_desc *desc) ++{ ++ return __le16_to_cpu(desc->u.ipq8074.mpdu_start.frame_ctrl); ++} ++ + static bool ath11k_hw_ipq8074_rx_desc_mac_addr2_valid(struct hal_rx_desc *desc) + { + return __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & + RX_MPDU_START_INFO1_MAC_ADDR2_VALID; + } + +-static u8 *ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc) ++static u8* ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc) + { + return desc->u.ipq8074.mpdu_start.addr2; + } + +-static +-struct rx_attention *ath11k_hw_ipq8074_rx_desc_get_attention(struct hal_rx_desc *desc) ++static bool ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid(struct hal_rx_desc *desc) + { +- return &desc->u.ipq8074.attention; ++ if ((ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld(desc) && ++ ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid(desc) && ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & ++ RX_MPDU_START_INFO1_MAC_ADDR1_VALID && ++ ath11k_hw_ipq8074_rx_desc_mac_addr2_valid(desc) && ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & ++ RX_MPDU_START_INFO1_MAC_ADDR3_VALID && ++ FIELD_GET((RX_MPDU_START_INFO1_MPDU_DUR_VALID), ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)))) { ++ return true; ++ } ++ return false; ++} ++ ++static void ath11k_hw_ipq8074_rx_desc_get_dot11_hdr(struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr) ++{ ++ hdr->frame_control = __le16_to_cpu(desc->u.ipq8074.mpdu_start.frame_ctrl); ++ hdr->duration_id = __le16_to_cpu(desc->u.ipq8074.mpdu_start.duration); ++ ether_addr_copy(hdr->addr1, desc->u.ipq8074.mpdu_start.addr1); ++ ether_addr_copy(hdr->addr2, desc->u.ipq8074.mpdu_start.addr2); ++ ether_addr_copy(hdr->addr3, desc->u.ipq8074.mpdu_start.addr3); ++ if (__le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & ++ RX_MPDU_START_INFO1_MAC_ADDR4_VALID) { ++ ether_addr_copy(hdr->addr4, desc->u.ipq8074.mpdu_start.addr4); ++ } ++ hdr->seq_ctrl = __le16_to_cpu(desc->u.ipq8074.mpdu_start.seq_ctrl); ++} ++ ++static void ath11k_hw_ipq8074_rx_desc_get_crypto_hdr(struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype) ++{ ++ unsigned int key_id; ++ ++ switch (enctype) { ++ case HAL_ENCRYPT_TYPE_OPEN: ++ return; ++ case HAL_ENCRYPT_TYPE_TKIP_NO_MIC: ++ case HAL_ENCRYPT_TYPE_TKIP_MIC: ++ crypto_hdr[0] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[1] = 0; ++ crypto_hdr[2] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.ipq8074.mpdu_start.pn[0]); ++ break; ++ case HAL_ENCRYPT_TYPE_CCMP_128: ++ case HAL_ENCRYPT_TYPE_CCMP_256: ++ case HAL_ENCRYPT_TYPE_GCMP_128: ++ case HAL_ENCRYPT_TYPE_AES_GCMP_256: ++ crypto_hdr[0] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[1] = ++ HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[2] = 0; ++ break; ++ case HAL_ENCRYPT_TYPE_WEP_40: ++ case HAL_ENCRYPT_TYPE_WEP_104: ++ case HAL_ENCRYPT_TYPE_WEP_128: ++ case HAL_ENCRYPT_TYPE_WAPI_GCM_SM4: ++ case HAL_ENCRYPT_TYPE_WAPI: ++ return; ++ } ++ key_id = FIELD_GET(RX_MPDU_START_INFO5_KEY_ID, ++ __le32_to_cpu(desc->u.ipq8074.mpdu_start.info5)); ++ crypto_hdr[3] = 0x20 | (key_id << 6); ++ crypto_hdr[4] = HAL_RX_MPDU_INFO_PN_GET_BYTE3(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[5] = HAL_RX_MPDU_INFO_PN_GET_BYTE4(desc->u.ipq8074.mpdu_start.pn[0]); ++ crypto_hdr[6] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.ipq8074.mpdu_start.pn[1]); ++ crypto_hdr[7] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.ipq8074.mpdu_start.pn[1]); + } + +-static u8 *ath11k_hw_ipq8074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) ++static bool ath11k_hw_qcn9074_rx_desc_mac_addr2_valid(struct hal_rx_desc *desc) + { +- return &desc->u.ipq8074.msdu_payload[0]; ++ return __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR2_VALID; ++} ++ ++static u8* ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc) ++{ ++ return desc->u.qcn9074.mpdu_start.addr2; + } + + static bool ath11k_hw_qcn9074_rx_desc_get_first_msdu(struct hal_rx_desc *desc) +@@ -437,7 +547,11 @@ static u8 ath11k_hw_qcn9074_rx_desc_get_ + + static u8 *ath11k_hw_qcn9074_rx_desc_get_hdr_status(struct hal_rx_desc *desc) + { ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + return desc->u.qcn9074.hdr_status; ++#else ++ return NULL; ++#endif + } + + static bool ath11k_hw_qcn9074_rx_desc_encrypt_valid(struct hal_rx_desc *desc) +@@ -614,7 +728,11 @@ static u8 ath11k_hw_wcn6855_rx_desc_get_ + + static u8 *ath11k_hw_wcn6855_rx_desc_get_hdr_status(struct hal_rx_desc *desc) + { ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + return desc->u.wcn6855.hdr_status; ++#else ++ return NULL; ++#endif + } + + static bool ath11k_hw_wcn6855_rx_desc_encrypt_valid(struct hal_rx_desc *desc) +@@ -929,6 +1047,98 @@ static u32 ath11k_hw_qcn9074_rx_desc_get + return FIELD_GET(HAL_RX_MPDU_INFO_INFO1_MPDU_LEN, + __le32_to_cpu(mpdu_info->u.qcn9074.info1)); + } ++ ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++static void ath11k_hw_qcn9074_rx_desc_get_offset(struct htt_rx_ring_tlv_filter *tlv_filter) ++{ ++ tlv_filter->rx_mpdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, mpdu_end_tag)); ++ tlv_filter->rx_mpdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, mpdu_start_tag)); ++ tlv_filter->rx_msdu_end_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, msdu_end_tag)); ++ tlv_filter->rx_msdu_start_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, msdu_start_tag)); ++ tlv_filter->rx_attn_offset = __le16_to_cpu(offsetof ++ (struct hal_rx_desc_qcn9074, rx_attn_tag)); ++} ++#endif ++ ++static u16 ath11k_hw_qcn9074_rx_desc_get_mpdu_frame_ctl(struct hal_rx_desc *desc) ++{ ++ return __le16_to_cpu(desc->u.qcn9074.mpdu_start.frame_ctrl); ++} ++ ++static bool ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid(struct hal_rx_desc *desc) ++{ ++ if ((ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld(desc) && ++ ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid(desc) && ++ (__le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR1_VALID) && ++ ath11k_hw_qcn9074_rx_desc_mac_addr2_valid(desc) && ++ (__le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR3_VALID) && ++ FIELD_GET((RX_MPDU_START_INFO11_MPDU_DUR_VALID), ++ __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11)))) { ++ return true; ++ } ++ return false; ++} ++ ++static void ath11k_hw_qcn9074_rx_desc_get_dot11_hdr(struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr) ++{ ++ hdr->frame_control = __le16_to_cpu(desc->u.qcn9074.mpdu_start.frame_ctrl); ++ hdr->duration_id = __le16_to_cpu(desc->u.qcn9074.mpdu_start.duration); ++ ether_addr_copy(hdr->addr1, desc->u.qcn9074.mpdu_start.addr1); ++ ether_addr_copy(hdr->addr2, desc->u.qcn9074.mpdu_start.addr2); ++ ether_addr_copy(hdr->addr3, desc->u.qcn9074.mpdu_start.addr3); ++ if (__le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & ++ RX_MPDU_START_INFO11_MAC_ADDR4_VALID) { ++ ether_addr_copy(hdr->addr4, desc->u.qcn9074.mpdu_start.addr4); ++ } ++ hdr->seq_ctrl = __le16_to_cpu(desc->u.qcn9074.mpdu_start.seq_ctrl); ++} ++ ++static void ath11k_hw_qcn9074_rx_desc_get_crypto_hdr(struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype) ++{ ++ unsigned int key_id; ++ ++ switch (enctype) { ++ case HAL_ENCRYPT_TYPE_OPEN: ++ return; ++ case HAL_ENCRYPT_TYPE_TKIP_NO_MIC: ++ case HAL_ENCRYPT_TYPE_TKIP_MIC: ++ crypto_hdr[0] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[1] = 0; ++ crypto_hdr[2] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.qcn9074.mpdu_start.pn[0]); ++ break; ++ case HAL_ENCRYPT_TYPE_CCMP_128: ++ case HAL_ENCRYPT_TYPE_CCMP_256: ++ case HAL_ENCRYPT_TYPE_GCMP_128: ++ case HAL_ENCRYPT_TYPE_AES_GCMP_256: ++ crypto_hdr[0] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[1] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[2] = 0; ++ break; ++ case HAL_ENCRYPT_TYPE_WEP_40: ++ case HAL_ENCRYPT_TYPE_WEP_104: ++ case HAL_ENCRYPT_TYPE_WEP_128: ++ case HAL_ENCRYPT_TYPE_WAPI_GCM_SM4: ++ case HAL_ENCRYPT_TYPE_WAPI: ++ return; ++ } ++ key_id = FIELD_GET(RX_MPDU_START_INFO12_KEY_ID, ++ __le32_to_cpu(desc->u.qcn9074.mpdu_start.info12)); ++ crypto_hdr[3] = 0x20 | (key_id << 6); ++ crypto_hdr[4] = HAL_RX_MPDU_INFO_PN_GET_BYTE3(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[5] = HAL_RX_MPDU_INFO_PN_GET_BYTE4(desc->u.qcn9074.mpdu_start.pn[0]); ++ crypto_hdr[6] = HAL_RX_MPDU_INFO_PN_GET_BYTE1(desc->u.qcn9074.mpdu_start.pn[1]); ++ crypto_hdr[7] = HAL_RX_MPDU_INFO_PN_GET_BYTE2(desc->u.qcn9074.mpdu_start.pn[1]); ++} ++ + const struct ath11k_hw_ops ipq8074_ops = { + .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, + .wmi_init_config = ath11k_init_wmi_config_ipq8074, +@@ -1009,6 +1219,13 @@ const struct ath11k_hw_ops ipq6018_ops = + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, + .get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector, + .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_ipq8074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, + }; + + const struct ath11k_hw_ops qca6390_ops = { +@@ -1050,6 +1267,13 @@ const struct ath11k_hw_ops qca6390_ops = + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq8074_rx_desc_mpdu_start_addr2, + .get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector, + .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_ipq8074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, + }; + + const struct ath11k_hw_ops qcn9074_ops = { +@@ -1132,6 +1356,13 @@ const struct ath11k_hw_ops wcn6855_ops = + .rx_desc_mpdu_start_addr2 = ath11k_hw_wcn6855_rx_desc_mpdu_start_addr2, + .get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector, + .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_ipq8074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_ipq8074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_ipq8074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_ipq8074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_ipq8074_rx_desc_get_crypto_hdr, + }; + + const struct ath11k_hw_ops wcn6750_ops = { +@@ -1180,6 +1411,8 @@ const struct ath11k_hw_ops ipq5018_ops = + .wmi_init_config = ath11k_init_wmi_config_ipq8074, + .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, + .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, ++ .rx_desc_mac_addr2_valid = ath11k_hw_qcn9074_rx_desc_mac_addr2_valid, ++ .rx_desc_mpdu_start_addr2 = ath11k_hw_qcn9074_rx_desc_mpdu_start_addr2, + .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable, + .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu, + .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu, +@@ -1214,6 +1447,13 @@ const struct ath11k_hw_ops ipq5018_ops = + .rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2, + .get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector, + .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len, ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ .rx_desc_get_offset = ath11k_hw_qcn9074_rx_desc_get_offset, ++#endif ++ .rx_desc_get_mpdu_frame_ctl = ath11k_hw_qcn9074_rx_desc_get_mpdu_frame_ctl, ++ .rx_desc_dot11_hdr_fields_valid = ath11k_hw_qcn9074_rx_desc_dot11_hdr_fields_valid, ++ .rx_desc_get_dot11_hdr = ath11k_hw_qcn9074_rx_desc_get_dot11_hdr, ++ .rx_desc_get_crypto_header = ath11k_hw_qcn9074_rx_desc_get_crypto_hdr, + }; + + #define ATH11K_TX_RING_MASK_0 BIT(0) +--- a/drivers/net/wireless/ath/ath11k/hw.h ++++ b/drivers/net/wireless/ath/ath11k/hw.h +@@ -22,6 +22,11 @@ + #define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 512 + #define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 128 + #define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 128 ++#define ATH11K_DP_RXDMA_REFILL_RING_SIZE 2048 ++/* 256b desc TLV + 4b(rounded) Pad + 30byte max nwifi header + ++ * 18byte mesh hdr + 8byte snap + 1500 eth payload ++ */ ++#define ATH11K_DP_RXDMA_NSS_REFILL_RING_SIZE 1816 + #else + /* Num VDEVS per radio */ + #define TARGET_NUM_VDEVS(ab) (ab->hw_params.num_vdevs_peers[ab->qmi.target_mem_mode].num_vdevs) +@@ -33,6 +38,8 @@ + #define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 1024 + #define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 4096 + #define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 2048 ++#define ATH11K_DP_RXDMA_REFILL_RING_SIZE 2048 ++#define ATH11K_DP_RXDMA_NSS_REFILL_RING_SIZE 2048 + #endif + + /* Num of peers for Single Radio mode */ +@@ -128,6 +135,8 @@ enum ath11k_bus { + + struct hal_rx_desc; + struct hal_tcl_data_cmd; ++struct htt_rx_ring_tlv_filter; ++enum hal_encrypt_type; + + struct ath11k_hw_ring_mask { + u8 tx[ATH11K_EXT_IRQ_GRP_NUM_MAX]; +@@ -285,7 +294,17 @@ struct ath11k_hw_ops { + bool (*rx_desc_mac_addr2_valid)(struct hal_rx_desc *desc); + u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc); + u32 (*get_ring_selector)(struct sk_buff *skb); +- u32 (*rx_desc_get_hal_mpdu_len)(struct hal_rx_mpdu_info *mpdu_info); ++ u32 (*rx_desc_get_hal_mpdu_len) (struct hal_rx_mpdu_info *mpdu_info); ++#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M ++ void (*rx_desc_get_offset)(struct htt_rx_ring_tlv_filter *tlv_filter); ++#endif ++ u16 (*rx_desc_get_mpdu_frame_ctl)(struct hal_rx_desc *desc); ++ bool (*rx_desc_dot11_hdr_fields_valid)(struct hal_rx_desc *desc); ++ void (*rx_desc_get_dot11_hdr)(struct hal_rx_desc *desc, ++ struct ieee80211_hdr *hdr); ++ void (*rx_desc_get_crypto_header)(struct hal_rx_desc *desc, ++ u8 *crypto_hdr, ++ enum hal_encrypt_type enctype); + }; + + extern const struct ath11k_hw_ops ipq8074_ops; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6343,6 +6343,7 @@ static int ath11k_mac_config_mon_status_ + tlv_filter.rx_filter = ath11k_debugfs_rx_filter(ar); + } + ++ tlv_filter.offset_valid = false; + for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { + ring_id = ar->dp.rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; + ret = ath11k_dp_tx_htt_rx_filter_setup(ar->ab, ring_id, +--- a/drivers/net/wireless/ath/ath11k/rx_desc.h ++++ b/drivers/net/wireless/ath/ath11k/rx_desc.h +@@ -1442,9 +1442,11 @@ struct hal_rx_desc_ipq8074 { + __le32 mpdu_end_tag; + struct rx_mpdu_end mpdu_end; + u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + __le32 hdr_status_tag; + __le32 phy_ppdu_id; + u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; ++#endif + u8 msdu_payload[]; + } __packed; + +@@ -1461,9 +1463,11 @@ struct hal_rx_desc_qcn9074 { + __le32 mpdu_end_tag; + struct rx_mpdu_end mpdu_end; + u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + __le32 hdr_status_tag; + __le32 phy_ppdu_id; + u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; ++#endif + u8 msdu_payload[]; + } __packed; + +@@ -1480,9 +1484,11 @@ struct hal_rx_desc_wcn6855 { + __le32 mpdu_end_tag; + struct rx_mpdu_end mpdu_end; + u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; ++#ifndef CPTCFG_ATH11K_MEM_PROFILE_512M + __le32 hdr_status_tag; + __le32 phy_ppdu_id; + u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; ++#endif + u8 msdu_payload[]; + } __packed; + +@@ -1507,4 +1513,17 @@ struct hal_rx_desc { + #define RU_484 18 + #define RU_996 37 + ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE1(__val) \ ++ FIELD_GET(GENMASK(7, 0), __le32_to_cpu(__val)) ++ ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE2(__val) \ ++ FIELD_GET(GENMASK(15, 8), __le32_to_cpu(__val)) ++ ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE3(__val) \ ++ FIELD_GET(GENMASK(23, 16), __le32_to_cpu(__val)) ++ ++#define HAL_RX_MPDU_INFO_PN_GET_BYTE4(__val) \ ++ FIELD_GET(GENMASK(31, 24), __le32_to_cpu(__val)) ++ ++ + #endif /* ATH11K_RX_DESC_H */ +--- a/drivers/net/wireless/ath/ath11k/nss.c ++++ b/drivers/net/wireless/ath/ath11k/nss.c +@@ -2230,7 +2230,7 @@ static int ath11k_nss_init(struct ath11k + + /* fill rx parameters to initialize rx context */ + wim->wrip.tlv_size = ab->hw_params.hal_desc_sz; +- wim->wrip.rx_buf_len = DP_RX_BUFFER_SIZE; ++ wim->wrip.rx_buf_len = DP_RXDMA_NSS_REFILL_RING_SIZE; + + /* fill hal srng message */ + wim->hssm.dev_base_addr = (u32)ab->mem_pa; diff --git a/package/kernel/mac80211/patches/nss/ath11k/235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch b/package/kernel/mac80211/patches/nss/ath11k/235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch index 729ee80199b9a2..10e65157232edb 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch @@ -214,7 +214,7 @@ Signed-off-by: Sathishkumar Muruganandam ieee80211_queue_work(ar->hw, &arsta->set_4addr_wk); arsta->use_4addr_set = true; } -@@ -6646,6 +6770,9 @@ static int ath11k_mac_op_update_vif_offl +@@ -6647,6 +6771,9 @@ static int ath11k_mac_op_update_vif_offl u32 param_id, param_value; int ret; @@ -224,7 +224,7 @@ Signed-off-by: Sathishkumar Muruganandam param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE; if (ath11k_frame_mode != ATH11K_HW_TXRX_ETHERNET || (vif->type != NL80211_IFTYPE_STATION && -@@ -6866,7 +6993,8 @@ static int ath11k_mac_op_add_interface(s +@@ -6867,7 +6994,8 @@ static int ath11k_mac_op_add_interface(s goto err; } @@ -234,7 +234,7 @@ Signed-off-by: Sathishkumar Muruganandam ath11k_warn(ab, "failed to create vdev %u, reached max vdev limit %d\n", ar->num_created_vdevs, TARGET_NUM_VDEVS(ab)); ret = -EBUSY; -@@ -6886,6 +7014,28 @@ static int ath11k_mac_op_add_interface(s +@@ -6887,6 +7015,28 @@ static int ath11k_mac_op_add_interface(s arvif->vif = vif; INIT_LIST_HEAD(&arvif->list); @@ -263,7 +263,7 @@ Signed-off-by: Sathishkumar Muruganandam INIT_DELAYED_WORK(&arvif->connection_loss_work, ath11k_mac_vif_sta_connection_loss_work); -@@ -6915,6 +7065,7 @@ static int ath11k_mac_op_add_interface(s +@@ -6916,6 +7066,7 @@ static int ath11k_mac_op_add_interface(s fallthrough; case NL80211_IFTYPE_AP: arvif->vdev_type = WMI_VDEV_TYPE_AP; @@ -271,7 +271,7 @@ Signed-off-by: Sathishkumar Muruganandam break; case NL80211_IFTYPE_MONITOR: arvif->vdev_type = WMI_VDEV_TYPE_MONITOR; -@@ -7137,13 +7288,30 @@ static void ath11k_mac_op_remove_interfa +@@ -7138,13 +7289,30 @@ static void ath11k_mac_op_remove_interfa struct ath11k *ar = hw->priv; struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); struct ath11k_base *ab = ar->ab; @@ -304,7 +304,7 @@ Signed-off-by: Sathishkumar Muruganandam ath11k_dbg(ab, ATH11K_DBG_MAC, "remove interface (vdev %d)\n", arvif->vdev_id); -@@ -7160,6 +7328,14 @@ static void ath11k_mac_op_remove_interfa +@@ -7161,6 +7329,14 @@ static void ath11k_mac_op_remove_interfa if (ret) ath11k_warn(ab, "failed to submit AP self-peer removal on vdev %d: %d\n", arvif->vdev_id, ret); @@ -319,7 +319,7 @@ Signed-off-by: Sathishkumar Muruganandam } ret = ath11k_mac_vdev_delete(ar, arvif); -@@ -7203,8 +7379,7 @@ err_vdev_del: +@@ -7204,8 +7380,7 @@ err_vdev_del: ath11k_debugfs_remove_interface(arvif); @@ -329,7 +329,7 @@ Signed-off-by: Sathishkumar Muruganandam mutex_unlock(&ar->conf_mutex); } -@@ -7264,16 +7439,17 @@ static int ath11k_mac_op_ampdu_action(st +@@ -7265,16 +7440,17 @@ static int ath11k_mac_op_ampdu_action(st struct ieee80211_ampdu_params *params) { struct ath11k *ar = hw->priv; @@ -349,7 +349,7 @@ Signed-off-by: Sathishkumar Muruganandam break; case IEEE80211_AMPDU_TX_START: case IEEE80211_AMPDU_TX_STOP_CONT: -@@ -8796,6 +8972,7 @@ static void ath11k_mac_op_sta_statistics +@@ -8797,6 +8973,7 @@ static void ath11k_mac_op_sta_statistics { struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); struct ath11k *ar = arsta->arvif->ar; @@ -357,7 +357,7 @@ Signed-off-by: Sathishkumar Muruganandam s8 signal; bool db2dbm = test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT, ar->ab->wmi_ab.svc_map); -@@ -8852,7 +9029,8 @@ static void ath11k_mac_op_sta_statistics +@@ -8853,7 +9030,8 @@ static void ath11k_mac_op_sta_statistics ATH11K_DEFAULT_NOISE_FLOOR; sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG); @@ -380,7 +380,7 @@ Signed-off-by: Sathishkumar Muruganandam WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1, --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1121,12 +1121,13 @@ err_mem_free: +@@ -1156,12 +1156,13 @@ err_mem_free: return ret; } @@ -396,7 +396,7 @@ Signed-off-by: Sathishkumar Muruganandam int ret; ret = ath11k_peer_rx_tid_setup(ar, params->sta->addr, vdev_id, -@@ -1138,13 +1139,13 @@ int ath11k_dp_rx_ampdu_start(struct ath1 +@@ -1173,13 +1174,13 @@ int ath11k_dp_rx_ampdu_start(struct ath1 return ret; } diff --git a/package/kernel/mac80211/patches/nss/ath11k/236-003-ath11k-add-dynamic-VLAN-support-in-NSS-offload.patch b/package/kernel/mac80211/patches/nss/ath11k/236-003-ath11k-add-dynamic-VLAN-support-in-NSS-offload.patch index 80b8a5fc67d7ea..e7817f953ace6e 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/236-003-ath11k-add-dynamic-VLAN-support-in-NSS-offload.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/236-003-ath11k-add-dynamic-VLAN-support-in-NSS-offload.patch @@ -423,7 +423,7 @@ Signed-off-by: Sathishkumar Muruganandam } } else if (old_state == IEEE80211_STA_AUTHORIZED && new_state == IEEE80211_STA_ASSOC) { -@@ -7018,7 +7247,7 @@ static int ath11k_mac_op_add_interface(s +@@ -7019,7 +7248,7 @@ static int ath11k_mac_op_add_interface(s if ((vif->type == NL80211_IFTYPE_AP_VLAN || vif->type == NL80211_IFTYPE_STATION) && ab->nss.enabled) { if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET && @@ -432,7 +432,7 @@ Signed-off-by: Sathishkumar Muruganandam vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR; arvif->nss.encap = ATH11K_HW_TXRX_ETHERNET; arvif->nss.decap = ATH11K_HW_TXRX_ETHERNET; -@@ -7031,6 +7260,7 @@ static int ath11k_mac_op_add_interface(s +@@ -7032,6 +7261,7 @@ static int ath11k_mac_op_add_interface(s vif->addr, ret); goto err; } @@ -440,7 +440,7 @@ Signed-off-by: Sathishkumar Muruganandam mutex_unlock(&ar->conf_mutex); return ret; } -@@ -7055,6 +7285,20 @@ static int ath11k_mac_op_add_interface(s +@@ -7056,6 +7286,20 @@ static int ath11k_mac_op_add_interface(s arvif->vdev_id = bit; arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE; @@ -461,7 +461,7 @@ Signed-off-by: Sathishkumar Muruganandam switch (vif->type) { case NL80211_IFTYPE_UNSPECIFIED: case NL80211_IFTYPE_STATION: -@@ -7095,7 +7339,7 @@ static int ath11k_mac_op_add_interface(s +@@ -7096,7 +7340,7 @@ static int ath11k_mac_op_add_interface(s if (ret) { ath11k_warn(ab, "failed to create WMI vdev %d: %d\n", arvif->vdev_id, ret); @@ -470,7 +470,7 @@ Signed-off-by: Sathishkumar Muruganandam } ar->num_created_vdevs++; -@@ -7254,7 +7498,7 @@ err_peer_del: +@@ -7255,7 +7499,7 @@ err_peer_del: if (fbret) { ath11k_warn(ar->ab, "fallback fail to delete peer addr %pM vdev_id %d ret %d\n", vif->addr, arvif->vdev_id, fbret); @@ -479,7 +479,7 @@ Signed-off-by: Sathishkumar Muruganandam } } -@@ -7265,6 +7509,8 @@ err_vdev_del: +@@ -7266,6 +7510,8 @@ err_vdev_del: list_del(&arvif->list); spin_unlock_bh(&ar->data_lock); @@ -488,7 +488,7 @@ Signed-off-by: Sathishkumar Muruganandam err: mutex_unlock(&ar->conf_mutex); -@@ -7362,6 +7608,7 @@ err_vdev_del: +@@ -7363,6 +7609,7 @@ err_vdev_del: list_del(&arvif->list); spin_unlock_bh(&ar->data_lock); @@ -496,7 +496,7 @@ Signed-off-by: Sathishkumar Muruganandam ath11k_peer_cleanup(ar, arvif->vdev_id); idr_for_each(&ar->txmgmt_idr, -@@ -9960,8 +10207,11 @@ static int __ath11k_mac_register(struct +@@ -9961,8 +10208,11 @@ static int __ath11k_mac_register(struct ab->hw_params.bios_sar_capa) ar->hw->wiphy->sar_capa = ab->hw_params.bios_sar_capa; diff --git a/package/kernel/mac80211/patches/nss/ath11k/237-001-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch b/package/kernel/mac80211/patches/nss/ath11k/237-001-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch index bbf4f20ac2326c..493ed32105629e 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/237-001-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/237-001-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch @@ -10,7 +10,7 @@ }; --- a/drivers/net/wireless/ath/ath11k/debugfs.c +++ b/drivers/net/wireless/ath/ath11k/debugfs.c -@@ -973,6 +973,79 @@ static const struct file_operations fops +@@ -974,6 +974,79 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -90,7 +90,7 @@ int ath11k_debugfs_pdev_create(struct ath11k_base *ab) { if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags)) -@@ -1022,6 +1095,8 @@ int ath11k_debugfs_soc_create(struct ath +@@ -1023,6 +1096,8 @@ int ath11k_debugfs_soc_create(struct ath ret = PTR_ERR(ab->debugfs_soc); goto out; } diff --git a/package/kernel/mac80211/patches/nss/ath11k/237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch b/package/kernel/mac80211/patches/nss/ath11k/237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch index 61077309338ffb..c5cd8f20874996 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch @@ -33,7 +33,7 @@ Signed-off-by: P Praneesh enum ath11k_hw_rev { --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -340,6 +340,12 @@ static int ath11k_dp_purge_mon_ring(stru +@@ -375,6 +375,12 @@ static int ath11k_dp_purge_mon_ring(stru return -ETIMEDOUT; } @@ -46,7 +46,7 @@ Signed-off-by: P Praneesh /* Returns number of Rx buffers replenished */ int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, struct dp_rxdma_ring *rx_ring, -@@ -1664,7 +1670,7 @@ int ath11k_dp_htt_tlv_iter(struct ath11k +@@ -1699,7 +1705,7 @@ int ath11k_dp_htt_tlv_iter(struct ath11k len -= sizeof(*tlv); if (tlv_len > len) { @@ -55,7 +55,7 @@ Signed-off-by: P Praneesh tlv_tag, ptr - begin, len, tlv_len); return -EINVAL; } -@@ -2454,10 +2460,60 @@ ath11k_dp_rx_h_find_peer(struct ath11k_b +@@ -2561,10 +2567,60 @@ ath11k_dp_rx_h_find_peer(struct ath11k_b return peer; } @@ -117,7 +117,7 @@ Signed-off-by: P Praneesh { bool fill_crypto_hdr; enum hal_encrypt_type enctype; -@@ -2468,9 +2524,13 @@ static void ath11k_dp_rx_h_mpdu(struct a +@@ -2575,9 +2631,13 @@ static void ath11k_dp_rx_h_mpdu(struct a struct rx_attention *rx_attention; u32 err_bitmap; @@ -132,7 +132,7 @@ Signed-off-by: P Praneesh rxcb->is_mcbc = fill_crypto_hdr; if (rxcb->is_mcbc) { -@@ -2481,6 +2541,26 @@ static void ath11k_dp_rx_h_mpdu(struct a +@@ -2588,6 +2648,26 @@ static void ath11k_dp_rx_h_mpdu(struct a spin_lock_bh(&ar->ab->base_lock); peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); if (peer) { @@ -159,7 +159,7 @@ Signed-off-by: P Praneesh if (rxcb->is_mcbc) enctype = peer->sec_type_grp; else -@@ -2490,6 +2570,8 @@ static void ath11k_dp_rx_h_mpdu(struct a +@@ -2597,6 +2677,8 @@ static void ath11k_dp_rx_h_mpdu(struct a } spin_unlock_bh(&ar->ab->base_lock); @@ -168,7 +168,7 @@ Signed-off-by: P Praneesh rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_attention); if (enctype != HAL_ENCRYPT_TYPE_OPEN && !err_bitmap) -@@ -2731,7 +2813,8 @@ static void ath11k_dp_rx_deliver_msdu(st +@@ -2838,7 +2920,8 @@ static void ath11k_dp_rx_deliver_msdu(st static int ath11k_dp_rx_process_msdu(struct ath11k *ar, struct sk_buff *msdu, struct sk_buff_head *msdu_list, @@ -178,7 +178,7 @@ Signed-off-by: P Praneesh { struct ath11k_base *ab = ar->ab; struct hal_rx_desc *rx_desc, *lrx_desc; -@@ -2798,8 +2881,13 @@ static int ath11k_dp_rx_process_msdu(str +@@ -2920,8 +3003,13 @@ static int ath11k_dp_rx_process_msdu(str } } @@ -193,7 +193,7 @@ Signed-off-by: P Praneesh rx_status->flag |= RX_FLAG_SKIP_MONITOR | RX_FLAG_DUP_VALIDATED; -@@ -2814,10 +2902,12 @@ static void ath11k_dp_rx_process_receive +@@ -2936,10 +3024,12 @@ static void ath11k_dp_rx_process_receive struct sk_buff_head *msdu_list, int mac_id) { @@ -206,7 +206,7 @@ Signed-off-by: P Praneesh if (skb_queue_empty(msdu_list)) return; -@@ -2834,7 +2924,12 @@ static void ath11k_dp_rx_process_receive +@@ -2956,7 +3046,12 @@ static void ath11k_dp_rx_process_receive } while ((msdu = __skb_dequeue(msdu_list))) { @@ -220,7 +220,7 @@ Signed-off-by: P Praneesh if (unlikely(ret)) { ath11k_dbg(ab, ATH11K_DBG_DATA, "Unable to process msdu %d", ret); -@@ -2842,7 +2937,10 @@ static void ath11k_dp_rx_process_receive +@@ -2964,7 +3059,10 @@ static void ath11k_dp_rx_process_receive continue; } @@ -232,7 +232,7 @@ Signed-off-by: P Praneesh } } -@@ -2851,11 +2949,12 @@ void ath11k_dp_rx_from_nss(struct ath11k +@@ -2973,11 +3071,12 @@ void ath11k_dp_rx_from_nss(struct ath11k { struct ieee80211_rx_status rx_status = {0}; struct ath11k_skb_rxcb *rxcb; @@ -246,7 +246,7 @@ Signed-off-by: P Praneesh rx_status.flag |= RX_FLAG_SKIP_MONITOR | RX_FLAG_DUP_VALIDATED; -@@ -4322,6 +4421,7 @@ static int ath11k_dp_rx_h_null_q_desc(st +@@ -4446,6 +4545,7 @@ static int ath11k_dp_rx_h_null_q_desc(st struct ieee80211_rx_status *status, struct sk_buff_head *msdu_list) { @@ -254,7 +254,7 @@ Signed-off-by: P Praneesh u16 msdu_len; struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; struct rx_attention *rx_attention; -@@ -4371,7 +4471,8 @@ static int ath11k_dp_rx_h_null_q_desc(st +@@ -4495,7 +4595,8 @@ static int ath11k_dp_rx_h_null_q_desc(st } ath11k_dp_rx_h_ppdu(ar, desc, status); @@ -266,7 +266,7 @@ Signed-off-by: P Praneesh --- a/drivers/net/wireless/ath/ath11k/hw.c +++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -293,6 +293,16 @@ static bool ath11k_hw_ipq8074_rx_desc_ge +@@ -297,6 +297,16 @@ static bool ath11k_hw_ipq8074_rx_desc_ge __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); } @@ -283,7 +283,7 @@ Signed-off-by: P Praneesh static bool ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) { return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_CTRL_VALID, -@@ -470,6 +480,16 @@ static bool ath11k_hw_qcn9074_rx_desc_ge +@@ -584,6 +594,16 @@ static bool ath11k_hw_qcn9074_rx_desc_ge __le32_to_cpu(desc->u.qcn9074.msdu_start.info2)); } @@ -300,7 +300,7 @@ Signed-off-by: P Praneesh static bool ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) { return !!FIELD_GET(RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID, -@@ -1025,6 +1045,7 @@ const struct ath11k_hw_ops qca6390_ops = +@@ -1194,6 +1214,7 @@ const struct ath11k_hw_ops ipq6018_ops = .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, @@ -308,7 +308,15 @@ Signed-off-by: P Praneesh .rx_desc_get_ldpc_support = ath11k_hw_ipq8074_rx_desc_get_ldpc_support, .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, -@@ -1189,6 +1210,7 @@ const struct ath11k_hw_ops ipq5018_ops = +@@ -1242,6 +1263,7 @@ const struct ath11k_hw_ops qca6390_ops = + .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, + .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, + .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, ++ .rx_desc_get_ip_valid = ath11k_hw_ipq8074_rx_desc_get_ip_valid, + .rx_desc_get_ldpc_support = ath11k_hw_ipq8074_rx_desc_get_ldpc_support, + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, + .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, +@@ -1379,6 +1401,7 @@ const struct ath11k_hw_ops wcn6750_ops = .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type, .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type, .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl, @@ -318,7 +326,7 @@ Signed-off-by: P Praneesh .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid, --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -260,6 +260,7 @@ struct ath11k_hw_ops { +@@ -269,6 +269,7 @@ struct ath11k_hw_ops { u32 (*rx_desc_get_encrypt_type)(struct hal_rx_desc *desc); u8 (*rx_desc_get_decap_type)(struct hal_rx_desc *desc); u8 (*rx_desc_get_mesh_ctl)(struct hal_rx_desc *desc); diff --git a/package/kernel/mac80211/patches/nss/ath11k/244-ath11k-dp-tx-perf.patch b/package/kernel/mac80211/patches/nss/ath11k/244-ath11k-dp-tx-perf.patch index 7535883c4763d0..f514843b447f1a 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/244-ath11k-dp-tx-perf.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/244-ath11k-dp-tx-perf.patch @@ -454,7 +454,7 @@ Signed-off-by: P Praneesh ieee80211_free_txskb(ar->hw, skb); return; } -@@ -7622,7 +7632,7 @@ err_vdev_del: +@@ -7623,7 +7633,7 @@ err_vdev_del: idr_for_each(&ar->txmgmt_idr, ath11k_mac_vif_txmgmt_idr_remove, vif); @@ -465,7 +465,7 @@ Signed-off-by: P Praneesh ath11k_mac_vif_unref, vif); --- a/drivers/net/wireless/ath/ath11k/debugfs.c +++ b/drivers/net/wireless/ath/ath11k/debugfs.c -@@ -832,10 +832,22 @@ static ssize_t ath11k_debugfs_dump_soc_d +@@ -833,10 +833,22 @@ static ssize_t ath11k_debugfs_dump_soc_d len += scnprintf(buf + len, size - len, "ring%d: %u\n", i, soc_stats->tx_err.desc_na[i]); @@ -490,6 +490,15 @@ Signed-off-by: P Praneesh if (len > size) --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -105,7 +105,7 @@ static struct ath11k_hw_params ath11k_hw + .supports_regdb = false, + .fix_l1ss = true, + .credit_flow = false, +- .max_tx_ring = DP_TCL_NUM_RING_MAX, ++ .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .hal_params = &ath11k_hw_hal_params_ipq8074, + .supports_dynamic_smps_6ghz = false, + .alloc_cacheable_memory = true, @@ -188,7 +188,6 @@ static struct ath11k_hw_params ath11k_hw .supports_regdb = false, .fix_l1ss = true, @@ -504,10 +513,19 @@ Signed-off-by: P Praneesh .support_fw_mac_sequence = false, + /* In addition to TCL ring use TCL_CMD ring also for tx */ + .max_tx_ring = DP_TCL_NUM_RING_MAX + 1, + .num_vdevs_peers = ath11k_vdevs_peers, }, { .name = "qca6390 hw2.0", -@@ -380,6 +381,8 @@ static struct ath11k_hw_params ath11k_hw +@@ -355,7 +356,6 @@ static struct ath11k_hw_params ath11k_hw + .supports_regdb = false, + .fix_l1ss = true, + .credit_flow = false, +- .max_tx_ring = DP_TCL_NUM_RING_MAX, + .hal_params = &ath11k_hw_hal_params_ipq8074, + .supports_dynamic_smps_6ghz = true, + .alloc_cacheable_memory = true, +@@ -380,6 +380,8 @@ static struct ath11k_hw_params ath11k_hw .tx_ring_size = DP_TCL_DATA_RING_SIZE, .smp2p_wow_exit = false, .support_fw_mac_sequence = false, @@ -516,7 +534,7 @@ Signed-off-by: P Praneesh }, { .name = "wcn6855 hw2.0", -@@ -2143,6 +2146,9 @@ int ath11k_core_pre_init(struct ath11k_b +@@ -2143,6 +2145,9 @@ int ath11k_core_pre_init(struct ath11k_b if (nss_offload) ab->nss.stats_enabled = 1; diff --git a/package/kernel/mac80211/patches/nss/ath11k/300-ath11k-nss-mesh-offload-support.patch b/package/kernel/mac80211/patches/nss/ath11k/300-ath11k-nss-mesh-offload-support.patch index b31809f689548b..1fa2d32aaa33cb 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/300-ath11k-nss-mesh-offload-support.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/300-ath11k-nss-mesh-offload-support.patch @@ -1014,7 +1014,7 @@ Signed-off-by: Vasanthakumar Thiagarajan +#endif --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h -@@ -1453,15 +1453,29 @@ struct htt_ppdu_stats_usr_cmn_array { +@@ -1529,15 +1529,29 @@ struct htt_ppdu_stats_usr_cmn_array { struct htt_tx_ppdu_stats_info tx_ppdu_info[]; } __packed; @@ -1046,7 +1046,7 @@ Signed-off-by: Vasanthakumar Thiagarajan #define HTT_PPDU_STATS_MAX_USERS 37 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1409,6 +1409,71 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1444,6 +1444,71 @@ static int ath11k_htt_tlv_ppdu_stats_par return 0; } @@ -1118,7 +1118,7 @@ Signed-off-by: Vasanthakumar Thiagarajan static void ath11k_update_per_peer_tx_stats(struct ath11k *ar, struct htt_ppdu_stats *ppdu_stats, u8 user) -@@ -1432,6 +1497,9 @@ ath11k_update_per_peer_tx_stats(struct a +@@ -1467,6 +1532,9 @@ ath11k_update_per_peer_tx_stats(struct a if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE))) return; @@ -1128,7 +1128,7 @@ Signed-off-by: Vasanthakumar Thiagarajan if (usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON)) is_ampdu = HTT_USR_CMPLTN_IS_AMPDU(usr_stats->cmpltn_cmn.flags); -@@ -1565,6 +1633,8 @@ ath11k_update_per_peer_tx_stats(struct a +@@ -1600,6 +1668,8 @@ ath11k_update_per_peer_tx_stats(struct a ath11k_debugfs_sta_add_tx_stats(arsta, peer_stats, rate_idx); } @@ -1137,7 +1137,7 @@ Signed-off-by: Vasanthakumar Thiagarajan spin_unlock_bh(&ab->base_lock); rcu_read_unlock(); } -@@ -1685,6 +1755,69 @@ int ath11k_dp_htt_tlv_iter(struct ath11k +@@ -1720,6 +1790,69 @@ int ath11k_dp_htt_tlv_iter(struct ath11k return 0; } @@ -1207,7 +1207,7 @@ Signed-off-by: Vasanthakumar Thiagarajan static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, struct sk_buff *skb) { -@@ -1703,6 +1836,15 @@ static int ath11k_htt_pull_ppdu_stats(st +@@ -1738,6 +1871,15 @@ static int ath11k_htt_pull_ppdu_stats(st pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_INFO_PDEV_ID, msg->info); ppdu_id = msg->ppdu_id; @@ -1223,7 +1223,7 @@ Signed-off-by: Vasanthakumar Thiagarajan rcu_read_lock(); ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); if (!ar) { -@@ -1770,6 +1912,12 @@ static int ath11k_htt_pull_ppdu_stats(st +@@ -1805,6 +1947,12 @@ static int ath11k_htt_pull_ppdu_stats(st } } @@ -1257,7 +1257,7 @@ Signed-off-by: Vasanthakumar Thiagarajan mutex_unlock(&ar->conf_mutex); } -@@ -9714,6 +9726,28 @@ err_fallback: +@@ -9715,6 +9727,28 @@ err_fallback: return 0; } @@ -1286,7 +1286,7 @@ Signed-off-by: Vasanthakumar Thiagarajan static const struct ieee80211_ops ath11k_ops = { .tx = ath11k_mac_op_tx, .wake_tx_queue = ieee80211_handle_wake_tx_queue, -@@ -9771,6 +9805,9 @@ static const struct ieee80211_ops ath11k +@@ -9772,6 +9806,9 @@ static const struct ieee80211_ops ath11k .set_sar_specs = ath11k_mac_op_set_bios_sar_specs, .remain_on_channel = ath11k_mac_op_remain_on_channel, .cancel_remain_on_channel = ath11k_mac_op_cancel_remain_on_channel, @@ -1296,7 +1296,7 @@ Signed-off-by: Vasanthakumar Thiagarajan }; static void ath11k_mac_update_ch_list(struct ath11k *ar, -@@ -10231,6 +10268,8 @@ static int __ath11k_mac_register(struct +@@ -10232,6 +10269,8 @@ static int __ath11k_mac_register(struct ieee80211_hw_set(ar->hw, SUPPORTS_NSS_OFFLOAD); wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_VLAN_OFFLOAD); diff --git a/package/kernel/mac80211/patches/nss/ath11k/314-ath11k-Fix-peer-lookup-failure-in-mgmt-tx-completion.patch b/package/kernel/mac80211/patches/nss/ath11k/314-ath11k-Fix-peer-lookup-failure-in-mgmt-tx-completion.patch index cb4fba0a2ffdcd..1d7cf5b0e7c585 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/314-ath11k-Fix-peer-lookup-failure-in-mgmt-tx-completion.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/314-ath11k-Fix-peer-lookup-failure-in-mgmt-tx-completion.patch @@ -23,7 +23,7 @@ Signed-off-by: Rameshkumar Sundaram --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -7643,8 +7643,10 @@ err_vdev_del: +@@ -7644,8 +7644,10 @@ err_vdev_del: kfree(arvif->vlan_keyid_map); ath11k_peer_cleanup(ar, arvif->vdev_id); diff --git a/package/kernel/mac80211/patches/nss/ath11k/319-ath11k-fix-double-free-of-peer-rx_tid-during-reo-cmd.patch b/package/kernel/mac80211/patches/nss/ath11k/319-ath11k-fix-double-free-of-peer-rx_tid-during-reo-cmd.patch index d733219b38aa7f..798ec1973c3fe3 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/319-ath11k-fix-double-free-of-peer-rx_tid-during-reo-cmd.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/319-ath11k-fix-double-free-of-peer-rx_tid-during-reo-cmd.patch @@ -30,7 +30,7 @@ Signed-off-by: Sathishkumar Muruganandam --- a/drivers/net/wireless/ath/ath11k/hw.c +++ b/drivers/net/wireless/ath/ath11k/hw.c -@@ -1332,6 +1332,7 @@ const struct ath11k_hw_ring_mask ath11k_ +@@ -1573,6 +1573,7 @@ const struct ath11k_hw_ring_mask ath11k_ ATH11K_RX_WBM_REL_RING_MASK_0, }, .reo_status = { diff --git a/package/kernel/mac80211/patches/nss/ath11k/335-0003-ath11k-skip-HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE-con.patch b/package/kernel/mac80211/patches/nss/ath11k/335-0003-ath11k-skip-HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE-con.patch index 3c3e436c75ce41..67781ea0ad2b6b 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/335-0003-ath11k-skip-HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE-con.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/335-0003-ath11k-skip-HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE-con.patch @@ -58,7 +58,7 @@ Signed-off-by: Venkateswara Naralasetty tcl_cmd.info3 = FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX, --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -10154,6 +10154,8 @@ static int __ath11k_mac_register(struct +@@ -10155,6 +10155,8 @@ static int __ath11k_mac_register(struct ieee80211_hw_set(ar->hw, USES_RSS); } diff --git a/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-Fix-updating-rx-stats-with-monitor-vif-enable.patch b/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-Fix-updating-rx-stats-with-monitor-vif-enable.patch index 752218e9b8ec26..90adde1baf67db 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-Fix-updating-rx-stats-with-monitor-vif-enable.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-Fix-updating-rx-stats-with-monitor-vif-enable.patch @@ -16,7 +16,7 @@ Signed-off-by: Anilkumar Kolli --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -5953,12 +5953,23 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -6124,12 +6124,23 @@ int ath11k_dp_rx_process_mon_status(stru pmon->mon_ppdu_status = DP_PPDU_STATUS_START; } @@ -43,7 +43,7 @@ Signed-off-by: Anilkumar Kolli rcu_read_lock(); spin_lock_bh(&ab->base_lock); peer = ath11k_peer_find_by_id(ab, ppdu_info->peer_id); -@@ -6282,6 +6293,13 @@ static int ath11k_dp_full_mon_process_rx +@@ -6453,6 +6464,13 @@ static int ath11k_dp_full_mon_process_rx spin_lock_bh(&pmon->mon_lock); @@ -57,7 +57,7 @@ Signed-off-by: Anilkumar Kolli sw_mon_entries = &pmon->sw_mon_entries; rx_mon_stats = &pmon->rx_mon_stats; -@@ -6321,7 +6339,6 @@ static int ath11k_dp_full_mon_process_rx +@@ -6492,7 +6510,6 @@ static int ath11k_dp_full_mon_process_rx } rx_mon_stats->dest_ppdu_done++; @@ -65,7 +65,7 @@ Signed-off-by: Anilkumar Kolli pmon->buf_state = DP_MON_STATUS_LAG; pmon->mon_status_paddr = sw_mon_entries->mon_status_paddr; pmon->hold_mon_dst_ring = true; -@@ -6352,16 +6369,10 @@ reap_status_ring: +@@ -6523,16 +6540,10 @@ reap_status_ring: int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, struct napi_struct *napi, int budget) { diff --git a/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-skip-status-ring-entry-processing.patch b/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-skip-status-ring-entry-processing.patch index 0adf26c808aec6..8950e960467e67 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-skip-status-ring-entry-processing.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/336-ath11k-skip-status-ring-entry-processing.patch @@ -35,7 +35,7 @@ Signed-off-by: Venkateswara Naralasetty --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -3660,6 +3660,46 @@ ath11k_dp_rx_mon_update_status_buf_state +@@ -3782,6 +3782,46 @@ ath11k_dp_rx_mon_update_status_buf_state } } @@ -82,7 +82,7 @@ Signed-off-by: Venkateswara Naralasetty static int ath11k_dp_rx_reap_mon_status_ring(struct ath11k_base *ab, int mac_id, int *budget, struct sk_buff_head *skb_list) { -@@ -3673,6 +3713,7 @@ static int ath11k_dp_rx_reap_mon_status_ +@@ -3795,6 +3835,7 @@ static int ath11k_dp_rx_reap_mon_status_ struct sk_buff *skb; struct ath11k_skb_rxcb *rxcb; struct hal_tlv_hdr *tlv; @@ -90,7 +90,7 @@ Signed-off-by: Venkateswara Naralasetty u32 cookie; int buf_id, srng_id; dma_addr_t paddr; -@@ -3692,8 +3733,7 @@ static int ath11k_dp_rx_reap_mon_status_ +@@ -3814,8 +3855,7 @@ static int ath11k_dp_rx_reap_mon_status_ ath11k_hal_srng_access_begin(ab, srng); while (*budget) { *budget -= 1; @@ -100,7 +100,7 @@ Signed-off-by: Venkateswara Naralasetty if (!rx_mon_status_desc) { pmon->buf_state = DP_MON_STATUS_REPLINISH; break; -@@ -3724,18 +3764,43 @@ static int ath11k_dp_rx_reap_mon_status_ +@@ -3846,18 +3886,43 @@ static int ath11k_dp_rx_reap_mon_status_ tlv = (struct hal_tlv_hdr *)skb->data; if (FIELD_GET(HAL_TLV_HDR_TAG, tlv->tl) != HAL_RX_STATUS_BUFFER_DONE) { diff --git a/package/kernel/mac80211/patches/nss/ath11k/356-ath11k-invalid-desc-sanity-check.patch b/package/kernel/mac80211/patches/nss/ath11k/356-ath11k-invalid-desc-sanity-check.patch index f574597dceb969..8e23cd99e747c6 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/356-ath11k-invalid-desc-sanity-check.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/356-ath11k-invalid-desc-sanity-check.patch @@ -46,7 +46,7 @@ Signed-off-by: Nagarajan Maran --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -396,8 +396,8 @@ int ath11k_dp_rxbufs_replenish(struct at +@@ -431,8 +431,8 @@ int ath11k_dp_rxbufs_replenish(struct at goto fail_free_skb; spin_lock_bh(&rx_ring->idr_lock); @@ -57,7 +57,7 @@ Signed-off-by: Nagarajan Maran spin_unlock_bh(&rx_ring->idr_lock); if (buf_id <= 0) goto fail_dma_unmap; -@@ -3141,6 +3141,16 @@ try_again: +@@ -3263,6 +3263,16 @@ try_again: while (likely(desc = (struct hal_reo_dest_ring *)ath11k_hal_srng_dst_get_next_entry(ab, srng))) { @@ -74,7 +74,7 @@ Signed-off-by: Nagarajan Maran cookie = FIELD_GET(BUFFER_ADDR_INFO1_SW_COOKIE, desc->buf_addr_info.info1); buf_id = FIELD_GET(DP_RXDMA_BUF_COOKIE_BUF_ID, -@@ -3171,8 +3181,6 @@ try_again: +@@ -3293,8 +3303,6 @@ try_again: num_buffs_reaped[mac_id]++; diff --git a/package/kernel/mac80211/patches/nss/ath11k/359-ath11k-fix-tkip-encryption-traffic-failure.patch b/package/kernel/mac80211/patches/nss/ath11k/359-ath11k-fix-tkip-encryption-traffic-failure.patch index f57faaa465ae76..fe231db61355ea 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/359-ath11k-fix-tkip-encryption-traffic-failure.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/359-ath11k-fix-tkip-encryption-traffic-failure.patch @@ -13,7 +13,7 @@ Signed-off-by: Ramya Gnanasekar --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -2564,7 +2564,8 @@ static void ath11k_dp_rx_h_undecap(struc +@@ -2671,7 +2671,8 @@ static void ath11k_dp_rx_h_undecap(struc ehdr = (struct ethhdr *)msdu->data; /* mac80211 allows fast path only for authorized STA */ diff --git a/package/kernel/mac80211/patches/nss/ath11k/371-ath11k-Fix-ppdu_id-from-firmware-PPDU-stats.patch b/package/kernel/mac80211/patches/nss/ath11k/371-ath11k-Fix-ppdu_id-from-firmware-PPDU-stats.patch index f909ba4a673f69..fd4f0938cdb83b 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/371-ath11k-Fix-ppdu_id-from-firmware-PPDU-stats.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/371-ath11k-Fix-ppdu_id-from-firmware-PPDU-stats.patch @@ -14,7 +14,7 @@ Signed-off-by: Ramya Gnanasekar --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h -@@ -1425,6 +1425,7 @@ struct htt_ppdu_stats_usr_cmpltn_cmn { +@@ -1501,6 +1501,7 @@ struct htt_ppdu_stats_usr_cmpltn_cmn { #define HTT_PPDU_STATS_ACK_BA_INFO_TID_NUM GENMASK(31, 25) #define HTT_PPDU_STATS_NON_QOS_TID 16 @@ -24,7 +24,7 @@ Signed-off-by: Ramya Gnanasekar u32 ppdu_id; --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1288,7 +1288,7 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1323,7 +1323,7 @@ static int ath11k_htt_tlv_ppdu_stats_par struct htt_ppdu_user_stats *user_stats = NULL; int cur_user; u16 peer_id; @@ -33,7 +33,7 @@ Signed-off-by: Ramya Gnanasekar ppdu_info = data; -@@ -1369,6 +1369,8 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1404,6 +1404,8 @@ static int ath11k_htt_tlv_ppdu_stats_par return -EINVAL; } @@ -42,7 +42,7 @@ Signed-off-by: Ramya Gnanasekar peer_id = ((struct htt_ppdu_stats_usr_cmpltn_ack_ba_status *)ptr)->sw_peer_id; cur_user = ath11k_get_ppdu_user_index(&ppdu_info->ppdu_stats, -@@ -1380,6 +1382,7 @@ static int ath11k_htt_tlv_ppdu_stats_par +@@ -1415,6 +1417,7 @@ static int ath11k_htt_tlv_ppdu_stats_par user_stats->is_valid_peer_id = true; memcpy((void *)&user_stats->ack_ba, ptr, sizeof(struct htt_ppdu_stats_usr_cmpltn_ack_ba_status)); diff --git a/package/kernel/mac80211/patches/nss/ath11k/373-ath11k-Add-retry-mechanism-for-update_rx_qu.patch b/package/kernel/mac80211/patches/nss/ath11k/373-ath11k-Add-retry-mechanism-for-update_rx_qu.patch index 8adb5448a1564c..fd78090aebc0f0 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/373-ath11k-Add-retry-mechanism-for-update_rx_qu.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/373-ath11k-Add-retry-mechanism-for-update_rx_qu.patch @@ -53,7 +53,7 @@ Signed-off-by: Tamizh Chelvam Raja }; --- a/drivers/net/wireless/ath/ath11k/debugfs.c +++ b/drivers/net/wireless/ath/ath11k/debugfs.c -@@ -848,6 +848,18 @@ static ssize_t ath11k_debugfs_dump_soc_d +@@ -849,6 +849,18 @@ static ssize_t ath11k_debugfs_dump_soc_d "\nNSS Transmit Failures: %d\n", atomic_read(&soc_stats->tx_err.nss_tx_fail)); @@ -110,7 +110,7 @@ Signed-off-by: Tamizh Chelvam Raja struct dp_reo_cmd { struct list_head list; struct dp_rx_tid data; -@@ -295,6 +304,12 @@ struct ath11k_dp { +@@ -296,6 +305,12 @@ struct ath11k_dp { * - reo_cmd_cache_flush_count */ spinlock_t reo_cmd_lock; @@ -135,7 +135,7 @@ Signed-off-by: Tamizh Chelvam Raja static inline u8 *ath11k_dp_rx_h_80211_hdr(struct ath11k_base *ab, struct hal_rx_desc *desc) { -@@ -672,13 +675,50 @@ static int ath11k_dp_rx_pdev_srng_alloc( +@@ -707,13 +710,50 @@ static int ath11k_dp_rx_pdev_srng_alloc( return 0; } @@ -186,7 +186,7 @@ Signed-off-by: Tamizh Chelvam Raja spin_lock_bh(&dp->reo_cmd_lock); list_for_each_entry_safe(cmd, tmp, &dp->reo_cmd_list, list) { list_del(&cmd->list); -@@ -724,14 +764,18 @@ static void ath11k_dp_reo_cmd_free(struc +@@ -759,14 +799,18 @@ static void ath11k_dp_reo_cmd_free(struc } } @@ -207,7 +207,7 @@ Signed-off-by: Tamizh Chelvam Raja desc_sz = ath11k_hal_reo_qdesc_size(0, HAL_DESC_REO_NON_QOS_TID); while (tot_desc_sz > desc_sz) { -@@ -742,11 +786,17 @@ static void ath11k_dp_reo_cache_flush(st +@@ -777,11 +821,17 @@ static void ath11k_dp_reo_cache_flush(st HAL_REO_CMD_FLUSH_CACHE, &cmd, NULL); if (ret) @@ -228,7 +228,7 @@ Signed-off-by: Tamizh Chelvam Raja memset(&cmd, 0, sizeof(cmd)); cmd.addr_lo = lower_32_bits(rx_tid->paddr); cmd.addr_hi = upper_32_bits(rx_tid->paddr); -@@ -754,24 +804,21 @@ static void ath11k_dp_reo_cache_flush(st +@@ -789,24 +839,21 @@ static void ath11k_dp_reo_cache_flush(st ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, HAL_REO_CMD_FLUSH_CACHE, &cmd, ath11k_dp_reo_cmd_free); @@ -259,7 +259,7 @@ Signed-off-by: Tamizh Chelvam Raja goto free_desc; } else if (status != HAL_REO_CMD_SUCCESS) { /* Shouldn't happen! Cleanup in case of other failure? */ -@@ -780,6 +827,29 @@ static void ath11k_dp_rx_tid_del_func(st +@@ -815,6 +862,29 @@ static void ath11k_dp_rx_tid_del_func(st return; } @@ -289,7 +289,7 @@ Signed-off-by: Tamizh Chelvam Raja elem = kzalloc(sizeof(*elem), GFP_ATOMIC); if (!elem) goto free_desc; -@@ -797,13 +867,20 @@ static void ath11k_dp_rx_tid_del_func(st +@@ -832,13 +902,20 @@ static void ath11k_dp_rx_tid_del_func(st if (dp->reo_cmd_cache_flush_count > DP_REO_DESC_FREE_THRESHOLD || time_after(jiffies, elem->ts + msecs_to_jiffies(DP_REO_DESC_FREE_TIMEOUT_MS))) { @@ -314,7 +314,7 @@ Signed-off-by: Tamizh Chelvam Raja } } spin_unlock_bh(&dp->reo_cmd_lock); -@@ -819,34 +896,48 @@ free_desc: +@@ -854,34 +931,48 @@ free_desc: void ath11k_peer_rx_tid_delete(struct ath11k *ar, struct ath11k_peer *peer, u8 tid) { diff --git a/package/kernel/mac80211/patches/nss/ath11k/401-ath11k-Fix-mutex-dead-lock-and-q6-dump-crash.patch b/package/kernel/mac80211/patches/nss/ath11k/401-ath11k-Fix-mutex-dead-lock-and-q6-dump-crash.patch new file mode 100644 index 00000000000000..1f66f72a4a4851 --- /dev/null +++ b/package/kernel/mac80211/patches/nss/ath11k/401-ath11k-Fix-mutex-dead-lock-and-q6-dump-crash.patch @@ -0,0 +1,59 @@ +From 0a30d8c3d51d798b50bd792aa49e6a5b5ad14183 Mon Sep 17 00:00:00 2001 +From: Rajat Soni +Date: Wed, 12 Apr 2023 18:06:54 +0530 +Subject: [PATCH] ath11k: Fix mutex dead lock and q6 dump crash + +Issue 1: +Currently for HOST_DDR_REGION_TYPE memory, we are facing crash +because target memory virtual address (vaddr) is NULL. We are +not assigning any value to vaddr. + +Issue 2: +In ath11k_mac_op_start we are using mutex lock and waiting for +waiting for completion of ab->reconfigure_complete. +Before completing ab->reconfigure_complete in function +ath11k_core_reconfigure_on_crash, we are again trying +to get mutex lock in ath11k_spectral_deinit. This results +in dead lock. + +Due to these two issue during SSR case fw recovery pdev +is not recovered properly. + +To resolve these two issues: +Issue1: +During ath11k_qmi_assign_target_mem_chunk we should assign +ab->qmi.target_mem[idx].vaddr. + +Issue 2: +Unlock mutex lock before waiting for completion of +ab->reconfigure_complete and acquiring lock again. + +Signed-off-by: Rajat Soni +--- + drivers/net/wireless/ath/ath11k/mac.c | 2 ++ + drivers/net/wireless/ath/ath11k/qmi.c | 1 + + 2 files changed, 3 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -8001,7 +8001,9 @@ static int ath11k_mac_op_start(struct ie + break; + case ATH11K_STATE_RESTARTING: + ar->state = ATH11K_STATE_RESTARTED; ++ mutex_unlock(&ar->conf_mutex); + ath11k_mac_wait_reconfigure(ab); ++ mutex_lock(&ar->conf_mutex); + break; + case ATH11K_STATE_RESTARTED: + case ATH11K_STATE_WEDGED: +--- a/drivers/net/wireless/ath/ath11k/qmi.c ++++ b/drivers/net/wireless/ath/ath11k/qmi.c +@@ -2960,6 +2960,8 @@ static int ath11k_qmi_assign_target_mem_ + if (!ab->qmi.target_mem[idx].iaddr) + return -EIO; + ++ ab->qmi.target_mem[idx].vaddr = ab->qmi.target_mem[idx].iaddr; ++ + ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; + host_ddr_sz = ab->qmi.target_mem[i].size; + ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; diff --git a/package/kernel/mac80211/patches/nss/ath11k/453-ath11k-flush-management-frames-to-firmware-before-wa.patch b/package/kernel/mac80211/patches/nss/ath11k/453-ath11k-flush-management-frames-to-firmware-before-wa.patch new file mode 100644 index 00000000000000..7d413afec97b3d --- /dev/null +++ b/package/kernel/mac80211/patches/nss/ath11k/453-ath11k-flush-management-frames-to-firmware-before-wa.patch @@ -0,0 +1,43 @@ +From 76482cd32e1053ef6437015d9418636616931213 Mon Sep 17 00:00:00 2001 +From: Hari Chandrakanthan +Date: Thu, 22 Jun 2023 00:45:47 +0530 +Subject: [PATCH] ath11k : flush management frames to firmware before waiting + for tx completion + +warning print "ath11k c000000.wifi: failed to flush mgmt transmit queue 0" +is observed during interface down. + +The management packets are queued in a skb_queue and the skb_queue +is dequeued in the work ar->wmi_mgmt_tx_work. + +In ath11k_mac_flush_tx_complete, before waiting for the tx completion of +all the management frames, we are not ensuring that queued +management frames are flushed to the firmware. + +This causes ar->num_pending_mgmt_tx to be positive and it leads to the +warning print. + +Fix this by flushing all the management frames to firmware before waiting +for the tx completion. + +Signed-off-by: Hari Chandrakanthan +--- + drivers/net/wireless/ath/ath11k/mac.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c +index 28c9908ef816..dbdb7aa5c498 100644 +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -10266,6 +10266,8 @@ static int ath11k_mac_flush_tx_complete(struct ath11k *ar) + ret = -ETIMEDOUT; + } + ++ flush_work(&ar->wmi_mgmt_tx_work); ++ + time_left = wait_event_timeout(ar->txmgmt_empty_waitq, + (atomic_read(&ar->num_pending_mgmt_tx) == 0), + ATH11K_FLUSH_TIMEOUT); +-- +2.7.4 + diff --git a/package/kernel/mac80211/patches/nss/ath11k/456-wifi-ath11k-Advertise-TX_QUEUE-mac-hw-flag.patch b/package/kernel/mac80211/patches/nss/ath11k/456-wifi-ath11k-Advertise-TX_QUEUE-mac-hw-flag.patch index 510fbc2448cee7..1f81a8ef722598 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/456-wifi-ath11k-Advertise-TX_QUEUE-mac-hw-flag.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/456-wifi-ath11k-Advertise-TX_QUEUE-mac-hw-flag.patch @@ -13,7 +13,7 @@ Signed-off-by: Yuvasree Sivasankaran --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -10141,6 +10141,7 @@ static int __ath11k_mac_register(struct +@@ -10142,6 +10142,7 @@ static int __ath11k_mac_register(struct ieee80211_hw_set(ar->hw, QUEUE_CONTROL); ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK); diff --git a/package/kernel/mac80211/patches/nss/ath11k/457-wifi-ath11k-Avoid-memset-of-ppdu-info-for-next-skb.patch b/package/kernel/mac80211/patches/nss/ath11k/457-wifi-ath11k-Avoid-memset-of-ppdu-info-for-next-skb.patch index c23b6cb3c858b4..55d8063a2403ca 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/457-wifi-ath11k-Avoid-memset-of-ppdu-info-for-next-skb.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/457-wifi-ath11k-Avoid-memset-of-ppdu-info-for-next-skb.patch @@ -48,7 +48,7 @@ Signed-off-by: Yuvasree Sivasankaran --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -6090,7 +6090,9 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -6261,7 +6261,9 @@ int ath11k_dp_rx_process_mon_status(stru if (!num_buffs_reaped) goto exit; @@ -59,7 +59,7 @@ Signed-off-by: Yuvasree Sivasankaran ppdu_info->peer_id = HAL_INVALID_PEERID; while ((skb = __skb_dequeue(&skb_list))) { -@@ -6108,7 +6110,6 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -6279,7 +6281,6 @@ int ath11k_dp_rx_process_mon_status(stru if (log_type != ATH11K_PKTLOG_TYPE_INVALID) trace_ath11k_htt_rxdesc(ar, skb->data, log_type, rx_buf_sz); @@ -67,7 +67,7 @@ Signed-off-by: Yuvasree Sivasankaran ppdu_info->peer_id = HAL_INVALID_PEERID; hal_status = ath11k_hal_rx_parse_mon_status(ab, ppdu_info, skb); -@@ -6136,6 +6137,7 @@ int ath11k_dp_rx_process_mon_status(stru +@@ -6307,6 +6308,7 @@ int ath11k_dp_rx_process_mon_status(stru if ((ppdu_info->peer_id == HAL_INVALID_PEERID || hal_status != HAL_RX_MON_STATUS_PPDU_DONE)) { dev_kfree_skb_any(skb); diff --git a/package/kernel/mac80211/patches/nss/ath11k/669-ath11k-change-dma_map_single-to-virt_to_phys-in-rx-r.patch b/package/kernel/mac80211/patches/nss/ath11k/669-ath11k-change-dma_map_single-to-virt_to_phys-in-rx-r.patch new file mode 100644 index 00000000000000..fe767b6a33de2a --- /dev/null +++ b/package/kernel/mac80211/patches/nss/ath11k/669-ath11k-change-dma_map_single-to-virt_to_phys-in-rx-r.patch @@ -0,0 +1,66 @@ +From cd0401a0fe82b5f9c31016d11dcc99d9fa4be96d Mon Sep 17 00:00:00 2001 +From: Balamurugan Selvarajan +Date: Wed, 14 Sep 2022 17:12:20 +0530 +Subject: [PATCH] ath11k: Skip cache invalidation in rx replenish + +In ath11k_dp_rxbufs_replenish() the descriptors are updated with +new skb physical address. currently physical address is obtained +using dma_map_single() this api additionally invalidates the cache +lines which is not required in replenish(). This consumes CPU cycles. +In the Rx data path, the desc->skb memory is invalidated before +reading from the memory. So, replace dmap_map_single() with +dma_map_single_attrs(DMA_ATTR_SKIP_CPU_SYNC). This reduces CPU usage by 7%. + +perf top with dma_map_single() +============================= + 24.99% [kernel] [k] __pi___inval_dcache_area + 14.56% [ath11k] [k] ath11k_dp_process_rx + 8.24% [qca_nss_dp] [k] edma_tx_ring_xmit + 5.22% [kernel] [k] dmac_clean_range_no_dsb + 4.26% [kernel] [k] __dma_clean_area_no_dsb + 4.22% [qca_nss_sfe] [k] sfe_recv + 3.90% [kernel] [k] skb_recycler_alloc + 3.87% [kernel] [k] __local_bh_enable_ip + +perf top with dma_map_single_attrs with DMA_ATTR_SKIP_CPU_SYNC +============================================================= + 17.07% [kernel] [k] __pi___inval_dcache_area + 15.53% [ath11k] [k] ath11k_dp_process_rx + 9.03% [qca_nss_dp] [k] edma_tx_ring_xmit + 5.62% [kernel] [k] dmac_clean_range_no_dsb + 5.41% [kernel] [k] skb_recycler_alloc + 4.68% [qca_nss_sfe] [k] sfe_recv + 4.64% [kernel] [k] __dma_clean_area_no_dsb + 3.88% [kernel] [k] __local_bh_enable_ip + +Signed-off-by: Balamurugan Selvarajan +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -427,9 +427,9 @@ int ath11k_dp_rxbufs_replenish(struct at + skb->data); + } + +- paddr = dma_map_single(ab->dev, skb->data, +- skb->len + skb_tailroom(skb), +- DMA_FROM_DEVICE); ++ paddr = dma_map_single_attrs(ab->dev, skb->data, ++ skb->len + skb_tailroom(skb), ++ DMA_FROM_DEVICE, DMA_ATTR_SKIP_CPU_SYNC); + if (dma_mapping_error(ab->dev, paddr)) + goto fail_free_skb; + +@@ -465,8 +465,8 @@ fail_idr_remove: + idr_remove(&rx_ring->bufs_idr, buf_id); + spin_unlock_bh(&rx_ring->idr_lock); + fail_dma_unmap: +- dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), +- DMA_FROM_DEVICE); ++ dma_unmap_single_attrs(ab->dev, paddr, skb->len + skb_tailroom(skb), ++ DMA_FROM_DEVICE, DMA_ATTR_SKIP_CPU_SYNC); + fail_free_skb: + dev_kfree_skb_any(skb); + diff --git a/package/kernel/mac80211/patches/nss/ath11k/907-01-wifi-ath11k-remove-invalid-peer-create-logic.patch b/package/kernel/mac80211/patches/nss/ath11k/907-01-wifi-ath11k-remove-invalid-peer-create-logic.patch index b471fb326a5b48..b2912777fad5d0 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/907-01-wifi-ath11k-remove-invalid-peer-create-logic.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/907-01-wifi-ath11k-remove-invalid-peer-create-logic.patch @@ -26,7 +26,7 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -8221,7 +8221,6 @@ ath11k_mac_op_assign_vif_chanctx(struct +@@ -8222,7 +8222,6 @@ ath11k_mac_op_assign_vif_chanctx(struct struct ath11k_base *ab = ar->ab; struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); int ret; @@ -34,7 +34,7 @@ Acked-by: Jeff Johnson mutex_lock(&ar->conf_mutex); -@@ -8244,21 +8243,6 @@ ath11k_mac_op_assign_vif_chanctx(struct +@@ -8245,21 +8244,6 @@ ath11k_mac_op_assign_vif_chanctx(struct goto out; } diff --git a/package/kernel/mac80211/patches/nss/ath11k/907-02-wifi-ath11k-rename-ath11k_start_vdev_delay.patch b/package/kernel/mac80211/patches/nss/ath11k/907-02-wifi-ath11k-rename-ath11k_start_vdev_delay.patch index 2fb2cdfd429b11..ea08ea8818155d 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/907-02-wifi-ath11k-rename-ath11k_start_vdev_delay.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/907-02-wifi-ath11k-rename-ath11k_start_vdev_delay.patch @@ -39,7 +39,7 @@ Acked-by: Jeff Johnson if (ret) { ath11k_warn(ab, "failed to delay vdev start: %d\n", ret); goto free_tx_stats; -@@ -8164,8 +8164,8 @@ unlock: +@@ -8165,8 +8165,8 @@ unlock: mutex_unlock(&ar->conf_mutex); } diff --git a/package/kernel/mac80211/patches/nss/ath11k/907-03-wifi-ath11k-avoid-forward-declaration-of-ath11k_mac_start_vdev_delay.patch b/package/kernel/mac80211/patches/nss/ath11k/907-03-wifi-ath11k-avoid-forward-declaration-of-ath11k_mac_start_vdev_delay.patch index 4d83d0f0ed9029..a2ff42ad9d194d 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/907-03-wifi-ath11k-avoid-forward-declaration-of-ath11k_mac_start_vdev_delay.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/907-03-wifi-ath11k-avoid-forward-declaration-of-ath11k_mac_start_vdev_delay.patch @@ -317,7 +317,7 @@ Acked-by: Jeff Johnson static int ath11k_mac_op_sta_set_txpwr(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) -@@ -9739,6 +9461,281 @@ ath11k_mac_op_config_mesh_offload_path(s +@@ -9740,6 +9462,281 @@ ath11k_mac_op_config_mesh_offload_path(s } #endif diff --git a/package/kernel/mac80211/patches/nss/ath11k/907-04-wifi-ath11k-fix-connection-failure-due-to-unexpected-peer-delete.patch b/package/kernel/mac80211/patches/nss/ath11k/907-04-wifi-ath11k-fix-connection-failure-due-to-unexpected-peer-delete.patch index d1b462519c91e8..aeaf65aaa0e73b 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/907-04-wifi-ath11k-fix-connection-failure-due-to-unexpected-peer-delete.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/907-04-wifi-ath11k-fix-connection-failure-due-to-unexpected-peer-delete.patch @@ -52,7 +52,7 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -7933,6 +7933,30 @@ static int ath11k_mac_start_vdev_delay(s +@@ -7934,6 +7934,30 @@ static int ath11k_mac_start_vdev_delay(s return 0; } @@ -83,7 +83,7 @@ Acked-by: Jeff Johnson static int ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -@@ -7977,15 +8001,17 @@ ath11k_mac_op_assign_vif_chanctx(struct +@@ -7978,15 +8002,17 @@ ath11k_mac_op_assign_vif_chanctx(struct goto out; } @@ -109,7 +109,7 @@ Acked-by: Jeff Johnson if (arvif->vdev_type != WMI_VDEV_TYPE_MONITOR && test_bit(ATH11K_FLAG_MONITOR_VDEV_CREATED, &ar->monitor_flags)) { -@@ -8025,8 +8051,6 @@ ath11k_mac_op_unassign_vif_chanctx(struc +@@ -8026,8 +8052,6 @@ ath11k_mac_op_unassign_vif_chanctx(struc "chanctx unassign ptr %p vdev_id %i\n", ctx, arvif->vdev_id); @@ -118,7 +118,7 @@ Acked-by: Jeff Johnson if (ab->hw_params.vdev_start_delay && arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) { spin_lock_bh(&ab->base_lock); -@@ -8050,24 +8074,13 @@ ath11k_mac_op_unassign_vif_chanctx(struc +@@ -8051,24 +8075,13 @@ ath11k_mac_op_unassign_vif_chanctx(struc return; } @@ -149,7 +149,7 @@ Acked-by: Jeff Johnson } if (ab->hw_params.vdev_start_delay && -@@ -9555,6 +9568,46 @@ exit: +@@ -9556,6 +9569,46 @@ exit: return ret; } @@ -196,7 +196,7 @@ Acked-by: Jeff Johnson static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, -@@ -9590,31 +9643,15 @@ static int ath11k_mac_op_sta_state(struc +@@ -9591,31 +9644,15 @@ static int ath11k_mac_op_sta_state(struc sta->addr, arvif->vdev_id); } else if ((old_state == IEEE80211_STA_NONE && new_state == IEEE80211_STA_NOTEXIST)) { @@ -233,7 +233,7 @@ Acked-by: Jeff Johnson ath11k_warn(ar->ab, "Found peer entry %pM n vdev %i after it was supposedly removed\n", vif->addr, arvif->vdev_id); ath11k_peer_rhash_delete(ar->ab, peer); -@@ -9625,12 +9662,6 @@ static int ath11k_mac_op_sta_state(struc +@@ -9626,12 +9663,6 @@ static int ath11k_mac_op_sta_state(struc } spin_unlock_bh(&ar->ab->base_lock); mutex_unlock(&ar->ab->tbl_mtx_lock); @@ -246,7 +246,7 @@ Acked-by: Jeff Johnson } else if (old_state == IEEE80211_STA_AUTH && new_state == IEEE80211_STA_ASSOC && (vif->type == NL80211_IFTYPE_AP || -@@ -10202,6 +10233,8 @@ static int __ath11k_mac_register(struct +@@ -10203,6 +10234,8 @@ static int __ath11k_mac_register(struct wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT); diff --git a/package/kernel/mac80211/patches/nss/ath11k/908-ath11k-make-debugfs-sta-htt-stats-modular.patch b/package/kernel/mac80211/patches/nss/ath11k/908-ath11k-make-debugfs-sta-htt-stats-modular.patch index 2362820dc9e838..06f5e62c7b103c 100644 --- a/package/kernel/mac80211/patches/nss/ath11k/908-ath11k-make-debugfs-sta-htt-stats-modular.patch +++ b/package/kernel/mac80211/patches/nss/ath11k/908-ath11k-make-debugfs-sta-htt-stats-modular.patch @@ -40,7 +40,7 @@ ath11k-$(CPTCFG_ATH11K_THERMAL) += thermal.o --- a/drivers/net/wireless/ath/ath11k/debugfs.c +++ b/drivers/net/wireless/ath/ath11k/debugfs.c -@@ -1875,7 +1875,9 @@ int ath11k_debugfs_register(struct ath11 +@@ -1877,7 +1877,9 @@ int ath11k_debugfs_register(struct ath11 snprintf(buf, 100, "../../ath11k/%pd2", ar->debug.debugfs_pdev); debugfs_create_symlink("ath11k", ar->hw->wiphy->debugfsdir, buf); @@ -120,7 +120,7 @@ &fops_peer_ps_state); --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c -@@ -1723,8 +1723,10 @@ ath11k_update_per_peer_tx_stats(struct a +@@ -1758,8 +1758,10 @@ ath11k_update_per_peer_tx_stats(struct a peer_stats->mu_pos = mu_pos; peer_stats->ru_tones = arsta->txrate.he_ru_alloc; @@ -131,7 +131,7 @@ } usr_stats->rate_stats_updated = true; -@@ -2170,7 +2172,9 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s +@@ -2205,7 +2207,9 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s ath11k_htt_pull_ppdu_stats(ab, skb); break; case HTT_T2H_MSG_TYPE_EXT_STATS_CONF: @@ -176,7 +176,7 @@ spin_unlock_bh(&ab->base_lock); --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -9812,7 +9812,7 @@ static const struct ieee80211_ops ath11k +@@ -9813,7 +9813,7 @@ static const struct ieee80211_ops ath11k .set_wakeup = ath11k_wow_op_set_wakeup, #endif diff --git a/package/kernel/mac80211/patches/nss/ath11k/999-336-0002-ath11k-Use-idr_replace.patch b/package/kernel/mac80211/patches/nss/ath11k/999-336-0002-ath11k-Use-idr_replace.patch new file mode 100644 index 00000000000000..c2cc4f2f89f43e --- /dev/null +++ b/package/kernel/mac80211/patches/nss/ath11k/999-336-0002-ath11k-Use-idr_replace.patch @@ -0,0 +1,264 @@ +From 93abe1755de2727bf8fb5969bce25ae49c704484 Mon Sep 17 00:00:00 2001 +From: Tamizh Chelvam +Date: Mon, 15 Nov 2021 18:15:38 +0530 +Subject: [PATCH] ath11k: Use idr_replace + +idr_alloc has been done multiple times upon reaping the msdu +using idr_remove. This idr_alloc would take more cpu, to redue +the cpu usage call idr_replace by storing used buf_ids instead +of calling idr_alloc during replenish. + +Signed-off-by: Tamizh Chelvam +--- + drivers/net/wireless/ath/ath11k/core.h | 6 +++ + drivers/net/wireless/ath/ath11k/dp.c | 2 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 66 +++++++++++++++++++++++++-------- + drivers/net/wireless/ath/ath11k/dp_rx.h | 2 +- + 4 files changed, 59 insertions(+), 17 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -662,6 +662,11 @@ struct ath11k_per_peer_tx_stats { + #define ATH11K_FLUSH_TIMEOUT (5 * HZ) + #define ATH11K_VDEV_DELETE_TIMEOUT_HZ (5 * HZ) + ++struct ath11k_rx_buf_id { ++ struct list_head list; ++ int used_buf_id; ++}; ++ + struct ath11k { + struct ath11k_base *ab; + struct ath11k_pdev *pdev; +@@ -811,6 +816,7 @@ struct ath11k { + /* protected by conf_mutex */ + bool ps_state_enable; + bool ps_timekeeper_enable; ++ struct ath11k_rx_buf_id rx_buf_id; + }; + + struct ath11k_band_cap { +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -897,7 +897,7 @@ int ath11k_dp_service_srng(struct ath11k + + hal_params = ab->hw_params.hal_params; + ath11k_dp_rxbufs_replenish(ab, id, rx_ring, 0, +- hal_params->rx_buf_rbm); ++ hal_params->rx_buf_rbm, NULL); + } + } + } +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -388,7 +388,8 @@ static inline u8 ath11k_dp_rx_h_msdu_sta + int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, + struct dp_rxdma_ring *rx_ring, + int req_entries, +- enum hal_rx_buf_return_buf_manager mgr) ++ enum hal_rx_buf_return_buf_manager mgr, ++ u32 *buf_ids) + { + struct hal_srng *srng; + u32 *desc; +@@ -396,9 +397,15 @@ int ath11k_dp_rxbufs_replenish(struct at + int num_free; + int num_remain; + int buf_id; ++ int buf_id_index; + u32 cookie; + dma_addr_t paddr; + ++ if (!buf_ids) ++ buf_id_index = 0; ++ else ++ buf_id_index = min(req_entries, DP_RX_MAX_IDR_BUF); ++ + req_entries = min(req_entries, rx_ring->bufs_max); + + srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; +@@ -434,8 +441,14 @@ int ath11k_dp_rxbufs_replenish(struct at + goto fail_free_skb; + + spin_lock_bh(&rx_ring->idr_lock); ++ if (buf_ids && buf_id_index) { ++ buf_id_index--; ++ buf_id = buf_ids[buf_id_index]; ++ idr_replace(&rx_ring->bufs_idr, skb, buf_id); ++ } else { + buf_id = idr_alloc(&rx_ring->bufs_idr, skb, 1, + (rx_ring->bufs_max * 3) + 1, GFP_ATOMIC); ++ } + spin_unlock_bh(&rx_ring->idr_lock); + if (buf_id <= 0) + goto fail_dma_unmap; +@@ -458,6 +471,12 @@ int ath11k_dp_rxbufs_replenish(struct at + + spin_unlock_bh(&srng->lock); + ++ while (buf_id_index--) { ++ spin_lock_bh(&rx_ring->idr_lock); ++ idr_remove(&rx_ring->bufs_idr, buf_ids[buf_id_index]); ++ spin_unlock_bh(&rx_ring->idr_lock); ++ } ++ + return req_entries - num_remain; + + fail_idr_remove: +@@ -532,7 +551,7 @@ static int ath11k_dp_rxdma_ring_buf_setu + + rx_ring->bufs_max = num_entries; + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries, +- ar->ab->hw_params.hal_params->rx_buf_rbm); ++ ar->ab->hw_params.hal_params->rx_buf_rbm, NULL); + return 0; + } + +@@ -3346,11 +3365,14 @@ int ath11k_dp_process_rx(struct ath11k_b + struct ath11k *ar; + struct hal_reo_dest_ring *desc; + enum hal_reo_dest_ring_push_reason push_reason; ++ u32 *rx_buf_id[MAX_RADIOS]; + u32 cookie; + int i; + +- for (i = 0; i < MAX_RADIOS; i++) ++ for (i = 0; i < MAX_RADIOS; i++) { + __skb_queue_head_init(&msdu_list[i]); ++ rx_buf_id[i] = kzalloc(sizeof(u32) * DP_RX_MAX_IDR_BUF, GFP_ATOMIC); ++ } + + srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; + +@@ -3383,8 +3405,16 @@ try_again: + + ar = ab->pdevs[mac_id].ar; + rx_ring = &ar->dp.rx_refill_buf_ring; ++ i = num_buffs_reaped[mac_id]; ++ + spin_lock_bh(&rx_ring->idr_lock); +- msdu = idr_find(&rx_ring->bufs_idr, buf_id); ++ if (rx_buf_id[mac_id] && i < DP_RX_MAX_IDR_BUF) { ++ msdu = idr_find(&rx_ring->bufs_idr, buf_id); ++ rx_buf_id[mac_id][i] = buf_id; ++ } else { ++ msdu = idr_remove(&rx_ring->bufs_idr, buf_id); ++ } ++ spin_unlock_bh(&rx_ring->idr_lock); + if (unlikely(!msdu)) { + ath11k_warn(ab, "frame rx with invalid buf_id %d\n", + buf_id); +@@ -3464,9 +3494,12 @@ try_again: + rx_ring = &ar->dp.rx_refill_buf_ring; + + ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], +- ab->hw_params.hal_params->rx_buf_rbm); ++ ab->hw_params.hal_params->rx_buf_rbm, rx_buf_id[i]); + } + exit: ++ for (i = 0; i < MAX_RADIOS; i++) ++ kfree(rx_buf_id[i]); ++ + return total_msdu_reaped; + } + +@@ -4831,7 +4864,7 @@ exit: + rx_ring = &ar->dp.rx_refill_buf_ring; + + ath11k_dp_rxbufs_replenish(ab, i, rx_ring, n_bufs_reaped[i], +- ab->hw_params.hal_params->rx_buf_rbm); ++ ab->hw_params.hal_params->rx_buf_rbm, NULL); + } + + return tot_n_bufs_reaped; +@@ -5047,14 +5080,17 @@ int ath11k_dp_rx_process_wbm_err(struct + struct sk_buff *msdu; + struct sk_buff_head msdu_list[MAX_RADIOS]; + struct ath11k_skb_rxcb *rxcb; ++ u32 *wbm_err_buf_id[MAX_RADIOS]; + u32 *rx_desc; + int buf_id, mac_id; + int num_buffs_reaped[MAX_RADIOS] = {0}; + int total_num_buffs_reaped = 0; + int ret, i; + +- for (i = 0; i < ab->num_radios; i++) ++ for (i = 0; i < ab->num_radios; i++) { + __skb_queue_head_init(&msdu_list[i]); ++ wbm_err_buf_id[i] = kzalloc(sizeof(u32) * DP_RX_MAX_IDR_BUF, GFP_ATOMIC); ++ } + + srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; + +@@ -5129,7 +5165,7 @@ int ath11k_dp_rx_process_wbm_err(struct + rx_ring = &ar->dp.rx_refill_buf_ring; + + ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], +- ab->hw_params.hal_params->rx_buf_rbm); ++ ab->hw_params.hal_params->rx_buf_rbm, wbm_err_buf_id[i]); + } + + rcu_read_lock(); +@@ -5151,6 +5187,8 @@ int ath11k_dp_rx_process_wbm_err(struct + } + rcu_read_unlock(); + done: ++ for (i = 0; i < ab->num_radios; i++) ++ kfree(wbm_err_buf_id[i]); + return total_num_buffs_reaped; + } + +@@ -5238,7 +5276,7 @@ int ath11k_dp_process_rxdma_err(struct a + + if (num_buf_freed) + ath11k_dp_rxbufs_replenish(ab, mac_id, rx_ring, num_buf_freed, +- ab->hw_params.hal_params->rx_buf_rbm); ++ ab->hw_params.hal_params->rx_buf_rbm, NULL); + + return budget - quota; + } +@@ -6184,12 +6222,12 @@ static void ath11k_dp_rx_mon_dest_proces + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, + &dp->rxdma_mon_buf_ring, + rx_bufs_used, +- hal_params->rx_buf_rbm); ++ hal_params->rx_buf_rbm, NULL); + else + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, + &dp->rx_refill_buf_ring, + rx_bufs_used, +- hal_params->rx_buf_rbm); ++ hal_params->rx_buf_rbm, NULL); + } + } + +@@ -6701,7 +6739,7 @@ next_entry: + ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, + &dp->rxdma_mon_buf_ring, + rx_bufs_used, +- HAL_RX_BUF_RBM_SW3_BM); ++ HAL_RX_BUF_RBM_SW3_BM, NULL); + } + + reap_status_ring: +--- a/drivers/net/wireless/ath/ath11k/dp_rx.h ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.h +@@ -11,6 +11,8 @@ + + #define DP_MAX_NWIFI_HDR_LEN 36 + ++#define DP_RX_MAX_IDR_BUF 256 ++ + #define DP_RX_MPDU_ERR_FCS BIT(0) + #define DP_RX_MPDU_ERR_DECRYPT BIT(1) + #define DP_RX_MPDU_ERR_TKIP_MIC BIT(2) +@@ -125,7 +127,8 @@ int ath11k_dp_process_rx(struct ath11k_b + int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, + struct dp_rxdma_ring *rx_ring, + int req_entries, +- enum hal_rx_buf_return_buf_manager mgr); ++ enum hal_rx_buf_return_buf_manager mgr, ++ u32 *buf_id); + int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, + int (*iter)(struct ath11k_base *ar, u16 tag, u16 len, + const void *ptr, void *data),