diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-01-24 10:44:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-06 13:47:20 -0800 |
commit | 631c7b5c602f9516cfe11c4556181c14bee6fdb3 (patch) | |
tree | 22c3a161d2ccd8dcf4f50d31075a9ac5dfd708e2 | |
parent | 1d2966c46a14815bf7c5016b5ca6068bce9ec1c6 (diff) | |
download | lwn-631c7b5c602f9516cfe11c4556181c14bee6fdb3.tar.gz lwn-631c7b5c602f9516cfe11c4556181c14bee6fdb3.zip |
p54: fix lm87 checksum endianness
commit c91276592695e13d1b52eab572551017cbf96ee7 upstream
This fixes the checksum calculation for lm87 firmwares
on big endian platforms, the device treats the data as
an array of 32-bit little endian values so the driver
needs to do that as well.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/p54/p54usb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 8a2e32d087a5..b5963ebb6718 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c @@ -222,13 +222,13 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct p54_control_hdr *data, usb_submit_urb(data_urb, GFP_ATOMIC); } -static __le32 p54u_lm87_chksum(const u32 *data, size_t length) +static __le32 p54u_lm87_chksum(const __le32 *data, size_t length) { u32 chk = 0; length >>= 2; while (length--) { - chk ^= *data++; + chk ^= le32_to_cpu(*data++); chk = (chk >> 5) ^ (chk << 3); } @@ -247,7 +247,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, if (!data_urb) return; - hdr->chksum = p54u_lm87_chksum((u32 *)data, len); + hdr->chksum = p54u_lm87_chksum((__le32 *) data, len); hdr->device_addr = data->req_id; usb_fill_bulk_urb(data_urb, priv->udev, |