Loading drivers/net/wireless/ath/ath10k/core.c +99 −82 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -1797,7 +1797,7 @@ 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; ath10k_bmi_start(ar); Loading @@ -1814,14 +1814,15 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, /* Some of of qca988x solutions are having global reset issue * during target initialization. Bypassing PLL setting before * downloading firmware and letting the SoC run on REF_CLK is * fixing the problem. Corresponding firmware change is also needed * to set the clock source once the target is initialized. * fixing the problem. Corresponding firmware change is also * needed to set the clock source once the target is * initialized. */ if (test_bit(ATH10K_FW_FEATURE_SUPPORTS_SKIP_CLOCK_INIT, ar->running_fw->fw_file.fw_features)) { status = ath10k_bmi_write32(ar, hi_skip_clock_init, 1); if (status) { ath10k_err(ar, "could not write to skip_clock_init: %d\n", ath10k_err(ar, "skip_clock_init failed: %d\n", status); goto err; } Loading @@ -1834,6 +1835,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, status = ath10k_init_uart(ar); if (status) goto err; } ar->htc.htc_ops.target_send_suspend_complete = ath10k_send_suspend_complete; Loading @@ -1844,9 +1846,11 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, goto err; } if (!ar->qmi.is_qmi) { status = ath10k_bmi_done(ar); if (status) goto err; } status = ath10k_wmi_attach(ar); if (status) { Loading Loading @@ -2079,6 +2083,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) return ret; } if (!ar->qmi.is_qmi) { memset(&target_info, 0, sizeof(target_info)); ret = ath10k_bmi_get_target_info(ar, &target_info); if (ret) { Loading @@ -2097,13 +2102,15 @@ 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; } BUILD_BUG_ON(sizeof(ar->hw->wiphy->fw_version) != sizeof(ar->normal_mode_fw.fw_file.fw_version)); memcpy(ar->hw->wiphy->fw_version, ar->normal_mode_fw.fw_file.fw_version, 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); Loading Loading @@ -2131,6 +2138,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) } ath10k_debug_print_board_info(ar); } ret = ath10k_core_init_firmware_features(ar); if (ret) { Loading @@ -2139,12 +2147,15 @@ static int ath10k_core_probe_fw(struct ath10k *ar) goto err_free_firmware_files; } ret = ath10k_swap_code_seg_init(ar, &ar->normal_mode_fw.fw_file); if (!ar->qmi.is_qmi) { ret = ath10k_swap_code_seg_init(ar, &ar->normal_mode_fw.fw_file); if (ret) { ath10k_err(ar, "failed to initialize code swap segment: %d\n", ath10k_err(ar, "failed to init code swap segment: %d\n", ret); goto err_free_firmware_files; } } mutex_lock(&ar->conf_mutex); Loading Loading @@ -2312,6 +2323,12 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->regs = &qca4019_regs; ar->hw_values = &qca4019_values; break; case ATH10K_HW_WCN3990: ar->regs = &wcn3990_regs; ar->hw_values = &wcn3990_values; ar->qmi.is_qmi = true; ar->fw_flags = &wcn3990_fw_flags; break; default: ath10k_err(ar, "unsupported core hardware revision %d\n", hw_rev); Loading drivers/net/wireless/ath/ath10k/core.h +12 −1 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -138,6 +138,11 @@ 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 @@ -661,6 +666,10 @@ enum ath10k_tx_pause_reason { ATH10K_TX_PAUSE_MAX, }; struct fw_flag { u32 flags; }; struct ath10k_fw_file { const struct firmware *firmware; Loading Loading @@ -736,6 +745,7 @@ 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 @@ -919,6 +929,7 @@ struct ath10k { u32 (*bus_read32)(void *ar, u32 offset); spinlock_t ce_lock; /* lock for CE access */ void *ce_states; struct fw_flag *fw_flags; /* must be last */ u8 drv_priv[0] __aligned(sizeof(void *)); }; Loading drivers/net/wireless/ath/ath10k/hw.c +5 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014-2015 Qualcomm Atheros, Inc. * Copyright (c) 2014-2015, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -216,6 +216,10 @@ const struct ath10k_hw_values wcn3990_values = { .ce_desc_meta_data_lsb = 4, }; struct fw_flag wcn3990_fw_flags = { .flags = 0x82E, }; void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey, u32 cc, u32 rcc, u32 cc_prev, u32 rcc_prev) { Loading drivers/net/wireless/ath/ath10k/hw.h +3 −1 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013,2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -265,6 +265,8 @@ extern const struct ath10k_hw_regs qca99x0_regs; extern const struct ath10k_hw_regs qca4019_regs; extern const struct ath10k_hw_regs wcn3990_regs; extern struct fw_flag wcn3990_fw_flags; struct ath10k_hw_values { u32 rtc_state_val_on; u8 ce_count; Loading drivers/net/wireless/ath/ath10k/mac.c +4 −2 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -3446,7 +3446,9 @@ ath10k_mac_tx_h_get_txpath(struct ath10k *ar, return ATH10K_MAC_TX_HTT; case ATH10K_HW_TXRX_MGMT: if (test_bit(ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX, ar->running_fw->fw_file.fw_features)) ar->running_fw->fw_file.fw_features) || test_bit(WMI_SERVICE_MGMT_TX_WMI, ar->wmi.svc_map)) return ATH10K_MAC_TX_WMI_MGMT; else if (ar->htt.target_version_major >= 3) return ATH10K_MAC_TX_HTT; Loading Loading
drivers/net/wireless/ath/ath10k/core.c +99 −82 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -1797,7 +1797,7 @@ 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; ath10k_bmi_start(ar); Loading @@ -1814,14 +1814,15 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, /* Some of of qca988x solutions are having global reset issue * during target initialization. Bypassing PLL setting before * downloading firmware and letting the SoC run on REF_CLK is * fixing the problem. Corresponding firmware change is also needed * to set the clock source once the target is initialized. * fixing the problem. Corresponding firmware change is also * needed to set the clock source once the target is * initialized. */ if (test_bit(ATH10K_FW_FEATURE_SUPPORTS_SKIP_CLOCK_INIT, ar->running_fw->fw_file.fw_features)) { status = ath10k_bmi_write32(ar, hi_skip_clock_init, 1); if (status) { ath10k_err(ar, "could not write to skip_clock_init: %d\n", ath10k_err(ar, "skip_clock_init failed: %d\n", status); goto err; } Loading @@ -1834,6 +1835,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, status = ath10k_init_uart(ar); if (status) goto err; } ar->htc.htc_ops.target_send_suspend_complete = ath10k_send_suspend_complete; Loading @@ -1844,9 +1846,11 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, goto err; } if (!ar->qmi.is_qmi) { status = ath10k_bmi_done(ar); if (status) goto err; } status = ath10k_wmi_attach(ar); if (status) { Loading Loading @@ -2079,6 +2083,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) return ret; } if (!ar->qmi.is_qmi) { memset(&target_info, 0, sizeof(target_info)); ret = ath10k_bmi_get_target_info(ar, &target_info); if (ret) { Loading @@ -2097,13 +2102,15 @@ 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; } BUILD_BUG_ON(sizeof(ar->hw->wiphy->fw_version) != sizeof(ar->normal_mode_fw.fw_file.fw_version)); memcpy(ar->hw->wiphy->fw_version, ar->normal_mode_fw.fw_file.fw_version, 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); Loading Loading @@ -2131,6 +2138,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) } ath10k_debug_print_board_info(ar); } ret = ath10k_core_init_firmware_features(ar); if (ret) { Loading @@ -2139,12 +2147,15 @@ static int ath10k_core_probe_fw(struct ath10k *ar) goto err_free_firmware_files; } ret = ath10k_swap_code_seg_init(ar, &ar->normal_mode_fw.fw_file); if (!ar->qmi.is_qmi) { ret = ath10k_swap_code_seg_init(ar, &ar->normal_mode_fw.fw_file); if (ret) { ath10k_err(ar, "failed to initialize code swap segment: %d\n", ath10k_err(ar, "failed to init code swap segment: %d\n", ret); goto err_free_firmware_files; } } mutex_lock(&ar->conf_mutex); Loading Loading @@ -2312,6 +2323,12 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->regs = &qca4019_regs; ar->hw_values = &qca4019_values; break; case ATH10K_HW_WCN3990: ar->regs = &wcn3990_regs; ar->hw_values = &wcn3990_values; ar->qmi.is_qmi = true; ar->fw_flags = &wcn3990_fw_flags; break; default: ath10k_err(ar, "unsupported core hardware revision %d\n", hw_rev); Loading
drivers/net/wireless/ath/ath10k/core.h +12 −1 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -138,6 +138,11 @@ 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 @@ -661,6 +666,10 @@ enum ath10k_tx_pause_reason { ATH10K_TX_PAUSE_MAX, }; struct fw_flag { u32 flags; }; struct ath10k_fw_file { const struct firmware *firmware; Loading Loading @@ -736,6 +745,7 @@ 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 @@ -919,6 +929,7 @@ struct ath10k { u32 (*bus_read32)(void *ar, u32 offset); spinlock_t ce_lock; /* lock for CE access */ void *ce_states; struct fw_flag *fw_flags; /* must be last */ u8 drv_priv[0] __aligned(sizeof(void *)); }; Loading
drivers/net/wireless/ath/ath10k/hw.c +5 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014-2015 Qualcomm Atheros, Inc. * Copyright (c) 2014-2015, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -216,6 +216,10 @@ const struct ath10k_hw_values wcn3990_values = { .ce_desc_meta_data_lsb = 4, }; struct fw_flag wcn3990_fw_flags = { .flags = 0x82E, }; void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey, u32 cc, u32 rcc, u32 cc_prev, u32 rcc_prev) { Loading
drivers/net/wireless/ath/ath10k/hw.h +3 −1 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013,2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -265,6 +265,8 @@ extern const struct ath10k_hw_regs qca99x0_regs; extern const struct ath10k_hw_regs qca4019_regs; extern const struct ath10k_hw_regs wcn3990_regs; extern struct fw_flag wcn3990_fw_flags; struct ath10k_hw_values { u32 rtc_state_val_on; u8 ce_count; Loading
drivers/net/wireless/ath/ath10k/mac.c +4 −2 Original line number Diff line number Diff line /* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. * Copyright (c) 2011-2013, 2017 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above Loading Loading @@ -3446,7 +3446,9 @@ ath10k_mac_tx_h_get_txpath(struct ath10k *ar, return ATH10K_MAC_TX_HTT; case ATH10K_HW_TXRX_MGMT: if (test_bit(ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX, ar->running_fw->fw_file.fw_features)) ar->running_fw->fw_file.fw_features) || test_bit(WMI_SERVICE_MGMT_TX_WMI, ar->wmi.svc_map)) return ATH10K_MAC_TX_WMI_MGMT; else if (ar->htt.target_version_major >= 3) return ATH10K_MAC_TX_HTT; Loading