linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch v4] ath6kl: Different version for different FW binaries
@ 2012-06-07  7:44 Naveen Singh
  2012-06-11 13:19 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Naveen Singh @ 2012-06-07  7:44 UTC (permalink / raw)
  To: ath6kl-devel; +Cc: linux-wireless

Need to have different FW versioning for different FW binaries.
This is handled by appending different meta data in firmware
binaries.

Signed-off-by: Naveen Singh <navesing@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/init.c |    8 ++++++++
 drivers/net/wireless/ath/ath6kl/main.c |   21 ++++++++++++---------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index daf24ee..62e25cc 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -943,6 +943,14 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
 		}
 
 		switch (ie_id) {
+		case ATH6KL_FW_IE_FW_VERSION:
+			strlcpy(ar->wiphy->fw_version, data,
+				sizeof(ar->wiphy->fw_version));
+
+			ath6kl_dbg(ATH6KL_DBG_BOOT,
+				   "found fw version %s\n",
+				    ar->wiphy->fw_version);
+			break;
 		case ATH6KL_FW_IE_OTP_IMAGE:
 			ath6kl_dbg(ATH6KL_DBG_BOOT, "found otp image ie (%zd B)\n",
 				   ie_len);
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 3e6768a..ceff85c 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -554,20 +554,23 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver,
 	struct ath6kl *ar = devt;
 
 	memcpy(ar->mac_addr, datap, ETH_ALEN);
-	ath6kl_dbg(ATH6KL_DBG_TRC, "%s: mac addr = %pM\n",
-		   __func__, ar->mac_addr);
+	ath6kl_dbg(ATH6KL_DBG_BOOT,
+		"ready event mac addr %pM sw_ver 0x%x abi_ver 0x%x cap 0x%x\n",
+		ar->mac_addr, sw_ver, abi_ver, cap);
 
 	ar->version.wlan_ver = sw_ver;
 	ar->version.abi_ver = abi_ver;
 	ar->hw.cap = cap;
 
-	snprintf(ar->wiphy->fw_version,
-		 sizeof(ar->wiphy->fw_version),
-		 "%u.%u.%u.%u",
-		 (ar->version.wlan_ver & 0xf0000000) >> 28,
-		 (ar->version.wlan_ver & 0x0f000000) >> 24,
-		 (ar->version.wlan_ver & 0x00ff0000) >> 16,
-		 (ar->version.wlan_ver & 0x0000ffff));
+	if (strlen(ar->wiphy->fw_version) == 0x00) {
+		snprintf(ar->wiphy->fw_version,
+			sizeof(ar->wiphy->fw_version),
+			"%u.%u.%u.%u",
+			(ar->version.wlan_ver & 0xf0000000) >> 28,
+			(ar->version.wlan_ver & 0x0f000000) >> 24,
+			(ar->version.wlan_ver & 0x00ff0000) >> 16,
+			(ar->version.wlan_ver & 0x0000ffff));
+	}
 
 	/* indicate to the waiting thread that the ready event was received */
 	set_bit(WMI_READY, &ar->flag);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch v4] ath6kl: Different version for different FW binaries
  2012-06-07  7:44 [patch v4] ath6kl: Different version for different FW binaries Naveen Singh
@ 2012-06-11 13:19 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2012-06-11 13:19 UTC (permalink / raw)
  To: Naveen Singh; +Cc: ath6kl-devel, linux-wireless

On 06/07/2012 10:44 AM, Naveen Singh wrote:
> Need to have different FW versioning for different FW binaries.
> This is handled by appending different meta data in firmware
> binaries.
> 
> Signed-off-by: Naveen Singh <navesing@qca.qualcomm.com>

Thanks, applied with minor changes:

commit b5b6f6a9a07ac230d54a85a9fb9e691c85f2eb0a
Author: Naveen Singh <navesing@qca.qualcomm.com>
Date:   Thu Jun 7 00:44:02 2012 -0700

    ath6kl: use firmware version from FW IE

    Need to have different FW versioning for different FW binaries.
    This is handled by appending different meta data in firmware
    binaries.

    kvalo: add an empty line before a debug message, use '0' instead of
'0x00',
    fix indentation

    Signed-off-by: Naveen Singh <navesing@qca.qualcomm.com>
    Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

Kalle

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-11 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07  7:44 [patch v4] ath6kl: Different version for different FW binaries Naveen Singh
2012-06-11 13:19 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).