Loading drivers/net/wireless/ath/ath10k/core.c +60 −35 Original line number Diff line number Diff line Loading @@ -305,6 +305,21 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_ops = &qca99x0_ops, .decap_align_bytes = 1, }, { .id = ATH10K_HW_WCN3990, .dev_id = 0, .name = "wcn3990 hw1.0", .continuous_frag_desc = true, .tx_chain_mask = 0x7, .rx_chain_mask = 0x7, .max_spatial_stream = 4, .fw = { .dir = WCN3990_HW_1_0_FW_DIR, }, .sw_decrypt_mcast_mgmt = true, .hw_ops = &wcn3990_ops, .decap_align_bytes = 1, }, }; static const char *const ath10k_core_fw_feature_str[] = { Loading Loading @@ -1263,6 +1278,7 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name, data += ie_len; } if (ar->is_bmi) { if (!fw_file->firmware_data || !fw_file->firmware_len) { ath10k_warn(ar, "No ATH10K_FW_IE_FW_IMAGE found from '%s/%s', skipping\n", Loading @@ -1270,6 +1286,7 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name, ret = -ENOMEDIUM; goto err; } } return 0; Loading @@ -1282,8 +1299,10 @@ static int ath10k_core_fetch_firmware_files(struct ath10k *ar) { int ret; if (ar->is_bmi) { /* calibration file is optional, don't check for any errors */ ath10k_fetch_cal_file(ar); } ar->fw_api = 5; ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); Loading Loading @@ -1574,8 +1593,6 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) { struct ath10k_fw_file *fw_file = &ar->normal_mode_fw.fw_file; init_fw_param(ar, &ar->normal_mode_fw.fw_file); if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, fw_file->fw_features) && !test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) { ath10k_err(ar, "feature bits corrupted: 10.2 feature requires 10.x feature to be set as well"); Loading Loading @@ -1797,9 +1814,11 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, lockdep_assert_held(&ar->conf_mutex); clear_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags); if (!ar->qmi.is_qmi) { ar->running_fw = fw; if (ar->is_bmi) { ath10k_bmi_start(ar); if (ath10k_init_configure_target(ar)) { Loading Loading @@ -1846,7 +1865,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, goto err; } if (!ar->qmi.is_qmi) { if (ar->is_bmi) { status = ath10k_bmi_done(ar); if (status) goto err; Loading Loading @@ -2083,16 +2102,16 @@ static int ath10k_core_probe_fw(struct ath10k *ar) return ret; } if (!ar->qmi.is_qmi) { if (ar->is_bmi) { memset(&target_info, 0, sizeof(target_info)); ret = ath10k_bmi_get_target_info(ar, &target_info); if (ret) { ath10k_err(ar, "could not get target info (%d)\n", ret); goto err_power_down; } ar->target_version = target_info.version; ar->hw->wiphy->hw_version = target_info.version; } ret = ath10k_init_hw_params(ar); if (ret) { Loading @@ -2102,8 +2121,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ret = ath10k_core_fetch_firmware_files(ar); if (ret) { ath10k_err(ar, "could not fetch firmware files (%d)\n", ret); ath10k_err(ar, "could not fetch firmware files (%d)\n", ret); goto err_power_down; } Loading @@ -2112,9 +2130,9 @@ static int ath10k_core_probe_fw(struct ath10k *ar) memcpy(ar->hw->wiphy->fw_version, ar->normal_mode_fw.fw_file.fw_version, sizeof(ar->hw->wiphy->fw_version)); ath10k_debug_print_hwfw_info(ar); if (ar->is_bmi) { ret = ath10k_core_pre_cal_download(ar); if (ret) { /* pre calibration data download is not necessary Loading Loading @@ -2147,7 +2165,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) goto err_free_firmware_files; } if (!ar->qmi.is_qmi) { if (ar->is_bmi) { ret = ath10k_swap_code_seg_init(ar, &ar->normal_mode_fw.fw_file); if (ret) { Loading Loading @@ -2299,6 +2317,12 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->hif.ops = hif_ops; ar->hif.bus = bus; /* By default, assume bmi is set, as most of the existing * chip sets are based on this, set to false explicitly * when current chip set does not support. */ ar->is_bmi = true; switch (hw_rev) { case ATH10K_HW_QCA988X: case ATH10K_HW_QCA9887: Loading Loading @@ -2326,7 +2350,8 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, case ATH10K_HW_WCN3990: ar->regs = &wcn3990_regs; ar->hw_values = &wcn3990_values; ar->qmi.is_qmi = true; /* WCN3990 chip set is non bmi based */ ar->is_bmi = false; ar->fw_flags = &wcn3990_fw_flags; break; default: Loading drivers/net/wireless/ath/ath10k/core.h +2 −6 Original line number Diff line number Diff line Loading @@ -138,11 +138,6 @@ struct ath10k_bmi { bool done_sent; }; struct ath10k_qmi { bool fw_ready; bool is_qmi; }; struct ath10k_mem_chunk { void *vaddr; dma_addr_t paddr; Loading Loading @@ -745,7 +740,6 @@ struct ath10k { const struct ath10k_hw_regs *regs; const struct ath10k_hw_values *hw_values; struct ath10k_bmi bmi; struct ath10k_qmi qmi; struct ath10k_wmi wmi; struct ath10k_htc htc; struct ath10k_htt htt; Loading Loading @@ -930,6 +924,8 @@ struct ath10k { spinlock_t ce_lock; /* lock for CE access */ void *ce_states; struct fw_flag *fw_flags; /* set for bmi chip sets */ bool is_bmi; /* must be last */ u8 drv_priv[0] __aligned(sizeof(void *)); }; Loading drivers/net/wireless/ath/ath10k/hw.c +2 −0 Original line number Diff line number Diff line Loading @@ -271,3 +271,5 @@ static int ath10k_qca99x0_rx_desc_get_l3_pad_bytes(struct htt_rx_desc *rxd) const struct ath10k_hw_ops qca99x0_ops = { .rx_desc_get_l3_pad_bytes = ath10k_qca99x0_rx_desc_get_l3_pad_bytes, }; const struct ath10k_hw_ops wcn3990_ops = {0}; drivers/net/wireless/ath/ath10k/hw.h +5 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,10 @@ enum qca9377_chip_id_rev { #define QCA4019_HW_1_0_BOARD_DATA_FILE "board.bin" #define QCA4019_HW_1_0_PATCH_LOAD_ADDR 0x1234 /* WCN3990 1.0 definitions */ #define WCN3990_HW_1_0_DEV_VERSION ATH10K_HW_WCN3990 #define WCN3990_HW_1_0_FW_DIR "/etc/firmware" #define ATH10K_FW_API2_FILE "firmware-2.bin" #define ATH10K_FW_API3_FILE "firmware-3.bin" Loading Loading @@ -434,6 +438,7 @@ struct ath10k_hw_ops { extern const struct ath10k_hw_ops qca988x_ops; extern const struct ath10k_hw_ops qca99x0_ops; extern const struct ath10k_hw_ops wcn3990_ops; static inline int ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw, Loading Loading
drivers/net/wireless/ath/ath10k/core.c +60 −35 Original line number Diff line number Diff line Loading @@ -305,6 +305,21 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_ops = &qca99x0_ops, .decap_align_bytes = 1, }, { .id = ATH10K_HW_WCN3990, .dev_id = 0, .name = "wcn3990 hw1.0", .continuous_frag_desc = true, .tx_chain_mask = 0x7, .rx_chain_mask = 0x7, .max_spatial_stream = 4, .fw = { .dir = WCN3990_HW_1_0_FW_DIR, }, .sw_decrypt_mcast_mgmt = true, .hw_ops = &wcn3990_ops, .decap_align_bytes = 1, }, }; static const char *const ath10k_core_fw_feature_str[] = { Loading Loading @@ -1263,6 +1278,7 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name, data += ie_len; } if (ar->is_bmi) { if (!fw_file->firmware_data || !fw_file->firmware_len) { ath10k_warn(ar, "No ATH10K_FW_IE_FW_IMAGE found from '%s/%s', skipping\n", Loading @@ -1270,6 +1286,7 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name, ret = -ENOMEDIUM; goto err; } } return 0; Loading @@ -1282,8 +1299,10 @@ static int ath10k_core_fetch_firmware_files(struct ath10k *ar) { int ret; if (ar->is_bmi) { /* calibration file is optional, don't check for any errors */ ath10k_fetch_cal_file(ar); } ar->fw_api = 5; ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api); Loading Loading @@ -1574,8 +1593,6 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) { struct ath10k_fw_file *fw_file = &ar->normal_mode_fw.fw_file; init_fw_param(ar, &ar->normal_mode_fw.fw_file); if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, fw_file->fw_features) && !test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) { ath10k_err(ar, "feature bits corrupted: 10.2 feature requires 10.x feature to be set as well"); Loading Loading @@ -1797,9 +1814,11 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, lockdep_assert_held(&ar->conf_mutex); clear_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags); if (!ar->qmi.is_qmi) { ar->running_fw = fw; if (ar->is_bmi) { ath10k_bmi_start(ar); if (ath10k_init_configure_target(ar)) { Loading Loading @@ -1846,7 +1865,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, goto err; } if (!ar->qmi.is_qmi) { if (ar->is_bmi) { status = ath10k_bmi_done(ar); if (status) goto err; Loading Loading @@ -2083,16 +2102,16 @@ static int ath10k_core_probe_fw(struct ath10k *ar) return ret; } if (!ar->qmi.is_qmi) { if (ar->is_bmi) { memset(&target_info, 0, sizeof(target_info)); ret = ath10k_bmi_get_target_info(ar, &target_info); if (ret) { ath10k_err(ar, "could not get target info (%d)\n", ret); goto err_power_down; } ar->target_version = target_info.version; ar->hw->wiphy->hw_version = target_info.version; } ret = ath10k_init_hw_params(ar); if (ret) { Loading @@ -2102,8 +2121,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ret = ath10k_core_fetch_firmware_files(ar); if (ret) { ath10k_err(ar, "could not fetch firmware files (%d)\n", ret); ath10k_err(ar, "could not fetch firmware files (%d)\n", ret); goto err_power_down; } Loading @@ -2112,9 +2130,9 @@ static int ath10k_core_probe_fw(struct ath10k *ar) memcpy(ar->hw->wiphy->fw_version, ar->normal_mode_fw.fw_file.fw_version, sizeof(ar->hw->wiphy->fw_version)); ath10k_debug_print_hwfw_info(ar); if (ar->is_bmi) { ret = ath10k_core_pre_cal_download(ar); if (ret) { /* pre calibration data download is not necessary Loading Loading @@ -2147,7 +2165,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) goto err_free_firmware_files; } if (!ar->qmi.is_qmi) { if (ar->is_bmi) { ret = ath10k_swap_code_seg_init(ar, &ar->normal_mode_fw.fw_file); if (ret) { Loading Loading @@ -2299,6 +2317,12 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->hif.ops = hif_ops; ar->hif.bus = bus; /* By default, assume bmi is set, as most of the existing * chip sets are based on this, set to false explicitly * when current chip set does not support. */ ar->is_bmi = true; switch (hw_rev) { case ATH10K_HW_QCA988X: case ATH10K_HW_QCA9887: Loading Loading @@ -2326,7 +2350,8 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, case ATH10K_HW_WCN3990: ar->regs = &wcn3990_regs; ar->hw_values = &wcn3990_values; ar->qmi.is_qmi = true; /* WCN3990 chip set is non bmi based */ ar->is_bmi = false; ar->fw_flags = &wcn3990_fw_flags; break; default: Loading
drivers/net/wireless/ath/ath10k/core.h +2 −6 Original line number Diff line number Diff line Loading @@ -138,11 +138,6 @@ struct ath10k_bmi { bool done_sent; }; struct ath10k_qmi { bool fw_ready; bool is_qmi; }; struct ath10k_mem_chunk { void *vaddr; dma_addr_t paddr; Loading Loading @@ -745,7 +740,6 @@ struct ath10k { const struct ath10k_hw_regs *regs; const struct ath10k_hw_values *hw_values; struct ath10k_bmi bmi; struct ath10k_qmi qmi; struct ath10k_wmi wmi; struct ath10k_htc htc; struct ath10k_htt htt; Loading Loading @@ -930,6 +924,8 @@ struct ath10k { spinlock_t ce_lock; /* lock for CE access */ void *ce_states; struct fw_flag *fw_flags; /* set for bmi chip sets */ bool is_bmi; /* must be last */ u8 drv_priv[0] __aligned(sizeof(void *)); }; Loading
drivers/net/wireless/ath/ath10k/hw.c +2 −0 Original line number Diff line number Diff line Loading @@ -271,3 +271,5 @@ static int ath10k_qca99x0_rx_desc_get_l3_pad_bytes(struct htt_rx_desc *rxd) const struct ath10k_hw_ops qca99x0_ops = { .rx_desc_get_l3_pad_bytes = ath10k_qca99x0_rx_desc_get_l3_pad_bytes, }; const struct ath10k_hw_ops wcn3990_ops = {0};
drivers/net/wireless/ath/ath10k/hw.h +5 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,10 @@ enum qca9377_chip_id_rev { #define QCA4019_HW_1_0_BOARD_DATA_FILE "board.bin" #define QCA4019_HW_1_0_PATCH_LOAD_ADDR 0x1234 /* WCN3990 1.0 definitions */ #define WCN3990_HW_1_0_DEV_VERSION ATH10K_HW_WCN3990 #define WCN3990_HW_1_0_FW_DIR "/etc/firmware" #define ATH10K_FW_API2_FILE "firmware-2.bin" #define ATH10K_FW_API3_FILE "firmware-3.bin" Loading Loading @@ -434,6 +438,7 @@ struct ath10k_hw_ops { extern const struct ath10k_hw_ops qca988x_ops; extern const struct ath10k_hw_ops qca99x0_ops; extern const struct ath10k_hw_ops wcn3990_ops; static inline int ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw, Loading