summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/tx.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-05-25 23:36:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-06-11 14:28:45 -0400
commit981f187b7c4b237011d4175cae0120d5d203c0fd (patch)
treeb4508fc33a9aed0177c18c3a4db5c4e500fdb646 /drivers/net/wireless/libertas/tx.c
parent123e0e044091ca35a4766b38ae15032f2d41bcd6 (diff)
downloadlinux-981f187b7c4b237011d4175cae0120d5d203c0fd.tar.bz2
[PATCH] libertas: first pass at fixing up endianness issues
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/tx.c')
-rw-r--r--drivers/net/wireless/libertas/tx.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index b6cb675f730d..10d1db0ab3a6 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -85,13 +85,13 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
memset(plocaltxpd, 0, sizeof(struct txpd));
- plocaltxpd->tx_packet_length = skb->len;
+ plocaltxpd->tx_packet_length = cpu_to_le16(skb->len);
/* offset of actual data */
- plocaltxpd->tx_packet_location = sizeof(struct txpd);
+ plocaltxpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
/* TxCtrl set by user or default */
- plocaltxpd->tx_control = adapter->pkttxctrl;
+ plocaltxpd->tx_control = cpu_to_le32(adapter->pkttxctrl);
p802x_hdr = skb->data;
if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP) {
@@ -102,15 +102,16 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
/* set txpd fields from the radiotap header */
new_rate = convert_radiotap_rate_to_mv(pradiotap_hdr->rate);
if (new_rate != 0) {
- /* erase tx_control[4:0] */
- plocaltxpd->tx_control &= ~0x1f;
- /* write new tx_control[4:0] */
- plocaltxpd->tx_control |= new_rate;
+ /* use new tx_control[4:0] */
+ new_rate |= (adapter->pkttxctrl & ~0x1f);
+ plocaltxpd->tx_control = cpu_to_le32(new_rate);
}
/* skip the radiotap header */
p802x_hdr += sizeof(struct tx_radiotap_hdr);
- plocaltxpd->tx_packet_length -= sizeof(struct tx_radiotap_hdr);
+ plocaltxpd->tx_packet_length =
+ cpu_to_le32(le32_to_cpu(plocaltxpd->tx_packet_length)
+ - sizeof(struct tx_radiotap_hdr));
}
/* copy destination address from 802.3 or 802.11 header */
@@ -122,19 +123,19 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
lbs_dbg_hex("txpd", (u8 *) plocaltxpd, sizeof(struct txpd));
if (IS_MESH_FRAME(skb)) {
- plocaltxpd->tx_control |= TxPD_MESH_FRAME;
+ plocaltxpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME);
}
memcpy(ptr, plocaltxpd, sizeof(struct txpd));
ptr += sizeof(struct txpd);
- lbs_dbg_hex("Tx Data", (u8 *) p802x_hdr, plocaltxpd->tx_packet_length);
- memcpy(ptr, p802x_hdr, plocaltxpd->tx_packet_length);
+ lbs_dbg_hex("Tx Data", (u8 *) p802x_hdr, le32_to_cpu(plocaltxpd->tx_packet_length));
+ memcpy(ptr, p802x_hdr, le32_to_cpu(plocaltxpd->tx_packet_length));
ret = priv->hw_host_to_card(priv, MVMS_DAT,
- priv->adapter->tmptxbuf,
- plocaltxpd->tx_packet_length +
- sizeof(struct txpd));
+ priv->adapter->tmptxbuf,
+ le32_to_cpu(plocaltxpd->tx_packet_length) +
+ sizeof(struct txpd));
if (ret) {
lbs_deb_tx("tx err: hw_host_to_card returned 0x%X\n", ret);