提交 dac10a9f 编写于 作者: H Holger Schurig 提交者: David S. Miller

libertas: always show firmware release

Always shows the firmware release.

Also converts the firmware release into something that is easily comparable.
Signed-off-by: NHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 4365929d
...@@ -60,13 +60,24 @@ int lbs_update_hw_spec(struct lbs_private *priv) ...@@ -60,13 +60,24 @@ int lbs_update_hw_spec(struct lbs_private *priv)
goto out; goto out;
priv->fwcapinfo = le32_to_cpu(cmd.fwcapinfo); 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", /* The firmware release is in an interesting format: the patch
priv->fwreleasenumber[2], priv->fwreleasenumber[1], * level is in the most significant nibble ... so fix that: */
priv->fwreleasenumber[0], priv->fwreleasenumber[3]); priv->fwrelease = le32_to_cpu(cmd.fwrelease);
lbs_deb_cmd("GET_HW_SPEC: MAC addr %s\n", priv->fwrelease = (priv->fwrelease << 8) |
print_mac(mac, cmd.permanentaddr)); (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", lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n",
cmd.hwifversion, cmd.version); cmd.hwifversion, cmd.version);
......
...@@ -161,7 +161,7 @@ struct lbs_private { ...@@ -161,7 +161,7 @@ struct lbs_private {
/** Wlan adapter data structure*/ /** Wlan adapter data structure*/
/** STATUS variables */ /** STATUS variables */
u8 fwreleasenumber[4]; u32 fwrelease;
u32 fwcapinfo; u32 fwcapinfo;
/* protected with big lock */ /* protected with big lock */
......
...@@ -136,8 +136,8 @@ struct cmd_ds_get_hw_spec { ...@@ -136,8 +136,8 @@ struct cmd_ds_get_hw_spec {
/* Number of antenna used */ /* Number of antenna used */
__le16 nr_antenna; __le16 nr_antenna;
/* FW release number, example 1,2,3,4 = 3.2.1p4 */ /* FW release number, example 0x01030304 = 2.3.4p1 */
u8 fwreleasenumber[4]; __le32 fwrelease;
/* Base Address of TxPD queue */ /* Base Address of TxPD queue */
__le32 wcb_base; __le32 wcb_base;
......
...@@ -2071,17 +2071,11 @@ void lbs_get_fwversion(struct lbs_private *priv, char *fwversion, int maxlen) ...@@ -2071,17 +2071,11 @@ void lbs_get_fwversion(struct lbs_private *priv, char *fwversion, int maxlen)
mutex_lock(&priv->lock); mutex_lock(&priv->lock);
if (priv->fwreleasenumber[3] == 0) sprintf(fwver, "%u.%u.%u.p%u",
sprintf(fwver, "%u.%u.%u", priv->fwrelease >> 24 & 0xff,
priv->fwreleasenumber[2], priv->fwrelease >> 16 & 0xff,
priv->fwreleasenumber[1], priv->fwrelease >> 8 & 0xff,
priv->fwreleasenumber[0]); priv->fwrelease & 0xff);
else
sprintf(fwver, "%u.%u.%u.p%u",
priv->fwreleasenumber[2],
priv->fwreleasenumber[1],
priv->fwreleasenumber[0],
priv->fwreleasenumber[3]);
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
snprintf(fwversion, maxlen, fwver); snprintf(fwversion, maxlen, fwver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册