aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/ieee80211_tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee80211/ieee80211_tx.c')
-rw-r--r--net/ieee80211/ieee80211_tx.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index 6a5de1b84459..ae254497ba3d 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -24,7 +24,6 @@
24 24
25******************************************************************************/ 25******************************************************************************/
26#include <linux/compiler.h> 26#include <linux/compiler.h>
27#include <linux/config.h>
28#include <linux/errno.h> 27#include <linux/errno.h>
29#include <linux/if_arp.h> 28#include <linux/if_arp.h>
30#include <linux/in6.h> 29#include <linux/in6.h>
@@ -338,7 +337,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
338 hdr_len += 2; 337 hdr_len += 2;
339 338
340 skb->priority = ieee80211_classify(skb); 339 skb->priority = ieee80211_classify(skb);
341 header.qos_ctl |= skb->priority & IEEE80211_QCTL_TID; 340 header.qos_ctl |= cpu_to_le16(skb->priority & IEEE80211_QCTL_TID);
342 } 341 }
343 header.frame_ctl = cpu_to_le16(fc); 342 header.frame_ctl = cpu_to_le16(fc);
344 343
@@ -533,13 +532,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
533 return 0; 532 return 0;
534 } 533 }
535 534
536 if (ret == NETDEV_TX_BUSY) {
537 printk(KERN_ERR "%s: NETDEV_TX_BUSY returned; "
538 "driver should report queue full via "
539 "ieee_device->is_queue_full.\n",
540 ieee->dev->name);
541 }
542
543 ieee80211_txb_free(txb); 535 ieee80211_txb_free(txb);
544 } 536 }
545 537
@@ -563,10 +555,13 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee,
563 struct net_device_stats *stats = &ieee->stats; 555 struct net_device_stats *stats = &ieee->stats;
564 struct sk_buff *skb_frag; 556 struct sk_buff *skb_frag;
565 int priority = -1; 557 int priority = -1;
558 int fraglen = total_len;
559 int headroom = ieee->tx_headroom;
560 struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];
566 561
567 spin_lock_irqsave(&ieee->lock, flags); 562 spin_lock_irqsave(&ieee->lock, flags);
568 563
569 if (encrypt_mpdu && !ieee->sec.encrypt) 564 if (encrypt_mpdu && (!ieee->sec.encrypt || !crypt))
570 encrypt_mpdu = 0; 565 encrypt_mpdu = 0;
571 566
572 /* If there is no driver handler to take the TXB, dont' bother 567 /* If there is no driver handler to take the TXB, dont' bother
@@ -582,20 +577,24 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee,
582 goto success; 577 goto success;
583 } 578 }
584 579
585 if (encrypt_mpdu) 580 if (encrypt_mpdu) {
586 frame->frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED); 581 frame->frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
582 fraglen += crypt->ops->extra_mpdu_prefix_len +
583 crypt->ops->extra_mpdu_postfix_len;
584 headroom += crypt->ops->extra_mpdu_prefix_len;
585 }
587 586
588 /* When we allocate the TXB we allocate enough space for the reserve 587 /* When we allocate the TXB we allocate enough space for the reserve
589 * and full fragment bytes (bytes_per_frag doesn't include prefix, 588 * and full fragment bytes (bytes_per_frag doesn't include prefix,
590 * postfix, header, FCS, etc.) */ 589 * postfix, header, FCS, etc.) */
591 txb = ieee80211_alloc_txb(1, total_len, ieee->tx_headroom, GFP_ATOMIC); 590 txb = ieee80211_alloc_txb(1, fraglen, headroom, GFP_ATOMIC);
592 if (unlikely(!txb)) { 591 if (unlikely(!txb)) {
593 printk(KERN_WARNING "%s: Could not allocate TXB\n", 592 printk(KERN_WARNING "%s: Could not allocate TXB\n",
594 ieee->dev->name); 593 ieee->dev->name);
595 goto failed; 594 goto failed;
596 } 595 }
597 txb->encrypted = 0; 596 txb->encrypted = 0;
598 txb->payload_size = total_len; 597 txb->payload_size = fraglen;
599 598
600 skb_frag = txb->fragments[0]; 599 skb_frag = txb->fragments[0];
601 600