Skip to content

Commit

Permalink
USB: asix - Fix endian issues in asix_tx_fixup()
Browse files Browse the repository at this point in the history
The attached patch fixes endian issues in asix_tx_fixup() that prevented
AX88772 and AX88178 devices from working on big-endian systems.  With
the attached patch, all three chips are reported to work on big endian.

Signed-off-by: David Hollis <dhollis@davehollis.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
David Hollis authored and Greg Kroah-Hartman committed Feb 16, 2007
1 parent db90e7a commit 57e4f04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/net/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,11 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,

skb_push(skb, 4);
packet_len = (((skb->len - 4) ^ 0x0000ffff) << 16) + (skb->len - 4);
cpu_to_le32s(&packet_len);
memcpy(skb->data, &packet_len, sizeof(packet_len));

if ((skb->len % 512) == 0) {
cpu_to_le32s(&padbytes);
memcpy( skb->tail, &padbytes, sizeof(padbytes));
skb_put(skb, sizeof(padbytes));
}
Expand Down

0 comments on commit 57e4f04

Please sign in to comment.