diff options
Diffstat (limited to 'drivers/net/wireless/libertas/tx.c')
-rw-r--r-- | drivers/net/wireless/libertas/tx.c | 29 |
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) | |||
85 | 85 | ||
86 | memset(plocaltxpd, 0, sizeof(struct txpd)); | 86 | memset(plocaltxpd, 0, sizeof(struct txpd)); |
87 | 87 | ||
88 | plocaltxpd->tx_packet_length = skb->len; | 88 | plocaltxpd->tx_packet_length = cpu_to_le16(skb->len); |
89 | 89 | ||
90 | /* offset of actual data */ | 90 | /* offset of actual data */ |
91 | plocaltxpd->tx_packet_location = sizeof(struct txpd); | 91 | plocaltxpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd)); |
92 | 92 | ||
93 | /* TxCtrl set by user or default */ | 93 | /* TxCtrl set by user or default */ |
94 | plocaltxpd->tx_control = adapter->pkttxctrl; | 94 | plocaltxpd->tx_control = cpu_to_le32(adapter->pkttxctrl); |
95 | 95 | ||
96 | p802x_hdr = skb->data; | 96 | p802x_hdr = skb->data; |
97 | if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP) { | 97 | if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP) { |
@@ -102,15 +102,16 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) | |||
102 | /* set txpd fields from the radiotap header */ | 102 | /* set txpd fields from the radiotap header */ |
103 | new_rate = convert_radiotap_rate_to_mv(pradiotap_hdr->rate); | 103 | new_rate = convert_radiotap_rate_to_mv(pradiotap_hdr->rate); |
104 | if (new_rate != 0) { | 104 | if (new_rate != 0) { |
105 | /* erase tx_control[4:0] */ | 105 | /* use new tx_control[4:0] */ |
106 | plocaltxpd->tx_control &= ~0x1f; | 106 | new_rate |= (adapter->pkttxctrl & ~0x1f); |
107 | /* write new tx_control[4:0] */ | 107 | plocaltxpd->tx_control = cpu_to_le32(new_rate); |
108 | plocaltxpd->tx_control |= new_rate; | ||
109 | } | 108 | } |
110 | 109 | ||
111 | /* skip the radiotap header */ | 110 | /* skip the radiotap header */ |
112 | p802x_hdr += sizeof(struct tx_radiotap_hdr); | 111 | p802x_hdr += sizeof(struct tx_radiotap_hdr); |
113 | plocaltxpd->tx_packet_length -= sizeof(struct tx_radiotap_hdr); | 112 | plocaltxpd->tx_packet_length = |
113 | cpu_to_le32(le32_to_cpu(plocaltxpd->tx_packet_length) | ||
114 | - sizeof(struct tx_radiotap_hdr)); | ||
114 | 115 | ||
115 | } | 116 | } |
116 | /* copy destination address from 802.3 or 802.11 header */ | 117 | /* copy destination address from 802.3 or 802.11 header */ |
@@ -122,19 +123,19 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb) | |||
122 | lbs_dbg_hex("txpd", (u8 *) plocaltxpd, sizeof(struct txpd)); | 123 | lbs_dbg_hex("txpd", (u8 *) plocaltxpd, sizeof(struct txpd)); |
123 | 124 | ||
124 | if (IS_MESH_FRAME(skb)) { | 125 | if (IS_MESH_FRAME(skb)) { |
125 | plocaltxpd->tx_control |= TxPD_MESH_FRAME; | 126 | plocaltxpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME); |
126 | } | 127 | } |
127 | 128 | ||
128 | memcpy(ptr, plocaltxpd, sizeof(struct txpd)); | 129 | memcpy(ptr, plocaltxpd, sizeof(struct txpd)); |
129 | 130 | ||
130 | ptr += sizeof(struct txpd); | 131 | ptr += sizeof(struct txpd); |
131 | 132 | ||
132 | lbs_dbg_hex("Tx Data", (u8 *) p802x_hdr, plocaltxpd->tx_packet_length); | 133 | lbs_dbg_hex("Tx Data", (u8 *) p802x_hdr, le32_to_cpu(plocaltxpd->tx_packet_length)); |
133 | memcpy(ptr, p802x_hdr, plocaltxpd->tx_packet_length); | 134 | memcpy(ptr, p802x_hdr, le32_to_cpu(plocaltxpd->tx_packet_length)); |
134 | ret = priv->hw_host_to_card(priv, MVMS_DAT, | 135 | ret = priv->hw_host_to_card(priv, MVMS_DAT, |
135 | priv->adapter->tmptxbuf, | 136 | priv->adapter->tmptxbuf, |
136 | plocaltxpd->tx_packet_length + | 137 | le32_to_cpu(plocaltxpd->tx_packet_length) + |
137 | sizeof(struct txpd)); | 138 | sizeof(struct txpd)); |
138 | 139 | ||
139 | if (ret) { | 140 | if (ret) { |
140 | lbs_deb_tx("tx err: hw_host_to_card returned 0x%X\n", ret); | 141 | lbs_deb_tx("tx err: hw_host_to_card returned 0x%X\n", ret); |