]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
libertas: always show firmware release
authorHolger Schurig <hs4233@mail.mn-solutions.de>
Wed, 16 Jan 2008 14:55:22 +0000 (15:55 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:10:05 +0000 (15:10 -0800)
Always shows the firmware release.

Also converts the firmware release into something that is easily comparable.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/dev.h
drivers/net/wireless/libertas/hostcmd.h
drivers/net/wireless/libertas/wext.c

index 4d06dec6cd46288137355765c63a5f1cad366510..eab020338fde2b345c1c795b88d68ac4c360364a 100644 (file)
@@ -60,13 +60,24 @@ int lbs_update_hw_spec(struct lbs_private *priv)
                goto out;
 
        priv->fwcapinfo = le32_to_cpu(cmd.fwcapinfo);
-       memcpy(priv->fwreleasenumber, cmd.fwreleasenumber, 4);
 
-       lbs_deb_cmd("GET_HW_SPEC: firmware release %u.%u.%up%u\n",
-                   priv->fwreleasenumber[2], priv->fwreleasenumber[1],
-                   priv->fwreleasenumber[0], priv->fwreleasenumber[3]);
-       lbs_deb_cmd("GET_HW_SPEC: MAC addr %s\n",
-                   print_mac(mac, cmd.permanentaddr));
+       /* The firmware release is in an interesting format: the patch
+        * level is in the most significant nibble ... so fix that: */
+       priv->fwrelease = le32_to_cpu(cmd.fwrelease);
+       priv->fwrelease = (priv->fwrelease << 8) |
+               (priv->fwrelease >> 24 & 0xff);
+
+       /* Some firmware capabilities:
+        * CF card    firmware 5.0.16p0:   cap 0x00000303
+        * USB dongle firmware 5.110.17p2: cap 0x00000303
+        */
+       printk("libertas: %s, fw %u.%u.%up%u, cap 0x%08x\n",
+               print_mac(mac, cmd.permanentaddr),
+               priv->fwrelease >> 24 & 0xff,
+               priv->fwrelease >> 16 & 0xff,
+               priv->fwrelease >>  8 & 0xff,
+               priv->fwrelease       & 0xff,
+               priv->fwcapinfo);
        lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n",
                    cmd.hwifversion, cmd.version);
 
index c1c9733c5f9e48760a2bcbc50c2a923b056e1a32..58d7ef6b5ff5b127591c65bd9d60ffb731c87e9d 100644 (file)
@@ -161,7 +161,7 @@ struct lbs_private {
 
        /** Wlan adapter data structure*/
        /** STATUS variables */
-       u8 fwreleasenumber[4];
+       u32 fwrelease;
        u32 fwcapinfo;
        /* protected with big lock */
 
index be325eda6a4b22ed6b3ac845cfea1e0b84bc79de..d35b015b66577d80620b1e1bdebfa4cf81d1af51 100644 (file)
@@ -136,8 +136,8 @@ struct cmd_ds_get_hw_spec {
        /* Number of antenna used */
        __le16 nr_antenna;
 
-       /* FW release number, example 1,2,3,4 = 3.2.1p4 */
-       u8 fwreleasenumber[4];
+       /* FW release number, example 0x01030304 = 2.3.4p1 */
+       __le32 fwrelease;
 
        /* Base Address of TxPD queue */
        __le32 wcb_base;
index 3e8d555ba3a97bc0d2de00f4ef47a5c6dafda124..e8bfc26b10a4eb11d647229bc085cea71a00f84c 100644 (file)
@@ -2071,17 +2071,11 @@ void lbs_get_fwversion(struct lbs_private *priv, char *fwversion, int maxlen)
 
        mutex_lock(&priv->lock);
 
-       if (priv->fwreleasenumber[3] == 0)
-               sprintf(fwver, "%u.%u.%u",
-                       priv->fwreleasenumber[2],
-                       priv->fwreleasenumber[1],
-                       priv->fwreleasenumber[0]);
-       else
-               sprintf(fwver, "%u.%u.%u.p%u",
-                       priv->fwreleasenumber[2],
-                       priv->fwreleasenumber[1],
-                       priv->fwreleasenumber[0],
-                       priv->fwreleasenumber[3]);
+       sprintf(fwver, "%u.%u.%u.p%u",
+               priv->fwrelease >> 24 & 0xff,
+               priv->fwrelease >> 16 & 0xff,
+               priv->fwrelease >>  8 & 0xff,
+               priv->fwrelease       & 0xff);
 
        mutex_unlock(&priv->lock);
        snprintf(fwversion, maxlen, fwver);