diff options
author | Ulrich Kunitz <kune@deine-taler.de> | 2006-08-01 17:43:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-08-02 14:26:51 -0400 |
commit | b269825b9bb2c925bbaf4365ec9fa4c6a16e46b4 (patch) | |
tree | f181233d2dc78a02f04a3e7e1d4281b5adcbe474 /drivers/net | |
parent | b1162b639cc13d5a1ab9bcbd0a502599ddf49f86 (diff) |
[PATCH] zd1211rw: Fixed endianess issue with length info tag detection
Discovered a problem while accessing www.python.org on my PPC32.
The problem was pretty consistent for all sticks. The reason was
that while testing for the length info tag, I ignored the
endianess of the host system.
Please recognize that converting the constant to little endian, we
create faster code.
Signed-off-by: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index f9a93f6abe84..6320984126c7 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -544,11 +544,11 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer, | |||
544 | * be padded. Unaligned access might also happen if the length_info | 544 | * be padded. Unaligned access might also happen if the length_info |
545 | * structure is not present. | 545 | * structure is not present. |
546 | */ | 546 | */ |
547 | if (get_unaligned(&length_info->tag) == RX_LENGTH_INFO_TAG) { | 547 | if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG)) |
548 | { | ||
548 | unsigned int l, k, n; | 549 | unsigned int l, k, n; |
549 | for (i = 0, l = 0;; i++) { | 550 | for (i = 0, l = 0;; i++) { |
550 | k = le16_to_cpu(get_unaligned( | 551 | k = le16_to_cpu(get_unaligned(&length_info->length[i])); |
551 | &length_info->length[i])); | ||
552 | n = l+k; | 552 | n = l+k; |
553 | if (n > length) | 553 | if (n > length) |
554 | return; | 554 | return; |