diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-10-13 09:40:53 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-10-21 09:59:07 +0300 |
commit | 830915597747013b18143d298922f7ea227d3769 (patch) | |
tree | 4ee5e935e69457a01163417802c518f0d23676c1 /drivers | |
parent | e07db352ca679a8b915008195aeee5c790bee545 (diff) |
ath10k: refactor ath10k_init_download_firmware()
This is preparation for being able to download calibration data from a file.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/core.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 76f0db0654bb..d0b67a7512cf 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -225,6 +225,12 @@ static int ath10k_download_and_run_otp(struct ath10k *ar) u32 result, address = ar->hw_params.patch_load_addr; int ret; + ret = ath10k_download_board_data(ar); + if (ret) { + ath10k_err(ar, "failed to download board data: %d\n", ret); + return ret; + } + /* OTP is optional */ if (!ar->otp_data || !ar->otp_len) { @@ -589,29 +595,16 @@ success: return 0; } -static int ath10k_init_download_firmware(struct ath10k *ar, - enum ath10k_firmware_mode mode) +static int ath10k_download_cal_data(struct ath10k *ar) { int ret; - ret = ath10k_download_board_data(ar); - if (ret) { - ath10k_err(ar, "failed to download board data: %d\n", ret); - return ret; - } - ret = ath10k_download_and_run_otp(ar); if (ret) { ath10k_err(ar, "failed to run otp: %d\n", ret); return ret; } - ret = ath10k_download_fw(ar, mode); - if (ret) { - ath10k_err(ar, "failed to download firmware: %d\n", ret); - return ret; - } - return ret; } @@ -729,7 +722,11 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode) goto err; } - status = ath10k_init_download_firmware(ar, mode); + status = ath10k_download_cal_data(ar); + if (status) + goto err; + + status = ath10k_download_fw(ar, mode); if (status) goto err; |