Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git

ath.git patches for v5.13. Major changes:

ath11k

* add initial support for QCN9074, but not enabled yet due to firmware problems

* enable radar detection for 160MHz secondary segment

* handle beacon misses in station mode

+1972 -480
+20 -9
drivers/net/wireless/ath/ath10k/snoc.c
··· 1759 1759 return ret; 1760 1760 } 1761 1761 1762 - static int ath10k_snoc_remove(struct platform_device *pdev) 1762 + static int ath10k_snoc_free_resources(struct ath10k *ar) 1763 1763 { 1764 - struct ath10k *ar = platform_get_drvdata(pdev); 1765 1764 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); 1766 1765 1767 - ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); 1768 - 1769 - reinit_completion(&ar->driver_recovery); 1770 - 1771 - if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags)) 1772 - wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ); 1766 + ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc free resources\n"); 1773 1767 1774 1768 set_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags); 1775 1769 ··· 1777 1783 return 0; 1778 1784 } 1779 1785 1786 + static int ath10k_snoc_remove(struct platform_device *pdev) 1787 + { 1788 + struct ath10k *ar = platform_get_drvdata(pdev); 1789 + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); 1790 + 1791 + ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); 1792 + 1793 + reinit_completion(&ar->driver_recovery); 1794 + 1795 + if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags)) 1796 + wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ); 1797 + 1798 + ath10k_snoc_free_resources(ar); 1799 + 1800 + return 0; 1801 + } 1802 + 1780 1803 static void ath10k_snoc_shutdown(struct platform_device *pdev) 1781 1804 { 1782 1805 struct ath10k *ar = platform_get_drvdata(pdev); 1783 1806 1784 1807 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc shutdown\n"); 1785 - ath10k_snoc_remove(pdev); 1808 + ath10k_snoc_free_resources(ar); 1786 1809 } 1787 1810 1788 1811 static struct platform_driver ath10k_snoc_driver = {
+1 -1
drivers/net/wireless/ath/ath11k/ahb.c
··· 373 373 cfg->tgt_ce = ab->hw_params.target_ce_config; 374 374 cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; 375 375 cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; 376 - ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074; 376 + ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; 377 377 } 378 378 379 379 static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
+56 -2
drivers/net/wireless/ath/ath11k/ce.c
··· 187 187 188 188 }; 189 189 190 + const struct ce_attr ath11k_host_ce_config_qcn9074[] = { 191 + /* CE0: host->target HTC control and raw streams */ 192 + { 193 + .flags = CE_ATTR_FLAGS, 194 + .src_nentries = 16, 195 + .src_sz_max = 2048, 196 + .dest_nentries = 0, 197 + }, 198 + 199 + /* CE1: target->host HTT + HTC control */ 200 + { 201 + .flags = CE_ATTR_FLAGS, 202 + .src_nentries = 0, 203 + .src_sz_max = 2048, 204 + .dest_nentries = 512, 205 + .recv_cb = ath11k_htc_rx_completion_handler, 206 + }, 207 + 208 + /* CE2: target->host WMI */ 209 + { 210 + .flags = CE_ATTR_FLAGS, 211 + .src_nentries = 0, 212 + .src_sz_max = 2048, 213 + .dest_nentries = 32, 214 + .recv_cb = ath11k_htc_rx_completion_handler, 215 + }, 216 + 217 + /* CE3: host->target WMI (mac0) */ 218 + { 219 + .flags = CE_ATTR_FLAGS, 220 + .src_nentries = 32, 221 + .src_sz_max = 2048, 222 + .dest_nentries = 0, 223 + }, 224 + 225 + /* CE4: host->target HTT */ 226 + { 227 + .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, 228 + .src_nentries = 2048, 229 + .src_sz_max = 256, 230 + .dest_nentries = 0, 231 + }, 232 + 233 + /* CE5: target->host pktlog */ 234 + { 235 + .flags = CE_ATTR_FLAGS, 236 + .src_nentries = 0, 237 + .src_sz_max = 2048, 238 + .dest_nentries = 512, 239 + .recv_cb = ath11k_dp_htt_htc_t2h_msg_handler, 240 + }, 241 + }; 242 + 190 243 static bool ath11k_ce_need_shadow_fix(int ce_id) 191 244 { 192 245 /* only ce4 needs shadow workaroud*/ ··· 508 455 struct hal_srng_params *ring_params) 509 456 { 510 457 u32 msi_data_start; 511 - u32 msi_data_count; 458 + u32 msi_data_count, msi_data_idx; 512 459 u32 msi_irq_start; 513 460 u32 addr_lo; 514 461 u32 addr_hi; ··· 522 469 return; 523 470 524 471 ath11k_get_msi_address(ab, &addr_lo, &addr_hi); 472 + ath11k_get_ce_msi_idx(ab, ce_id, &msi_data_idx); 525 473 526 474 ring_params->msi_addr = addr_lo; 527 475 ring_params->msi_addr |= (dma_addr_t)(((uint64_t)addr_hi) << 32); 528 - ring_params->msi_data = (ce_id % msi_data_count) + msi_data_start; 476 + ring_params->msi_data = (msi_data_idx % msi_data_count) + msi_data_start; 529 477 ring_params->flags |= HAL_SRNG_FLAGS_MSI_INTR; 530 478 } 531 479
+1
drivers/net/wireless/ath/ath11k/ce.h
··· 173 173 174 174 extern const struct ce_attr ath11k_host_ce_config_ipq8074[]; 175 175 extern const struct ce_attr ath11k_host_ce_config_qca6390[]; 176 + extern const struct ce_attr ath11k_host_ce_config_qcn9074[]; 176 177 177 178 void ath11k_ce_cleanup_pipes(struct ath11k_base *ab); 178 179 void ath11k_ce_rx_replenish_retry(struct timer_list *t);
+44 -1
drivers/net/wireless/ath/ath11k/core.c
··· 45 45 .ring_mask = &ath11k_hw_ring_mask_ipq8074, 46 46 .internal_sleep_clock = false, 47 47 .regs = &ipq8074_regs, 48 + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074, 48 49 .host_ce_config = ath11k_host_ce_config_ipq8074, 49 50 .ce_count = 12, 50 51 .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, ··· 69 68 .idle_ps = false, 70 69 .cold_boot_calib = true, 71 70 .supports_suspend = false, 71 + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), 72 72 }, 73 73 { 74 74 .hw_rev = ATH11K_HW_IPQ6018_HW10, ··· 85 83 .ring_mask = &ath11k_hw_ring_mask_ipq8074, 86 84 .internal_sleep_clock = false, 87 85 .regs = &ipq8074_regs, 86 + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074, 88 87 .host_ce_config = ath11k_host_ce_config_ipq8074, 89 88 .ce_count = 12, 90 89 .target_ce_config = ath11k_target_ce_config_wlan_ipq8074, ··· 109 106 .idle_ps = false, 110 107 .cold_boot_calib = true, 111 108 .supports_suspend = false, 109 + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), 112 110 }, 113 111 { 114 112 .name = "qca6390 hw2.0", ··· 125 121 .ring_mask = &ath11k_hw_ring_mask_qca6390, 126 122 .internal_sleep_clock = true, 127 123 .regs = &qca6390_regs, 124 + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390, 128 125 .host_ce_config = ath11k_host_ce_config_qca6390, 129 126 .ce_count = 9, 130 127 .target_ce_config = ath11k_target_ce_config_wlan_qca6390, ··· 148 143 .idle_ps = true, 149 144 .cold_boot_calib = false, 150 145 .supports_suspend = true, 146 + .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), 147 + }, 148 + { 149 + .name = "qcn9074 hw1.0", 150 + .hw_rev = ATH11K_HW_QCN9074_HW10, 151 + .fw = { 152 + .dir = "QCN9074/hw1.0", 153 + .board_size = 256 * 1024, 154 + .cal_size = 256 * 1024, 155 + }, 156 + .max_radios = 1, 157 + .single_pdev_only = false, 158 + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074, 159 + .hw_ops = &qcn9074_ops, 160 + .ring_mask = &ath11k_hw_ring_mask_qcn9074, 161 + .internal_sleep_clock = false, 162 + .regs = &qcn9074_regs, 163 + .host_ce_config = ath11k_host_ce_config_qcn9074, 164 + .ce_count = 6, 165 + .target_ce_config = ath11k_target_ce_config_wlan_qcn9074, 166 + .target_ce_count = 9, 167 + .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qcn9074, 168 + .svc_to_ce_map_len = 18, 169 + .rxdma1_enable = true, 170 + .num_rxmda_per_pdev = 1, 171 + .rx_mac_buf_ring = false, 172 + .vdev_start_delay = false, 173 + .htt_peer_map_v2 = true, 174 + .tcl_0_only = false, 175 + .interface_modes = BIT(NL80211_IFTYPE_STATION) | 176 + BIT(NL80211_IFTYPE_AP) | 177 + BIT(NL80211_IFTYPE_MESH_POINT), 178 + .supports_monitor = true, 179 + .supports_shadow_regs = false, 180 + .idle_ps = false, 181 + .cold_boot_calib = false, 182 + .supports_suspend = false, 183 + .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), 151 184 }, 152 185 }; 153 186 ··· 1017 974 1018 975 ab->hw_params = *hw_params; 1019 976 1020 - ath11k_dbg(ab, ATH11K_DBG_BOOT, "Hardware name %s\n", ab->hw_params.name); 977 + ath11k_info(ab, "%s\n", ab->hw_params.name); 1021 978 1022 979 return 0; 1023 980 }
+6
drivers/net/wireless/ath/ath11k/core.h
··· 34 34 #define ATH11K_PRB_RSP_DROP_THRESHOLD ((ATH11K_TX_MGMT_TARGET_MAX_SUPPORT_WMI * 3) / 4) 35 35 36 36 #define ATH11K_INVALID_HW_MAC_ID 0xFF 37 + #define ATH11K_CONNECTION_LOSS_HZ (3 * HZ) 37 38 38 39 extern unsigned int ath11k_frame_mode; 39 40 ··· 106 105 ATH11K_HW_IPQ8074, 107 106 ATH11K_HW_QCA6390_HW20, 108 107 ATH11K_HW_IPQ6018_HW10, 108 + ATH11K_HW_QCN9074_HW10, 109 109 }; 110 110 111 111 enum ath11k_firmware_mode { ··· 236 234 u32 aid; 237 235 u8 bssid[ETH_ALEN]; 238 236 struct cfg80211_bitrate_mask bitrate_mask; 237 + struct delayed_work connection_loss_work; 239 238 int num_legacy_stations; 240 239 int rtscts_prot_mode; 241 240 int txpower; ··· 610 607 bool m3_fw_support; 611 608 bool fixed_bdf_addr; 612 609 bool fixed_mem_region; 610 + bool static_window_map; 613 611 }; 614 612 615 613 /* IPQ8074 HW channel counters frequency value in hertz */ ··· 880 876 extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[]; 881 877 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[]; 882 878 879 + extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[]; 880 + extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[]; 883 881 int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab); 884 882 int ath11k_core_pre_init(struct ath11k_base *ab); 885 883 int ath11k_core_init(struct ath11k_base *ath11k);
+1 -1
drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
··· 3851 3851 htt_stats_buf->num_non_srg_ppdu_tried); 3852 3852 len += HTT_DBG_OUT(buf + len, buf_len - len, "Non-SRG success PPDU = %u\n", 3853 3853 htt_stats_buf->num_non_srg_ppdu_success); 3854 - len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG Opportunies = %u\n", 3854 + len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG Opportunities = %u\n", 3855 3855 htt_stats_buf->num_srg_opportunities); 3856 3856 len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG tried PPDU = %u\n", 3857 3857 htt_stats_buf->num_srg_ppdu_tried);
+248 -226
drivers/net/wireless/ath/ath11k/dp_rx.c
··· 20 20 21 21 #define ATH11K_DP_RX_FRAGMENT_TIMEOUT_MS (2 * HZ) 22 22 23 - static u8 *ath11k_dp_rx_h_80211_hdr(struct hal_rx_desc *desc) 23 + static u8 *ath11k_dp_rx_h_80211_hdr(struct ath11k_base *ab, struct hal_rx_desc *desc) 24 24 { 25 - return desc->hdr_status; 25 + return ab->hw_params.hw_ops->rx_desc_get_hdr_status(desc); 26 26 } 27 27 28 - static enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct hal_rx_desc *desc) 28 + static enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct ath11k_base *ab, 29 + struct hal_rx_desc *desc) 29 30 { 30 - if (!(__le32_to_cpu(desc->mpdu_start.info1) & 31 - RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID)) 31 + if (!ab->hw_params.hw_ops->rx_desc_encrypt_valid(desc)) 32 32 return HAL_ENCRYPT_TYPE_OPEN; 33 33 34 - return FIELD_GET(RX_MPDU_START_INFO2_ENC_TYPE, 35 - __le32_to_cpu(desc->mpdu_start.info2)); 34 + return ab->hw_params.hw_ops->rx_desc_get_encrypt_type(desc); 36 35 } 37 36 38 - static u8 ath11k_dp_rx_h_msdu_start_decap_type(struct hal_rx_desc *desc) 37 + static u8 ath11k_dp_rx_h_msdu_start_decap_type(struct ath11k_base *ab, 38 + struct hal_rx_desc *desc) 39 39 { 40 - return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, 41 - __le32_to_cpu(desc->msdu_start.info2)); 40 + return ab->hw_params.hw_ops->rx_desc_get_decap_type(desc); 42 41 } 43 42 44 - static u8 ath11k_dp_rx_h_msdu_start_mesh_ctl_present(struct hal_rx_desc *desc) 43 + static u8 ath11k_dp_rx_h_msdu_start_mesh_ctl_present(struct ath11k_base *ab, 44 + struct hal_rx_desc *desc) 45 45 { 46 - return FIELD_GET(RX_MSDU_START_INFO2_MESH_CTRL_PRESENT, 47 - __le32_to_cpu(desc->msdu_start.info2)); 46 + return ab->hw_params.hw_ops->rx_desc_get_mesh_ctl(desc); 48 47 } 49 48 50 - static bool ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(struct hal_rx_desc *desc) 49 + static bool ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(struct ath11k_base *ab, 50 + struct hal_rx_desc *desc) 51 51 { 52 - return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_CTRL_VALID, 53 - __le32_to_cpu(desc->mpdu_start.info1)); 52 + return ab->hw_params.hw_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); 54 53 } 55 54 56 - static bool ath11k_dp_rx_h_mpdu_start_fc_valid(struct hal_rx_desc *desc) 55 + static bool ath11k_dp_rx_h_mpdu_start_fc_valid(struct ath11k_base *ab, 56 + struct hal_rx_desc *desc) 57 57 { 58 - return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_FCTRL_VALID, 59 - __le32_to_cpu(desc->mpdu_start.info1)); 58 + return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); 60 59 } 61 60 62 - static bool ath11k_dp_rx_h_mpdu_start_more_frags(struct sk_buff *skb) 61 + static bool ath11k_dp_rx_h_mpdu_start_more_frags(struct ath11k_base *ab, 62 + struct sk_buff *skb) 63 63 { 64 64 struct ieee80211_hdr *hdr; 65 65 66 - hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); 66 + hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); 67 67 return ieee80211_has_morefrags(hdr->frame_control); 68 68 } 69 69 70 - static u16 ath11k_dp_rx_h_mpdu_start_frag_no(struct sk_buff *skb) 70 + static u16 ath11k_dp_rx_h_mpdu_start_frag_no(struct ath11k_base *ab, 71 + struct sk_buff *skb) 71 72 { 72 73 struct ieee80211_hdr *hdr; 73 74 74 - hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); 75 + hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); 75 76 return le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; 76 77 } 77 78 78 - static u16 ath11k_dp_rx_h_mpdu_start_seq_no(struct hal_rx_desc *desc) 79 + static u16 ath11k_dp_rx_h_mpdu_start_seq_no(struct ath11k_base *ab, 80 + struct hal_rx_desc *desc) 79 81 { 80 - return FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_NUM, 81 - __le32_to_cpu(desc->mpdu_start.info1)); 82 + return ab->hw_params.hw_ops->rx_desc_get_mpdu_start_seq_no(desc); 82 83 } 83 84 84 - static bool ath11k_dp_rx_h_attn_msdu_done(struct hal_rx_desc *desc) 85 + static void *ath11k_dp_rx_get_attention(struct ath11k_base *ab, 86 + struct hal_rx_desc *desc) 87 + { 88 + return ab->hw_params.hw_ops->rx_desc_get_attention(desc); 89 + } 90 + 91 + static bool ath11k_dp_rx_h_attn_msdu_done(struct rx_attention *attn) 85 92 { 86 93 return !!FIELD_GET(RX_ATTENTION_INFO2_MSDU_DONE, 87 - __le32_to_cpu(desc->attention.info2)); 94 + __le32_to_cpu(attn->info2)); 88 95 } 89 96 90 - static bool ath11k_dp_rx_h_attn_l4_cksum_fail(struct hal_rx_desc *desc) 97 + static bool ath11k_dp_rx_h_attn_l4_cksum_fail(struct rx_attention *attn) 91 98 { 92 99 return !!FIELD_GET(RX_ATTENTION_INFO1_TCP_UDP_CKSUM_FAIL, 93 - __le32_to_cpu(desc->attention.info1)); 100 + __le32_to_cpu(attn->info1)); 94 101 } 95 102 96 - static bool ath11k_dp_rx_h_attn_ip_cksum_fail(struct hal_rx_desc *desc) 103 + static bool ath11k_dp_rx_h_attn_ip_cksum_fail(struct rx_attention *attn) 97 104 { 98 105 return !!FIELD_GET(RX_ATTENTION_INFO1_IP_CKSUM_FAIL, 99 - __le32_to_cpu(desc->attention.info1)); 106 + __le32_to_cpu(attn->info1)); 100 107 } 101 108 102 - static bool ath11k_dp_rx_h_attn_is_decrypted(struct hal_rx_desc *desc) 109 + static bool ath11k_dp_rx_h_attn_is_decrypted(struct rx_attention *attn) 103 110 { 104 111 return (FIELD_GET(RX_ATTENTION_INFO2_DCRYPT_STATUS_CODE, 105 - __le32_to_cpu(desc->attention.info2)) == 112 + __le32_to_cpu(attn->info2)) == 106 113 RX_DESC_DECRYPT_STATUS_CODE_OK); 107 114 } 108 115 109 - static u32 ath11k_dp_rx_h_attn_mpdu_err(struct hal_rx_desc *desc) 116 + static u32 ath11k_dp_rx_h_attn_mpdu_err(struct rx_attention *attn) 110 117 { 111 - u32 info = __le32_to_cpu(desc->attention.info1); 118 + u32 info = __le32_to_cpu(attn->info1); 112 119 u32 errmap = 0; 113 120 114 121 if (info & RX_ATTENTION_INFO1_FCS_ERR) ··· 142 135 return errmap; 143 136 } 144 137 145 - static u16 ath11k_dp_rx_h_msdu_start_msdu_len(struct hal_rx_desc *desc) 138 + static u16 ath11k_dp_rx_h_msdu_start_msdu_len(struct ath11k_base *ab, 139 + struct hal_rx_desc *desc) 146 140 { 147 - return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, 148 - __le32_to_cpu(desc->msdu_start.info1)); 141 + return ab->hw_params.hw_ops->rx_desc_get_msdu_len(desc); 149 142 } 150 143 151 - static u8 ath11k_dp_rx_h_msdu_start_sgi(struct hal_rx_desc *desc) 144 + static u8 ath11k_dp_rx_h_msdu_start_sgi(struct ath11k_base *ab, 145 + struct hal_rx_desc *desc) 152 146 { 153 - return FIELD_GET(RX_MSDU_START_INFO3_SGI, 154 - __le32_to_cpu(desc->msdu_start.info3)); 147 + return ab->hw_params.hw_ops->rx_desc_get_msdu_sgi(desc); 155 148 } 156 149 157 - static u8 ath11k_dp_rx_h_msdu_start_rate_mcs(struct hal_rx_desc *desc) 150 + static u8 ath11k_dp_rx_h_msdu_start_rate_mcs(struct ath11k_base *ab, 151 + struct hal_rx_desc *desc) 158 152 { 159 - return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, 160 - __le32_to_cpu(desc->msdu_start.info3)); 153 + return ab->hw_params.hw_ops->rx_desc_get_msdu_rate_mcs(desc); 161 154 } 162 155 163 - static u8 ath11k_dp_rx_h_msdu_start_rx_bw(struct hal_rx_desc *desc) 156 + static u8 ath11k_dp_rx_h_msdu_start_rx_bw(struct ath11k_base *ab, 157 + struct hal_rx_desc *desc) 164 158 { 165 - return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, 166 - __le32_to_cpu(desc->msdu_start.info3)); 159 + return ab->hw_params.hw_ops->rx_desc_get_msdu_rx_bw(desc); 167 160 } 168 161 169 - static u32 ath11k_dp_rx_h_msdu_start_freq(struct hal_rx_desc *desc) 162 + static u32 ath11k_dp_rx_h_msdu_start_freq(struct ath11k_base *ab, 163 + struct hal_rx_desc *desc) 170 164 { 171 - return __le32_to_cpu(desc->msdu_start.phy_meta_data); 165 + return ab->hw_params.hw_ops->rx_desc_get_msdu_freq(desc); 172 166 } 173 167 174 - static u8 ath11k_dp_rx_h_msdu_start_pkt_type(struct hal_rx_desc *desc) 168 + static u8 ath11k_dp_rx_h_msdu_start_pkt_type(struct ath11k_base *ab, 169 + struct hal_rx_desc *desc) 175 170 { 176 - return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, 177 - __le32_to_cpu(desc->msdu_start.info3)); 171 + return ab->hw_params.hw_ops->rx_desc_get_msdu_pkt_type(desc); 178 172 } 179 173 180 - static u8 ath11k_dp_rx_h_msdu_start_nss(struct hal_rx_desc *desc) 174 + static u8 ath11k_dp_rx_h_msdu_start_nss(struct ath11k_base *ab, 175 + struct hal_rx_desc *desc) 181 176 { 182 - u8 mimo_ss_bitmap = FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, 183 - __le32_to_cpu(desc->msdu_start.info3)); 184 - 185 - return hweight8(mimo_ss_bitmap); 177 + return hweight8(ab->hw_params.hw_ops->rx_desc_get_msdu_nss(desc)); 186 178 } 187 179 188 - static u8 ath11k_dp_rx_h_mpdu_start_tid(struct hal_rx_desc *desc) 180 + static u8 ath11k_dp_rx_h_mpdu_start_tid(struct ath11k_base *ab, 181 + struct hal_rx_desc *desc) 189 182 { 190 - return FIELD_GET(RX_MPDU_START_INFO2_TID, 191 - __le32_to_cpu(desc->mpdu_start.info2)); 183 + return ab->hw_params.hw_ops->rx_desc_get_mpdu_tid(desc); 192 184 } 193 185 194 - static u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct hal_rx_desc *desc) 186 + static u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct ath11k_base *ab, 187 + struct hal_rx_desc *desc) 195 188 { 196 - return __le16_to_cpu(desc->mpdu_start.sw_peer_id); 189 + return ab->hw_params.hw_ops->rx_desc_get_mpdu_peer_id(desc); 197 190 } 198 191 199 - static u8 ath11k_dp_rx_h_msdu_end_l3pad(struct hal_rx_desc *desc) 192 + static u8 ath11k_dp_rx_h_msdu_end_l3pad(struct ath11k_base *ab, 193 + struct hal_rx_desc *desc) 200 194 { 201 - return FIELD_GET(RX_MSDU_END_INFO2_L3_HDR_PADDING, 202 - __le32_to_cpu(desc->msdu_end.info2)); 195 + return ab->hw_params.hw_ops->rx_desc_get_l3_pad_bytes(desc); 203 196 } 204 197 205 - static bool ath11k_dp_rx_h_msdu_end_first_msdu(struct hal_rx_desc *desc) 198 + static bool ath11k_dp_rx_h_msdu_end_first_msdu(struct ath11k_base *ab, 199 + struct hal_rx_desc *desc) 206 200 { 207 - return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU, 208 - __le32_to_cpu(desc->msdu_end.info2)); 201 + return ab->hw_params.hw_ops->rx_desc_get_first_msdu(desc); 209 202 } 210 203 211 - static bool ath11k_dp_rx_h_msdu_end_last_msdu(struct hal_rx_desc *desc) 204 + static bool ath11k_dp_rx_h_msdu_end_last_msdu(struct ath11k_base *ab, 205 + struct hal_rx_desc *desc) 212 206 { 213 - return !!FIELD_GET(RX_MSDU_END_INFO2_LAST_MSDU, 214 - __le32_to_cpu(desc->msdu_end.info2)); 207 + return ab->hw_params.hw_ops->rx_desc_get_last_msdu(desc); 215 208 } 216 209 217 - static void ath11k_dp_rx_desc_end_tlv_copy(struct hal_rx_desc *fdesc, 210 + static void ath11k_dp_rx_desc_end_tlv_copy(struct ath11k_base *ab, 211 + struct hal_rx_desc *fdesc, 218 212 struct hal_rx_desc *ldesc) 219 213 { 220 - memcpy((u8 *)&fdesc->msdu_end, (u8 *)&ldesc->msdu_end, 221 - sizeof(struct rx_msdu_end)); 222 - memcpy((u8 *)&fdesc->attention, (u8 *)&ldesc->attention, 223 - sizeof(struct rx_attention)); 224 - memcpy((u8 *)&fdesc->mpdu_end, (u8 *)&ldesc->mpdu_end, 225 - sizeof(struct rx_mpdu_end)); 214 + ab->hw_params.hw_ops->rx_desc_copy_attn_end_tlv(fdesc, ldesc); 226 215 } 227 216 228 - static u32 ath11k_dp_rxdesc_get_mpdulen_err(struct hal_rx_desc *rx_desc) 217 + static u32 ath11k_dp_rxdesc_get_mpdulen_err(struct rx_attention *attn) 229 218 { 230 - struct rx_attention *rx_attn; 231 - 232 - rx_attn = &rx_desc->attention; 233 - 234 219 return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, 235 - __le32_to_cpu(rx_attn->info1)); 220 + __le32_to_cpu(attn->info1)); 236 221 } 237 222 238 - static u32 ath11k_dp_rxdesc_get_decap_format(struct hal_rx_desc *rx_desc) 239 - { 240 - struct rx_msdu_start *rx_msdu_start; 241 - 242 - rx_msdu_start = &rx_desc->msdu_start; 243 - 244 - return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, 245 - __le32_to_cpu(rx_msdu_start->info2)); 246 - } 247 - 248 - static u8 *ath11k_dp_rxdesc_get_80211hdr(struct hal_rx_desc *rx_desc) 223 + static u8 *ath11k_dp_rxdesc_get_80211hdr(struct ath11k_base *ab, 224 + struct hal_rx_desc *rx_desc) 249 225 { 250 226 u8 *rx_pkt_hdr; 251 227 252 - rx_pkt_hdr = &rx_desc->msdu_payload[0]; 228 + rx_pkt_hdr = ab->hw_params.hw_ops->rx_desc_get_msdu_payload(rx_desc); 253 229 254 230 return rx_pkt_hdr; 255 231 } 256 232 257 - static bool ath11k_dp_rxdesc_mpdu_valid(struct hal_rx_desc *rx_desc) 233 + static bool ath11k_dp_rxdesc_mpdu_valid(struct ath11k_base *ab, 234 + struct hal_rx_desc *rx_desc) 258 235 { 259 236 u32 tlv_tag; 260 237 261 - tlv_tag = FIELD_GET(HAL_TLV_HDR_TAG, 262 - __le32_to_cpu(rx_desc->mpdu_start_tag)); 238 + tlv_tag = ab->hw_params.hw_ops->rx_desc_get_mpdu_start_tag(rx_desc); 263 239 264 240 return tlv_tag == HAL_RX_MPDU_START; 265 241 } 266 242 267 - static u32 ath11k_dp_rxdesc_get_ppduid(struct hal_rx_desc *rx_desc) 243 + static u32 ath11k_dp_rxdesc_get_ppduid(struct ath11k_base *ab, 244 + struct hal_rx_desc *rx_desc) 268 245 { 269 - return __le16_to_cpu(rx_desc->mpdu_start.phy_ppdu_id); 246 + return ab->hw_params.hw_ops->rx_desc_get_mpdu_ppdu_id(rx_desc); 247 + } 248 + 249 + static void ath11k_dp_rxdesc_set_msdu_len(struct ath11k_base *ab, 250 + struct hal_rx_desc *desc, 251 + u16 len) 252 + { 253 + ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); 270 254 } 271 255 272 256 static void ath11k_dp_service_mon_ring(struct timer_list *t) ··· 1720 1722 struct sk_buff *first, struct sk_buff *last, 1721 1723 u8 l3pad_bytes, int msdu_len) 1722 1724 { 1725 + struct ath11k_base *ab = ar->ab; 1723 1726 struct sk_buff *skb; 1724 1727 struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(first); 1725 1728 int buf_first_hdr_len, buf_first_len; 1726 1729 struct hal_rx_desc *ldesc; 1727 - int space_extra; 1728 - int rem_len; 1729 - int buf_len; 1730 + int space_extra, rem_len, buf_len; 1731 + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 1730 1732 1731 1733 /* As the msdu is spread across multiple rx buffers, 1732 1734 * find the offset to the start of msdu for computing 1733 1735 * the length of the msdu in the first buffer. 1734 1736 */ 1735 - buf_first_hdr_len = HAL_RX_DESC_SIZE + l3pad_bytes; 1737 + buf_first_hdr_len = hal_rx_desc_sz + l3pad_bytes; 1736 1738 buf_first_len = DP_RX_BUFFER_SIZE - buf_first_hdr_len; 1737 1739 1738 1740 if (WARN_ON_ONCE(msdu_len <= buf_first_len)) { ··· 1742 1744 } 1743 1745 1744 1746 ldesc = (struct hal_rx_desc *)last->data; 1745 - rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ldesc); 1746 - rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ldesc); 1747 + rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ab, ldesc); 1748 + rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ab, ldesc); 1747 1749 1748 1750 /* MSDU spans over multiple buffers because the length of the MSDU 1749 1751 * exceeds DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. So assume the data ··· 1755 1757 /* When an MSDU spread over multiple buffers attention, MSDU_END and 1756 1758 * MPDU_END tlvs are valid only in the last buffer. Copy those tlvs. 1757 1759 */ 1758 - ath11k_dp_rx_desc_end_tlv_copy(rxcb->rx_desc, ldesc); 1760 + ath11k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); 1759 1761 1760 1762 space_extra = msdu_len - (buf_first_len + skb_tailroom(first)); 1761 1763 if (space_extra > 0 && ··· 1776 1778 while ((skb = __skb_dequeue(msdu_list)) != NULL && rem_len > 0) { 1777 1779 rxcb = ATH11K_SKB_RXCB(skb); 1778 1780 if (rxcb->is_continuation) 1779 - buf_len = DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE; 1781 + buf_len = DP_RX_BUFFER_SIZE - hal_rx_desc_sz; 1780 1782 else 1781 1783 buf_len = rem_len; 1782 1784 1783 - if (buf_len > (DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE)) { 1785 + if (buf_len > (DP_RX_BUFFER_SIZE - hal_rx_desc_sz)) { 1784 1786 WARN_ON_ONCE(1); 1785 1787 dev_kfree_skb_any(skb); 1786 1788 return -EINVAL; 1787 1789 } 1788 1790 1789 - skb_put(skb, buf_len + HAL_RX_DESC_SIZE); 1790 - skb_pull(skb, HAL_RX_DESC_SIZE); 1791 + skb_put(skb, buf_len + hal_rx_desc_sz); 1792 + skb_pull(skb, hal_rx_desc_sz); 1791 1793 skb_copy_from_linear_data(skb, skb_put(first, buf_len), 1792 1794 buf_len); 1793 1795 dev_kfree_skb_any(skb); ··· 1818 1820 return NULL; 1819 1821 } 1820 1822 1821 - static void ath11k_dp_rx_h_csum_offload(struct sk_buff *msdu) 1823 + static void ath11k_dp_rx_h_csum_offload(struct ath11k *ar, struct sk_buff *msdu) 1822 1824 { 1823 1825 struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); 1826 + struct rx_attention *rx_attention; 1824 1827 bool ip_csum_fail, l4_csum_fail; 1825 1828 1826 - ip_csum_fail = ath11k_dp_rx_h_attn_ip_cksum_fail(rxcb->rx_desc); 1827 - l4_csum_fail = ath11k_dp_rx_h_attn_l4_cksum_fail(rxcb->rx_desc); 1829 + rx_attention = ath11k_dp_rx_get_attention(ar->ab, rxcb->rx_desc); 1830 + ip_csum_fail = ath11k_dp_rx_h_attn_ip_cksum_fail(rx_attention); 1831 + l4_csum_fail = ath11k_dp_rx_h_attn_l4_cksum_fail(rx_attention); 1828 1832 1829 1833 msdu->ip_summed = (ip_csum_fail || l4_csum_fail) ? 1830 1834 CHECKSUM_NONE : CHECKSUM_UNNECESSARY; ··· 1957 1957 1958 1958 qos_ctl = rxcb->tid; 1959 1959 1960 - if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(rxcb->rx_desc)) 1960 + if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ar->ab, rxcb->rx_desc)) 1961 1961 qos_ctl |= IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT; 1962 1962 1963 1963 /* TODO Add other QoS ctl fields when required */ ··· 2061 2061 bool is_amsdu; 2062 2062 2063 2063 is_amsdu = !(rxcb->is_first_msdu && rxcb->is_last_msdu); 2064 - hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(rxcb->rx_desc); 2064 + hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(ar->ab, rxcb->rx_desc); 2065 2065 rfc1042 = hdr; 2066 2066 2067 2067 if (rxcb->is_first_msdu) { ··· 2134 2134 u8 *first_hdr; 2135 2135 u8 decap; 2136 2136 2137 - first_hdr = ath11k_dp_rx_h_80211_hdr(rx_desc); 2138 - decap = ath11k_dp_rx_h_msdu_start_decap_type(rx_desc); 2137 + first_hdr = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); 2138 + decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); 2139 2139 2140 2140 switch (decap) { 2141 2141 case DP_RX_DECAP_TYPE_NATIVE_WIFI: ··· 2167 2167 bool is_decrypted = false; 2168 2168 struct ieee80211_hdr *hdr; 2169 2169 struct ath11k_peer *peer; 2170 + struct rx_attention *rx_attention; 2170 2171 u32 err_bitmap; 2171 2172 2172 2173 hdr = (struct ieee80211_hdr *)msdu->data; ··· 2189 2188 } 2190 2189 spin_unlock_bh(&ar->ab->base_lock); 2191 2190 2192 - err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_desc); 2191 + rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); 2192 + err_bitmap = ath11k_dp_rx_h_attn_mpdu_err(rx_attention); 2193 2193 if (enctype != HAL_ENCRYPT_TYPE_OPEN && !err_bitmap) 2194 - is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); 2194 + is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_attention); 2195 2195 2196 2196 /* Clear per-MPDU flags while leaving per-PPDU flags intact */ 2197 2197 rx_status->flag &= ~(RX_FLAG_FAILED_FCS_CRC | ··· 2217 2215 RX_FLAG_PN_VALIDATED; 2218 2216 } 2219 2217 2220 - ath11k_dp_rx_h_csum_offload(msdu); 2218 + ath11k_dp_rx_h_csum_offload(ar, msdu); 2221 2219 ath11k_dp_rx_h_undecap(ar, msdu, rx_desc, 2222 2220 enctype, rx_status, is_decrypted); 2223 2221 ··· 2238 2236 u8 sgi; 2239 2237 bool is_cck; 2240 2238 2241 - pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(rx_desc); 2242 - bw = ath11k_dp_rx_h_msdu_start_rx_bw(rx_desc); 2243 - rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(rx_desc); 2244 - nss = ath11k_dp_rx_h_msdu_start_nss(rx_desc); 2245 - sgi = ath11k_dp_rx_h_msdu_start_sgi(rx_desc); 2239 + pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(ar->ab, rx_desc); 2240 + bw = ath11k_dp_rx_h_msdu_start_rx_bw(ar->ab, rx_desc); 2241 + rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(ar->ab, rx_desc); 2242 + nss = ath11k_dp_rx_h_msdu_start_nss(ar->ab, rx_desc); 2243 + sgi = ath11k_dp_rx_h_msdu_start_sgi(ar->ab, rx_desc); 2246 2244 2247 2245 switch (pkt_type) { 2248 2246 case RX_MSDU_START_PKT_TYPE_11A: ··· 2299 2297 struct ieee80211_rx_status *rx_status) 2300 2298 { 2301 2299 u8 channel_num; 2302 - u32 center_freq; 2300 + u32 center_freq, meta_data; 2303 2301 struct ieee80211_channel *channel; 2304 2302 2305 2303 rx_status->freq = 0; ··· 2310 2308 2311 2309 rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; 2312 2310 2313 - channel_num = ath11k_dp_rx_h_msdu_start_freq(rx_desc); 2314 - center_freq = ath11k_dp_rx_h_msdu_start_freq(rx_desc) >> 16; 2311 + meta_data = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc); 2312 + channel_num = meta_data; 2313 + center_freq = meta_data >> 16; 2315 2314 2316 2315 if (center_freq >= 5935 && center_freq <= 7105) { 2317 2316 rx_status->band = NL80211_BAND_6GHZ; ··· 2412 2409 struct sk_buff *msdu, 2413 2410 struct sk_buff_head *msdu_list) 2414 2411 { 2412 + struct ath11k_base *ab = ar->ab; 2415 2413 struct hal_rx_desc *rx_desc, *lrx_desc; 2414 + struct rx_attention *rx_attention; 2416 2415 struct ieee80211_rx_status rx_status = {0}; 2417 2416 struct ieee80211_rx_status *status; 2418 2417 struct ath11k_skb_rxcb *rxcb; ··· 2424 2419 u8 *hdr_status; 2425 2420 u16 msdu_len; 2426 2421 int ret; 2422 + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 2427 2423 2428 2424 last_buf = ath11k_dp_rx_get_msdu_last_buf(msdu_list, msdu); 2429 2425 if (!last_buf) { 2430 - ath11k_warn(ar->ab, 2426 + ath11k_warn(ab, 2431 2427 "No valid Rx buffer to access Atten/MSDU_END/MPDU_END tlvs\n"); 2432 2428 ret = -EIO; 2433 2429 goto free_out; ··· 2436 2430 2437 2431 rx_desc = (struct hal_rx_desc *)msdu->data; 2438 2432 lrx_desc = (struct hal_rx_desc *)last_buf->data; 2439 - if (!ath11k_dp_rx_h_attn_msdu_done(lrx_desc)) { 2440 - ath11k_warn(ar->ab, "msdu_done bit in attention is not set\n"); 2433 + rx_attention = ath11k_dp_rx_get_attention(ab, lrx_desc); 2434 + if (!ath11k_dp_rx_h_attn_msdu_done(rx_attention)) { 2435 + ath11k_warn(ab, "msdu_done bit in attention is not set\n"); 2441 2436 ret = -EIO; 2442 2437 goto free_out; 2443 2438 } 2444 2439 2445 2440 rxcb = ATH11K_SKB_RXCB(msdu); 2446 2441 rxcb->rx_desc = rx_desc; 2447 - msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); 2448 - l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(lrx_desc); 2442 + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ab, rx_desc); 2443 + l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ab, lrx_desc); 2449 2444 2450 2445 if (rxcb->is_frag) { 2451 - skb_pull(msdu, HAL_RX_DESC_SIZE); 2446 + skb_pull(msdu, hal_rx_desc_sz); 2452 2447 } else if (!rxcb->is_continuation) { 2453 - if ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { 2454 - hdr_status = ath11k_dp_rx_h_80211_hdr(rx_desc); 2448 + if ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE) { 2449 + hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); 2455 2450 ret = -EINVAL; 2456 - ath11k_warn(ar->ab, "invalid msdu len %u\n", msdu_len); 2457 - ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, 2451 + ath11k_warn(ab, "invalid msdu len %u\n", msdu_len); 2452 + ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, 2458 2453 sizeof(struct ieee80211_hdr)); 2459 - ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, 2454 + ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", rx_desc, 2460 2455 sizeof(struct hal_rx_desc)); 2461 2456 goto free_out; 2462 2457 } 2463 - skb_put(msdu, HAL_RX_DESC_SIZE + l3_pad_bytes + msdu_len); 2464 - skb_pull(msdu, HAL_RX_DESC_SIZE + l3_pad_bytes); 2458 + skb_put(msdu, hal_rx_desc_sz + l3_pad_bytes + msdu_len); 2459 + skb_pull(msdu, hal_rx_desc_sz + l3_pad_bytes); 2465 2460 } else { 2466 2461 ret = ath11k_dp_rx_msdu_coalesce(ar, msdu_list, 2467 2462 msdu, last_buf, 2468 2463 l3_pad_bytes, msdu_len); 2469 2464 if (ret) { 2470 - ath11k_warn(ar->ab, 2465 + ath11k_warn(ab, 2471 2466 "failed to coalesce msdu rx buffer%d\n", ret); 2472 2467 goto free_out; 2473 2468 } ··· 3097 3090 u8 mic[IEEE80211_CCMP_MIC_LEN]; 3098 3091 int head_len, tail_len, ret; 3099 3092 size_t data_len; 3100 - u32 hdr_len; 3093 + u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 3101 3094 u8 *key, *data; 3102 3095 u8 key_idx; 3103 3096 3104 - if (ath11k_dp_rx_h_mpdu_start_enctype(rx_desc) != HAL_ENCRYPT_TYPE_TKIP_MIC) 3097 + if (ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc) != 3098 + HAL_ENCRYPT_TYPE_TKIP_MIC) 3105 3099 return 0; 3106 3100 3107 - hdr = (struct ieee80211_hdr *)(msdu->data + HAL_RX_DESC_SIZE); 3101 + hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); 3108 3102 hdr_len = ieee80211_hdrlen(hdr->frame_control); 3109 - head_len = hdr_len + HAL_RX_DESC_SIZE + IEEE80211_TKIP_IV_LEN; 3103 + head_len = hdr_len + hal_rx_desc_sz + IEEE80211_TKIP_IV_LEN; 3110 3104 tail_len = IEEE80211_CCMP_MIC_LEN + IEEE80211_TKIP_ICV_LEN + FCS_LEN; 3111 3105 3112 3106 if (!is_multicast_ether_addr(hdr->addr1)) ··· 3133 3125 3134 3126 rxs->flag |= RX_FLAG_MMIC_ERROR | RX_FLAG_MMIC_STRIPPED | 3135 3127 RX_FLAG_IV_STRIPPED | RX_FLAG_DECRYPTED; 3136 - skb_pull(msdu, HAL_RX_DESC_SIZE); 3128 + skb_pull(msdu, hal_rx_desc_sz); 3137 3129 3138 3130 ath11k_dp_rx_h_ppdu(ar, rx_desc, rxs); 3139 3131 ath11k_dp_rx_h_undecap(ar, msdu, rx_desc, ··· 3148 3140 struct ieee80211_hdr *hdr; 3149 3141 size_t hdr_len; 3150 3142 size_t crypto_len; 3143 + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 3151 3144 3152 3145 if (!flags) 3153 3146 return; 3154 3147 3155 - hdr = (struct ieee80211_hdr *)(msdu->data + HAL_RX_DESC_SIZE); 3148 + hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); 3156 3149 3157 3150 if (flags & RX_FLAG_MIC_STRIPPED) 3158 3151 skb_trim(msdu, msdu->len - ··· 3167 3158 hdr_len = ieee80211_hdrlen(hdr->frame_control); 3168 3159 crypto_len = ath11k_dp_rx_crypto_param_len(ar, enctype); 3169 3160 3170 - memmove((void *)msdu->data + HAL_RX_DESC_SIZE + crypto_len, 3171 - (void *)msdu->data + HAL_RX_DESC_SIZE, hdr_len); 3161 + memmove((void *)msdu->data + hal_rx_desc_sz + crypto_len, 3162 + (void *)msdu->data + hal_rx_desc_sz, hdr_len); 3172 3163 skb_pull(msdu, crypto_len); 3173 3164 } 3174 3165 } ··· 3181 3172 struct hal_rx_desc *rx_desc; 3182 3173 struct sk_buff *skb, *first_frag, *last_frag; 3183 3174 struct ieee80211_hdr *hdr; 3175 + struct rx_attention *rx_attention; 3184 3176 enum hal_encrypt_type enctype; 3185 3177 bool is_decrypted = false; 3186 3178 int msdu_len = 0; 3187 3179 int extra_space; 3188 - u32 flags; 3180 + u32 flags, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 3189 3181 3190 3182 first_frag = skb_peek(&rx_tid->rx_frags); 3191 3183 last_frag = skb_peek_tail(&rx_tid->rx_frags); ··· 3194 3184 skb_queue_walk(&rx_tid->rx_frags, skb) { 3195 3185 flags = 0; 3196 3186 rx_desc = (struct hal_rx_desc *)skb->data; 3197 - hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); 3187 + hdr = (struct ieee80211_hdr *)(skb->data + hal_rx_desc_sz); 3198 3188 3199 - enctype = ath11k_dp_rx_h_mpdu_start_enctype(rx_desc); 3200 - if (enctype != HAL_ENCRYPT_TYPE_OPEN) 3201 - is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_desc); 3189 + enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); 3190 + if (enctype != HAL_ENCRYPT_TYPE_OPEN) { 3191 + rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); 3192 + is_decrypted = ath11k_dp_rx_h_attn_is_decrypted(rx_attention); 3193 + } 3202 3194 3203 3195 if (is_decrypted) { 3204 3196 if (skb != first_frag) ··· 3216 3204 ath11k_dp_rx_h_undecap_frag(ar, skb, enctype, flags); 3217 3205 3218 3206 if (skb != first_frag) 3219 - skb_pull(skb, HAL_RX_DESC_SIZE + 3207 + skb_pull(skb, hal_rx_desc_sz + 3220 3208 ieee80211_hdrlen(hdr->frame_control)); 3221 3209 msdu_len += skb->len; 3222 3210 } ··· 3232 3220 dev_kfree_skb_any(skb); 3233 3221 } 3234 3222 3235 - hdr = (struct ieee80211_hdr *)(first_frag->data + HAL_RX_DESC_SIZE); 3223 + hdr = (struct ieee80211_hdr *)(first_frag->data + hal_rx_desc_sz); 3236 3224 hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_MOREFRAGS); 3237 3225 ATH11K_SKB_RXCB(first_frag)->is_frag = 1; 3238 3226 ··· 3258 3246 struct hal_srng *srng; 3259 3247 dma_addr_t paddr; 3260 3248 u32 desc_bank, msdu_info, mpdu_info; 3261 - u32 dst_idx, cookie; 3262 - u32 *msdu_len_offset; 3249 + u32 dst_idx, cookie, hal_rx_desc_sz; 3263 3250 int ret, buf_id; 3264 3251 3252 + hal_rx_desc_sz = ab->hw_params.hal_desc_sz; 3265 3253 link_desc_banks = ab->dp.link_desc_banks; 3266 3254 reo_dest_ring = rx_tid->dst_ring_desc; 3267 3255 ··· 3276 3264 FIELD_PREP(RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU, 1) | 3277 3265 FIELD_PREP(RX_MSDU_DESC_INFO0_MSDU_CONTINUATION, 0) | 3278 3266 FIELD_PREP(RX_MSDU_DESC_INFO0_MSDU_LENGTH, 3279 - defrag_skb->len - HAL_RX_DESC_SIZE) | 3267 + defrag_skb->len - hal_rx_desc_sz) | 3280 3268 FIELD_PREP(RX_MSDU_DESC_INFO0_REO_DEST_IND, dst_idx) | 3281 3269 FIELD_PREP(RX_MSDU_DESC_INFO0_VALID_SA, 1) | 3282 3270 FIELD_PREP(RX_MSDU_DESC_INFO0_VALID_DA, 1); 3283 3271 msdu0->rx_msdu_info.info0 = msdu_info; 3284 3272 3285 3273 /* change msdu len in hal rx desc */ 3286 - msdu_len_offset = (u32 *)&rx_desc->msdu_start; 3287 - *msdu_len_offset &= ~(RX_MSDU_START_INFO1_MSDU_LENGTH); 3288 - *msdu_len_offset |= defrag_skb->len - HAL_RX_DESC_SIZE; 3274 + ath11k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); 3289 3275 3290 3276 paddr = dma_map_single(ab->dev, defrag_skb->data, 3291 3277 defrag_skb->len + skb_tailroom(defrag_skb), ··· 3356 3346 return ret; 3357 3347 } 3358 3348 3359 - static int ath11k_dp_rx_h_cmp_frags(struct sk_buff *a, struct sk_buff *b) 3349 + static int ath11k_dp_rx_h_cmp_frags(struct ath11k *ar, 3350 + struct sk_buff *a, struct sk_buff *b) 3360 3351 { 3361 3352 int frag1, frag2; 3362 3353 3363 - frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(a); 3364 - frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(b); 3354 + frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, a); 3355 + frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, b); 3365 3356 3366 3357 return frag1 - frag2; 3367 3358 } 3368 3359 3369 - static void ath11k_dp_rx_h_sort_frags(struct sk_buff_head *frag_list, 3360 + static void ath11k_dp_rx_h_sort_frags(struct ath11k *ar, 3361 + struct sk_buff_head *frag_list, 3370 3362 struct sk_buff *cur_frag) 3371 3363 { 3372 3364 struct sk_buff *skb; 3373 3365 int cmp; 3374 3366 3375 3367 skb_queue_walk(frag_list, skb) { 3376 - cmp = ath11k_dp_rx_h_cmp_frags(skb, cur_frag); 3368 + cmp = ath11k_dp_rx_h_cmp_frags(ar, skb, cur_frag); 3377 3369 if (cmp < 0) 3378 3370 continue; 3379 3371 __skb_queue_before(frag_list, skb, cur_frag); ··· 3384 3372 __skb_queue_tail(frag_list, cur_frag); 3385 3373 } 3386 3374 3387 - static u64 ath11k_dp_rx_h_get_pn(struct sk_buff *skb) 3375 + static u64 ath11k_dp_rx_h_get_pn(struct ath11k *ar, struct sk_buff *skb) 3388 3376 { 3389 3377 struct ieee80211_hdr *hdr; 3390 3378 u64 pn = 0; 3391 3379 u8 *ehdr; 3380 + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 3392 3381 3393 - hdr = (struct ieee80211_hdr *)(skb->data + HAL_RX_DESC_SIZE); 3394 - ehdr = skb->data + HAL_RX_DESC_SIZE + ieee80211_hdrlen(hdr->frame_control); 3382 + hdr = (struct ieee80211_hdr *)(skb->data + hal_rx_desc_sz); 3383 + ehdr = skb->data + hal_rx_desc_sz + ieee80211_hdrlen(hdr->frame_control); 3395 3384 3396 3385 pn = ehdr[0]; 3397 3386 pn |= (u64)ehdr[1] << 8; ··· 3416 3403 first_frag = skb_peek(&rx_tid->rx_frags); 3417 3404 desc = (struct hal_rx_desc *)first_frag->data; 3418 3405 3419 - encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(desc); 3406 + encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, desc); 3420 3407 if (encrypt_type != HAL_ENCRYPT_TYPE_CCMP_128 && 3421 3408 encrypt_type != HAL_ENCRYPT_TYPE_CCMP_256 && 3422 3409 encrypt_type != HAL_ENCRYPT_TYPE_GCMP_128 && 3423 3410 encrypt_type != HAL_ENCRYPT_TYPE_AES_GCMP_256) 3424 3411 return true; 3425 3412 3426 - last_pn = ath11k_dp_rx_h_get_pn(first_frag); 3413 + last_pn = ath11k_dp_rx_h_get_pn(ar, first_frag); 3427 3414 skb_queue_walk(&rx_tid->rx_frags, skb) { 3428 3415 if (skb == first_frag) 3429 3416 continue; 3430 3417 3431 - cur_pn = ath11k_dp_rx_h_get_pn(skb); 3418 + cur_pn = ath11k_dp_rx_h_get_pn(ar, skb); 3432 3419 if (cur_pn != last_pn + 1) 3433 3420 return false; 3434 3421 last_pn = cur_pn; ··· 3452 3439 bool more_frags; 3453 3440 3454 3441 rx_desc = (struct hal_rx_desc *)msdu->data; 3455 - peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(rx_desc); 3456 - tid = ath11k_dp_rx_h_mpdu_start_tid(rx_desc); 3457 - seqno = ath11k_dp_rx_h_mpdu_start_seq_no(rx_desc); 3458 - frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(msdu); 3459 - more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(msdu); 3442 + peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); 3443 + tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, rx_desc); 3444 + seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); 3445 + frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); 3446 + more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); 3460 3447 3461 - if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(rx_desc) || 3462 - !ath11k_dp_rx_h_mpdu_start_fc_valid(rx_desc) || 3448 + if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || 3449 + !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || 3463 3450 tid > IEEE80211_NUM_TIDS) 3464 3451 return -EINVAL; 3465 3452 ··· 3497 3484 if (frag_no > __fls(rx_tid->rx_frag_bitmap)) 3498 3485 __skb_queue_tail(&rx_tid->rx_frags, msdu); 3499 3486 else 3500 - ath11k_dp_rx_h_sort_frags(&rx_tid->rx_frags, msdu); 3487 + ath11k_dp_rx_h_sort_frags(ar, &rx_tid->rx_frags, msdu); 3501 3488 3502 3489 rx_tid->rx_frag_bitmap |= BIT(frag_no); 3503 3490 if (!more_frags) ··· 3564 3551 struct hal_rx_desc *rx_desc; 3565 3552 u8 *hdr_status; 3566 3553 u16 msdu_len; 3554 + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 3567 3555 3568 3556 spin_lock_bh(&rx_ring->idr_lock); 3569 3557 msdu = idr_find(&rx_ring->bufs_idr, buf_id); ··· 3600 3586 } 3601 3587 3602 3588 rx_desc = (struct hal_rx_desc *)msdu->data; 3603 - msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(rx_desc); 3604 - if ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE) { 3605 - hdr_status = ath11k_dp_rx_h_80211_hdr(rx_desc); 3589 + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, rx_desc); 3590 + if ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE) { 3591 + hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); 3606 3592 ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); 3607 3593 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, 3608 3594 sizeof(struct ieee80211_hdr)); ··· 3612 3598 goto exit; 3613 3599 } 3614 3600 3615 - skb_put(msdu, HAL_RX_DESC_SIZE + msdu_len); 3601 + skb_put(msdu, hal_rx_desc_sz + msdu_len); 3616 3602 3617 3603 if (ath11k_dp_rx_frag_h_mpdu(ar, msdu, ring_desc)) { 3618 3604 dev_kfree_skb_any(msdu); ··· 3746 3732 int n_buffs; 3747 3733 3748 3734 n_buffs = DIV_ROUND_UP(msdu_len, 3749 - (DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE)); 3735 + (DP_RX_BUFFER_SIZE - ar->ab->hw_params.hal_desc_sz)); 3750 3736 3751 3737 skb_queue_walk_safe(msdu_list, skb, tmp) { 3752 3738 rxcb = ATH11K_SKB_RXCB(skb); ··· 3767 3753 { 3768 3754 u16 msdu_len; 3769 3755 struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; 3756 + struct rx_attention *rx_attention; 3770 3757 u8 l3pad_bytes; 3771 3758 struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); 3759 + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 3772 3760 3773 - msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(desc); 3761 + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); 3774 3762 3775 - if (!rxcb->is_frag && ((msdu_len + HAL_RX_DESC_SIZE) > DP_RX_BUFFER_SIZE)) { 3763 + if (!rxcb->is_frag && ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE)) { 3776 3764 /* First buffer will be freed by the caller, so deduct it's length */ 3777 - msdu_len = msdu_len - (DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE); 3765 + msdu_len = msdu_len - (DP_RX_BUFFER_SIZE - hal_rx_desc_sz); 3778 3766 ath11k_dp_rx_null_q_desc_sg_drop(ar, msdu_len, msdu_list); 3779 3767 return -EINVAL; 3780 3768 } 3781 3769 3782 - if (!ath11k_dp_rx_h_attn_msdu_done(desc)) { 3770 + rx_attention = ath11k_dp_rx_get_attention(ar->ab, desc); 3771 + if (!ath11k_dp_rx_h_attn_msdu_done(rx_attention)) { 3783 3772 ath11k_warn(ar->ab, 3784 3773 "msdu_done bit not set in null_q_des processing\n"); 3785 3774 __skb_queue_purge(msdu_list); ··· 3798 3781 * This error can show up both in a REO destination or WBM release ring. 3799 3782 */ 3800 3783 3801 - rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(desc); 3802 - rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(desc); 3784 + rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); 3785 + rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); 3803 3786 3804 3787 if (rxcb->is_frag) { 3805 - skb_pull(msdu, HAL_RX_DESC_SIZE); 3788 + skb_pull(msdu, hal_rx_desc_sz); 3806 3789 } else { 3807 - l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(desc); 3790 + l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); 3808 3791 3809 - if ((HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len) > DP_RX_BUFFER_SIZE) 3792 + if ((hal_rx_desc_sz + l3pad_bytes + msdu_len) > DP_RX_BUFFER_SIZE) 3810 3793 return -EINVAL; 3811 3794 3812 - skb_put(msdu, HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len); 3813 - skb_pull(msdu, HAL_RX_DESC_SIZE + l3pad_bytes); 3795 + skb_put(msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len); 3796 + skb_pull(msdu, hal_rx_desc_sz + l3pad_bytes); 3814 3797 } 3815 3798 ath11k_dp_rx_h_ppdu(ar, desc, status); 3816 3799 3817 3800 ath11k_dp_rx_h_mpdu(ar, msdu, desc, status); 3818 3801 3819 - rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(desc); 3802 + rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, desc); 3820 3803 3821 3804 /* Please note that caller will having the access to msdu and completing 3822 3805 * rx with mac80211. Need not worry about cleaning up amsdu_list. ··· 3863 3846 struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; 3864 3847 u8 l3pad_bytes; 3865 3848 struct ath11k_skb_rxcb *rxcb = ATH11K_SKB_RXCB(msdu); 3849 + u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; 3866 3850 3867 - rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(desc); 3868 - rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(desc); 3851 + rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); 3852 + rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); 3869 3853 3870 - l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(desc); 3871 - msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(desc); 3872 - skb_put(msdu, HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len); 3873 - skb_pull(msdu, HAL_RX_DESC_SIZE + l3pad_bytes); 3854 + l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); 3855 + msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); 3856 + skb_put(msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len); 3857 + skb_pull(msdu, hal_rx_desc_sz + l3pad_bytes); 3874 3858 3875 3859 ath11k_dp_rx_h_ppdu(ar, desc, status); 3876 3860 ··· 4613 4595 rx_desc = (struct hal_rx_desc *)msdu->data; 4614 4596 4615 4597 rx_pkt_offset = sizeof(struct hal_rx_desc); 4616 - l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(rx_desc); 4598 + l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); 4617 4599 4618 4600 if (is_first_msdu) { 4619 - if (!ath11k_dp_rxdesc_mpdu_valid(rx_desc)) { 4601 + if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { 4620 4602 drop_mpdu = true; 4621 4603 dev_kfree_skb_any(msdu); 4622 4604 msdu = NULL; ··· 4625 4607 } 4626 4608 4627 4609 msdu_ppdu_id = 4628 - ath11k_dp_rxdesc_get_ppduid(rx_desc); 4610 + ath11k_dp_rxdesc_get_ppduid(ar->ab, rx_desc); 4629 4611 4630 4612 if (ath11k_dp_rx_mon_comp_ppduid(msdu_ppdu_id, 4631 4613 ppdu_id, ··· 4694 4676 return rx_bufs_used; 4695 4677 } 4696 4678 4697 - static void ath11k_dp_rx_msdus_set_payload(struct sk_buff *msdu) 4679 + static void ath11k_dp_rx_msdus_set_payload(struct ath11k *ar, struct sk_buff *msdu) 4698 4680 { 4699 4681 u32 rx_pkt_offset, l2_hdr_offset; 4700 4682 4701 - rx_pkt_offset = sizeof(struct hal_rx_desc); 4702 - l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad((struct hal_rx_desc *)msdu->data); 4683 + rx_pkt_offset = ar->ab->hw_params.hal_desc_sz; 4684 + l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, 4685 + (struct hal_rx_desc *)msdu->data); 4703 4686 skb_pull(msdu, rx_pkt_offset + l2_hdr_offset); 4704 4687 } 4705 4688 ··· 4710 4691 struct sk_buff *last_msdu, 4711 4692 struct ieee80211_rx_status *rxs) 4712 4693 { 4694 + struct ath11k_base *ab = ar->ab; 4713 4695 struct sk_buff *msdu, *mpdu_buf, *prev_buf; 4714 - u32 decap_format, wifi_hdr_len; 4696 + u32 wifi_hdr_len; 4715 4697 struct hal_rx_desc *rx_desc; 4716 4698 char *hdr_desc; 4717 - u8 *dest; 4699 + u8 *dest, decap_format; 4718 4700 struct ieee80211_hdr_3addr *wh; 4701 + struct rx_attention *rx_attention; 4719 4702 4720 4703 mpdu_buf = NULL; 4721 4704 ··· 4725 4704 goto err_merge_fail; 4726 4705 4727 4706 rx_desc = (struct hal_rx_desc *)head_msdu->data; 4707 + rx_attention = ath11k_dp_rx_get_attention(ab, rx_desc); 4728 4708 4729 - if (ath11k_dp_rxdesc_get_mpdulen_err(rx_desc)) 4709 + if (ath11k_dp_rxdesc_get_mpdulen_err(rx_attention)) 4730 4710 return NULL; 4731 4711 4732 - decap_format = ath11k_dp_rxdesc_get_decap_format(rx_desc); 4712 + decap_format = ath11k_dp_rx_h_msdu_start_decap_type(ab, rx_desc); 4733 4713 4734 4714 ath11k_dp_rx_h_ppdu(ar, rx_desc, rxs); 4735 4715 4736 4716 if (decap_format == DP_RX_DECAP_TYPE_RAW) { 4737 - ath11k_dp_rx_msdus_set_payload(head_msdu); 4717 + ath11k_dp_rx_msdus_set_payload(ar, head_msdu); 4738 4718 4739 4719 prev_buf = head_msdu; 4740 4720 msdu = head_msdu->next; 4741 4721 4742 4722 while (msdu) { 4743 - ath11k_dp_rx_msdus_set_payload(msdu); 4723 + ath11k_dp_rx_msdus_set_payload(ar, msdu); 4744 4724 4745 4725 prev_buf = msdu; 4746 4726 msdu = msdu->next; ··· 4755 4733 u8 qos_pkt = 0; 4756 4734 4757 4735 rx_desc = (struct hal_rx_desc *)head_msdu->data; 4758 - hdr_desc = ath11k_dp_rxdesc_get_80211hdr(rx_desc); 4736 + hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); 4759 4737 4760 4738 /* Base size */ 4761 4739 wifi_hdr_len = sizeof(struct ieee80211_hdr_3addr); ··· 4772 4750 4773 4751 while (msdu) { 4774 4752 rx_desc = (struct hal_rx_desc *)msdu->data; 4775 - hdr_desc = ath11k_dp_rxdesc_get_80211hdr(rx_desc); 4753 + hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); 4776 4754 4777 4755 if (qos_pkt) { 4778 4756 dest = skb_push(msdu, sizeof(__le16)); ··· 4782 4760 memcpy(dest + wifi_hdr_len, 4783 4761 (u8 *)&qos_field, sizeof(__le16)); 4784 4762 } 4785 - ath11k_dp_rx_msdus_set_payload(msdu); 4763 + ath11k_dp_rx_msdus_set_payload(ar, msdu); 4786 4764 prev_buf = msdu; 4787 4765 msdu = msdu->next; 4788 4766 } ··· 4790 4768 if (!dest) 4791 4769 goto err_merge_fail; 4792 4770 4793 - ath11k_dbg(ar->ab, ATH11K_DBG_DATA, 4771 + ath11k_dbg(ab, ATH11K_DBG_DATA, 4794 4772 "mpdu_buf %pK mpdu_buf->len %u", 4795 4773 prev_buf, prev_buf->len); 4796 4774 } else { 4797 - ath11k_dbg(ar->ab, ATH11K_DBG_DATA, 4775 + ath11k_dbg(ab, ATH11K_DBG_DATA, 4798 4776 "decap format %d is not supported!\n", 4799 4777 decap_format); 4800 4778 goto err_merge_fail; ··· 4804 4782 4805 4783 err_merge_fail: 4806 4784 if (mpdu_buf && decap_format != DP_RX_DECAP_TYPE_RAW) { 4807 - ath11k_dbg(ar->ab, ATH11K_DBG_DATA, 4785 + ath11k_dbg(ab, ATH11K_DBG_DATA, 4808 4786 "err_merge_fail mpdu_buf %pK", mpdu_buf); 4809 4787 /* Free the head buffer */ 4810 4788 dev_kfree_skb_any(mpdu_buf);
+3 -3
drivers/net/wireless/ath/ath11k/dp_tx.c
··· 178 178 } 179 179 180 180 if (ieee80211_vif_is_mesh(arvif->vif)) 181 - ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE, 1); 181 + ti.enable_mesh = true; 182 182 183 183 ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE, 1); 184 184 ··· 792 792 cmd->ring_tail_off32_remote_addr_hi = (u64)tp_addr >> 793 793 HAL_ADDR_MSB_REG_SHIFT; 794 794 795 - cmd->ring_msi_addr_lo = params.msi_addr & 0xffffffff; 796 - cmd->ring_msi_addr_hi = ((uint64_t)(params.msi_addr) >> 32) & 0xffffffff; 795 + cmd->ring_msi_addr_lo = lower_32_bits(params.msi_addr); 796 + cmd->ring_msi_addr_hi = upper_32_bits(params.msi_addr); 797 797 cmd->msi_data = params.msi_data; 798 798 799 799 cmd->intr_info = FIELD_PREP(
+41 -55
drivers/net/wireless/ath/ath11k/hal.c
··· 89 89 .entry_size = sizeof(struct hal_ce_srng_src_desc) >> 2, 90 90 .lmac_ring = false, 91 91 .ring_dir = HAL_SRNG_DIR_SRC, 92 - .reg_start = { 93 - (HAL_SEQ_WCSS_UMAC_CE0_SRC_REG + 94 - HAL_CE_DST_RING_BASE_LSB), 95 - HAL_SEQ_WCSS_UMAC_CE0_SRC_REG + HAL_CE_DST_RING_HP, 96 - }, 97 - .reg_size = { 98 - (HAL_SEQ_WCSS_UMAC_CE1_SRC_REG - 99 - HAL_SEQ_WCSS_UMAC_CE0_SRC_REG), 100 - (HAL_SEQ_WCSS_UMAC_CE1_SRC_REG - 101 - HAL_SEQ_WCSS_UMAC_CE0_SRC_REG), 102 - }, 103 92 .max_size = HAL_CE_SRC_RING_BASE_MSB_RING_SIZE, 104 93 }, 105 94 { /* CE_DST */ ··· 97 108 .entry_size = sizeof(struct hal_ce_srng_dest_desc) >> 2, 98 109 .lmac_ring = false, 99 110 .ring_dir = HAL_SRNG_DIR_SRC, 100 - .reg_start = { 101 - (HAL_SEQ_WCSS_UMAC_CE0_DST_REG + 102 - HAL_CE_DST_RING_BASE_LSB), 103 - HAL_SEQ_WCSS_UMAC_CE0_DST_REG + HAL_CE_DST_RING_HP, 104 - }, 105 - .reg_size = { 106 - (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - 107 - HAL_SEQ_WCSS_UMAC_CE0_DST_REG), 108 - (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - 109 - HAL_SEQ_WCSS_UMAC_CE0_DST_REG), 110 - }, 111 111 .max_size = HAL_CE_DST_RING_BASE_MSB_RING_SIZE, 112 112 }, 113 113 { /* CE_DST_STATUS */ ··· 105 127 .entry_size = sizeof(struct hal_ce_srng_dst_status_desc) >> 2, 106 128 .lmac_ring = false, 107 129 .ring_dir = HAL_SRNG_DIR_DST, 108 - .reg_start = { 109 - (HAL_SEQ_WCSS_UMAC_CE0_DST_REG + 110 - HAL_CE_DST_STATUS_RING_BASE_LSB), 111 - (HAL_SEQ_WCSS_UMAC_CE0_DST_REG + 112 - HAL_CE_DST_STATUS_RING_HP), 113 - }, 114 - .reg_size = { 115 - (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - 116 - HAL_SEQ_WCSS_UMAC_CE0_DST_REG), 117 - (HAL_SEQ_WCSS_UMAC_CE1_DST_REG - 118 - HAL_SEQ_WCSS_UMAC_CE0_DST_REG), 119 - }, 120 130 .max_size = HAL_CE_DST_STATUS_RING_BASE_MSB_RING_SIZE, 121 131 }, 122 132 { /* WBM_IDLE_LINK */ ··· 113 147 .entry_size = sizeof(struct hal_wbm_link_desc) >> 2, 114 148 .lmac_ring = false, 115 149 .ring_dir = HAL_SRNG_DIR_SRC, 116 - .reg_start = { 117 - (HAL_SEQ_WCSS_UMAC_WBM_REG + 118 - HAL_WBM_IDLE_LINK_RING_BASE_LSB), 119 - (HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_HP), 120 - }, 121 150 .max_size = HAL_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE, 122 151 }, 123 152 { /* SW2WBM_RELEASE */ ··· 121 160 .entry_size = sizeof(struct hal_wbm_release_ring) >> 2, 122 161 .lmac_ring = false, 123 162 .ring_dir = HAL_SRNG_DIR_SRC, 124 - .reg_start = { 125 - (HAL_SEQ_WCSS_UMAC_WBM_REG + 126 - HAL_WBM_RELEASE_RING_BASE_LSB), 127 - (HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_HP), 128 - }, 129 163 .max_size = HAL_SW2WBM_RELEASE_RING_BASE_MSB_RING_SIZE, 130 164 }, 131 165 { /* WBM2SW_RELEASE */ ··· 129 173 .entry_size = sizeof(struct hal_wbm_release_ring) >> 2, 130 174 .lmac_ring = false, 131 175 .ring_dir = HAL_SRNG_DIR_DST, 132 - .reg_start = { 133 - (HAL_SEQ_WCSS_UMAC_WBM_REG + 134 - HAL_WBM0_RELEASE_RING_BASE_LSB), 135 - (HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_HP), 136 - }, 137 - .reg_size = { 138 - (HAL_WBM1_RELEASE_RING_BASE_LSB - 139 - HAL_WBM0_RELEASE_RING_BASE_LSB), 140 - (HAL_WBM1_RELEASE_RING_HP - HAL_WBM0_RELEASE_RING_HP), 141 - }, 142 176 .max_size = HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE, 143 177 }, 144 178 { /* RXDMA_BUF */ ··· 901 955 /* Enable the SRNG */ 902 956 ath11k_hif_write32(ab, 903 957 HAL_SEQ_WCSS_UMAC_WBM_REG + 904 - HAL_WBM_IDLE_LINK_RING_MISC_ADDR, 0x40); 958 + HAL_WBM_IDLE_LINK_RING_MISC_ADDR(ab), 0x40); 905 959 } 906 960 907 961 int ath11k_hal_srng_setup(struct ath11k_base *ab, enum hal_ring_type type, ··· 1179 1233 s = &hal->srng_config[HAL_TCL_STATUS]; 1180 1234 s->reg_start[0] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_BASE_LSB(ab); 1181 1235 s->reg_start[1] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_HP; 1236 + 1237 + s = &hal->srng_config[HAL_CE_SRC]; 1238 + s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_BASE_LSB; 1239 + s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_HP; 1240 + s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) - 1241 + HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab); 1242 + s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) - 1243 + HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab); 1244 + 1245 + s = &hal->srng_config[HAL_CE_DST]; 1246 + s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_BASE_LSB; 1247 + s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_HP; 1248 + s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - 1249 + HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); 1250 + s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - 1251 + HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); 1252 + 1253 + s = &hal->srng_config[HAL_CE_DST_STATUS]; 1254 + s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + 1255 + HAL_CE_DST_STATUS_RING_BASE_LSB; 1256 + s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_STATUS_RING_HP; 1257 + s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - 1258 + HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); 1259 + s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) - 1260 + HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab); 1261 + 1262 + s = &hal->srng_config[HAL_WBM_IDLE_LINK]; 1263 + s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_BASE_LSB(ab); 1264 + s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_HP; 1265 + 1266 + s = &hal->srng_config[HAL_SW2WBM_RELEASE]; 1267 + s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_BASE_LSB(ab); 1268 + s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_HP; 1269 + 1270 + s = &hal->srng_config[HAL_WBM2SW_RELEASE]; 1271 + s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_BASE_LSB(ab); 1272 + s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_HP; 1273 + s->reg_size[0] = HAL_WBM1_RELEASE_RING_BASE_LSB(ab) - 1274 + HAL_WBM0_RELEASE_RING_BASE_LSB(ab); 1275 + s->reg_size[1] = HAL_WBM1_RELEASE_RING_HP - HAL_WBM0_RELEASE_RING_HP; 1182 1276 1183 1277 return 0; 1184 1278 }
+22 -11
drivers/net/wireless/ath/ath11k/hal.h
··· 39 39 #define HAL_SHADOW_REG(x) (HAL_SHADOW_BASE_ADDR + (4 * (x))) 40 40 41 41 /* WCSS Relative address */ 42 + #define HAL_SEQ_WCSS_UMAC_OFFSET 0x00a00000 42 43 #define HAL_SEQ_WCSS_UMAC_REO_REG 0x00a38000 43 44 #define HAL_SEQ_WCSS_UMAC_TCL_REG 0x00a44000 44 - #define HAL_SEQ_WCSS_UMAC_CE0_SRC_REG 0x00a00000 45 - #define HAL_SEQ_WCSS_UMAC_CE0_DST_REG 0x00a01000 46 - #define HAL_SEQ_WCSS_UMAC_CE1_SRC_REG 0x00a02000 47 - #define HAL_SEQ_WCSS_UMAC_CE1_DST_REG 0x00a03000 45 + #define HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(x) \ 46 + (ab->hw_params.regs->hal_seq_wcss_umac_ce0_src_reg) 47 + #define HAL_SEQ_WCSS_UMAC_CE0_DST_REG(x) \ 48 + (ab->hw_params.regs->hal_seq_wcss_umac_ce0_dst_reg) 49 + #define HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(x) \ 50 + (ab->hw_params.regs->hal_seq_wcss_umac_ce1_src_reg) 51 + #define HAL_SEQ_WCSS_UMAC_CE1_DST_REG(x) \ 52 + (ab->hw_params.regs->hal_seq_wcss_umac_ce1_dst_reg) 48 53 #define HAL_SEQ_WCSS_UMAC_WBM_REG 0x00a34000 54 + 55 + #define HAL_CE_WFSS_CE_REG_BASE 0x01b80000 56 + #define HAL_WLAON_REG_BASE 0x01f80000 49 57 50 58 /* SW2TCL(x) R0 ring configuration address */ 51 59 #define HAL_TCL1_RING_CMN_CTRL_REG 0x00000014 ··· 205 197 #define HAL_REO_STATUS_HP(ab) ab->hw_params.regs->hal_reo_status_hp 206 198 207 199 /* WBM Idle R0 address */ 208 - #define HAL_WBM_IDLE_LINK_RING_BASE_LSB 0x00000860 209 - #define HAL_WBM_IDLE_LINK_RING_MISC_ADDR 0x00000870 200 + #define HAL_WBM_IDLE_LINK_RING_BASE_LSB(x) \ 201 + (ab->hw_params.regs->hal_wbm_idle_link_ring_base_lsb) 202 + #define HAL_WBM_IDLE_LINK_RING_MISC_ADDR(x) \ 203 + (ab->hw_params.regs->hal_wbm_idle_link_ring_misc) 210 204 #define HAL_WBM_R0_IDLE_LIST_CONTROL_ADDR 0x00000048 211 205 #define HAL_WBM_R0_IDLE_LIST_SIZE_ADDR 0x0000004c 212 206 #define HAL_WBM_SCATTERED_RING_BASE_LSB 0x00000058 ··· 223 213 #define HAL_WBM_IDLE_LINK_RING_HP 0x000030b0 224 214 225 215 /* SW2WBM R0 release address */ 226 - #define HAL_WBM_RELEASE_RING_BASE_LSB 0x000001d8 216 + #define HAL_WBM_RELEASE_RING_BASE_LSB(x) \ 217 + (ab->hw_params.regs->hal_wbm_release_ring_base_lsb) 227 218 228 219 /* SW2WBM R2 release address */ 229 220 #define HAL_WBM_RELEASE_RING_HP 0x00003018 230 221 231 222 /* WBM2SW R0 release address */ 232 - #define HAL_WBM0_RELEASE_RING_BASE_LSB 0x00000910 233 - #define HAL_WBM1_RELEASE_RING_BASE_LSB 0x00000968 223 + #define HAL_WBM0_RELEASE_RING_BASE_LSB(x) \ 224 + (ab->hw_params.regs->hal_wbm0_release_ring_base_lsb) 225 + #define HAL_WBM1_RELEASE_RING_BASE_LSB(x) \ 226 + (ab->hw_params.regs->hal_wbm1_release_ring_base_lsb) 234 227 235 228 /* WBM2SW R2 release address */ 236 229 #define HAL_WBM0_RELEASE_RING_HP 0x000030c0 ··· 315 302 #define HAL_SW2WBM_RELEASE_RING_BASE_MSB_RING_SIZE 0x0000ffff 316 303 #define HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE 0x000fffff 317 304 #define HAL_RXDMA_RING_MAX_SIZE 0x0000ffff 318 - 319 - #define HAL_RX_DESC_SIZE (sizeof(struct hal_rx_desc)) 320 305 321 306 /* Add any other errors here and return them in 322 307 * ath11k_hal_rx_desc_get_err().
+7 -6
drivers/net/wireless/ath/ath11k/hal_desc.h
··· 949 949 #define HAL_TCL_DATA_CMD_INFO1_TO_FW BIT(21) 950 950 #define HAL_TCL_DATA_CMD_INFO1_PKT_OFFSET GENMASK(31, 23) 951 951 952 - #define HAL_TCL_DATA_CMD_INFO2_BUF_TIMESTAMP GENMASK(18, 0) 953 - #define HAL_TCL_DATA_CMD_INFO2_BUF_T_VALID BIT(19) 954 - #define HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE BIT(20) 955 - #define HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE BIT(21) 956 - #define HAL_TCL_DATA_CMD_INFO2_TID GENMASK(25, 22) 957 - #define HAL_TCL_DATA_CMD_INFO2_LMAC_ID GENMASK(27, 26) 952 + #define HAL_TCL_DATA_CMD_INFO2_BUF_TIMESTAMP GENMASK(18, 0) 953 + #define HAL_TCL_DATA_CMD_INFO2_BUF_T_VALID BIT(19) 954 + #define HAL_IPQ8074_TCL_DATA_CMD_INFO2_MESH_ENABLE BIT(20) 955 + #define HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE BIT(21) 956 + #define HAL_TCL_DATA_CMD_INFO2_TID GENMASK(25, 22) 957 + #define HAL_TCL_DATA_CMD_INFO2_LMAC_ID GENMASK(27, 26) 958 958 959 959 #define HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX GENMASK(5, 0) 960 960 #define HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX GENMASK(25, 6) 961 961 #define HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM GENMASK(29, 26) 962 + #define HAL_QCN9074_TCL_DATA_CMD_INFO3_MESH_ENABLE GENMASK(31, 30) 962 963 963 964 #define HAL_TCL_DATA_CMD_INFO4_RING_ID GENMASK(27, 20) 964 965 #define HAL_TCL_DATA_CMD_INFO4_LOOPING_COUNT GENMASK(31, 28)
+3
drivers/net/wireless/ath/ath11k/hal_tx.c
··· 75 75 FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM, 76 76 ti->bss_ast_hash); 77 77 tcl_cmd->info4 = 0; 78 + 79 + if (ti->enable_mesh) 80 + ab->hw_params.hw_ops->tx_mesh_enable(ab, tcl_cmd); 78 81 } 79 82 80 83 void ath11k_hal_tx_set_dscp_tid_map(struct ath11k_base *ab, int id)
+1
drivers/net/wireless/ath/ath11k/hal_tx.h
··· 34 34 u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */ 35 35 u8 lmac_id; 36 36 u8 dscp_tid_tbl_idx; 37 + bool enable_mesh; 37 38 }; 38 39 39 40 /* TODO: Check if the actual desc macros can be used instead */
+10
drivers/net/wireless/ath/ath11k/hif.h
··· 28 28 u32 *msi_addr_hi); 29 29 void (*ce_irq_enable)(struct ath11k_base *ab); 30 30 void (*ce_irq_disable)(struct ath11k_base *ab); 31 + void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx); 31 32 }; 32 33 33 34 static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab) ··· 124 123 return; 125 124 126 125 ab->hif.ops->get_msi_address(ab, msi_addr_lo, msi_addr_hi); 126 + } 127 + 128 + static inline void ath11k_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id, 129 + u32 *msi_data_idx) 130 + { 131 + if (ab->hif.ops->get_ce_msi_idx) 132 + ab->hif.ops->get_ce_msi_idx(ab, ce_id, msi_data_idx); 133 + else 134 + *msi_data_idx = ce_id; 127 135 } 128 136 #endif /* _HIF_H_ */
+796
drivers/net/wireless/ath/ath11k/hw.c
··· 31 31 return pdev_idx; 32 32 } 33 33 34 + static void ath11k_hw_ipq8074_tx_mesh_enable(struct ath11k_base *ab, 35 + struct hal_tcl_data_cmd *tcl_cmd) 36 + { 37 + tcl_cmd->info2 |= FIELD_PREP(HAL_IPQ8074_TCL_DATA_CMD_INFO2_MESH_ENABLE, 38 + true); 39 + } 40 + 41 + static void ath11k_hw_qcn9074_tx_mesh_enable(struct ath11k_base *ab, 42 + struct hal_tcl_data_cmd *tcl_cmd) 43 + { 44 + tcl_cmd->info3 |= FIELD_PREP(HAL_QCN9074_TCL_DATA_CMD_INFO3_MESH_ENABLE, 45 + true); 46 + } 47 + 34 48 static void ath11k_init_wmi_config_qca6390(struct ath11k_base *ab, 35 49 struct target_resource_config *config) 36 50 { ··· 169 155 return mac_id; 170 156 } 171 157 158 + static bool ath11k_hw_ipq8074_rx_desc_get_first_msdu(struct hal_rx_desc *desc) 159 + { 160 + return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU, 161 + __le32_to_cpu(desc->u.ipq8074.msdu_end.info2)); 162 + } 163 + 164 + static bool ath11k_hw_ipq8074_rx_desc_get_last_msdu(struct hal_rx_desc *desc) 165 + { 166 + return !!FIELD_GET(RX_MSDU_END_INFO2_LAST_MSDU, 167 + __le32_to_cpu(desc->u.ipq8074.msdu_end.info2)); 168 + } 169 + 170 + static u8 ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes(struct hal_rx_desc *desc) 171 + { 172 + return FIELD_GET(RX_MSDU_END_INFO2_L3_HDR_PADDING, 173 + __le32_to_cpu(desc->u.ipq8074.msdu_end.info2)); 174 + } 175 + 176 + static u8 *ath11k_hw_ipq8074_rx_desc_get_hdr_status(struct hal_rx_desc *desc) 177 + { 178 + return desc->u.ipq8074.hdr_status; 179 + } 180 + 181 + static bool ath11k_hw_ipq8074_rx_desc_encrypt_valid(struct hal_rx_desc *desc) 182 + { 183 + return __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1) & 184 + RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID; 185 + } 186 + 187 + static u32 ath11k_hw_ipq8074_rx_desc_get_encrypt_type(struct hal_rx_desc *desc) 188 + { 189 + return FIELD_GET(RX_MPDU_START_INFO2_ENC_TYPE, 190 + __le32_to_cpu(desc->u.ipq8074.mpdu_start.info2)); 191 + } 192 + 193 + static u8 ath11k_hw_ipq8074_rx_desc_get_decap_type(struct hal_rx_desc *desc) 194 + { 195 + return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, 196 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); 197 + } 198 + 199 + static u8 ath11k_hw_ipq8074_rx_desc_get_mesh_ctl(struct hal_rx_desc *desc) 200 + { 201 + return FIELD_GET(RX_MSDU_START_INFO2_MESH_CTRL_PRESENT, 202 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info2)); 203 + } 204 + 205 + static bool ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) 206 + { 207 + return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_CTRL_VALID, 208 + __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)); 209 + } 210 + 211 + static bool ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid(struct hal_rx_desc *desc) 212 + { 213 + return !!FIELD_GET(RX_MPDU_START_INFO1_MPDU_FCTRL_VALID, 214 + __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)); 215 + } 216 + 217 + static u16 ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no(struct hal_rx_desc *desc) 218 + { 219 + return FIELD_GET(RX_MPDU_START_INFO1_MPDU_SEQ_NUM, 220 + __le32_to_cpu(desc->u.ipq8074.mpdu_start.info1)); 221 + } 222 + 223 + static u16 ath11k_hw_ipq8074_rx_desc_get_msdu_len(struct hal_rx_desc *desc) 224 + { 225 + return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, 226 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info1)); 227 + } 228 + 229 + static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_sgi(struct hal_rx_desc *desc) 230 + { 231 + return FIELD_GET(RX_MSDU_START_INFO3_SGI, 232 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); 233 + } 234 + 235 + static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs(struct hal_rx_desc *desc) 236 + { 237 + return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, 238 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); 239 + } 240 + 241 + static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw(struct hal_rx_desc *desc) 242 + { 243 + return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, 244 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); 245 + } 246 + 247 + static u32 ath11k_hw_ipq8074_rx_desc_get_msdu_freq(struct hal_rx_desc *desc) 248 + { 249 + return __le32_to_cpu(desc->u.ipq8074.msdu_start.phy_meta_data); 250 + } 251 + 252 + static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type(struct hal_rx_desc *desc) 253 + { 254 + return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, 255 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); 256 + } 257 + 258 + static u8 ath11k_hw_ipq8074_rx_desc_get_msdu_nss(struct hal_rx_desc *desc) 259 + { 260 + return FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, 261 + __le32_to_cpu(desc->u.ipq8074.msdu_start.info3)); 262 + } 263 + 264 + static u8 ath11k_hw_ipq8074_rx_desc_get_mpdu_tid(struct hal_rx_desc *desc) 265 + { 266 + return FIELD_GET(RX_MPDU_START_INFO2_TID, 267 + __le32_to_cpu(desc->u.ipq8074.mpdu_start.info2)); 268 + } 269 + 270 + static u16 ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id(struct hal_rx_desc *desc) 271 + { 272 + return __le16_to_cpu(desc->u.ipq8074.mpdu_start.sw_peer_id); 273 + } 274 + 275 + static void ath11k_hw_ipq8074_rx_desc_copy_attn_end(struct hal_rx_desc *fdesc, 276 + struct hal_rx_desc *ldesc) 277 + { 278 + memcpy((u8 *)&fdesc->u.ipq8074.msdu_end, (u8 *)&ldesc->u.ipq8074.msdu_end, 279 + sizeof(struct rx_msdu_end_ipq8074)); 280 + memcpy((u8 *)&fdesc->u.ipq8074.attention, (u8 *)&ldesc->u.ipq8074.attention, 281 + sizeof(struct rx_attention)); 282 + memcpy((u8 *)&fdesc->u.ipq8074.mpdu_end, (u8 *)&ldesc->u.ipq8074.mpdu_end, 283 + sizeof(struct rx_mpdu_end)); 284 + } 285 + 286 + static u32 ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag(struct hal_rx_desc *desc) 287 + { 288 + return FIELD_GET(HAL_TLV_HDR_TAG, 289 + __le32_to_cpu(desc->u.ipq8074.mpdu_start_tag)); 290 + } 291 + 292 + static u32 ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id(struct hal_rx_desc *desc) 293 + { 294 + return __le16_to_cpu(desc->u.ipq8074.mpdu_start.phy_ppdu_id); 295 + } 296 + 297 + static void ath11k_hw_ipq8074_rx_desc_set_msdu_len(struct hal_rx_desc *desc, u16 len) 298 + { 299 + u32 info = __le32_to_cpu(desc->u.ipq8074.msdu_start.info1); 300 + 301 + info &= ~RX_MSDU_START_INFO1_MSDU_LENGTH; 302 + info |= FIELD_PREP(RX_MSDU_START_INFO1_MSDU_LENGTH, len); 303 + 304 + desc->u.ipq8074.msdu_start.info1 = __cpu_to_le32(info); 305 + } 306 + 307 + static 308 + struct rx_attention *ath11k_hw_ipq8074_rx_desc_get_attention(struct hal_rx_desc *desc) 309 + { 310 + return &desc->u.ipq8074.attention; 311 + } 312 + 313 + static u8 *ath11k_hw_ipq8074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) 314 + { 315 + return &desc->u.ipq8074.msdu_payload[0]; 316 + } 317 + 318 + static bool ath11k_hw_qcn9074_rx_desc_get_first_msdu(struct hal_rx_desc *desc) 319 + { 320 + return !!FIELD_GET(RX_MSDU_END_INFO4_FIRST_MSDU, 321 + __le16_to_cpu(desc->u.qcn9074.msdu_end.info4)); 322 + } 323 + 324 + static bool ath11k_hw_qcn9074_rx_desc_get_last_msdu(struct hal_rx_desc *desc) 325 + { 326 + return !!FIELD_GET(RX_MSDU_END_INFO4_LAST_MSDU, 327 + __le16_to_cpu(desc->u.qcn9074.msdu_end.info4)); 328 + } 329 + 330 + static u8 ath11k_hw_qcn9074_rx_desc_get_l3_pad_bytes(struct hal_rx_desc *desc) 331 + { 332 + return FIELD_GET(RX_MSDU_END_INFO4_L3_HDR_PADDING, 333 + __le16_to_cpu(desc->u.qcn9074.msdu_end.info4)); 334 + } 335 + 336 + static u8 *ath11k_hw_qcn9074_rx_desc_get_hdr_status(struct hal_rx_desc *desc) 337 + { 338 + return desc->u.qcn9074.hdr_status; 339 + } 340 + 341 + static bool ath11k_hw_qcn9074_rx_desc_encrypt_valid(struct hal_rx_desc *desc) 342 + { 343 + return __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11) & 344 + RX_MPDU_START_INFO11_ENCRYPT_INFO_VALID; 345 + } 346 + 347 + static u32 ath11k_hw_qcn9074_rx_desc_get_encrypt_type(struct hal_rx_desc *desc) 348 + { 349 + return FIELD_GET(RX_MPDU_START_INFO9_ENC_TYPE, 350 + __le32_to_cpu(desc->u.qcn9074.mpdu_start.info9)); 351 + } 352 + 353 + static u8 ath11k_hw_qcn9074_rx_desc_get_decap_type(struct hal_rx_desc *desc) 354 + { 355 + return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, 356 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info2)); 357 + } 358 + 359 + static u8 ath11k_hw_qcn9074_rx_desc_get_mesh_ctl(struct hal_rx_desc *desc) 360 + { 361 + return FIELD_GET(RX_MSDU_START_INFO2_MESH_CTRL_PRESENT, 362 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info2)); 363 + } 364 + 365 + static bool ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld(struct hal_rx_desc *desc) 366 + { 367 + return !!FIELD_GET(RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID, 368 + __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11)); 369 + } 370 + 371 + static bool ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid(struct hal_rx_desc *desc) 372 + { 373 + return !!FIELD_GET(RX_MPDU_START_INFO11_MPDU_FCTRL_VALID, 374 + __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11)); 375 + } 376 + 377 + static u16 ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no(struct hal_rx_desc *desc) 378 + { 379 + return FIELD_GET(RX_MPDU_START_INFO11_MPDU_SEQ_NUM, 380 + __le32_to_cpu(desc->u.qcn9074.mpdu_start.info11)); 381 + } 382 + 383 + static u16 ath11k_hw_qcn9074_rx_desc_get_msdu_len(struct hal_rx_desc *desc) 384 + { 385 + return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, 386 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info1)); 387 + } 388 + 389 + static u8 ath11k_hw_qcn9074_rx_desc_get_msdu_sgi(struct hal_rx_desc *desc) 390 + { 391 + return FIELD_GET(RX_MSDU_START_INFO3_SGI, 392 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info3)); 393 + } 394 + 395 + static u8 ath11k_hw_qcn9074_rx_desc_get_msdu_rate_mcs(struct hal_rx_desc *desc) 396 + { 397 + return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, 398 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info3)); 399 + } 400 + 401 + static u8 ath11k_hw_qcn9074_rx_desc_get_msdu_rx_bw(struct hal_rx_desc *desc) 402 + { 403 + return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, 404 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info3)); 405 + } 406 + 407 + static u32 ath11k_hw_qcn9074_rx_desc_get_msdu_freq(struct hal_rx_desc *desc) 408 + { 409 + return __le32_to_cpu(desc->u.qcn9074.msdu_start.phy_meta_data); 410 + } 411 + 412 + static u8 ath11k_hw_qcn9074_rx_desc_get_msdu_pkt_type(struct hal_rx_desc *desc) 413 + { 414 + return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, 415 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info3)); 416 + } 417 + 418 + static u8 ath11k_hw_qcn9074_rx_desc_get_msdu_nss(struct hal_rx_desc *desc) 419 + { 420 + return FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, 421 + __le32_to_cpu(desc->u.qcn9074.msdu_start.info3)); 422 + } 423 + 424 + static u8 ath11k_hw_qcn9074_rx_desc_get_mpdu_tid(struct hal_rx_desc *desc) 425 + { 426 + return FIELD_GET(RX_MPDU_START_INFO9_TID, 427 + __le32_to_cpu(desc->u.qcn9074.mpdu_start.info9)); 428 + } 429 + 430 + static u16 ath11k_hw_qcn9074_rx_desc_get_mpdu_peer_id(struct hal_rx_desc *desc) 431 + { 432 + return __le16_to_cpu(desc->u.qcn9074.mpdu_start.sw_peer_id); 433 + } 434 + 435 + static void ath11k_hw_qcn9074_rx_desc_copy_attn_end(struct hal_rx_desc *fdesc, 436 + struct hal_rx_desc *ldesc) 437 + { 438 + memcpy((u8 *)&fdesc->u.qcn9074.msdu_end, (u8 *)&ldesc->u.qcn9074.msdu_end, 439 + sizeof(struct rx_msdu_end_qcn9074)); 440 + memcpy((u8 *)&fdesc->u.qcn9074.attention, (u8 *)&ldesc->u.qcn9074.attention, 441 + sizeof(struct rx_attention)); 442 + memcpy((u8 *)&fdesc->u.qcn9074.mpdu_end, (u8 *)&ldesc->u.qcn9074.mpdu_end, 443 + sizeof(struct rx_mpdu_end)); 444 + } 445 + 446 + static u32 ath11k_hw_qcn9074_rx_desc_get_mpdu_start_tag(struct hal_rx_desc *desc) 447 + { 448 + return FIELD_GET(HAL_TLV_HDR_TAG, 449 + __le32_to_cpu(desc->u.qcn9074.mpdu_start_tag)); 450 + } 451 + 452 + static u32 ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id(struct hal_rx_desc *desc) 453 + { 454 + return __le16_to_cpu(desc->u.qcn9074.mpdu_start.phy_ppdu_id); 455 + } 456 + 457 + static void ath11k_hw_qcn9074_rx_desc_set_msdu_len(struct hal_rx_desc *desc, u16 len) 458 + { 459 + u32 info = __le32_to_cpu(desc->u.qcn9074.msdu_start.info1); 460 + 461 + info &= ~RX_MSDU_START_INFO1_MSDU_LENGTH; 462 + info |= FIELD_PREP(RX_MSDU_START_INFO1_MSDU_LENGTH, len); 463 + 464 + desc->u.qcn9074.msdu_start.info1 = __cpu_to_le32(info); 465 + } 466 + 467 + static 468 + struct rx_attention *ath11k_hw_qcn9074_rx_desc_get_attention(struct hal_rx_desc *desc) 469 + { 470 + return &desc->u.qcn9074.attention; 471 + } 472 + 473 + static u8 *ath11k_hw_qcn9074_rx_desc_get_msdu_payload(struct hal_rx_desc *desc) 474 + { 475 + return &desc->u.qcn9074.msdu_payload[0]; 476 + } 477 + 172 478 const struct ath11k_hw_ops ipq8074_ops = { 173 479 .get_hw_mac_from_pdev_id = ath11k_hw_ipq8074_mac_from_pdev_id, 174 480 .wmi_init_config = ath11k_init_wmi_config_ipq8074, 175 481 .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, 176 482 .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, 483 + .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, 484 + .rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu, 485 + .rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu, 486 + .rx_desc_get_l3_pad_bytes = ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes, 487 + .rx_desc_get_hdr_status = ath11k_hw_ipq8074_rx_desc_get_hdr_status, 488 + .rx_desc_encrypt_valid = ath11k_hw_ipq8074_rx_desc_encrypt_valid, 489 + .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, 490 + .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, 491 + .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, 492 + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, 493 + .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, 494 + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, 495 + .rx_desc_get_msdu_len = ath11k_hw_ipq8074_rx_desc_get_msdu_len, 496 + .rx_desc_get_msdu_sgi = ath11k_hw_ipq8074_rx_desc_get_msdu_sgi, 497 + .rx_desc_get_msdu_rate_mcs = ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs, 498 + .rx_desc_get_msdu_rx_bw = ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw, 499 + .rx_desc_get_msdu_freq = ath11k_hw_ipq8074_rx_desc_get_msdu_freq, 500 + .rx_desc_get_msdu_pkt_type = ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type, 501 + .rx_desc_get_msdu_nss = ath11k_hw_ipq8074_rx_desc_get_msdu_nss, 502 + .rx_desc_get_mpdu_tid = ath11k_hw_ipq8074_rx_desc_get_mpdu_tid, 503 + .rx_desc_get_mpdu_peer_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id, 504 + .rx_desc_copy_attn_end_tlv = ath11k_hw_ipq8074_rx_desc_copy_attn_end, 505 + .rx_desc_get_mpdu_start_tag = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag, 506 + .rx_desc_get_mpdu_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id, 507 + .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, 508 + .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, 509 + .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, 177 510 }; 178 511 179 512 const struct ath11k_hw_ops ipq6018_ops = { ··· 528 167 .wmi_init_config = ath11k_init_wmi_config_ipq8074, 529 168 .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, 530 169 .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, 170 + .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, 171 + .rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu, 172 + .rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu, 173 + .rx_desc_get_l3_pad_bytes = ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes, 174 + .rx_desc_get_hdr_status = ath11k_hw_ipq8074_rx_desc_get_hdr_status, 175 + .rx_desc_encrypt_valid = ath11k_hw_ipq8074_rx_desc_encrypt_valid, 176 + .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, 177 + .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, 178 + .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, 179 + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, 180 + .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, 181 + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, 182 + .rx_desc_get_msdu_len = ath11k_hw_ipq8074_rx_desc_get_msdu_len, 183 + .rx_desc_get_msdu_sgi = ath11k_hw_ipq8074_rx_desc_get_msdu_sgi, 184 + .rx_desc_get_msdu_rate_mcs = ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs, 185 + .rx_desc_get_msdu_rx_bw = ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw, 186 + .rx_desc_get_msdu_freq = ath11k_hw_ipq8074_rx_desc_get_msdu_freq, 187 + .rx_desc_get_msdu_pkt_type = ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type, 188 + .rx_desc_get_msdu_nss = ath11k_hw_ipq8074_rx_desc_get_msdu_nss, 189 + .rx_desc_get_mpdu_tid = ath11k_hw_ipq8074_rx_desc_get_mpdu_tid, 190 + .rx_desc_get_mpdu_peer_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id, 191 + .rx_desc_copy_attn_end_tlv = ath11k_hw_ipq8074_rx_desc_copy_attn_end, 192 + .rx_desc_get_mpdu_start_tag = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag, 193 + .rx_desc_get_mpdu_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id, 194 + .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, 195 + .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, 196 + .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, 531 197 }; 532 198 533 199 const struct ath11k_hw_ops qca6390_ops = { ··· 562 174 .wmi_init_config = ath11k_init_wmi_config_qca6390, 563 175 .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_qca6390, 564 176 .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_qca6390, 177 + .tx_mesh_enable = ath11k_hw_ipq8074_tx_mesh_enable, 178 + .rx_desc_get_first_msdu = ath11k_hw_ipq8074_rx_desc_get_first_msdu, 179 + .rx_desc_get_last_msdu = ath11k_hw_ipq8074_rx_desc_get_last_msdu, 180 + .rx_desc_get_l3_pad_bytes = ath11k_hw_ipq8074_rx_desc_get_l3_pad_bytes, 181 + .rx_desc_get_hdr_status = ath11k_hw_ipq8074_rx_desc_get_hdr_status, 182 + .rx_desc_encrypt_valid = ath11k_hw_ipq8074_rx_desc_encrypt_valid, 183 + .rx_desc_get_encrypt_type = ath11k_hw_ipq8074_rx_desc_get_encrypt_type, 184 + .rx_desc_get_decap_type = ath11k_hw_ipq8074_rx_desc_get_decap_type, 185 + .rx_desc_get_mesh_ctl = ath11k_hw_ipq8074_rx_desc_get_mesh_ctl, 186 + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_ipq8074_rx_desc_get_mpdu_seq_ctl_vld, 187 + .rx_desc_get_mpdu_fc_valid = ath11k_hw_ipq8074_rx_desc_get_mpdu_fc_valid, 188 + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_seq_no, 189 + .rx_desc_get_msdu_len = ath11k_hw_ipq8074_rx_desc_get_msdu_len, 190 + .rx_desc_get_msdu_sgi = ath11k_hw_ipq8074_rx_desc_get_msdu_sgi, 191 + .rx_desc_get_msdu_rate_mcs = ath11k_hw_ipq8074_rx_desc_get_msdu_rate_mcs, 192 + .rx_desc_get_msdu_rx_bw = ath11k_hw_ipq8074_rx_desc_get_msdu_rx_bw, 193 + .rx_desc_get_msdu_freq = ath11k_hw_ipq8074_rx_desc_get_msdu_freq, 194 + .rx_desc_get_msdu_pkt_type = ath11k_hw_ipq8074_rx_desc_get_msdu_pkt_type, 195 + .rx_desc_get_msdu_nss = ath11k_hw_ipq8074_rx_desc_get_msdu_nss, 196 + .rx_desc_get_mpdu_tid = ath11k_hw_ipq8074_rx_desc_get_mpdu_tid, 197 + .rx_desc_get_mpdu_peer_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_peer_id, 198 + .rx_desc_copy_attn_end_tlv = ath11k_hw_ipq8074_rx_desc_copy_attn_end, 199 + .rx_desc_get_mpdu_start_tag = ath11k_hw_ipq8074_rx_desc_get_mpdu_start_tag, 200 + .rx_desc_get_mpdu_ppdu_id = ath11k_hw_ipq8074_rx_desc_get_mpdu_ppdu_id, 201 + .rx_desc_set_msdu_len = ath11k_hw_ipq8074_rx_desc_set_msdu_len, 202 + .rx_desc_get_attention = ath11k_hw_ipq8074_rx_desc_get_attention, 203 + .rx_desc_get_msdu_payload = ath11k_hw_ipq8074_rx_desc_get_msdu_payload, 204 + }; 205 + 206 + const struct ath11k_hw_ops qcn9074_ops = { 207 + .get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id, 208 + .wmi_init_config = ath11k_init_wmi_config_ipq8074, 209 + .mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074, 210 + .mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074, 211 + .tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable, 212 + .rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu, 213 + .rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu, 214 + .rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9074_rx_desc_get_l3_pad_bytes, 215 + .rx_desc_get_hdr_status = ath11k_hw_qcn9074_rx_desc_get_hdr_status, 216 + .rx_desc_encrypt_valid = ath11k_hw_qcn9074_rx_desc_encrypt_valid, 217 + .rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type, 218 + .rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type, 219 + .rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl, 220 + .rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld, 221 + .rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid, 222 + .rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no, 223 + .rx_desc_get_msdu_len = ath11k_hw_qcn9074_rx_desc_get_msdu_len, 224 + .rx_desc_get_msdu_sgi = ath11k_hw_qcn9074_rx_desc_get_msdu_sgi, 225 + .rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9074_rx_desc_get_msdu_rate_mcs, 226 + .rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9074_rx_desc_get_msdu_rx_bw, 227 + .rx_desc_get_msdu_freq = ath11k_hw_qcn9074_rx_desc_get_msdu_freq, 228 + .rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9074_rx_desc_get_msdu_pkt_type, 229 + .rx_desc_get_msdu_nss = ath11k_hw_qcn9074_rx_desc_get_msdu_nss, 230 + .rx_desc_get_mpdu_tid = ath11k_hw_qcn9074_rx_desc_get_mpdu_tid, 231 + .rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_peer_id, 232 + .rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9074_rx_desc_copy_attn_end, 233 + .rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_tag, 234 + .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id, 235 + .rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len, 236 + .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention, 237 + .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload, 565 238 }; 566 239 567 240 #define ATH11K_TX_RING_MASK_0 0x1 ··· 1241 792 }, 1242 793 }; 1243 794 795 + /* Target firmware's Copy Engine configuration. */ 796 + const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[] = { 797 + /* CE0: host->target HTC control and raw streams */ 798 + { 799 + .pipenum = __cpu_to_le32(0), 800 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), 801 + .nentries = __cpu_to_le32(32), 802 + .nbytes_max = __cpu_to_le32(2048), 803 + .flags = __cpu_to_le32(CE_ATTR_FLAGS), 804 + .reserved = __cpu_to_le32(0), 805 + }, 806 + 807 + /* CE1: target->host HTT + HTC control */ 808 + { 809 + .pipenum = __cpu_to_le32(1), 810 + .pipedir = __cpu_to_le32(PIPEDIR_IN), 811 + .nentries = __cpu_to_le32(32), 812 + .nbytes_max = __cpu_to_le32(2048), 813 + .flags = __cpu_to_le32(CE_ATTR_FLAGS), 814 + .reserved = __cpu_to_le32(0), 815 + }, 816 + 817 + /* CE2: target->host WMI */ 818 + { 819 + .pipenum = __cpu_to_le32(2), 820 + .pipedir = __cpu_to_le32(PIPEDIR_IN), 821 + .nentries = __cpu_to_le32(32), 822 + .nbytes_max = __cpu_to_le32(2048), 823 + .flags = __cpu_to_le32(CE_ATTR_FLAGS), 824 + .reserved = __cpu_to_le32(0), 825 + }, 826 + 827 + /* CE3: host->target WMI */ 828 + { 829 + .pipenum = __cpu_to_le32(3), 830 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), 831 + .nentries = __cpu_to_le32(32), 832 + .nbytes_max = __cpu_to_le32(2048), 833 + .flags = __cpu_to_le32(CE_ATTR_FLAGS), 834 + .reserved = __cpu_to_le32(0), 835 + }, 836 + 837 + /* CE4: host->target HTT */ 838 + { 839 + .pipenum = __cpu_to_le32(4), 840 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), 841 + .nentries = __cpu_to_le32(256), 842 + .nbytes_max = __cpu_to_le32(256), 843 + .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), 844 + .reserved = __cpu_to_le32(0), 845 + }, 846 + 847 + /* CE5: target->host Pktlog */ 848 + { 849 + .pipenum = __cpu_to_le32(5), 850 + .pipedir = __cpu_to_le32(PIPEDIR_IN), 851 + .nentries = __cpu_to_le32(32), 852 + .nbytes_max = __cpu_to_le32(2048), 853 + .flags = __cpu_to_le32(CE_ATTR_FLAGS), 854 + .reserved = __cpu_to_le32(0), 855 + }, 856 + 857 + /* CE6: Reserved for target autonomous hif_memcpy */ 858 + { 859 + .pipenum = __cpu_to_le32(6), 860 + .pipedir = __cpu_to_le32(PIPEDIR_INOUT), 861 + .nentries = __cpu_to_le32(32), 862 + .nbytes_max = __cpu_to_le32(16384), 863 + .flags = __cpu_to_le32(CE_ATTR_FLAGS), 864 + .reserved = __cpu_to_le32(0), 865 + }, 866 + 867 + /* CE7 used only by Host */ 868 + { 869 + .pipenum = __cpu_to_le32(7), 870 + .pipedir = __cpu_to_le32(PIPEDIR_INOUT_H2H), 871 + .nentries = __cpu_to_le32(0), 872 + .nbytes_max = __cpu_to_le32(0), 873 + .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR), 874 + .reserved = __cpu_to_le32(0), 875 + }, 876 + 877 + /* CE8 target->host used only by IPA */ 878 + { 879 + .pipenum = __cpu_to_le32(8), 880 + .pipedir = __cpu_to_le32(PIPEDIR_INOUT), 881 + .nentries = __cpu_to_le32(32), 882 + .nbytes_max = __cpu_to_le32(16384), 883 + .flags = __cpu_to_le32(CE_ATTR_FLAGS), 884 + .reserved = __cpu_to_le32(0), 885 + }, 886 + /* CE 9, 10, 11 are used by MHI driver */ 887 + }; 888 + 889 + /* Map from service/endpoint to Copy Engine. 890 + * This table is derived from the CE_PCI TABLE, above. 891 + * It is passed to the Target at startup for use by firmware. 892 + */ 893 + const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[] = { 894 + { 895 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), 896 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 897 + __cpu_to_le32(3), 898 + }, 899 + { 900 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO), 901 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 902 + __cpu_to_le32(2), 903 + }, 904 + { 905 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), 906 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 907 + __cpu_to_le32(3), 908 + }, 909 + { 910 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK), 911 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 912 + __cpu_to_le32(2), 913 + }, 914 + { 915 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), 916 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 917 + __cpu_to_le32(3), 918 + }, 919 + { 920 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE), 921 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 922 + __cpu_to_le32(2), 923 + }, 924 + { 925 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), 926 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 927 + __cpu_to_le32(3), 928 + }, 929 + { 930 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI), 931 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 932 + __cpu_to_le32(2), 933 + }, 934 + { 935 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), 936 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 937 + __cpu_to_le32(3), 938 + }, 939 + { 940 + __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL), 941 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 942 + __cpu_to_le32(2), 943 + }, 944 + { 945 + __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), 946 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 947 + __cpu_to_le32(0), 948 + }, 949 + { 950 + __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL), 951 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 952 + __cpu_to_le32(1), 953 + }, 954 + { 955 + __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), 956 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 957 + __cpu_to_le32(0), 958 + }, 959 + { 960 + __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS), 961 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 962 + __cpu_to_le32(1), 963 + }, 964 + { 965 + __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), 966 + __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */ 967 + __cpu_to_le32(4), 968 + }, 969 + { 970 + __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG), 971 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 972 + __cpu_to_le32(1), 973 + }, 974 + { 975 + __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG), 976 + __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */ 977 + __cpu_to_le32(5), 978 + }, 979 + 980 + /* (Additions here) */ 981 + 982 + { /* must be last */ 983 + __cpu_to_le32(0), 984 + __cpu_to_le32(0), 985 + __cpu_to_le32(0), 986 + }, 987 + }; 988 + 989 + const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074 = { 990 + .tx = { 991 + ATH11K_TX_RING_MASK_0, 992 + ATH11K_TX_RING_MASK_1, 993 + ATH11K_TX_RING_MASK_2, 994 + }, 995 + .rx_mon_status = { 996 + 0, 0, 0, 997 + ATH11K_RX_MON_STATUS_RING_MASK_0, 998 + ATH11K_RX_MON_STATUS_RING_MASK_1, 999 + ATH11K_RX_MON_STATUS_RING_MASK_2, 1000 + }, 1001 + .rx = { 1002 + 0, 0, 0, 0, 1003 + ATH11K_RX_RING_MASK_0, 1004 + ATH11K_RX_RING_MASK_1, 1005 + ATH11K_RX_RING_MASK_2, 1006 + ATH11K_RX_RING_MASK_3, 1007 + }, 1008 + .rx_err = { 1009 + 0, 0, 0, 1010 + ATH11K_RX_ERR_RING_MASK_0, 1011 + }, 1012 + .rx_wbm_rel = { 1013 + 0, 0, 0, 1014 + ATH11K_RX_WBM_REL_RING_MASK_0, 1015 + }, 1016 + .reo_status = { 1017 + 0, 0, 0, 1018 + ATH11K_REO_STATUS_RING_MASK_0, 1019 + }, 1020 + .rxdma2host = { 1021 + 0, 0, 0, 1022 + ATH11K_RXDMA2HOST_RING_MASK_0, 1023 + }, 1024 + .host2rxdma = { 1025 + 0, 0, 0, 1026 + ATH11K_HOST2RXDMA_RING_MASK_0, 1027 + }, 1028 + }; 1029 + 1244 1030 const struct ath11k_hw_regs ipq8074_regs = { 1245 1031 /* SW2TCL(x) R0 ring configuration address */ 1246 1032 .hal_tcl1_ring_base_lsb = 0x00000510, ··· 1525 841 .hal_reo_status_ring_base_lsb = 0x00000504, 1526 842 .hal_reo_status_hp = 0x00003070, 1527 843 844 + /* WCSS relative address */ 845 + .hal_seq_wcss_umac_ce0_src_reg = 0x00a00000, 846 + .hal_seq_wcss_umac_ce0_dst_reg = 0x00a01000, 847 + .hal_seq_wcss_umac_ce1_src_reg = 0x00a02000, 848 + .hal_seq_wcss_umac_ce1_dst_reg = 0x00a03000, 849 + 850 + /* WBM Idle address */ 851 + .hal_wbm_idle_link_ring_base_lsb = 0x00000860, 852 + .hal_wbm_idle_link_ring_misc = 0x00000870, 853 + 854 + /* SW2WBM release address */ 855 + .hal_wbm_release_ring_base_lsb = 0x000001d8, 856 + 857 + /* WBM2SW release address */ 858 + .hal_wbm0_release_ring_base_lsb = 0x00000910, 859 + .hal_wbm1_release_ring_base_lsb = 0x00000968, 860 + 861 + /* PCIe base address */ 862 + .pcie_qserdes_sysclk_en_sel = 0x0, 863 + .pcie_pcs_osc_dtct_config_base = 0x0, 1528 864 }; 1529 865 1530 866 const struct ath11k_hw_regs qca6390_regs = { ··· 1595 891 /* REO status address */ 1596 892 .hal_reo_status_ring_base_lsb = 0x000004ac, 1597 893 .hal_reo_status_hp = 0x00003068, 894 + 895 + /* WCSS relative address */ 896 + .hal_seq_wcss_umac_ce0_src_reg = 0x00a00000, 897 + .hal_seq_wcss_umac_ce0_dst_reg = 0x00a01000, 898 + .hal_seq_wcss_umac_ce1_src_reg = 0x00a02000, 899 + .hal_seq_wcss_umac_ce1_dst_reg = 0x00a03000, 900 + 901 + /* WBM Idle address */ 902 + .hal_wbm_idle_link_ring_base_lsb = 0x00000860, 903 + .hal_wbm_idle_link_ring_misc = 0x00000870, 904 + 905 + /* SW2WBM release address */ 906 + .hal_wbm_release_ring_base_lsb = 0x000001d8, 907 + 908 + /* WBM2SW release address */ 909 + .hal_wbm0_release_ring_base_lsb = 0x00000910, 910 + .hal_wbm1_release_ring_base_lsb = 0x00000968, 911 + 912 + /* PCIe base address */ 913 + .pcie_qserdes_sysclk_en_sel = 0x01e0c0ac, 914 + .pcie_pcs_osc_dtct_config_base = 0x01e0c628, 915 + }; 916 + 917 + const struct ath11k_hw_regs qcn9074_regs = { 918 + /* SW2TCL(x) R0 ring configuration address */ 919 + .hal_tcl1_ring_base_lsb = 0x000004f0, 920 + .hal_tcl1_ring_base_msb = 0x000004f4, 921 + .hal_tcl1_ring_id = 0x000004f8, 922 + .hal_tcl1_ring_misc = 0x00000500, 923 + .hal_tcl1_ring_tp_addr_lsb = 0x0000050c, 924 + .hal_tcl1_ring_tp_addr_msb = 0x00000510, 925 + .hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000520, 926 + .hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000524, 927 + .hal_tcl1_ring_msi1_base_lsb = 0x00000538, 928 + .hal_tcl1_ring_msi1_base_msb = 0x0000053c, 929 + .hal_tcl1_ring_msi1_data = 0x00000540, 930 + .hal_tcl2_ring_base_lsb = 0x00000548, 931 + .hal_tcl_ring_base_lsb = 0x000005f8, 932 + 933 + /* TCL STATUS ring address */ 934 + .hal_tcl_status_ring_base_lsb = 0x00000700, 935 + 936 + /* REO2SW(x) R0 ring configuration address */ 937 + .hal_reo1_ring_base_lsb = 0x0000029c, 938 + .hal_reo1_ring_base_msb = 0x000002a0, 939 + .hal_reo1_ring_id = 0x000002a4, 940 + .hal_reo1_ring_misc = 0x000002ac, 941 + .hal_reo1_ring_hp_addr_lsb = 0x000002b0, 942 + .hal_reo1_ring_hp_addr_msb = 0x000002b4, 943 + .hal_reo1_ring_producer_int_setup = 0x000002c0, 944 + .hal_reo1_ring_msi1_base_lsb = 0x000002e4, 945 + .hal_reo1_ring_msi1_base_msb = 0x000002e8, 946 + .hal_reo1_ring_msi1_data = 0x000002ec, 947 + .hal_reo2_ring_base_lsb = 0x000002f4, 948 + .hal_reo1_aging_thresh_ix_0 = 0x00000564, 949 + .hal_reo1_aging_thresh_ix_1 = 0x00000568, 950 + .hal_reo1_aging_thresh_ix_2 = 0x0000056c, 951 + .hal_reo1_aging_thresh_ix_3 = 0x00000570, 952 + 953 + /* REO2SW(x) R2 ring pointers (head/tail) address */ 954 + .hal_reo1_ring_hp = 0x00003038, 955 + .hal_reo1_ring_tp = 0x0000303c, 956 + .hal_reo2_ring_hp = 0x00003040, 957 + 958 + /* REO2TCL R0 ring configuration address */ 959 + .hal_reo_tcl_ring_base_lsb = 0x000003fc, 960 + .hal_reo_tcl_ring_hp = 0x00003058, 961 + 962 + /* REO status address */ 963 + .hal_reo_status_ring_base_lsb = 0x00000504, 964 + .hal_reo_status_hp = 0x00003070, 965 + 966 + /* WCSS relative address */ 967 + .hal_seq_wcss_umac_ce0_src_reg = 0x01b80000, 968 + .hal_seq_wcss_umac_ce0_dst_reg = 0x01b81000, 969 + .hal_seq_wcss_umac_ce1_src_reg = 0x01b82000, 970 + .hal_seq_wcss_umac_ce1_dst_reg = 0x01b83000, 971 + 972 + /* WBM Idle address */ 973 + .hal_wbm_idle_link_ring_base_lsb = 0x00000874, 974 + .hal_wbm_idle_link_ring_misc = 0x00000884, 975 + 976 + /* SW2WBM release address */ 977 + .hal_wbm_release_ring_base_lsb = 0x000001ec, 978 + 979 + /* WBM2SW release address */ 980 + .hal_wbm0_release_ring_base_lsb = 0x00000924, 981 + .hal_wbm1_release_ring_base_lsb = 0x0000097c, 982 + 983 + /* PCIe base address */ 984 + .pcie_qserdes_sysclk_en_sel = 0x01e0e0a8, 985 + .pcie_pcs_osc_dtct_config_base = 0x01e0f45c, 1598 986 };
+53
drivers/net/wireless/ath/ath11k/hw.h
··· 105 105 106 106 #define ATH11K_EXT_IRQ_GRP_NUM_MAX 11 107 107 108 + struct hal_rx_desc; 109 + struct hal_tcl_data_cmd; 110 + 108 111 struct ath11k_hw_ring_mask { 109 112 u8 tx[ATH11K_EXT_IRQ_GRP_NUM_MAX]; 110 113 u8 rx_mon_status[ATH11K_EXT_IRQ_GRP_NUM_MAX]; ··· 137 134 bool internal_sleep_clock; 138 135 139 136 const struct ath11k_hw_regs *regs; 137 + u32 qmi_service_ins_id; 140 138 const struct ce_attr *host_ce_config; 141 139 u32 ce_count; 142 140 const struct ce_pipe_config *target_ce_config; ··· 161 157 bool idle_ps; 162 158 bool cold_boot_calib; 163 159 bool supports_suspend; 160 + u32 hal_desc_sz; 164 161 }; 165 162 166 163 struct ath11k_hw_ops { ··· 170 165 struct target_resource_config *config); 171 166 int (*mac_id_to_pdev_id)(struct ath11k_hw_params *hw, int mac_id); 172 167 int (*mac_id_to_srng_id)(struct ath11k_hw_params *hw, int mac_id); 168 + void (*tx_mesh_enable)(struct ath11k_base *ab, 169 + struct hal_tcl_data_cmd *tcl_cmd); 170 + bool (*rx_desc_get_first_msdu)(struct hal_rx_desc *desc); 171 + bool (*rx_desc_get_last_msdu)(struct hal_rx_desc *desc); 172 + u8 (*rx_desc_get_l3_pad_bytes)(struct hal_rx_desc *desc); 173 + u8 *(*rx_desc_get_hdr_status)(struct hal_rx_desc *desc); 174 + bool (*rx_desc_encrypt_valid)(struct hal_rx_desc *desc); 175 + u32 (*rx_desc_get_encrypt_type)(struct hal_rx_desc *desc); 176 + u8 (*rx_desc_get_decap_type)(struct hal_rx_desc *desc); 177 + u8 (*rx_desc_get_mesh_ctl)(struct hal_rx_desc *desc); 178 + bool (*rx_desc_get_mpdu_seq_ctl_vld)(struct hal_rx_desc *desc); 179 + bool (*rx_desc_get_mpdu_fc_valid)(struct hal_rx_desc *desc); 180 + u16 (*rx_desc_get_mpdu_start_seq_no)(struct hal_rx_desc *desc); 181 + u16 (*rx_desc_get_msdu_len)(struct hal_rx_desc *desc); 182 + u8 (*rx_desc_get_msdu_sgi)(struct hal_rx_desc *desc); 183 + u8 (*rx_desc_get_msdu_rate_mcs)(struct hal_rx_desc *desc); 184 + u8 (*rx_desc_get_msdu_rx_bw)(struct hal_rx_desc *desc); 185 + u32 (*rx_desc_get_msdu_freq)(struct hal_rx_desc *desc); 186 + u8 (*rx_desc_get_msdu_pkt_type)(struct hal_rx_desc *desc); 187 + u8 (*rx_desc_get_msdu_nss)(struct hal_rx_desc *desc); 188 + u8 (*rx_desc_get_mpdu_tid)(struct hal_rx_desc *desc); 189 + u16 (*rx_desc_get_mpdu_peer_id)(struct hal_rx_desc *desc); 190 + void (*rx_desc_copy_attn_end_tlv)(struct hal_rx_desc *fdesc, 191 + struct hal_rx_desc *ldesc); 192 + u32 (*rx_desc_get_mpdu_start_tag)(struct hal_rx_desc *desc); 193 + u32 (*rx_desc_get_mpdu_ppdu_id)(struct hal_rx_desc *desc); 194 + void (*rx_desc_set_msdu_len)(struct hal_rx_desc *desc, u16 len); 195 + struct rx_attention *(*rx_desc_get_attention)(struct hal_rx_desc *desc); 196 + u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc); 173 197 }; 174 198 175 199 extern const struct ath11k_hw_ops ipq8074_ops; 176 200 extern const struct ath11k_hw_ops ipq6018_ops; 177 201 extern const struct ath11k_hw_ops qca6390_ops; 202 + extern const struct ath11k_hw_ops qcn9074_ops; 178 203 179 204 extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074; 180 205 extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; 206 + extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074; 181 207 182 208 static inline 183 209 int ath11k_hw_get_mac_from_pdev_id(struct ath11k_hw_params *hw, ··· 297 261 298 262 u32 hal_reo_status_ring_base_lsb; 299 263 u32 hal_reo_status_hp; 264 + 265 + u32 hal_seq_wcss_umac_ce0_src_reg; 266 + u32 hal_seq_wcss_umac_ce0_dst_reg; 267 + u32 hal_seq_wcss_umac_ce1_src_reg; 268 + u32 hal_seq_wcss_umac_ce1_dst_reg; 269 + 270 + u32 hal_wbm_idle_link_ring_base_lsb; 271 + u32 hal_wbm_idle_link_ring_misc; 272 + 273 + u32 hal_wbm_release_ring_base_lsb; 274 + 275 + u32 hal_wbm0_release_ring_base_lsb; 276 + u32 hal_wbm1_release_ring_base_lsb; 277 + 278 + u32 pcie_qserdes_sysclk_en_sel; 279 + u32 pcie_pcs_osc_dtct_config_base; 300 280 }; 301 281 302 282 extern const struct ath11k_hw_regs ipq8074_regs; 303 283 extern const struct ath11k_hw_regs qca6390_regs; 284 + extern const struct ath11k_hw_regs qcn9074_regs; 304 285 305 286 #endif
+79 -9
drivers/net/wireless/ath/ath11k/mac.c
··· 829 829 ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id); 830 830 } 831 831 832 + static void ath11k_mac_handle_beacon_iter(void *data, u8 *mac, 833 + struct ieee80211_vif *vif) 834 + { 835 + struct sk_buff *skb = data; 836 + struct ieee80211_mgmt *mgmt = (void *)skb->data; 837 + struct ath11k_vif *arvif = (void *)vif->drv_priv; 838 + 839 + if (vif->type != NL80211_IFTYPE_STATION) 840 + return; 841 + 842 + if (!ether_addr_equal(mgmt->bssid, vif->bss_conf.bssid)) 843 + return; 844 + 845 + cancel_delayed_work(&arvif->connection_loss_work); 846 + } 847 + 848 + void ath11k_mac_handle_beacon(struct ath11k *ar, struct sk_buff *skb) 849 + { 850 + ieee80211_iterate_active_interfaces_atomic(ar->hw, 851 + IEEE80211_IFACE_ITER_NORMAL, 852 + ath11k_mac_handle_beacon_iter, 853 + skb); 854 + } 855 + 856 + static void ath11k_mac_handle_beacon_miss_iter(void *data, u8 *mac, 857 + struct ieee80211_vif *vif) 858 + { 859 + u32 *vdev_id = data; 860 + struct ath11k_vif *arvif = (void *)vif->drv_priv; 861 + struct ath11k *ar = arvif->ar; 862 + struct ieee80211_hw *hw = ar->hw; 863 + 864 + if (arvif->vdev_id != *vdev_id) 865 + return; 866 + 867 + if (!arvif->is_up) 868 + return; 869 + 870 + ieee80211_beacon_loss(vif); 871 + 872 + /* Firmware doesn't report beacon loss events repeatedly. If AP probe 873 + * (done by mac80211) succeeds but beacons do not resume then it 874 + * doesn't make sense to continue operation. Queue connection loss work 875 + * which can be cancelled when beacon is received. 876 + */ 877 + ieee80211_queue_delayed_work(hw, &arvif->connection_loss_work, 878 + ATH11K_CONNECTION_LOSS_HZ); 879 + } 880 + 881 + void ath11k_mac_handle_beacon_miss(struct ath11k *ar, u32 vdev_id) 882 + { 883 + ieee80211_iterate_active_interfaces_atomic(ar->hw, 884 + IEEE80211_IFACE_ITER_NORMAL, 885 + ath11k_mac_handle_beacon_miss_iter, 886 + &vdev_id); 887 + } 888 + 889 + static void ath11k_mac_vif_sta_connection_loss_work(struct work_struct *work) 890 + { 891 + struct ath11k_vif *arvif = container_of(work, struct ath11k_vif, 892 + connection_loss_work.work); 893 + struct ieee80211_vif *vif = arvif->vif; 894 + 895 + if (!arvif->is_up) 896 + return; 897 + 898 + ieee80211_connection_loss(vif); 899 + } 900 + 832 901 static void ath11k_peer_assoc_h_basic(struct ath11k *ar, 833 902 struct ieee80211_vif *vif, 834 903 struct ieee80211_sta *sta, ··· 1829 1760 1830 1761 arvif->is_up = false; 1831 1762 1832 - /* TODO: cancel connection_loss_work */ 1763 + cancel_delayed_work_sync(&arvif->connection_loss_work); 1833 1764 } 1834 1765 1835 1766 static u32 ath11k_mac_get_rate_hw_value(int bitrate) ··· 3988 3919 3989 3920 he_cap_elem->phy_cap_info[5] &= 3990 3921 ~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK; 3991 - he_cap_elem->phy_cap_info[5] &= 3992 - ~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK; 3993 3922 he_cap_elem->phy_cap_info[5] |= ar->num_tx_chains - 1; 3994 3923 3995 3924 switch (i) { ··· 4280 4213 return -ENOSPC; 4281 4214 } 4282 4215 4283 - if (skb_queue_len(q) == ATH11K_TX_MGMT_NUM_PENDING_MAX) { 4216 + if (skb_queue_len_lockless(q) >= ATH11K_TX_MGMT_NUM_PENDING_MAX) { 4284 4217 ath11k_warn(ar->ab, "mgmt tx queue is full\n"); 4285 4218 return -ENOSPC; 4286 4219 } ··· 4684 4617 arvif->vif = vif; 4685 4618 4686 4619 INIT_LIST_HEAD(&arvif->list); 4687 - 4688 - /* Should we initialize any worker to handle connection loss indication 4689 - * from firmware in sta mode? 4690 - */ 4620 + INIT_DELAYED_WORK(&arvif->connection_loss_work, 4621 + ath11k_mac_vif_sta_connection_loss_work); 4691 4622 4692 4623 for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { 4693 4624 arvif->bitrate_mask.control[i].legacy = 0xffffffff; ··· 4893 4828 unsigned long time_left; 4894 4829 int ret; 4895 4830 int i; 4831 + 4832 + cancel_delayed_work_sync(&arvif->connection_loss_work); 4896 4833 4897 4834 mutex_lock(&ar->conf_mutex); 4898 4835 ··· 5163 5096 arg.channel.chan_radar = 5164 5097 !!(chandef->chan->flags & IEEE80211_CHAN_RADAR); 5165 5098 5099 + arg.channel.freq2_radar = 5100 + !!(chandef->chan->flags & IEEE80211_CHAN_RADAR); 5101 + 5166 5102 arg.channel.passive = arg.channel.chan_radar; 5167 5103 5168 5104 spin_lock_bh(&ab->base_lock); 5169 5105 arg.regdomain = ar->ab->dfs_region; 5170 5106 spin_unlock_bh(&ab->base_lock); 5171 5107 5172 - /* TODO: Notify if secondary 80Mhz also needs radar detection */ 5173 5108 if (he_support) { 5174 5109 ret = ath11k_set_he_mu_sounding_mode(ar, arvif); 5175 5110 if (ret) { ··· 6151 6082 6152 6083 /* TODO: Use real NF instead of default one. */ 6153 6084 sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; 6085 + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL); 6154 6086 } 6155 6087 6156 6088 static const struct ieee80211_ops ath11k_ops = {
+2
drivers/net/wireless/ath/ath11k/mac.h
··· 150 150 u8 ath11k_mac_bw_to_mac80211_bw(u8 bw); 151 151 enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw); 152 152 enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher); 153 + void ath11k_mac_handle_beacon(struct ath11k *ar, struct sk_buff *skb); 154 + void ath11k_mac_handle_beacon_miss(struct ath11k *ar, u32 vdev_id); 153 155 #endif
+108 -8
drivers/net/wireless/ath/ath11k/mhi.c
··· 7 7 #include "core.h" 8 8 #include "debug.h" 9 9 #include "mhi.h" 10 + #include "pci.h" 10 11 11 12 #define MHI_TIMEOUT_DEFAULT_MS 90000 12 13 13 - static struct mhi_channel_config ath11k_mhi_channels[] = { 14 + static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = { 14 15 { 15 16 .num = 0, 16 17 .name = "LOOPBACK", ··· 70 69 }, 71 70 }; 72 71 73 - static struct mhi_event_config ath11k_mhi_events[] = { 72 + static struct mhi_event_config ath11k_mhi_events_qca6390[] = { 74 73 { 75 74 .num_elements = 32, 76 75 .irq_moderation_ms = 0, ··· 93 92 }, 94 93 }; 95 94 96 - static struct mhi_controller_config ath11k_mhi_config = { 95 + static struct mhi_controller_config ath11k_mhi_config_qca6390 = { 97 96 .max_channels = 128, 98 97 .timeout_ms = 2000, 99 98 .use_bounce_buf = false, 100 99 .buf_len = 0, 101 - .num_channels = ARRAY_SIZE(ath11k_mhi_channels), 102 - .ch_cfg = ath11k_mhi_channels, 103 - .num_events = ARRAY_SIZE(ath11k_mhi_events), 104 - .event_cfg = ath11k_mhi_events, 100 + .num_channels = ARRAY_SIZE(ath11k_mhi_channels_qca6390), 101 + .ch_cfg = ath11k_mhi_channels_qca6390, 102 + .num_events = ARRAY_SIZE(ath11k_mhi_events_qca6390), 103 + .event_cfg = ath11k_mhi_events_qca6390, 104 + }; 105 + 106 + static struct mhi_channel_config ath11k_mhi_channels_qcn9074[] = { 107 + { 108 + .num = 0, 109 + .name = "LOOPBACK", 110 + .num_elements = 32, 111 + .event_ring = 1, 112 + .dir = DMA_TO_DEVICE, 113 + .ee_mask = 0x14, 114 + .pollcfg = 0, 115 + .doorbell = MHI_DB_BRST_DISABLE, 116 + .lpm_notify = false, 117 + .offload_channel = false, 118 + .doorbell_mode_switch = false, 119 + .auto_queue = false, 120 + }, 121 + { 122 + .num = 1, 123 + .name = "LOOPBACK", 124 + .num_elements = 32, 125 + .event_ring = 1, 126 + .dir = DMA_FROM_DEVICE, 127 + .ee_mask = 0x14, 128 + .pollcfg = 0, 129 + .doorbell = MHI_DB_BRST_DISABLE, 130 + .lpm_notify = false, 131 + .offload_channel = false, 132 + .doorbell_mode_switch = false, 133 + .auto_queue = false, 134 + }, 135 + { 136 + .num = 20, 137 + .name = "IPCR", 138 + .num_elements = 32, 139 + .event_ring = 1, 140 + .dir = DMA_TO_DEVICE, 141 + .ee_mask = 0x14, 142 + .pollcfg = 0, 143 + .doorbell = MHI_DB_BRST_DISABLE, 144 + .lpm_notify = false, 145 + .offload_channel = false, 146 + .doorbell_mode_switch = false, 147 + .auto_queue = false, 148 + }, 149 + { 150 + .num = 21, 151 + .name = "IPCR", 152 + .num_elements = 32, 153 + .event_ring = 1, 154 + .dir = DMA_FROM_DEVICE, 155 + .ee_mask = 0x14, 156 + .pollcfg = 0, 157 + .doorbell = MHI_DB_BRST_DISABLE, 158 + .lpm_notify = false, 159 + .offload_channel = false, 160 + .doorbell_mode_switch = false, 161 + .auto_queue = true, 162 + }, 163 + }; 164 + 165 + static struct mhi_event_config ath11k_mhi_events_qcn9074[] = { 166 + { 167 + .num_elements = 32, 168 + .irq_moderation_ms = 0, 169 + .irq = 1, 170 + .data_type = MHI_ER_CTRL, 171 + .mode = MHI_DB_BRST_DISABLE, 172 + .hardware_event = false, 173 + .client_managed = false, 174 + .offload_channel = false, 175 + }, 176 + { 177 + .num_elements = 256, 178 + .irq_moderation_ms = 1, 179 + .irq = 2, 180 + .mode = MHI_DB_BRST_DISABLE, 181 + .priority = 1, 182 + .hardware_event = false, 183 + .client_managed = false, 184 + .offload_channel = false, 185 + }, 186 + }; 187 + 188 + static struct mhi_controller_config ath11k_mhi_config_qcn9074 = { 189 + .max_channels = 30, 190 + .timeout_ms = 10000, 191 + .use_bounce_buf = false, 192 + .buf_len = 0, 193 + .num_channels = ARRAY_SIZE(ath11k_mhi_channels_qcn9074), 194 + .ch_cfg = ath11k_mhi_channels_qcn9074, 195 + .num_events = ARRAY_SIZE(ath11k_mhi_events_qcn9074), 196 + .event_cfg = ath11k_mhi_events_qcn9074, 105 197 }; 106 198 107 199 void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab) ··· 315 221 { 316 222 struct ath11k_base *ab = ab_pci->ab; 317 223 struct mhi_controller *mhi_ctrl; 224 + struct mhi_controller_config *ath11k_mhi_config; 318 225 int ret; 319 226 320 227 mhi_ctrl = mhi_alloc_controller(); ··· 349 254 mhi_ctrl->read_reg = ath11k_mhi_op_read_reg; 350 255 mhi_ctrl->write_reg = ath11k_mhi_op_write_reg; 351 256 352 - ret = mhi_register_controller(mhi_ctrl, &ath11k_mhi_config); 257 + if (ab->hw_rev == ATH11K_HW_QCA6390_HW20) 258 + ath11k_mhi_config = &ath11k_mhi_config_qca6390; 259 + else if (ab->hw_rev == ATH11K_HW_QCN9074_HW10) 260 + ath11k_mhi_config = &ath11k_mhi_config_qcn9074; 261 + 262 + ret = mhi_register_controller(mhi_ctrl, ath11k_mhi_config); 353 263 if (ret) { 354 264 ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret); 355 265 mhi_free_controller(mhi_ctrl);
+149 -45
drivers/net/wireless/ath/ath11k/pci.c
··· 35 35 #define ACCESS_ALWAYS_OFF 0xFE0 36 36 37 37 #define QCA6390_DEVICE_ID 0x1101 38 + #define QCN9074_DEVICE_ID 0x1104 38 39 39 40 static const struct pci_device_id ath11k_pci_id_table[] = { 40 41 { PCI_VDEVICE(QCOM, QCA6390_DEVICE_ID) }, 42 + /* TODO: add QCN9074_DEVICE_ID) once firmware issues are resolved */ 41 43 {0} 42 44 }; 43 45 ··· 52 50 .fixed_mem_region = false, 53 51 }; 54 52 55 - static const struct ath11k_msi_config msi_config = { 56 - .total_vectors = 32, 57 - .total_users = 4, 58 - .users = (struct ath11k_msi_user[]) { 59 - { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, 60 - { .name = "CE", .num_vectors = 10, .base_vector = 3 }, 61 - { .name = "WAKE", .num_vectors = 1, .base_vector = 13 }, 62 - { .name = "DP", .num_vectors = 18, .base_vector = 14 }, 53 + static const struct ath11k_msi_config ath11k_msi_config[] = { 54 + { 55 + .total_vectors = 32, 56 + .total_users = 4, 57 + .users = (struct ath11k_msi_user[]) { 58 + { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, 59 + { .name = "CE", .num_vectors = 10, .base_vector = 3 }, 60 + { .name = "WAKE", .num_vectors = 1, .base_vector = 13 }, 61 + { .name = "DP", .num_vectors = 18, .base_vector = 14 }, 62 + }, 63 + }, 64 + { 65 + .total_vectors = 16, 66 + .total_users = 3, 67 + .users = (struct ath11k_msi_user[]) { 68 + { .name = "MHI", .num_vectors = 3, .base_vector = 0 }, 69 + { .name = "CE", .num_vectors = 5, .base_vector = 3 }, 70 + { .name = "DP", .num_vectors = 8, .base_vector = 8 }, 71 + }, 63 72 }, 64 73 }; 65 74 ··· 144 131 } 145 132 } 146 133 134 + static inline void ath11k_pci_select_static_window(struct ath11k_pci *ab_pci) 135 + { 136 + u32 umac_window = FIELD_GET(WINDOW_VALUE_MASK, HAL_SEQ_WCSS_UMAC_OFFSET); 137 + u32 ce_window = FIELD_GET(WINDOW_VALUE_MASK, HAL_CE_WFSS_CE_REG_BASE); 138 + u32 window; 139 + 140 + window = (umac_window << 12) | (ce_window << 6); 141 + 142 + iowrite32(WINDOW_ENABLE_BIT | window, ab_pci->ab->mem + WINDOW_REG_ADDRESS); 143 + } 144 + 145 + static inline u32 ath11k_pci_get_window_start(struct ath11k_base *ab, 146 + u32 offset) 147 + { 148 + u32 window_start; 149 + 150 + /* If offset lies within DP register range, use 3rd window */ 151 + if ((offset ^ HAL_SEQ_WCSS_UMAC_OFFSET) < WINDOW_RANGE_MASK) 152 + window_start = 3 * WINDOW_START; 153 + /* If offset lies within CE register range, use 2nd window */ 154 + else if ((offset ^ HAL_CE_WFSS_CE_REG_BASE) < WINDOW_RANGE_MASK) 155 + window_start = 2 * WINDOW_START; 156 + else 157 + window_start = WINDOW_START; 158 + 159 + return window_start; 160 + } 161 + 147 162 void ath11k_pci_write32(struct ath11k_base *ab, u32 offset, u32 value) 148 163 { 149 164 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); 165 + u32 window_start; 150 166 151 167 /* for offset beyond BAR + 4K - 32, may 152 168 * need to wakeup MHI to access. ··· 187 145 if (offset < WINDOW_START) { 188 146 iowrite32(value, ab->mem + offset); 189 147 } else { 190 - spin_lock_bh(&ab_pci->window_lock); 191 - ath11k_pci_select_window(ab_pci, offset); 192 - iowrite32(value, ab->mem + WINDOW_START + (offset & WINDOW_RANGE_MASK)); 193 - spin_unlock_bh(&ab_pci->window_lock); 148 + if (ab->bus_params.static_window_map) 149 + window_start = ath11k_pci_get_window_start(ab, offset); 150 + else 151 + window_start = WINDOW_START; 152 + 153 + if (window_start == WINDOW_START) { 154 + spin_lock_bh(&ab_pci->window_lock); 155 + ath11k_pci_select_window(ab_pci, offset); 156 + iowrite32(value, ab->mem + window_start + 157 + (offset & WINDOW_RANGE_MASK)); 158 + spin_unlock_bh(&ab_pci->window_lock); 159 + } else { 160 + iowrite32(value, ab->mem + window_start + 161 + (offset & WINDOW_RANGE_MASK)); 162 + } 194 163 } 195 164 196 165 if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && ··· 212 159 u32 ath11k_pci_read32(struct ath11k_base *ab, u32 offset) 213 160 { 214 161 struct ath11k_pci *ab_pci = ath11k_pci_priv(ab); 215 - u32 val; 162 + u32 val, window_start; 216 163 217 164 /* for offset beyond BAR + 4K - 32, may 218 165 * need to wakeup MHI to access. ··· 224 171 if (offset < WINDOW_START) { 225 172 val = ioread32(ab->mem + offset); 226 173 } else { 227 - spin_lock_bh(&ab_pci->window_lock); 228 - ath11k_pci_select_window(ab_pci, offset); 229 - val = ioread32(ab->mem + WINDOW_START + (offset & WINDOW_RANGE_MASK)); 230 - spin_unlock_bh(&ab_pci->window_lock); 174 + if (ab->bus_params.static_window_map) 175 + window_start = ath11k_pci_get_window_start(ab, offset); 176 + else 177 + window_start = WINDOW_START; 178 + 179 + if (window_start == WINDOW_START) { 180 + spin_lock_bh(&ab_pci->window_lock); 181 + ath11k_pci_select_window(ab_pci, offset); 182 + val = ioread32(ab->mem + window_start + 183 + (offset & WINDOW_RANGE_MASK)); 184 + spin_unlock_bh(&ab_pci->window_lock); 185 + } else { 186 + val = ioread32(ab->mem + window_start + 187 + (offset & WINDOW_RANGE_MASK)); 188 + } 231 189 } 232 190 233 191 if (test_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags) && ··· 335 271 int ret; 336 272 337 273 ret = ath11k_pci_set_link_reg(ab, 338 - PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG, 274 + PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(ab), 339 275 PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL, 340 276 PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK); 341 277 if (ret) { ··· 344 280 } 345 281 346 282 ret = ath11k_pci_set_link_reg(ab, 347 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_REG, 348 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_VAL, 349 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK); 283 + PCIE_PCS_OSC_DTCT_CONFIG1_REG(ab), 284 + PCIE_PCS_OSC_DTCT_CONFIG1_VAL, 285 + PCIE_PCS_OSC_DTCT_CONFIG_MSK); 350 286 if (ret) { 351 287 ath11k_warn(ab, "failed to set dtct config1 error: %d\n", ret); 352 288 return ret; 353 289 } 354 290 355 291 ret = ath11k_pci_set_link_reg(ab, 356 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_REG, 357 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_VAL, 358 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK); 292 + PCIE_PCS_OSC_DTCT_CONFIG2_REG(ab), 293 + PCIE_PCS_OSC_DTCT_CONFIG2_VAL, 294 + PCIE_PCS_OSC_DTCT_CONFIG_MSK); 359 295 if (ret) { 360 296 ath11k_warn(ab, "failed to set dtct config2: %d\n", ret); 361 297 return ret; 362 298 } 363 299 364 300 ret = ath11k_pci_set_link_reg(ab, 365 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_REG, 366 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_VAL, 367 - PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK); 301 + PCIE_PCS_OSC_DTCT_CONFIG4_REG(ab), 302 + PCIE_PCS_OSC_DTCT_CONFIG4_VAL, 303 + PCIE_PCS_OSC_DTCT_CONFIG_MSK); 368 304 if (ret) { 369 305 ath11k_warn(ab, "failed to set dtct config4: %d\n", ret); 370 306 return ret; ··· 470 406 u32 *base_vector) 471 407 { 472 408 struct ath11k_base *ab = ab_pci->ab; 409 + const struct ath11k_msi_config *msi_config = ab_pci->msi_config; 473 410 int idx; 474 411 475 - for (idx = 0; idx < msi_config.total_users; idx++) { 476 - if (strcmp(user_name, msi_config.users[idx].name) == 0) { 477 - *num_vectors = msi_config.users[idx].num_vectors; 478 - *user_base_data = msi_config.users[idx].base_vector 412 + for (idx = 0; idx < msi_config->total_users; idx++) { 413 + if (strcmp(user_name, msi_config->users[idx].name) == 0) { 414 + *num_vectors = msi_config->users[idx].num_vectors; 415 + *user_base_data = msi_config->users[idx].base_vector 479 416 + ab_pci->msi_ep_base_data; 480 - *base_vector = msi_config.users[idx].base_vector; 417 + *base_vector = msi_config->users[idx].base_vector; 481 418 482 419 ath11k_dbg(ab, ATH11K_DBG_PCI, "Assign MSI to user: %s, num_vectors: %d, user_base_data: %u, base_vector: %u\n", 483 420 user_name, *num_vectors, *user_base_data, ··· 491 426 ath11k_err(ab, "Failed to find MSI assignment for %s!\n", user_name); 492 427 493 428 return -EINVAL; 429 + } 430 + 431 + static void ath11k_pci_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id, 432 + u32 *msi_idx) 433 + { 434 + u32 i, msi_data_idx; 435 + 436 + for (i = 0, msi_data_idx = 0; i < ab->hw_params.ce_count; i++) { 437 + if (ath11k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) 438 + continue; 439 + 440 + if (ce_id == i) 441 + break; 442 + 443 + msi_data_idx++; 444 + } 445 + *msi_idx = msi_data_idx; 494 446 } 495 447 496 448 static int ath11k_get_user_msi_assignment(struct ath11k_base *ab, char *user_name, ··· 603 521 { 604 522 struct ath11k_ce_pipe *ce_pipe = arg; 605 523 524 + /* last interrupt received for this CE */ 525 + ce_pipe->timestamp = jiffies; 526 + 606 527 ath11k_pci_ce_irq_disable(ce_pipe->ab, ce_pipe->pipe_num); 607 528 tasklet_schedule(&ce_pipe->intr_tq); 608 529 ··· 700 615 701 616 ath11k_dbg(irq_grp->ab, ATH11K_DBG_PCI, "ext irq:%d\n", irq); 702 617 618 + /* last interrupt received for this group */ 619 + irq_grp->timestamp = jiffies; 620 + 703 621 ath11k_pci_ext_grp_disable(irq_grp); 704 622 705 623 napi_schedule(&irq_grp->napi); ··· 713 625 static int ath11k_pci_ext_irq_config(struct ath11k_base *ab) 714 626 { 715 627 int i, j, ret, num_vectors = 0; 716 - u32 user_base_data = 0, base_vector = 0; 628 + u32 user_base_data = 0, base_vector = 0, base_idx; 717 629 630 + base_idx = ATH11K_PCI_IRQ_CE0_OFFSET + CE_COUNT_MAX; 718 631 ret = ath11k_pci_get_user_msi_assignment(ath11k_pci_priv(ab), "DP", 719 632 &num_vectors, 720 633 &user_base_data, ··· 745 656 } 746 657 747 658 irq_grp->num_irq = num_irq; 748 - irq_grp->irqs[0] = base_vector + i; 659 + irq_grp->irqs[0] = base_idx + i; 749 660 750 661 for (j = 0; j < irq_grp->num_irq; j++) { 751 662 int irq_idx = irq_grp->irqs[j]; ··· 756 667 757 668 ath11k_dbg(ab, ATH11K_DBG_PCI, 758 669 "irq:%d group:%d\n", irq, i); 670 + 671 + irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY); 759 672 ret = request_irq(irq, ath11k_pci_ext_interrupt_handler, 760 673 IRQF_SHARED, 761 674 "DP_EXT_IRQ", irq_grp); ··· 778 687 { 779 688 struct ath11k_ce_pipe *ce_pipe; 780 689 u32 msi_data_start; 781 - u32 msi_data_count; 690 + u32 msi_data_count, msi_data_idx; 782 691 u32 msi_irq_start; 783 692 unsigned int msi_data; 784 693 int irq, i, ret, irq_idx; ··· 790 699 return ret; 791 700 792 701 /* Configure CE irqs */ 793 - for (i = 0; i < ab->hw_params.ce_count; i++) { 794 - msi_data = (i % msi_data_count) + msi_irq_start; 795 - irq = ath11k_pci_get_msi_irq(ab->dev, msi_data); 796 - ce_pipe = &ab->ce.ce_pipe[i]; 797 - 702 + for (i = 0, msi_data_idx = 0; i < ab->hw_params.ce_count; i++) { 798 703 if (ath11k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) 799 704 continue; 705 + 706 + msi_data = (msi_data_idx % msi_data_count) + msi_irq_start; 707 + irq = ath11k_pci_get_msi_irq(ab->dev, msi_data); 708 + ce_pipe = &ab->ce.ce_pipe[i]; 800 709 801 710 irq_idx = ATH11K_PCI_IRQ_CE0_OFFSET + i; 802 711 ··· 812 721 } 813 722 814 723 ab->irq_num[irq_idx] = irq; 724 + msi_data_idx++; 725 + 815 726 ath11k_pci_ce_irq_disable(ab, i); 816 727 } 817 728 ··· 833 740 834 741 cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; 835 742 cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; 836 - ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390; 743 + ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id; 837 744 838 745 ath11k_ce_get_shadow_config(ab, &cfg->shadow_reg_v2, 839 746 &cfg->shadow_reg_v2_len); ··· 853 760 static int ath11k_pci_enable_msi(struct ath11k_pci *ab_pci) 854 761 { 855 762 struct ath11k_base *ab = ab_pci->ab; 763 + const struct ath11k_msi_config *msi_config = ab_pci->msi_config; 856 764 struct msi_desc *msi_desc; 857 765 int num_vectors; 858 766 int ret; 859 767 860 768 num_vectors = pci_alloc_irq_vectors(ab_pci->pdev, 861 - msi_config.total_vectors, 862 - msi_config.total_vectors, 769 + msi_config->total_vectors, 770 + msi_config->total_vectors, 863 771 PCI_IRQ_MSI); 864 - if (num_vectors != msi_config.total_vectors) { 772 + if (num_vectors != msi_config->total_vectors) { 865 773 ath11k_err(ab, "failed to get %d MSI vectors, only %d available", 866 - msi_config.total_vectors, num_vectors); 774 + msi_config->total_vectors, num_vectors); 867 775 868 776 if (num_vectors >= 0) 869 777 return -EINVAL; ··· 1026 932 return ret; 1027 933 } 1028 934 935 + if (ab->bus_params.static_window_map) 936 + ath11k_pci_select_static_window(ab_pci); 937 + 1029 938 return 0; 1030 939 } 1031 940 ··· 1173 1076 .map_service_to_pipe = ath11k_pci_map_service_to_pipe, 1174 1077 .ce_irq_enable = ath11k_pci_hif_ce_irq_enable, 1175 1078 .ce_irq_disable = ath11k_pci_hif_ce_irq_disable, 1079 + .get_ce_msi_idx = ath11k_pci_get_ce_msi_idx, 1176 1080 }; 1177 1081 1178 1082 static int ath11k_pci_probe(struct pci_dev *pdev, ··· 1228 1130 ret = -EOPNOTSUPP; 1229 1131 goto err_pci_free_region; 1230 1132 } 1133 + ab_pci->msi_config = &ath11k_msi_config[0]; 1134 + break; 1135 + case QCN9074_DEVICE_ID: 1136 + ab_pci->msi_config = &ath11k_msi_config[1]; 1137 + ab->bus_params.static_window_map = true; 1138 + ab->hw_rev = ATH11K_HW_QCN9074_HW10; 1231 1139 break; 1232 1140 default: 1233 1141 dev_err(&pdev->dev, "Unknown PCI device found: 0x%x\n",
+13 -8
drivers/net/wireless/ath/ath11k/pci.h
··· 34 34 #define PCIE_SMLH_REQ_RST_LINK_DOWN 0x2 35 35 #define PCIE_INT_CLEAR_ALL 0xffffffff 36 36 37 - #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG 0x01e0c0ac 37 + #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(x) \ 38 + (ab->hw_params.regs->pcie_qserdes_sysclk_en_sel) 38 39 #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL 0x10 39 40 #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK 0xffffffff 40 - #define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_REG 0x01e0c628 41 - #define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_VAL 0x02 42 - #define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_REG 0x01e0c62c 43 - #define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_VAL 0x52 44 - #define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_REG 0x01e0c634 45 - #define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_VAL 0xff 46 - #define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK 0x000000ff 41 + #define PCIE_PCS_OSC_DTCT_CONFIG1_REG(x) \ 42 + (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base) 43 + #define PCIE_PCS_OSC_DTCT_CONFIG1_VAL 0x02 44 + #define PCIE_PCS_OSC_DTCT_CONFIG2_REG(x) \ 45 + (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0x4) 46 + #define PCIE_PCS_OSC_DTCT_CONFIG2_VAL 0x52 47 + #define PCIE_PCS_OSC_DTCT_CONFIG4_REG(x) \ 48 + (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0xc) 49 + #define PCIE_PCS_OSC_DTCT_CONFIG4_VAL 0xff 50 + #define PCIE_PCS_OSC_DTCT_CONFIG_MSK 0x000000ff 47 51 48 52 #define WLAON_QFPROM_PWR_CTRL_REG 0x01f8031c 49 53 #define QFPROM_PWR_CTRL_VDD4BLOW_MASK 0x4 ··· 77 73 char amss_path[100]; 78 74 u32 msi_ep_base_data; 79 75 struct mhi_controller *mhi_ctrl; 76 + const struct ath11k_msi_config *msi_config; 80 77 unsigned long mhi_state; 81 78 u32 register_window; 82 79
+73 -45
drivers/net/wireless/ath/ath11k/qmi.c
··· 1556 1556 req.nm_modem |= SLEEP_CLOCK_SELECT_INTERNAL_BIT; 1557 1557 } 1558 1558 1559 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n"); 1560 + 1559 1561 ret = qmi_txn_init(&ab->qmi.handle, &txn, 1560 1562 qmi_wlanfw_host_cap_resp_msg_v01_ei, &resp); 1561 1563 if (ret < 0) ··· 1568 1566 QMI_WLANFW_HOST_CAP_REQ_MSG_V01_MAX_LEN, 1569 1567 qmi_wlanfw_host_cap_req_msg_v01_ei, &req); 1570 1568 if (ret < 0) { 1571 - ath11k_warn(ab, "Failed to send host capability request,err = %d\n", ret); 1569 + ath11k_warn(ab, "failed to send host capability request: %d\n", ret); 1572 1570 goto out; 1573 1571 } 1574 1572 ··· 1577 1575 goto out; 1578 1576 1579 1577 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { 1580 - ath11k_warn(ab, "Host capability request failed, result: %d, err: %d\n", 1578 + ath11k_warn(ab, "host capability request failed: %d %d\n", 1581 1579 resp.resp.result, resp.resp.error); 1582 1580 ret = -EINVAL; 1583 1581 goto out; ··· 1626 1624 if (ret < 0) 1627 1625 goto out; 1628 1626 1627 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi indication register request\n"); 1628 + 1629 1629 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 1630 1630 QMI_WLANFW_IND_REGISTER_REQ_V01, 1631 1631 QMI_WLANFW_IND_REGISTER_REQ_MSG_V01_MAX_LEN, 1632 1632 qmi_wlanfw_ind_register_req_msg_v01_ei, req); 1633 1633 if (ret < 0) { 1634 - ath11k_warn(ab, "Failed to send indication register request, err = %d\n", 1634 + ath11k_warn(ab, "failed to send indication register request: %d\n", 1635 1635 ret); 1636 1636 goto out; 1637 1637 } 1638 1638 1639 1639 ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); 1640 1640 if (ret < 0) { 1641 - ath11k_warn(ab, "failed to register fw indication %d\n", ret); 1641 + ath11k_warn(ab, "failed to register fw indication: %d\n", ret); 1642 1642 goto out; 1643 1643 } 1644 1644 1645 1645 if (resp->resp.result != QMI_RESULT_SUCCESS_V01) { 1646 - ath11k_warn(ab, "FW Ind register request failed, result: %d, err: %d\n", 1646 + ath11k_warn(ab, "firmware indication register request failed: %d %d\n", 1647 1647 resp->resp.result, resp->resp.error); 1648 1648 ret = -EINVAL; 1649 1649 goto out; ··· 1703 1699 if (ret < 0) 1704 1700 goto out; 1705 1701 1702 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi respond memory request delayed %i\n", 1703 + delayed); 1704 + 1706 1705 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 1707 1706 QMI_WLANFW_RESPOND_MEM_REQ_V01, 1708 1707 QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN, 1709 1708 qmi_wlanfw_respond_mem_req_msg_v01_ei, req); 1710 1709 if (ret < 0) { 1711 - ath11k_warn(ab, "qmi failed to respond memory request, err = %d\n", 1710 + ath11k_warn(ab, "failed to respond qmi memory request: %d\n", 1712 1711 ret); 1713 1712 goto out; 1714 1713 } 1715 1714 1716 1715 ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); 1717 1716 if (ret < 0) { 1718 - ath11k_warn(ab, "qmi failed memory request, err = %d\n", ret); 1717 + ath11k_warn(ab, "failed to wait qmi memory request: %d\n", ret); 1719 1718 goto out; 1720 1719 } 1721 1720 ··· 1729 1722 if (delayed && resp.resp.error == 0) 1730 1723 goto out; 1731 1724 1732 - ath11k_warn(ab, "Respond mem req failed, result: %d, err: %d\n", 1725 + ath11k_warn(ab, "qmi respond memory request failed: %d %d\n", 1733 1726 resp.resp.result, resp.resp.error); 1734 1727 ret = -EINVAL; 1735 1728 goto out; ··· 1772 1765 &chunk->paddr, 1773 1766 GFP_KERNEL); 1774 1767 if (!chunk->vaddr) { 1775 - if (ab->qmi.mem_seg_count <= 2) { 1768 + if (ab->qmi.mem_seg_count <= ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT) { 1776 1769 ath11k_dbg(ab, ATH11K_DBG_QMI, 1777 1770 "qmi dma allocation failed (%d B type %u), will try later with small size\n", 1778 1771 chunk->size, ··· 1781 1774 ab->qmi.target_mem_delayed = true; 1782 1775 return 0; 1783 1776 } 1784 - ath11k_err(ab, "failed to alloc memory, size: 0x%x, type: %u\n", 1777 + 1778 + ath11k_err(ab, "failed to allocate dma memory for qmi (%d B type %u)\n", 1785 1779 chunk->size, 1786 1780 chunk->type); 1787 1781 return -EINVAL; ··· 1851 1843 if (ret < 0) 1852 1844 goto out; 1853 1845 1846 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi target cap request\n"); 1847 + 1854 1848 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 1855 1849 QMI_WLANFW_CAP_REQ_V01, 1856 1850 QMI_WLANFW_CAP_REQ_MSG_V01_MAX_LEN, 1857 1851 qmi_wlanfw_cap_req_msg_v01_ei, &req); 1858 1852 if (ret < 0) { 1859 - ath11k_warn(ab, "qmi failed to send target cap request, err = %d\n", 1853 + ath11k_warn(ab, "failed to send qmi cap request: %d\n", 1860 1854 ret); 1861 1855 goto out; 1862 1856 } 1863 1857 1864 1858 ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); 1865 1859 if (ret < 0) { 1866 - ath11k_warn(ab, "qmi failed target cap request %d\n", ret); 1860 + ath11k_warn(ab, "failed to wait qmi cap request: %d\n", ret); 1867 1861 goto out; 1868 1862 } 1869 1863 1870 1864 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { 1871 - ath11k_warn(ab, "qmi targetcap req failed, result: %d, err: %d\n", 1865 + ath11k_warn(ab, "qmi cap request failed: %d %d\n", 1872 1866 resp.resp.result, resp.resp.error); 1873 1867 ret = -EINVAL; 1874 1868 goto out; ··· 1933 1923 1934 1924 ret = ath11k_core_fetch_bdf(ab, &bd); 1935 1925 if (ret) { 1936 - ath11k_warn(ab, "qmi failed to load BDF\n"); 1926 + ath11k_warn(ab, "failed to load board file: %d\n", ret); 1937 1927 return ret; 1938 1928 } 1939 1929 ··· 1981 1971 1982 1972 bdf_addr = ioremap(ab->hw_params.bdf_addr, ATH11K_QMI_BDF_MAX_SIZE); 1983 1973 if (!bdf_addr) { 1984 - ath11k_warn(ab, "qmi ioremap error for BDF\n"); 1974 + ath11k_warn(ab, "failed ioremap for board file\n"); 1985 1975 ret = -EIO; 1986 1976 goto out; 1987 1977 } ··· 2010 2000 if (ret < 0) 2011 2001 goto out_qmi_bdf; 2012 2002 2003 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi bdf download req fixed addr type %d\n", 2004 + type); 2005 + 2013 2006 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 2014 2007 QMI_WLANFW_BDF_DOWNLOAD_REQ_V01, 2015 2008 QMI_WLANFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_LEN, ··· 2027 2014 goto out_qmi_bdf; 2028 2015 2029 2016 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { 2030 - ath11k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n", 2017 + ath11k_warn(ab, "board file download request failed: %d %d\n", 2031 2018 resp.resp.result, resp.resp.error); 2032 2019 ret = -EINVAL; 2033 2020 goto out_qmi_bdf; ··· 2060 2047 memset(&bd, 0, sizeof(bd)); 2061 2048 ret = ath11k_core_fetch_bdf(ab, &bd); 2062 2049 if (ret) { 2063 - ath11k_warn(ab, "qmi failed to load bdf:\n"); 2050 + ath11k_warn(ab, "failed to fetch board file: %d\n", ret); 2064 2051 goto out; 2065 2052 } 2066 2053 ··· 2103 2090 if (ret < 0) 2104 2091 goto out_qmi_bdf; 2105 2092 2093 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi bdf download request remaining %i\n", 2094 + remaining); 2095 + 2106 2096 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 2107 2097 QMI_WLANFW_BDF_DOWNLOAD_REQ_V01, 2108 2098 QMI_WLANFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_LEN, ··· 2120 2104 goto out_qmi_bdf; 2121 2105 2122 2106 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { 2123 - ath11k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n", 2107 + ath11k_warn(ab, "bdf download request failed: %d %d\n", 2124 2108 resp.resp.result, resp.resp.error); 2125 2109 ret = resp.resp.result; 2126 2110 goto out_qmi_bdf; ··· 2216 2200 if (ret < 0) 2217 2201 goto out; 2218 2202 2203 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi m3 info req\n"); 2204 + 2219 2205 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 2220 2206 QMI_WLANFW_M3_INFO_REQ_V01, 2221 2207 QMI_WLANFW_M3_INFO_REQ_MSG_V01_MAX_MSG_LEN, 2222 2208 qmi_wlanfw_m3_info_req_msg_v01_ei, &req); 2223 2209 if (ret < 0) { 2224 - ath11k_warn(ab, "qmi failed to send M3 information request, err = %d\n", 2210 + ath11k_warn(ab, "failed to send m3 information request: %d\n", 2225 2211 ret); 2226 2212 goto out; 2227 2213 } 2228 2214 2229 2215 ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); 2230 2216 if (ret < 0) { 2231 - ath11k_warn(ab, "qmi failed M3 information request %d\n", ret); 2217 + ath11k_warn(ab, "failed to wait m3 information request: %d\n", ret); 2232 2218 goto out; 2233 2219 } 2234 2220 2235 2221 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { 2236 - ath11k_warn(ab, "qmi M3 info request failed, result: %d, err: %d\n", 2222 + ath11k_warn(ab, "m3 info request failed: %d %d\n", 2237 2223 resp.resp.result, resp.resp.error); 2238 2224 ret = -EINVAL; 2239 2225 goto out; ··· 2264 2246 if (ret < 0) 2265 2247 goto out; 2266 2248 2249 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi wlan mode req mode %d\n", mode); 2250 + 2267 2251 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 2268 2252 QMI_WLANFW_WLAN_MODE_REQ_V01, 2269 2253 QMI_WLANFW_WLAN_MODE_REQ_MSG_V01_MAX_LEN, 2270 2254 qmi_wlanfw_wlan_mode_req_msg_v01_ei, &req); 2271 2255 if (ret < 0) { 2272 - ath11k_warn(ab, "qmi failed to send mode request, mode: %d, err = %d\n", 2256 + ath11k_warn(ab, "failed to send wlan mode request (mode %d): %d\n", 2273 2257 mode, ret); 2274 2258 goto out; 2275 2259 } ··· 2282 2262 ath11k_warn(ab, "WLFW service is dis-connected\n"); 2283 2263 return 0; 2284 2264 } 2285 - ath11k_warn(ab, "qmi failed set mode request, mode: %d, err = %d\n", 2265 + ath11k_warn(ab, "failed to wait wlan mode request (mode %d): %d\n", 2286 2266 mode, ret); 2287 2267 goto out; 2288 2268 } 2289 2269 2290 2270 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { 2291 - ath11k_warn(ab, "Mode request failed, mode: %d, result: %d err: %d\n", 2271 + ath11k_warn(ab, "wlan mode request failed (mode: %d): %d %d\n", 2292 2272 mode, resp.resp.result, resp.resp.error); 2293 2273 ret = -EINVAL; 2294 2274 goto out; ··· 2358 2338 if (ret < 0) 2359 2339 goto out; 2360 2340 2341 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi wlan cfg req\n"); 2342 + 2361 2343 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, 2362 2344 QMI_WLANFW_WLAN_CFG_REQ_V01, 2363 2345 QMI_WLANFW_WLAN_CFG_REQ_MSG_V01_MAX_LEN, 2364 2346 qmi_wlanfw_wlan_cfg_req_msg_v01_ei, req); 2365 2347 if (ret < 0) { 2366 - ath11k_warn(ab, "qmi failed to send wlan config request, err = %d\n", 2348 + ath11k_warn(ab, "failed to send wlan config request: %d\n", 2367 2349 ret); 2368 2350 goto out; 2369 2351 } 2370 2352 2371 2353 ret = qmi_txn_wait(&txn, msecs_to_jiffies(ATH11K_QMI_WLANFW_TIMEOUT_MS)); 2372 2354 if (ret < 0) { 2373 - ath11k_warn(ab, "qmi failed wlan config request, err = %d\n", ret); 2355 + ath11k_warn(ab, "failed to wait wlan config request: %d\n", ret); 2374 2356 goto out; 2375 2357 } 2376 2358 2377 2359 if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { 2378 - ath11k_warn(ab, "qmi wlan config request failed, result: %d, err: %d\n", 2360 + ath11k_warn(ab, "wlan config request failed: %d %d\n", 2379 2361 resp.resp.result, resp.resp.error); 2380 2362 ret = -EINVAL; 2381 2363 goto out; ··· 2392 2370 { 2393 2371 int ret; 2394 2372 2373 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi firmware stop\n"); 2374 + 2395 2375 ret = ath11k_qmi_wlanfw_mode_send(ab, ATH11K_FIRMWARE_MODE_OFF); 2396 2376 if (ret < 0) { 2397 - ath11k_warn(ab, "qmi failed to send wlan mode off\n"); 2377 + ath11k_warn(ab, "qmi failed to send wlan mode off: %d\n", ret); 2398 2378 return; 2399 2379 } 2400 2380 } ··· 2406 2382 { 2407 2383 int ret; 2408 2384 2385 + ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi firmware start\n"); 2386 + 2409 2387 ret = ath11k_qmi_wlanfw_wlan_cfg_send(ab); 2410 2388 if (ret < 0) { 2411 - ath11k_warn(ab, "qmi failed to send wlan cfg:%d\n", ret); 2389 + ath11k_warn(ab, "qmi failed to send wlan cfg: %d\n", ret); 2412 2390 return ret; 2413 2391 } 2414 2392 2415 2393 ret = ath11k_qmi_wlanfw_mode_send(ab, mode); 2416 2394 if (ret < 0) { 2417 - ath11k_warn(ab, "qmi failed to send wlan fw mode:%d\n", ret); 2395 + ath11k_warn(ab, "qmi failed to send wlan fw mode: %d\n", ret); 2418 2396 return ret; 2419 2397 } 2420 2398 ··· 2430 2404 2431 2405 ret = ath11k_qmi_wlanfw_mode_send(ab, ATH11K_FIRMWARE_MODE_COLD_BOOT); 2432 2406 if (ret < 0) { 2433 - ath11k_warn(ab, "qmi failed to send wlan fw mode:%d\n", ret); 2407 + ath11k_warn(ab, "qmi failed to send wlan fw mode: %d\n", ret); 2434 2408 return ret; 2435 2409 } 2436 2410 ··· 2440 2414 (ab->qmi.cal_done == 1), 2441 2415 ATH11K_COLD_BOOT_FW_RESET_DELAY); 2442 2416 if (timeout <= 0) { 2443 - ath11k_warn(ab, "Coldboot Calibration failed - wait ended\n"); 2417 + ath11k_warn(ab, "coldboot calibration timed out\n"); 2444 2418 return 0; 2445 2419 } 2446 2420 ··· 2479 2453 2480 2454 ret = ath11k_qmi_fw_ind_register_send(ab); 2481 2455 if (ret < 0) { 2482 - ath11k_warn(ab, "qmi failed to send FW indication QMI:%d\n", ret); 2456 + ath11k_warn(ab, "failed to send qmi firmware indication: %d\n", 2457 + ret); 2483 2458 return ret; 2484 2459 } 2485 2460 2486 2461 ret = ath11k_qmi_host_cap_send(ab); 2487 2462 if (ret < 0) { 2488 - ath11k_warn(ab, "qmi failed to send host cap QMI:%d\n", ret); 2463 + ath11k_warn(ab, "failed to send qmi host cap: %d\n", ret); 2489 2464 return ret; 2490 2465 } 2491 2466 ··· 2500 2473 2501 2474 ret = ath11k_qmi_respond_fw_mem_request(ab); 2502 2475 if (ret < 0) { 2503 - ath11k_warn(ab, "qmi failed to respond fw mem req:%d\n", ret); 2476 + ath11k_warn(ab, "qmi failed to respond fw mem req: %d\n", ret); 2504 2477 return ret; 2505 2478 } 2506 2479 ··· 2514 2487 2515 2488 ret = ath11k_qmi_request_target_cap(ab); 2516 2489 if (ret < 0) { 2517 - ath11k_warn(ab, "qmi failed to req target capabilities:%d\n", ret); 2490 + ath11k_warn(ab, "failed to requeqst qmi target capabilities: %d\n", 2491 + ret); 2518 2492 return ret; 2519 2493 } 2520 2494 ··· 2524 2496 else 2525 2497 ret = ath11k_qmi_load_bdf_qmi(ab); 2526 2498 if (ret < 0) { 2527 - ath11k_warn(ab, "qmi failed to load board data file:%d\n", ret); 2499 + ath11k_warn(ab, "failed to load board data file: %d\n", ret); 2528 2500 return ret; 2529 2501 } 2530 2502 2531 2503 ret = ath11k_qmi_wlanfw_m3_info_send(ab); 2532 2504 if (ret < 0) { 2533 - ath11k_warn(ab, "qmi failed to send m3 info req:%d\n", ret); 2505 + ath11k_warn(ab, "failed to send qmi m3 info req: %d\n", ret); 2534 2506 return ret; 2535 2507 } 2536 2508 ··· 2551 2523 2552 2524 if (msg->mem_seg_len == 0 || 2553 2525 msg->mem_seg_len > ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01) 2554 - ath11k_warn(ab, "Invalid memory segment length: %u\n", 2526 + ath11k_warn(ab, "invalid memory segment length: %u\n", 2555 2527 msg->mem_seg_len); 2556 2528 2557 2529 ab->qmi.mem_seg_count = msg->mem_seg_len; ··· 2566 2538 if (ab->bus_params.fixed_mem_region) { 2567 2539 ret = ath11k_qmi_assign_target_mem_chunk(ab); 2568 2540 if (ret) { 2569 - ath11k_warn(ab, "qmi failed to assign target memory: %d\n", 2541 + ath11k_warn(ab, "failed to assign qmi target memory: %d\n", 2570 2542 ret); 2571 2543 return; 2572 2544 } 2573 2545 } else { 2574 2546 ret = ath11k_qmi_alloc_target_mem_chunk(ab); 2575 2547 if (ret) { 2576 - ath11k_warn(ab, "qmi failed to alloc target memory: %d\n", 2548 + ath11k_warn(ab, "failed to allocate qmi target memory: %d\n", 2577 2549 ret); 2578 2550 return; 2579 2551 } ··· 2667 2639 ret = kernel_connect(qmi_hdl->sock, (struct sockaddr *)sq, 2668 2640 sizeof(*sq), 0); 2669 2641 if (ret) { 2670 - ath11k_warn(ab, "qmi failed to connect to remote service %d\n", ret); 2642 + ath11k_warn(ab, "failed to connect to qmi remote service: %d\n", ret); 2671 2643 return ret; 2672 2644 } 2673 2645 ··· 2753 2725 case ATH11K_QMI_EVENT_COLD_BOOT_CAL_DONE: 2754 2726 break; 2755 2727 default: 2756 - ath11k_warn(ab, "invalid event type: %d", event->type); 2728 + ath11k_warn(ab, "invalid qmi event type: %d", event->type); 2757 2729 break; 2758 2730 } 2759 2731 kfree(event); ··· 2774 2746 ret = qmi_handle_init(&ab->qmi.handle, ATH11K_QMI_RESP_LEN_MAX, 2775 2747 &ath11k_qmi_ops, ath11k_qmi_msg_handlers); 2776 2748 if (ret < 0) { 2777 - ath11k_warn(ab, "failed to initialize qmi handle\n"); 2749 + ath11k_warn(ab, "failed to initialize qmi handle: %d\n", ret); 2778 2750 return ret; 2779 2751 } 2780 2752 ··· 2793 2765 ATH11K_QMI_WLFW_SERVICE_VERS_V01, 2794 2766 ab->qmi.service_ins_id); 2795 2767 if (ret < 0) { 2796 - ath11k_warn(ab, "failed to add qmi lookup\n"); 2768 + ath11k_warn(ab, "failed to add qmi lookup: %d\n", ret); 2797 2769 destroy_workqueue(ab->qmi.event_wq); 2798 2770 return ret; 2799 2771 }
+6 -3
drivers/net/wireless/ath/ath11k/qmi.h
··· 21 21 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 0x02 22 22 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 0x01 23 23 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02 24 + #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074 0x07 24 25 #define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32 25 26 #define ATH11K_QMI_RESP_LEN_MAX 8192 26 - #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 32 27 + #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 52 27 28 #define ATH11K_QMI_CALDB_SIZE 0x480000 28 29 #define ATH11K_QMI_BDF_EXT_STR_LENGTH 0x20 30 + #define ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT 3 29 31 30 32 #define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035 31 33 #define QMI_WLFW_FW_MEM_READY_IND_V01 0x0037 ··· 143 141 #define QMI_IPQ8074_FW_MEM_MODE 0xFF 144 142 #define HOST_DDR_REGION_TYPE 0x1 145 143 #define BDF_MEM_REGION_TYPE 0x2 144 + #define M3_DUMP_REGION_TYPE 0x3 146 145 #define CALDB_MEM_REGION_TYPE 0x4 147 146 148 147 struct qmi_wlanfw_host_cap_req_msg_v01 { ··· 219 216 u64 fw_status; 220 217 }; 221 218 222 - #define QMI_WLANFW_REQUEST_MEM_IND_MSG_V01_MAX_LEN 1124 223 - #define QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN 548 219 + #define QMI_WLANFW_REQUEST_MEM_IND_MSG_V01_MAX_LEN 1824 220 + #define QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN 888 224 221 #define QMI_WLANFW_RESPOND_MEM_RESP_MSG_V01_MAX_LEN 7 225 222 #define QMI_WLANFW_REQUEST_MEM_IND_V01 0x0035 226 223 #define QMI_WLANFW_RESPOND_MEM_REQ_V01 0x0036
+205 -7
drivers/net/wireless/ath/ath11k/rx_desc.h
··· 414 414 415 415 #define RX_MPDU_START_RAW_MPDU BIT(0) 416 416 417 - struct rx_mpdu_start { 417 + struct rx_mpdu_start_ipq8074 { 418 418 __le16 info0; 419 419 __le16 phy_ppdu_id; 420 420 __le16 ast_index; ··· 438 438 __le16 qos_ctrl; 439 439 __le32 ht_ctrl; 440 440 __le32 raw; 441 + } __packed; 442 + 443 + #define RX_MPDU_START_INFO7_REO_DEST_IND GENMASK(4, 0) 444 + #define RX_MPDU_START_INFO7_LMAC_PEER_ID_MSB GENMASK(6, 5) 445 + #define RX_MPDU_START_INFO7_FLOW_ID_TOEPLITZ BIT(7) 446 + #define RX_MPDU_START_INFO7_PKT_SEL_FP_UCAST_DATA BIT(8) 447 + #define RX_MPDU_START_INFO7_PKT_SEL_FP_MCAST_DATA BIT(9) 448 + #define RX_MPDU_START_INFO7_PKT_SEL_FP_CTRL_BAR BIT(10) 449 + #define RX_MPDU_START_INFO7_RXDMA0_SRC_RING_SEL GENMASK(12, 11) 450 + #define RX_MPDU_START_INFO7_RXDMA0_DST_RING_SEL GENMASK(14, 13) 451 + 452 + #define RX_MPDU_START_INFO8_REO_QUEUE_DESC_HI GENMASK(7, 0) 453 + #define RX_MPDU_START_INFO8_RECV_QUEUE_NUM GENMASK(23, 8) 454 + #define RX_MPDU_START_INFO8_PRE_DELIM_ERR_WARN BIT(24) 455 + #define RX_MPDU_START_INFO8_FIRST_DELIM_ERR BIT(25) 456 + 457 + #define RX_MPDU_START_INFO9_EPD_EN BIT(0) 458 + #define RX_MPDU_START_INFO9_ALL_FRAME_ENCPD BIT(1) 459 + #define RX_MPDU_START_INFO9_ENC_TYPE GENMASK(5, 2) 460 + #define RX_MPDU_START_INFO9_VAR_WEP_KEY_WIDTH GENMASK(7, 6) 461 + #define RX_MPDU_START_INFO9_MESH_STA GENMASK(9, 8) 462 + #define RX_MPDU_START_INFO9_BSSID_HIT BIT(10) 463 + #define RX_MPDU_START_INFO9_BSSID_NUM GENMASK(14, 11) 464 + #define RX_MPDU_START_INFO9_TID GENMASK(18, 15) 465 + 466 + #define RX_MPDU_START_INFO10_RXPCU_MPDU_FLTR GENMASK(1, 0) 467 + #define RX_MPDU_START_INFO10_SW_FRAME_GRP_ID GENMASK(8, 2) 468 + #define RX_MPDU_START_INFO10_NDP_FRAME BIT(9) 469 + #define RX_MPDU_START_INFO10_PHY_ERR BIT(10) 470 + #define RX_MPDU_START_INFO10_PHY_ERR_MPDU_HDR BIT(11) 471 + #define RX_MPDU_START_INFO10_PROTO_VER_ERR BIT(12) 472 + #define RX_MPDU_START_INFO10_AST_LOOKUP_VALID BIT(13) 473 + 474 + #define RX_MPDU_START_INFO11_MPDU_FCTRL_VALID BIT(0) 475 + #define RX_MPDU_START_INFO11_MPDU_DUR_VALID BIT(1) 476 + #define RX_MPDU_START_INFO11_MAC_ADDR1_VALID BIT(2) 477 + #define RX_MPDU_START_INFO11_MAC_ADDR2_VALID BIT(3) 478 + #define RX_MPDU_START_INFO11_MAC_ADDR3_VALID BIT(4) 479 + #define RX_MPDU_START_INFO11_MAC_ADDR4_VALID BIT(5) 480 + #define RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID BIT(6) 481 + #define RX_MPDU_START_INFO11_MPDU_QOS_CTRL_VALID BIT(7) 482 + #define RX_MPDU_START_INFO11_MPDU_HT_CTRL_VALID BIT(8) 483 + #define RX_MPDU_START_INFO11_ENCRYPT_INFO_VALID BIT(9) 484 + #define RX_MPDU_START_INFO11_MPDU_FRAG_NUMBER GENMASK(13, 10) 485 + #define RX_MPDU_START_INFO11_MORE_FRAG_FLAG BIT(14) 486 + #define RX_MPDU_START_INFO11_FROM_DS BIT(16) 487 + #define RX_MPDU_START_INFO11_TO_DS BIT(17) 488 + #define RX_MPDU_START_INFO11_ENCRYPTED BIT(18) 489 + #define RX_MPDU_START_INFO11_MPDU_RETRY BIT(19) 490 + #define RX_MPDU_START_INFO11_MPDU_SEQ_NUM GENMASK(31, 20) 491 + 492 + #define RX_MPDU_START_INFO12_KEY_ID GENMASK(7, 0) 493 + #define RX_MPDU_START_INFO12_NEW_PEER_ENTRY BIT(8) 494 + #define RX_MPDU_START_INFO12_DECRYPT_NEEDED BIT(9) 495 + #define RX_MPDU_START_INFO12_DECAP_TYPE GENMASK(11, 10) 496 + #define RX_MPDU_START_INFO12_VLAN_TAG_C_PADDING BIT(12) 497 + #define RX_MPDU_START_INFO12_VLAN_TAG_S_PADDING BIT(13) 498 + #define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_C BIT(14) 499 + #define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_S BIT(15) 500 + #define RX_MPDU_START_INFO12_PRE_DELIM_COUNT GENMASK(27, 16) 501 + #define RX_MPDU_START_INFO12_AMPDU_FLAG BIT(28) 502 + #define RX_MPDU_START_INFO12_BAR_FRAME BIT(29) 503 + #define RX_MPDU_START_INFO12_RAW_MPDU BIT(30) 504 + 505 + #define RX_MPDU_START_INFO13_MPDU_LEN GENMASK(13, 0) 506 + #define RX_MPDU_START_INFO13_FIRST_MPDU BIT(14) 507 + #define RX_MPDU_START_INFO13_MCAST_BCAST BIT(15) 508 + #define RX_MPDU_START_INFO13_AST_IDX_NOT_FOUND BIT(16) 509 + #define RX_MPDU_START_INFO13_AST_IDX_TIMEOUT BIT(17) 510 + #define RX_MPDU_START_INFO13_POWER_MGMT BIT(18) 511 + #define RX_MPDU_START_INFO13_NON_QOS BIT(19) 512 + #define RX_MPDU_START_INFO13_NULL_DATA BIT(20) 513 + #define RX_MPDU_START_INFO13_MGMT_TYPE BIT(21) 514 + #define RX_MPDU_START_INFO13_CTRL_TYPE BIT(22) 515 + #define RX_MPDU_START_INFO13_MORE_DATA BIT(23) 516 + #define RX_MPDU_START_INFO13_EOSP BIT(24) 517 + #define RX_MPDU_START_INFO13_FRAGMENT BIT(25) 518 + #define RX_MPDU_START_INFO13_ORDER BIT(26) 519 + #define RX_MPDU_START_INFO13_UAPSD_TRIGGER BIT(27) 520 + #define RX_MPDU_START_INFO13_ENCRYPT_REQUIRED BIT(28) 521 + #define RX_MPDU_START_INFO13_DIRECTED BIT(29) 522 + #define RX_MPDU_START_INFO13_AMSDU_PRESENT BIT(30) 523 + 524 + struct rx_mpdu_start_qcn9074 { 525 + __le32 info7; 526 + __le32 reo_queue_desc_lo; 527 + __le32 info8; 528 + __le32 pn[4]; 529 + __le32 info9; 530 + __le32 peer_meta_data; 531 + __le16 info10; 532 + __le16 phy_ppdu_id; 533 + __le16 ast_index; 534 + __le16 sw_peer_id; 535 + __le32 info11; 536 + __le32 info12; 537 + __le32 info13; 538 + __le16 frame_ctrl; 539 + __le16 duration; 540 + u8 addr1[ETH_ALEN]; 541 + u8 addr2[ETH_ALEN]; 542 + u8 addr3[ETH_ALEN]; 543 + __le16 seq_ctrl; 544 + u8 addr4[ETH_ALEN]; 545 + __le16 qos_ctrl; 546 + __le32 ht_ctrl; 441 547 } __packed; 442 548 443 549 /* rx_mpdu_start ··· 778 672 #define RX_MSDU_START_INFO3_RECEPTION_TYPE GENMASK(23, 21) 779 673 #define RX_MSDU_START_INFO3_MIMO_SS_BITMAP GENMASK(31, 24) 780 674 781 - struct rx_msdu_start { 675 + struct rx_msdu_start_ipq8074 { 782 676 __le16 info0; 783 677 __le16 phy_ppdu_id; 784 678 __le32 info1; ··· 788 682 __le32 info3; 789 683 __le32 ppdu_start_timestamp; 790 684 __le32 phy_meta_data; 685 + } __packed; 686 + 687 + struct rx_msdu_start_qcn9074 { 688 + __le16 info0; 689 + __le16 phy_ppdu_id; 690 + __le32 info1; 691 + __le32 info2; 692 + __le32 toeplitz_hash; 693 + __le32 flow_id_toeplitz; 694 + __le32 info3; 695 + __le32 ppdu_start_timestamp; 696 + __le32 phy_meta_data; 697 + __le16 vlan_ctag_c1; 698 + __le16 vlan_stag_c1; 791 699 } __packed; 792 700 793 701 /* rx_msdu_start ··· 1014 894 #define RX_MSDU_END_INFO5_REO_DEST_IND GENMASK(5, 1) 1015 895 #define RX_MSDU_END_INFO5_FLOW_IDX GENMASK(25, 6) 1016 896 1017 - struct rx_msdu_end { 897 + struct rx_msdu_end_ipq8074 { 1018 898 __le16 info0; 1019 899 __le16 phy_ppdu_id; 1020 900 __le16 ip_hdr_cksum; ··· 1035 915 __le32 fse_metadata; 1036 916 __le16 cce_metadata; 1037 917 __le16 sa_sw_peer_id; 918 + } __packed; 919 + 920 + #define RX_MSDU_END_MPDU_LENGTH_INFO GENMASK(13, 0) 921 + 922 + #define RX_MSDU_END_INFO2_DA_OFFSET GENMASK(5, 0) 923 + #define RX_MSDU_END_INFO2_SA_OFFSET GENMASK(11, 6) 924 + #define RX_MSDU_END_INFO2_DA_OFFSET_VALID BIT(12) 925 + #define RX_MSDU_END_INFO2_SA_OFFSET_VALID BIT(13) 926 + #define RX_MSDU_END_INFO2_L3_TYPE GENMASK(31, 16) 927 + 928 + #define RX_MSDU_END_INFO4_SA_IDX_TIMEOUT BIT(0) 929 + #define RX_MSDU_END_INFO4_DA_IDX_TIMEOUT BIT(1) 930 + #define RX_MSDU_END_INFO4_MSDU_LIMIT_ERR BIT(2) 931 + #define RX_MSDU_END_INFO4_FLOW_IDX_TIMEOUT BIT(3) 932 + #define RX_MSDU_END_INFO4_FLOW_IDX_INVALID BIT(4) 933 + #define RX_MSDU_END_INFO4_WIFI_PARSER_ERR BIT(5) 934 + #define RX_MSDU_END_INFO4_AMSDU_PARSER_ERR BIT(6) 935 + #define RX_MSDU_END_INFO4_SA_IS_VALID BIT(7) 936 + #define RX_MSDU_END_INFO4_DA_IS_VALID BIT(8) 937 + #define RX_MSDU_END_INFO4_DA_IS_MCBC BIT(9) 938 + #define RX_MSDU_END_INFO4_L3_HDR_PADDING GENMASK(11, 10) 939 + #define RX_MSDU_END_INFO4_FIRST_MSDU BIT(12) 940 + #define RX_MSDU_END_INFO4_LAST_MSDU BIT(13) 941 + 942 + #define RX_MSDU_END_INFO6_AGGR_COUNT GENMASK(7, 0) 943 + #define RX_MSDU_END_INFO6_FLOW_AGGR_CONTN BIT(8) 944 + #define RX_MSDU_END_INFO6_FISA_TIMEOUT BIT(9) 945 + 946 + struct rx_msdu_end_qcn9074 { 947 + __le16 info0; 948 + __le16 phy_ppdu_id; 949 + __le16 ip_hdr_cksum; 950 + __le16 mpdu_length_info; 951 + __le32 info1; 952 + __le32 rule_indication[2]; 953 + __le32 info2; 954 + __le32 ipv6_options_crc; 955 + __le32 tcp_seq_num; 956 + __le32 tcp_ack_num; 957 + __le16 info3; 958 + __le16 window_size; 959 + __le16 tcp_udp_cksum; 960 + __le16 info4; 961 + __le16 sa_idx; 962 + __le16 da_idx; 963 + __le32 info5; 964 + __le32 fse_metadata; 965 + __le16 cce_metadata; 966 + __le16 sa_sw_peer_id; 967 + __le32 info6; 968 + __le16 cum_l4_cksum; 969 + __le16 cum_ip_length; 1038 970 } __packed; 1039 971 1040 972 /* rx_msdu_end ··· 1362 1190 1363 1191 #define HAL_RX_DESC_HDR_STATUS_LEN 120 1364 1192 1365 - struct hal_rx_desc { 1193 + struct hal_rx_desc_ipq8074 { 1366 1194 __le32 msdu_end_tag; 1367 - struct rx_msdu_end msdu_end; 1195 + struct rx_msdu_end_ipq8074 msdu_end; 1368 1196 __le32 rx_attn_tag; 1369 1197 struct rx_attention attention; 1370 1198 __le32 msdu_start_tag; 1371 - struct rx_msdu_start msdu_start; 1199 + struct rx_msdu_start_ipq8074 msdu_start; 1372 1200 u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES]; 1373 1201 __le32 mpdu_start_tag; 1374 - struct rx_mpdu_start mpdu_start; 1202 + struct rx_mpdu_start_ipq8074 mpdu_start; 1375 1203 __le32 mpdu_end_tag; 1376 1204 struct rx_mpdu_end mpdu_end; 1377 1205 u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; ··· 1379 1207 __le32 phy_ppdu_id; 1380 1208 u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; 1381 1209 u8 msdu_payload[0]; 1210 + } __packed; 1211 + 1212 + struct hal_rx_desc_qcn9074 { 1213 + __le32 msdu_end_tag; 1214 + struct rx_msdu_end_qcn9074 msdu_end; 1215 + __le32 rx_attn_tag; 1216 + struct rx_attention attention; 1217 + __le32 msdu_start_tag; 1218 + struct rx_msdu_start_qcn9074 msdu_start; 1219 + u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES]; 1220 + __le32 mpdu_start_tag; 1221 + struct rx_mpdu_start_qcn9074 mpdu_start; 1222 + __le32 mpdu_end_tag; 1223 + struct rx_mpdu_end mpdu_end; 1224 + u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; 1225 + __le32 hdr_status_tag; 1226 + __le32 phy_ppdu_id; 1227 + u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN]; 1228 + u8 msdu_payload[0]; 1229 + } __packed; 1230 + 1231 + struct hal_rx_desc { 1232 + union { 1233 + struct hal_rx_desc_ipq8074 ipq8074; 1234 + struct hal_rx_desc_qcn9074 qcn9074; 1235 + } u; 1382 1236 } __packed; 1383 1237 1384 1238 #define HAL_RX_RU_ALLOC_TYPE_MAX 6
+24 -40
drivers/net/wireless/ath/ath11k/wmi.c
··· 5417 5417 return 0; 5418 5418 } 5419 5419 5420 - static int 5421 - ath11k_pull_pdev_temp_ev(struct ath11k_base *ab, u8 *evt_buf, 5422 - u32 len, const struct wmi_pdev_temperature_event *ev) 5423 - { 5424 - const void **tb; 5425 - int ret; 5426 - 5427 - tb = ath11k_wmi_tlv_parse_alloc(ab, evt_buf, len, GFP_ATOMIC); 5428 - if (IS_ERR(tb)) { 5429 - ret = PTR_ERR(tb); 5430 - ath11k_warn(ab, "failed to parse tlv: %d\n", ret); 5431 - return ret; 5432 - } 5433 - 5434 - ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT]; 5435 - if (!ev) { 5436 - ath11k_warn(ab, "failed to fetch pdev temp ev"); 5437 - kfree(tb); 5438 - return -EPROTO; 5439 - } 5440 - 5441 - kfree(tb); 5442 - return 0; 5443 - } 5444 - 5445 5420 size_t ath11k_wmi_fw_stats_num_vdevs(struct list_head *head) 5446 5421 { 5447 5422 struct ath11k_fw_stats_vdev *i; ··· 6171 6196 } 6172 6197 } 6173 6198 6174 - /* TODO: Pending handle beacon implementation 6175 - *if (ieee80211_is_beacon(hdr->frame_control)) 6176 - * ath11k_mac_handle_beacon(ar, skb); 6177 - */ 6199 + if (ieee80211_is_beacon(hdr->frame_control)) 6200 + ath11k_mac_handle_beacon(ar, skb); 6178 6201 6179 6202 ath11k_dbg(ab, ATH11K_DBG_MGMT, 6180 6203 "event mgmt rx skb %pK len %d ftype %02x stype %02x\n", ··· 6391 6418 6392 6419 switch (roam_ev.reason) { 6393 6420 case WMI_ROAM_REASON_BEACON_MISS: 6394 - /* TODO: Pending beacon miss and connection_loss_work 6395 - * implementation 6396 - * ath11k_mac_handle_beacon_miss(ar, vdev_id); 6397 - */ 6421 + ath11k_mac_handle_beacon_miss(ar, roam_ev.vdev_id); 6398 6422 break; 6399 6423 case WMI_ROAM_REASON_BETTER_AP: 6400 6424 case WMI_ROAM_REASON_LOW_RSSI: ··· 6819 6849 struct sk_buff *skb) 6820 6850 { 6821 6851 struct ath11k *ar; 6822 - struct wmi_pdev_temperature_event ev = {0}; 6852 + const void **tb; 6853 + const struct wmi_pdev_temperature_event *ev; 6854 + int ret; 6823 6855 6824 - if (ath11k_pull_pdev_temp_ev(ab, skb->data, skb->len, &ev) != 0) { 6825 - ath11k_warn(ab, "failed to extract pdev temperature event"); 6856 + tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC); 6857 + if (IS_ERR(tb)) { 6858 + ret = PTR_ERR(tb); 6859 + ath11k_warn(ab, "failed to parse tlv: %d\n", ret); 6860 + return; 6861 + } 6862 + 6863 + ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT]; 6864 + if (!ev) { 6865 + ath11k_warn(ab, "failed to fetch pdev temp ev"); 6866 + kfree(tb); 6826 6867 return; 6827 6868 } 6828 6869 6829 6870 ath11k_dbg(ab, ATH11K_DBG_WMI, 6830 - "pdev temperature ev temp %d pdev_id %d\n", ev.temp, ev.pdev_id); 6871 + "pdev temperature ev temp %d pdev_id %d\n", ev->temp, ev->pdev_id); 6831 6872 6832 - ar = ath11k_mac_get_ar_by_pdev_id(ab, ev.pdev_id); 6873 + ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); 6833 6874 if (!ar) { 6834 - ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id); 6875 + ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id); 6876 + kfree(tb); 6835 6877 return; 6836 6878 } 6837 6879 6838 - ath11k_thermal_event_temperature(ar, ev.temp); 6880 + ath11k_thermal_event_temperature(ar, ev->temp); 6881 + 6882 + kfree(tb); 6839 6883 } 6840 6884 6841 6885 static void ath11k_fils_discovery_event(struct ath11k_base *ab,