summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath10k/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/core.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/core.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 1e41d6c6de36..3de10faa629c 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -696,6 +696,7 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
"boot get otp board id result 0x%08x board_id %d chip_id %d\n",
result, board_id, chip_id);
+ /* Murata -- https:/patchwork.kernel.org/patch/9486941/ ; */
if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 ||
(board_id == 0)) {
ath10k_dbg(ar, ATH10K_DBG_BOOT,
@@ -1044,7 +1045,7 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
out:
if (!ar->normal_mode_fw.board_data || !ar->normal_mode_fw.board_len) {
- ath10k_err(ar,
+ ath10k_dbg(ar, ATH10K_DBG_BOOT,
"failed to fetch board data for %s from %s/%s\n",
boardname, ar->hw_params.fw.dir, filename);
ret = -ENODATA;
@@ -1124,7 +1125,7 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
fw_file->firmware = ath10k_fetch_fw_file(ar, ar->hw_params.fw.dir,
name);
if (IS_ERR(fw_file->firmware)) {
- ath10k_err(ar, "could not fetch firmware file '%s/%s': %ld\n",
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "could not fetch firmware file '%s/%s': %ld\n",
ar->hw_params.fw.dir, name,
PTR_ERR(fw_file->firmware));
return PTR_ERR(fw_file->firmware);
@@ -1292,44 +1293,41 @@ err:
return ret;
}
+/* Murata -- add this function */
+static void ath10k_core_get_fw_name(struct ath10k *ar, char *fw_name,
+ size_t fw_name_len, int fw_api)
+{
+ scnprintf(fw_name, fw_name_len, "%s-%d.bin", ATH10K_FW_FILE_BASE, fw_api);
+}
+
+/* Murata -- make significant changes to following function to pull correct firmware file */
static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
{
- int ret;
+ int ret, i;
+ char fw_name[100];
/* 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);
+ for (i = ATH10K_FW_API_MAX; i >= ATH10K_FW_API_MIN; i--) {
+ ar->fw_api = i;
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n",
+ ar->fw_api);
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API5_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret == 0)
- goto success;
-
- ar->fw_api = 4;
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
-
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API4_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret == 0)
- goto success;
-
- ar->fw_api = 3;
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+ ath10k_core_get_fw_name(ar, fw_name, sizeof(fw_name), ar->fw_api);
+ ret = ath10k_core_fetch_firmware_api_n(ar, fw_name,
+ &ar->normal_mode_fw.fw_file);
+ if (!ret)
+ goto success;
+ }
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API3_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret == 0)
- goto success;
+ /* we end up here if we couldn't fetch any firmware */
- ar->fw_api = 2;
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+ ath10k_err(ar, "Failed to find firmware-N.bin (N between %d and %d) from %s: %d",
+ ATH10K_FW_API_MIN, ATH10K_FW_API_MAX, ar->hw_params.fw.dir,
+ ret);
- ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API2_FILE,
- &ar->normal_mode_fw.fw_file);
- if (ret)
- return ret;
+ return ret;
success:
ath10k_dbg(ar, ATH10K_DBG_BOOT, "using fw api %d\n", ar->fw_api);
@@ -2098,7 +2096,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_dbg(ar, ATH10K_DBG_BOOT, "could not fetch firmware files (%d)\n", ret);
goto err_power_down;
}