Skip to contentSkip to conversation

ath9k_htc: Fix an endian issue

PATCH New Sujith 1 participant 1 message Feb 27, 2011 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore

Sujith

author
#0 lore raw

PATCH 1/1 ath9k_htc: Fix an endian issue

From: Sujith Manoharan <[email protected]>

The stream length/tag fields have to be in little endian format. Fixing this makes the driver work on big-endian platforms.

---
 drivers/net/wireless/ath/ath9k/hif_usb.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/hif_usb.c +5 -4
index 7dc2048..f1b8af6 100644
@@ -222,8 +222,9 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev)
 	struct tx_buf *tx_buf = NULL;
 	struct sk_buff *nskb = NULL;
 	int ret = 0, i;
-	u16 *hdr, tx_skb_cnt = 0;
+	u16 tx_skb_cnt = 0;
 	u8 *buf;
+	__le16 *hdr;
 
 	if (hif_dev->tx.tx_skb_cnt == 0)
 		return 0;
@@ -248,9 +249,9 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev)
 
 		buf = tx_buf->buf;
 		buf += tx_buf->offset;
-		hdr = (u16 *)buf;
-		*hdr++ = nskb->len;
-		*hdr++ = ATH_USB_TX_STREAM_MODE_TAG;
+		hdr = (__le16 *)buf;
+		*hdr++ = cpu_to_le16(nskb->len);
+		*hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG);
 		buf += 4;
 		memcpy(buf, nskb->data, nskb->len);
 		tx_buf->len = nskb->len + 4;
Signature · 1 line
1.7.4.1