aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/rtl8180_dev.c14
-rw-r--r--drivers/net/wireless/rtl8187_dev.c12
2 files changed, 19 insertions, 7 deletions
diff --git a/drivers/net/wireless/rtl8180_dev.c b/drivers/net/wireless/rtl8180_dev.c
index d0928c91c21c..b1b3a478335b 100644
--- a/drivers/net/wireless/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl8180_dev.c
@@ -257,19 +257,25 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
257 mapping = pci_map_single(priv->pdev, skb->data, 257 mapping = pci_map_single(priv->pdev, skb->data,
258 skb->len, PCI_DMA_TODEVICE); 258 skb->len, PCI_DMA_TODEVICE);
259 259
260 BUG_ON(!control->tx_rate);
261
260 tx_flags = RTL8180_TX_DESC_FLAG_OWN | RTL8180_TX_DESC_FLAG_FS | 262 tx_flags = RTL8180_TX_DESC_FLAG_OWN | RTL8180_TX_DESC_FLAG_FS |
261 RTL8180_TX_DESC_FLAG_LS | 263 RTL8180_TX_DESC_FLAG_LS |
262 (control->tx_rate->hw_value << 24) | 264 (control->tx_rate->hw_value << 24) | skb->len;
263 (control->rts_cts_rate->hw_value << 19) | skb->len;
264 265
265 if (priv->r8185) 266 if (priv->r8185)
266 tx_flags |= RTL8180_TX_DESC_FLAG_DMA | 267 tx_flags |= RTL8180_TX_DESC_FLAG_DMA |
267 RTL8180_TX_DESC_FLAG_NO_ENC; 268 RTL8180_TX_DESC_FLAG_NO_ENC;
268 269
269 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) 270 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
271 BUG_ON(!control->rts_cts_rate);
270 tx_flags |= RTL8180_TX_DESC_FLAG_RTS; 272 tx_flags |= RTL8180_TX_DESC_FLAG_RTS;
271 else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) 273 tx_flags |= control->rts_cts_rate->hw_value << 19;
274 } else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) {
275 BUG_ON(!control->rts_cts_rate);
272 tx_flags |= RTL8180_TX_DESC_FLAG_CTS; 276 tx_flags |= RTL8180_TX_DESC_FLAG_CTS;
277 tx_flags |= control->rts_cts_rate->hw_value << 19;
278 }
273 279
274 *((struct ieee80211_tx_control **) skb->cb) = 280 *((struct ieee80211_tx_control **) skb->cb) =
275 kmemdup(control, sizeof(*control), GFP_ATOMIC); 281 kmemdup(control, sizeof(*control), GFP_ATOMIC);
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 6ef67990692d..c03834d5cb0b 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -178,17 +178,23 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
178 178
179 flags = skb->len; 179 flags = skb->len;
180 flags |= RTL8187_TX_FLAG_NO_ENCRYPT; 180 flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
181 flags |= control->rts_cts_rate->hw_value << 19; 181
182 BUG_ON(!control->tx_rate);
183
182 flags |= control->tx_rate->hw_value << 24; 184 flags |= control->tx_rate->hw_value << 24;
183 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data)) 185 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
184 flags |= RTL8187_TX_FLAG_MORE_FRAG; 186 flags |= RTL8187_TX_FLAG_MORE_FRAG;
185 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 187 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
188 BUG_ON(!control->rts_cts_rate);
186 flags |= RTL8187_TX_FLAG_RTS; 189 flags |= RTL8187_TX_FLAG_RTS;
190 flags |= control->rts_cts_rate->hw_value << 19;
187 rts_dur = ieee80211_rts_duration(dev, priv->vif, 191 rts_dur = ieee80211_rts_duration(dev, priv->vif,
188 skb->len, control); 192 skb->len, control);
189 } 193 } else if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) {
190 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) 194 BUG_ON(!control->rts_cts_rate);
191 flags |= RTL8187_TX_FLAG_CTS; 195 flags |= RTL8187_TX_FLAG_CTS;
196 flags |= control->rts_cts_rate->hw_value << 19;
197 }
192 198
193 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); 199 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
194 hdr->flags = cpu_to_le32(flags); 200 hdr->flags = cpu_to_le32(flags);