Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32083
b: refs/heads/master
c: 4b30153
h: refs/heads/master
i:
  32081: c9be55c
  32079: a56cdb5
v: v3
  • Loading branch information
Hong Liu authored and Jeff Garzik committed Jul 5, 2006
1 parent 9775139 commit 0418144
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1d79aaaa564abc19b7bf3a024bb371fa7648a15
refs/heads/master: 4b301536694facb93f597281580f5ad907d36050
15 changes: 11 additions & 4 deletions trunk/net/ieee80211/ieee80211_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,13 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee,
struct net_device_stats *stats = &ieee->stats;
struct sk_buff *skb_frag;
int priority = -1;
int fraglen = total_len;
int headroom = ieee->tx_headroom;
struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];

spin_lock_irqsave(&ieee->lock, flags);

if (encrypt_mpdu && !ieee->sec.encrypt)
if (encrypt_mpdu && (!ieee->sec.encrypt || !crypt))
encrypt_mpdu = 0;

/* If there is no driver handler to take the TXB, dont' bother
Expand All @@ -581,20 +584,24 @@ int ieee80211_tx_frame(struct ieee80211_device *ieee,
goto success;
}

if (encrypt_mpdu)
if (encrypt_mpdu) {
frame->frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
fraglen += crypt->ops->extra_mpdu_prefix_len +
crypt->ops->extra_mpdu_postfix_len;
headroom += crypt->ops->extra_mpdu_prefix_len;
}

/* When we allocate the TXB we allocate enough space for the reserve
* and full fragment bytes (bytes_per_frag doesn't include prefix,
* postfix, header, FCS, etc.) */
txb = ieee80211_alloc_txb(1, total_len, ieee->tx_headroom, GFP_ATOMIC);
txb = ieee80211_alloc_txb(1, fraglen, headroom, GFP_ATOMIC);
if (unlikely(!txb)) {
printk(KERN_WARNING "%s: Could not allocate TXB\n",
ieee->dev->name);
goto failed;
}
txb->encrypted = 0;
txb->payload_size = total_len;
txb->payload_size = fraglen;

skb_frag = txb->fragments[0];

Expand Down

0 comments on commit 0418144

Please sign in to comment.