]> err.no Git - linux-2.6/commitdiff
[PATCH] libertas: don't byte-swap firmware version number. It's a byte array.
authorDavid Woodhouse <dwmw2@infradead.org>
Sat, 26 May 2007 03:40:21 +0000 (23:40 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Jun 2007 18:28:45 +0000 (14:28 -0400)
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmdresp.c
drivers/net/wireless/libertas/dev.h
drivers/net/wireless/libertas/hostcmd.h
drivers/net/wireless/libertas/wext.c

index e31d595e4753a1cb86b0f82d4cabbbacb27e903d..9385df52d7a2d2be6e23b4c7e66c5057ad308e7c 100644 (file)
@@ -168,10 +168,11 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
 
        adapter->fwcapinfo = le32_to_cpu(hwspec->fwcapinfo);
 
-       adapter->fwreleasenumber = le32_to_cpu(hwspec->fwreleasenumber);
+       memcpy(adapter->fwreleasenumber, hwspec->fwreleasenumber, 4);
 
-       lbs_deb_cmd("GET_HW_SPEC: FWReleaseVersion- 0x%X\n",
-              adapter->fwreleasenumber);
+       lbs_deb_cmd("GET_HW_SPEC: FWReleaseVersion- %u.%u.%u.p%u\n",
+                   adapter->fwreleasenumber[2], adapter->fwreleasenumber[1],
+                   adapter->fwreleasenumber[0], adapter->fwreleasenumber[3]);
        lbs_deb_cmd("GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n",
               hwspec->permanentaddr[0], hwspec->permanentaddr[1],
               hwspec->permanentaddr[2], hwspec->permanentaddr[3],
index 797a1249bcaf7329e0dc4bdfb20e72d0c4fc0a49..91ac744ab9bcc9ccd9490c390eacefd2c5d50b19 100644 (file)
@@ -205,7 +205,7 @@ struct assoc_request {
 /** Wlan adapter data structure*/
 struct _wlan_adapter {
        /** STATUS variables */
-       u32 fwreleasenumber;
+       u8 fwreleasenumber[4];
        u32 fwcapinfo;
        /* protected with big lock */
 
index 204d9d53aba85fd0bff57d99c3f9bfd1a8ca8217..dc66cf5253395a841c7595f88a366d5b80c1ac9b 100644 (file)
@@ -165,8 +165,8 @@ struct cmd_ds_get_hw_spec {
        /* Number of antenna used */
        __le16 nr_antenna;
 
-       /* FW release number, example 0x1234=1.2.3.4 */
-       __le32 fwreleasenumber;
+       /* FW release number, example 1,2,3,4 = 3.2.1p4 */
+       u8 fwreleasenumber[4];
 
        /* Base Address of TxPD queue */
        __le32 wcb_base;
index 1abb4bcecc66fb0e2ef32e7502ccdb0a1aa4dd96..5b7e5f257d6245738772e53e99835e7c0ea4f21e 100644 (file)
@@ -2297,22 +2297,23 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
 
 void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen)
 {
-       union {
-               u32 l;
-               u8 c[4];
-       } ver;
        char fwver[32];
 
        mutex_lock(&adapter->lock);
-       ver.l = adapter->fwreleasenumber;
-       mutex_unlock(&adapter->lock);
 
-       if (ver.c[3] == 0)
-               sprintf(fwver, "%u.%u.%u", ver.c[2], ver.c[1], ver.c[0]);
+       if (adapter->fwreleasenumber[3] == 0)
+               sprintf(fwver, "%u.%u.%u",
+                       adapter->fwreleasenumber[2],
+                       adapter->fwreleasenumber[1],
+                       adapter->fwreleasenumber[0]);
        else
                sprintf(fwver, "%u.%u.%u.p%u",
-                       ver.c[2], ver.c[1], ver.c[0], ver.c[3]);
+                       adapter->fwreleasenumber[2],
+                       adapter->fwreleasenumber[1],
+                       adapter->fwreleasenumber[0],
+                       adapter->fwreleasenumber[3]);
 
+       mutex_unlock(&adapter->lock);
        snprintf(fwversion, maxlen, fwver);
 }