提交 e5b3d472 编写于 作者: D David Woodhouse 提交者: John W. Linville

[PATCH] libertas: don't byte-swap firmware version number. It's a byte array.

Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 86760088
...@@ -168,10 +168,11 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, ...@@ -168,10 +168,11 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
adapter->fwcapinfo = le32_to_cpu(hwspec->fwcapinfo); 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", lbs_deb_cmd("GET_HW_SPEC: FWReleaseVersion- %u.%u.%u.p%u\n",
adapter->fwreleasenumber); 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", lbs_deb_cmd("GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n",
hwspec->permanentaddr[0], hwspec->permanentaddr[1], hwspec->permanentaddr[0], hwspec->permanentaddr[1],
hwspec->permanentaddr[2], hwspec->permanentaddr[3], hwspec->permanentaddr[2], hwspec->permanentaddr[3],
......
...@@ -205,7 +205,7 @@ struct assoc_request { ...@@ -205,7 +205,7 @@ struct assoc_request {
/** Wlan adapter data structure*/ /** Wlan adapter data structure*/
struct _wlan_adapter { struct _wlan_adapter {
/** STATUS variables */ /** STATUS variables */
u32 fwreleasenumber; u8 fwreleasenumber[4];
u32 fwcapinfo; u32 fwcapinfo;
/* protected with big lock */ /* protected with big lock */
......
...@@ -165,8 +165,8 @@ struct cmd_ds_get_hw_spec { ...@@ -165,8 +165,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 0x1234=1.2.3.4 */ /* FW release number, example 1,2,3,4 = 3.2.1p4 */
__le32 fwreleasenumber; u8 fwreleasenumber[4];
/* Base Address of TxPD queue */ /* Base Address of TxPD queue */
__le32 wcb_base; __le32 wcb_base;
......
...@@ -2297,22 +2297,23 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info, ...@@ -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) void libertas_get_fwversion(wlan_adapter * adapter, char *fwversion, int maxlen)
{ {
union {
u32 l;
u8 c[4];
} ver;
char fwver[32]; char fwver[32];
mutex_lock(&adapter->lock); mutex_lock(&adapter->lock);
ver.l = adapter->fwreleasenumber;
mutex_unlock(&adapter->lock);
if (ver.c[3] == 0) if (adapter->fwreleasenumber[3] == 0)
sprintf(fwver, "%u.%u.%u", ver.c[2], ver.c[1], ver.c[0]); sprintf(fwver, "%u.%u.%u",
adapter->fwreleasenumber[2],
adapter->fwreleasenumber[1],
adapter->fwreleasenumber[0]);
else else
sprintf(fwver, "%u.%u.%u.p%u", 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); snprintf(fwversion, maxlen, fwver);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册