brcm80211: smac: fix endianess issue for OTP memory access
authorArend van Spriel <arend@broadcom.com>
Thu, 10 Nov 2011 19:30:16 +0000 (20:30 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 11 Nov 2011 19:28:27 +0000 (14:28 -0500)
This fixes issue when using OTP memory. It was introduced by
following commit:

commit 028f78d43d80dcb8b1142ea38606067151dd3d51
Author: Arend van Spriel <arend@broadcom.com>
Date:   Fri Oct 21 16:16:35 2011 +0200

    brcm80211: smac: change buffer endianess convert function interface

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/srom.c

index 0539a6a831c50234c9bd35d99dc081aa1dc38186..3a9b81db8e63e0e2ed16b6c07ee45064243b4e9b 100644 (file)
@@ -835,6 +835,8 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint nwords)
                 */
                return -ENODATA;
 
+       /* fixup the endianness so crc8 will pass */
+       cpu_to_le16_buf(buf, sz);
        if (crc8(brcms_srom_crc8_table, (u8 *) buf, sz * 2,
                 CRC8_INIT_VALUE) != CRC8_GOOD_VALUE(brcms_srom_crc8_table))
                err = -EIO;