summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wil6210/fw_inc.c
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-08-22 12:42:22 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2016-08-31 10:31:16 +0300
commit13cd9f758a555d1ab547b0dbed3f9d1e529230c3 (patch)
treec7eed889b48531d0c3cfadea73839f716788ddd5 /drivers/net/wireless/ath/wil6210/fw_inc.c
parent12bace75704ec0d64621be6ebf6e51772ce2cb0f (diff)
wil6210: extract firmware version from file header
Currently the FW version is taken from the sw_version field of the FW ready event. This version is based on internal version control revision and it is difficult to map to actual FW version. Fix this by using the actual FW version stored in the FW file header record. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/fw_inc.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/fw_inc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/fw_inc.c b/drivers/net/wireless/ath/wil6210/fw_inc.c
index 3860238840ba..8f40eb301924 100644
--- a/drivers/net/wireless/ath/wil6210/fw_inc.c
+++ b/drivers/net/wireless/ath/wil6210/fw_inc.c
@@ -223,6 +223,13 @@ static int fw_handle_file_header(struct wil6210_priv *wil, const void *data,
wil_hex_dump_fw("", DUMP_PREFIX_OFFSET, 16, 1, d->comment,
sizeof(d->comment), true);
+ if (!memcmp(d->comment, WIL_FW_VERSION_PREFIX,
+ WIL_FW_VERSION_PREFIX_LEN))
+ memcpy(wil->fw_version,
+ d->comment + WIL_FW_VERSION_PREFIX_LEN,
+ min(sizeof(d->comment) - WIL_FW_VERSION_PREFIX_LEN,
+ sizeof(wil->fw_version) - 1));
+
return 0;
}