diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-21 14:58:47 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-21 14:58:47 -0400 |
commit | 9789089703c244ad766a13f441936736b6b1e709 (patch) | |
tree | 096e552a197400429a033f235fadd4ccbe886f01 | |
parent | 59b81827071a8ae7f399da533d268e1e33bfeeb7 (diff) | |
parent | 519a62bb8a0b0b383e6022cad6242cf63efc015c (diff) |
Merge rsync://bughost.org/repos/ieee80211-delta/
-rw-r--r-- | include/net/ieee80211.h | 2 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 3 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_tx.c | 23 |
3 files changed, 18 insertions, 10 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 58f62224e7ea..5e38dca1d082 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/kernel.h> /* ARRAY_SIZE */ | 29 | #include <linux/kernel.h> /* ARRAY_SIZE */ |
30 | #include <linux/wireless.h> | 30 | #include <linux/wireless.h> |
31 | 31 | ||
32 | #define IEEE80211_VERSION "git-1.1.5" | 32 | #define IEEE80211_VERSION "git-1.1.6" |
33 | 33 | ||
34 | #define IEEE80211_DATA_LEN 2304 | 34 | #define IEEE80211_DATA_LEN 2304 |
35 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section | 35 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section |
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 6b005cb0caa0..ce694cf5c160 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -409,7 +409,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
409 | return 1; | 409 | return 1; |
410 | } | 410 | } |
411 | 411 | ||
412 | if (is_multicast_ether_addr(hdr->addr1) ? ieee->host_mc_decrypt : | 412 | if ((is_multicast_ether_addr(hdr->addr1) || |
413 | is_broadcast_ether_addr(hdr->addr2)) ? ieee->host_mc_decrypt : | ||
413 | ieee->host_decrypt) { | 414 | ieee->host_decrypt) { |
414 | int idx = 0; | 415 | int idx = 0; |
415 | if (skb->len >= hdrlen + 3) | 416 | if (skb->len >= hdrlen + 3) |
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c index 42c50619aa8e..fb4509032402 100644 --- a/net/ieee80211/ieee80211_tx.c +++ b/net/ieee80211/ieee80211_tx.c | |||
@@ -157,11 +157,14 @@ static inline int ieee80211_encrypt_fragment(struct ieee80211_device *ieee, | |||
157 | struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx]; | 157 | struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx]; |
158 | int res; | 158 | int res; |
159 | 159 | ||
160 | if (crypt == NULL) | ||
161 | return -1; | ||
162 | |||
160 | /* To encrypt, frame format is: | 163 | /* To encrypt, frame format is: |
161 | * IV (4 bytes), clear payload (including SNAP), ICV (4 bytes) */ | 164 | * IV (4 bytes), clear payload (including SNAP), ICV (4 bytes) */ |
162 | atomic_inc(&crypt->refcnt); | 165 | atomic_inc(&crypt->refcnt); |
163 | res = 0; | 166 | res = 0; |
164 | if (crypt->ops->encrypt_mpdu) | 167 | if (crypt->ops && crypt->ops->encrypt_mpdu) |
165 | res = crypt->ops->encrypt_mpdu(frag, hdr_len, crypt->priv); | 168 | res = crypt->ops->encrypt_mpdu(frag, hdr_len, crypt->priv); |
166 | 169 | ||
167 | atomic_dec(&crypt->refcnt); | 170 | atomic_dec(&crypt->refcnt); |
@@ -187,7 +190,7 @@ void ieee80211_txb_free(struct ieee80211_txb *txb) | |||
187 | } | 190 | } |
188 | 191 | ||
189 | static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size, | 192 | static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size, |
190 | gfp_t gfp_mask) | 193 | int headroom, gfp_t gfp_mask) |
191 | { | 194 | { |
192 | struct ieee80211_txb *txb; | 195 | struct ieee80211_txb *txb; |
193 | int i; | 196 | int i; |
@@ -201,11 +204,13 @@ static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size, | |||
201 | txb->frag_size = txb_size; | 204 | txb->frag_size = txb_size; |
202 | 205 | ||
203 | for (i = 0; i < nr_frags; i++) { | 206 | for (i = 0; i < nr_frags; i++) { |
204 | txb->fragments[i] = dev_alloc_skb(txb_size); | 207 | txb->fragments[i] = __dev_alloc_skb(txb_size + headroom, |
208 | gfp_mask); | ||
205 | if (unlikely(!txb->fragments[i])) { | 209 | if (unlikely(!txb->fragments[i])) { |
206 | i--; | 210 | i--; |
207 | break; | 211 | break; |
208 | } | 212 | } |
213 | skb_reserve(txb->fragments[i], headroom); | ||
209 | } | 214 | } |
210 | if (unlikely(i != nr_frags)) { | 215 | if (unlikely(i != nr_frags)) { |
211 | while (i >= 0) | 216 | while (i >= 0) |
@@ -264,9 +269,9 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
264 | encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && | 269 | encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && |
265 | ieee->sec.encrypt; | 270 | ieee->sec.encrypt; |
266 | 271 | ||
267 | host_encrypt = ieee->host_encrypt && encrypt; | 272 | host_encrypt = ieee->host_encrypt && encrypt && crypt; |
268 | host_encrypt_msdu = ieee->host_encrypt_msdu && encrypt; | 273 | host_encrypt_msdu = ieee->host_encrypt_msdu && encrypt && crypt; |
269 | host_build_iv = ieee->host_build_iv && encrypt; | 274 | host_build_iv = ieee->host_build_iv && encrypt && crypt; |
270 | 275 | ||
271 | if (!encrypt && ieee->ieee802_1x && | 276 | if (!encrypt && ieee->ieee802_1x && |
272 | ieee->drop_unencrypted && ether_type != ETH_P_PAE) { | 277 | ieee->drop_unencrypted && ether_type != ETH_P_PAE) { |
@@ -338,7 +343,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
338 | if (host_encrypt || ieee->host_open_frag) { | 343 | if (host_encrypt || ieee->host_open_frag) { |
339 | /* Determine fragmentation size based on destination (multicast | 344 | /* Determine fragmentation size based on destination (multicast |
340 | * and broadcast are not fragmented) */ | 345 | * and broadcast are not fragmented) */ |
341 | if (is_multicast_ether_addr(dest)) | 346 | if (is_multicast_ether_addr(dest) || |
347 | is_broadcast_ether_addr(dest)) | ||
342 | frag_size = MAX_FRAG_THRESHOLD; | 348 | frag_size = MAX_FRAG_THRESHOLD; |
343 | else | 349 | else |
344 | frag_size = ieee->fts; | 350 | frag_size = ieee->fts; |
@@ -380,7 +386,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
380 | /* When we allocate the TXB we allocate enough space for the reserve | 386 | /* When we allocate the TXB we allocate enough space for the reserve |
381 | * and full fragment bytes (bytes_per_frag doesn't include prefix, | 387 | * and full fragment bytes (bytes_per_frag doesn't include prefix, |
382 | * postfix, header, FCS, etc.) */ | 388 | * postfix, header, FCS, etc.) */ |
383 | txb = ieee80211_alloc_txb(nr_frags, frag_size, GFP_ATOMIC); | 389 | txb = ieee80211_alloc_txb(nr_frags, frag_size, |
390 | ieee->tx_headroom, GFP_ATOMIC); | ||
384 | if (unlikely(!txb)) { | 391 | if (unlikely(!txb)) { |
385 | printk(KERN_WARNING "%s: Could not allocate TXB\n", | 392 | printk(KERN_WARNING "%s: Could not allocate TXB\n", |
386 | ieee->dev->name); | 393 | ieee->dev->name); |