summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54usb.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-12-01 18:19:36 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-12-05 15:35:46 +0100
commitc91276592695e13d1b52eab572551017cbf96ee7 (patch)
treec5e0a6611c215ce38637c56c0ef0989fda04d120 /drivers/net/wireless/p54/p54usb.c
parentcfg80211: "fix" 11d oops (diff)
downloadlinux-c91276592695e13d1b52eab572551017cbf96ee7.tar.xz
linux-c91276592695e13d1b52eab572551017cbf96ee7.zip
p54: fix lm87 checksum endianness
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>
Diffstat (limited to 'drivers/net/wireless/p54/p54usb.c')
-rw-r--r--drivers/net/wireless/p54/p54usb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index e9630b949256..2dd3cd41d0fe 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -244,13 +244,13 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb,
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);
}
@@ -270,7 +270,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb,
if (!data_urb)
return;
- checksum = p54u_lm87_chksum((u32 *)skb->data, skb->len);
+ checksum = p54u_lm87_chksum((__le32 *)skb->data, skb->len);
hdr = (struct lm87_tx_hdr *)skb_push(skb, sizeof(*hdr));
hdr->chksum = checksum;
hdr->device_addr = addr;