mwifiex: fix version display problem on big endian platforms
authorAmitkumar Karwar <akarwar@marvell.com>
Fri, 7 Nov 2014 10:14:52 +0000 (02:14 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 11 Nov 2014 21:31:15 +0000 (16:31 -0500)
It's been observed that wrong firmware version (ex. 66.14.96.p9
instead of 14.66.9.p96) is displayed on big endian platforms.

The problem is fixed here.

Reported-by: Daniel Mosquera <daniel.mosquera@ctag.com>
Tested-by: Daniel Mosquera <daniel.mosquera@ctag.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/sta_ioctl.c

index 92f3eb8398662700298e6ba81eab855ecdbe554b..1626868a4b5ce7935af22b31c8e506f1db923d06 100644 (file)
@@ -1026,12 +1026,12 @@ mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, char *version,
                               int max_len)
 {
        union {
-               u32 l;
+               __le32 l;
                u8 c[4];
        } ver;
        char fw_ver[32];
 
-       ver.l = adapter->fw_release_number;
+       ver.l = cpu_to_le32(adapter->fw_release_number);
        sprintf(fw_ver, "%u.%u.%u.p%u", ver.c[2], ver.c[1], ver.c[0], ver.c[3]);
 
        snprintf(version, max_len, driver_version, fw_ver);