diff options
author | Sujith Manoharan <Sujith.Manoharan@atheros.com> | 2011-02-26 22:53:52 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-28 13:39:06 -0500 |
commit | 2c27392dc4d4f5ee8a3967a520b8f6cac0418031 (patch) | |
tree | e12332c69cfff9dc983b352a12c7a2ce1781d305 /drivers | |
parent | 63453c05da685323d45b7063cc27cf5e44b4134c (diff) |
ath9k_htc: Fix an endian issue
The stream length/tag fields have to be in little endian
format. Fixing this makes the driver work on big-endian
platforms.
Cc: stable@kernel.org
Tested-by: raghunathan.kailasanathan@wipro.com
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hif_usb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 5ab3084eb9c..07b1633b7f3 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -219,8 +219,9 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev) | |||
219 | struct tx_buf *tx_buf = NULL; | 219 | struct tx_buf *tx_buf = NULL; |
220 | struct sk_buff *nskb = NULL; | 220 | struct sk_buff *nskb = NULL; |
221 | int ret = 0, i; | 221 | int ret = 0, i; |
222 | u16 *hdr, tx_skb_cnt = 0; | 222 | u16 tx_skb_cnt = 0; |
223 | u8 *buf; | 223 | u8 *buf; |
224 | __le16 *hdr; | ||
224 | 225 | ||
225 | if (hif_dev->tx.tx_skb_cnt == 0) | 226 | if (hif_dev->tx.tx_skb_cnt == 0) |
226 | return 0; | 227 | return 0; |
@@ -245,9 +246,9 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev) | |||
245 | 246 | ||
246 | buf = tx_buf->buf; | 247 | buf = tx_buf->buf; |
247 | buf += tx_buf->offset; | 248 | buf += tx_buf->offset; |
248 | hdr = (u16 *)buf; | 249 | hdr = (__le16 *)buf; |
249 | *hdr++ = nskb->len; | 250 | *hdr++ = cpu_to_le16(nskb->len); |
250 | *hdr++ = ATH_USB_TX_STREAM_MODE_TAG; | 251 | *hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG); |
251 | buf += 4; | 252 | buf += 4; |
252 | memcpy(buf, nskb->data, nskb->len); | 253 | memcpy(buf, nskb->data, nskb->len); |
253 | tx_buf->len = nskb->len + 4; | 254 | tx_buf->len = nskb->len + 4; |