aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-01-31 13:48:20 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:01 -0500
commit9ae54c8463691b64ca6e6d8680787a6527810984 (patch)
tree02ace411ce3ba8eb8d1862852f52ff042fd59290 /net
parent78330fddec4e326af5e6aede0fc97824c690ba1d (diff)
mac80211: split ieee80211_txrx_result
The _DROP result will need to be split in the RX path but not in the TX path, so for preparation split up the type into two types, one for RX and one for TX. Also make sure (via sparse) that they cannot be confused. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_i.h23
-rw-r--r--net/mac80211/ieee80211_sta.c14
-rw-r--r--net/mac80211/rx.c150
-rw-r--r--net/mac80211/tx.c110
-rw-r--r--net/mac80211/wep.c16
-rw-r--r--net/mac80211/wep.h4
-rw-r--r--net/mac80211/wpa.c72
-rw-r--r--net/mac80211/wpa.h12
8 files changed, 204 insertions, 197 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ac802feb7655..36ea4fbdf950 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -108,9 +108,16 @@ struct ieee80211_sta_bss {
108}; 108};
109 109
110 110
111typedef enum { 111typedef unsigned __bitwise__ ieee80211_tx_result;
112 TXRX_CONTINUE, TXRX_DROP, TXRX_QUEUED 112#define TX_CONTINUE ((__force ieee80211_tx_result) 0u)
113} ieee80211_txrx_result; 113#define TX_DROP ((__force ieee80211_tx_result) 1u)
114#define TX_QUEUED ((__force ieee80211_tx_result) 2u)
115
116typedef unsigned __bitwise__ ieee80211_rx_result;
117#define RX_CONTINUE ((__force ieee80211_rx_result) 0u)
118#define RX_DROP ((__force ieee80211_rx_result) 1u)
119#define RX_QUEUED ((__force ieee80211_rx_result) 2u)
120
114 121
115/* flags used in struct ieee80211_txrx_data.flags */ 122/* flags used in struct ieee80211_txrx_data.flags */
116/* whether the MSDU was fragmented */ 123/* whether the MSDU was fragmented */
@@ -182,10 +189,10 @@ struct ieee80211_tx_stored_packet {
182 unsigned int last_frag_rate_ctrl_probe; 189 unsigned int last_frag_rate_ctrl_probe;
183}; 190};
184 191
185typedef ieee80211_txrx_result (*ieee80211_tx_handler) 192typedef ieee80211_tx_result (*ieee80211_tx_handler)
186(struct ieee80211_txrx_data *tx); 193(struct ieee80211_txrx_data *tx);
187 194
188typedef ieee80211_txrx_result (*ieee80211_rx_handler) 195typedef ieee80211_rx_result (*ieee80211_rx_handler)
189(struct ieee80211_txrx_data *rx); 196(struct ieee80211_txrx_data *rx);
190 197
191struct beacon_data { 198struct beacon_data {
@@ -729,9 +736,9 @@ int ieee80211_sta_req_scan(struct net_device *dev, u8 *ssid, size_t ssid_len);
729void ieee80211_sta_req_auth(struct net_device *dev, 736void ieee80211_sta_req_auth(struct net_device *dev,
730 struct ieee80211_if_sta *ifsta); 737 struct ieee80211_if_sta *ifsta);
731int ieee80211_sta_scan_results(struct net_device *dev, char *buf, size_t len); 738int ieee80211_sta_scan_results(struct net_device *dev, char *buf, size_t len);
732ieee80211_txrx_result ieee80211_sta_rx_scan(struct net_device *dev, 739ieee80211_rx_result ieee80211_sta_rx_scan(
733 struct sk_buff *skb, 740 struct net_device *dev, struct sk_buff *skb,
734 struct ieee80211_rx_status *rx_status); 741 struct ieee80211_rx_status *rx_status);
735void ieee80211_rx_bss_list_init(struct net_device *dev); 742void ieee80211_rx_bss_list_init(struct net_device *dev);
736void ieee80211_rx_bss_list_deinit(struct net_device *dev); 743void ieee80211_rx_bss_list_deinit(struct net_device *dev);
737int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len); 744int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len);
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index dac02d001ef0..991689371bdc 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2559,7 +2559,7 @@ static void ieee80211_sta_rx_queued_mgmt(struct net_device *dev,
2559} 2559}
2560 2560
2561 2561
2562ieee80211_txrx_result 2562ieee80211_rx_result
2563ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb, 2563ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb,
2564 struct ieee80211_rx_status *rx_status) 2564 struct ieee80211_rx_status *rx_status)
2565{ 2565{
@@ -2567,31 +2567,31 @@ ieee80211_sta_rx_scan(struct net_device *dev, struct sk_buff *skb,
2567 u16 fc; 2567 u16 fc;
2568 2568
2569 if (skb->len < 2) 2569 if (skb->len < 2)
2570 return TXRX_DROP; 2570 return RX_DROP;
2571 2571
2572 mgmt = (struct ieee80211_mgmt *) skb->data; 2572 mgmt = (struct ieee80211_mgmt *) skb->data;
2573 fc = le16_to_cpu(mgmt->frame_control); 2573 fc = le16_to_cpu(mgmt->frame_control);
2574 2574
2575 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) 2575 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL)
2576 return TXRX_CONTINUE; 2576 return RX_CONTINUE;
2577 2577
2578 if (skb->len < 24) 2578 if (skb->len < 24)
2579 return TXRX_DROP; 2579 return RX_DROP;
2580 2580
2581 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { 2581 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) {
2582 if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) { 2582 if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP) {
2583 ieee80211_rx_mgmt_probe_resp(dev, mgmt, 2583 ieee80211_rx_mgmt_probe_resp(dev, mgmt,
2584 skb->len, rx_status); 2584 skb->len, rx_status);
2585 dev_kfree_skb(skb); 2585 dev_kfree_skb(skb);
2586 return TXRX_QUEUED; 2586 return RX_QUEUED;
2587 } else if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) { 2587 } else if ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) {
2588 ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len, 2588 ieee80211_rx_mgmt_beacon(dev, mgmt, skb->len,
2589 rx_status); 2589 rx_status);
2590 dev_kfree_skb(skb); 2590 dev_kfree_skb(skb);
2591 return TXRX_QUEUED; 2591 return RX_QUEUED;
2592 } 2592 }
2593 } 2593 }
2594 return TXRX_CONTINUE; 2594 return RX_CONTINUE;
2595} 2595}
2596 2596
2597 2597
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 0989c212b7c2..ffd68d9a0013 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -351,16 +351,16 @@ static u32 ieee80211_rx_load_stats(struct ieee80211_local *local,
351 351
352/* rx handlers */ 352/* rx handlers */
353 353
354static ieee80211_txrx_result 354static ieee80211_rx_result
355ieee80211_rx_h_if_stats(struct ieee80211_txrx_data *rx) 355ieee80211_rx_h_if_stats(struct ieee80211_txrx_data *rx)
356{ 356{
357 if (rx->sta) 357 if (rx->sta)
358 rx->sta->channel_use_raw += rx->u.rx.load; 358 rx->sta->channel_use_raw += rx->u.rx.load;
359 rx->sdata->channel_use_raw += rx->u.rx.load; 359 rx->sdata->channel_use_raw += rx->u.rx.load;
360 return TXRX_CONTINUE; 360 return RX_CONTINUE;
361} 361}
362 362
363static ieee80211_txrx_result 363static ieee80211_rx_result
364ieee80211_rx_h_passive_scan(struct ieee80211_txrx_data *rx) 364ieee80211_rx_h_passive_scan(struct ieee80211_txrx_data *rx)
365{ 365{
366 struct ieee80211_local *local = rx->local; 366 struct ieee80211_local *local = rx->local;
@@ -372,21 +372,21 @@ ieee80211_rx_h_passive_scan(struct ieee80211_txrx_data *rx)
372 if (unlikely(local->sta_sw_scanning)) { 372 if (unlikely(local->sta_sw_scanning)) {
373 /* drop all the other packets during a software scan anyway */ 373 /* drop all the other packets during a software scan anyway */
374 if (ieee80211_sta_rx_scan(rx->dev, skb, rx->u.rx.status) 374 if (ieee80211_sta_rx_scan(rx->dev, skb, rx->u.rx.status)
375 != TXRX_QUEUED) 375 != RX_QUEUED)
376 dev_kfree_skb(skb); 376 dev_kfree_skb(skb);
377 return TXRX_QUEUED; 377 return RX_QUEUED;
378 } 378 }
379 379
380 if (unlikely(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) { 380 if (unlikely(rx->flags & IEEE80211_TXRXD_RXIN_SCAN)) {
381 /* scanning finished during invoking of handlers */ 381 /* scanning finished during invoking of handlers */
382 I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); 382 I802_DEBUG_INC(local->rx_handlers_drop_passive_scan);
383 return TXRX_DROP; 383 return RX_DROP;
384 } 384 }
385 385
386 return TXRX_CONTINUE; 386 return RX_CONTINUE;
387} 387}
388 388
389static ieee80211_txrx_result 389static ieee80211_rx_result
390ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) 390ieee80211_rx_h_check(struct ieee80211_txrx_data *rx)
391{ 391{
392 struct ieee80211_hdr *hdr; 392 struct ieee80211_hdr *hdr;
@@ -401,14 +401,14 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx)
401 rx->local->dot11FrameDuplicateCount++; 401 rx->local->dot11FrameDuplicateCount++;
402 rx->sta->num_duplicates++; 402 rx->sta->num_duplicates++;
403 } 403 }
404 return TXRX_DROP; 404 return RX_DROP;
405 } else 405 } else
406 rx->sta->last_seq_ctrl[rx->u.rx.queue] = hdr->seq_ctrl; 406 rx->sta->last_seq_ctrl[rx->u.rx.queue] = hdr->seq_ctrl;
407 } 407 }
408 408
409 if (unlikely(rx->skb->len < 16)) { 409 if (unlikely(rx->skb->len < 16)) {
410 I802_DEBUG_INC(rx->local->rx_handlers_drop_short); 410 I802_DEBUG_INC(rx->local->rx_handlers_drop_short);
411 return TXRX_DROP; 411 return RX_DROP;
412 } 412 }
413 413
414 /* Drop disallowed frame classes based on STA auth/assoc state; 414 /* Drop disallowed frame classes based on STA auth/assoc state;
@@ -430,23 +430,23 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx)
430 || !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) { 430 || !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) {
431 /* Drop IBSS frames and frames for other hosts 431 /* Drop IBSS frames and frames for other hosts
432 * silently. */ 432 * silently. */
433 return TXRX_DROP; 433 return RX_DROP;
434 } 434 }
435 435
436 return TXRX_DROP; 436 return RX_DROP;
437 } 437 }
438 438
439 return TXRX_CONTINUE; 439 return RX_CONTINUE;
440} 440}
441 441
442 442
443static ieee80211_txrx_result 443static ieee80211_rx_result
444ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) 444ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
445{ 445{
446 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; 446 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data;
447 int keyidx; 447 int keyidx;
448 int hdrlen; 448 int hdrlen;
449 ieee80211_txrx_result result = TXRX_DROP; 449 ieee80211_rx_result result = RX_DROP;
450 struct ieee80211_key *stakey = NULL; 450 struct ieee80211_key *stakey = NULL;
451 451
452 /* 452 /*
@@ -476,14 +476,14 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
476 */ 476 */
477 477
478 if (!(rx->fc & IEEE80211_FCTL_PROTECTED)) 478 if (!(rx->fc & IEEE80211_FCTL_PROTECTED))
479 return TXRX_CONTINUE; 479 return RX_CONTINUE;
480 480
481 /* 481 /*
482 * No point in finding a key and decrypting if the frame is neither 482 * No point in finding a key and decrypting if the frame is neither
483 * addressed to us nor a multicast frame. 483 * addressed to us nor a multicast frame.
484 */ 484 */
485 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) 485 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH))
486 return TXRX_CONTINUE; 486 return RX_CONTINUE;
487 487
488 if (rx->sta) 488 if (rx->sta)
489 stakey = rcu_dereference(rx->sta->key); 489 stakey = rcu_dereference(rx->sta->key);
@@ -502,12 +502,12 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
502 */ 502 */
503 if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && 503 if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) &&
504 (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) 504 (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED))
505 return TXRX_CONTINUE; 505 return RX_CONTINUE;
506 506
507 hdrlen = ieee80211_get_hdrlen(rx->fc); 507 hdrlen = ieee80211_get_hdrlen(rx->fc);
508 508
509 if (rx->skb->len < 8 + hdrlen) 509 if (rx->skb->len < 8 + hdrlen)
510 return TXRX_DROP; /* TODO: count this? */ 510 return RX_DROP; /* TODO: count this? */
511 511
512 /* 512 /*
513 * no need to call ieee80211_wep_get_keyidx, 513 * no need to call ieee80211_wep_get_keyidx,
@@ -536,7 +536,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
536 printk(KERN_DEBUG "%s: RX protected frame," 536 printk(KERN_DEBUG "%s: RX protected frame,"
537 " but have no key\n", rx->dev->name); 537 " but have no key\n", rx->dev->name);
538#endif /* CONFIG_MAC80211_DEBUG */ 538#endif /* CONFIG_MAC80211_DEBUG */
539 return TXRX_DROP; 539 return RX_DROP;
540 } 540 }
541 541
542 /* Check for weak IVs if possible */ 542 /* Check for weak IVs if possible */
@@ -629,7 +629,7 @@ static int ap_sta_ps_end(struct net_device *dev, struct sta_info *sta)
629 return sent; 629 return sent;
630} 630}
631 631
632static ieee80211_txrx_result 632static ieee80211_rx_result
633ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx) 633ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx)
634{ 634{
635 struct sta_info *sta = rx->sta; 635 struct sta_info *sta = rx->sta;
@@ -637,7 +637,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx)
637 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; 637 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data;
638 638
639 if (!sta) 639 if (!sta)
640 return TXRX_CONTINUE; 640 return RX_CONTINUE;
641 641
642 /* Update last_rx only for IBSS packets which are for the current 642 /* Update last_rx only for IBSS packets which are for the current
643 * BSSID to avoid keeping the current IBSS network alive in cases where 643 * BSSID to avoid keeping the current IBSS network alive in cases where
@@ -658,7 +658,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx)
658 } 658 }
659 659
660 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) 660 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH))
661 return TXRX_CONTINUE; 661 return RX_CONTINUE;
662 662
663 sta->rx_fragments++; 663 sta->rx_fragments++;
664 sta->rx_bytes += rx->skb->len; 664 sta->rx_bytes += rx->skb->len;
@@ -685,10 +685,10 @@ ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx)
685 * as a dropped packed. */ 685 * as a dropped packed. */
686 sta->rx_packets++; 686 sta->rx_packets++;
687 dev_kfree_skb(rx->skb); 687 dev_kfree_skb(rx->skb);
688 return TXRX_QUEUED; 688 return RX_QUEUED;
689 } 689 }
690 690
691 return TXRX_CONTINUE; 691 return RX_CONTINUE;
692} /* ieee80211_rx_h_sta_process */ 692} /* ieee80211_rx_h_sta_process */
693 693
694static inline struct ieee80211_fragment_entry * 694static inline struct ieee80211_fragment_entry *
@@ -774,7 +774,7 @@ ieee80211_reassemble_find(struct ieee80211_sub_if_data *sdata,
774 return NULL; 774 return NULL;
775} 775}
776 776
777static ieee80211_txrx_result 777static ieee80211_rx_result
778ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) 778ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
779{ 779{
780 struct ieee80211_hdr *hdr; 780 struct ieee80211_hdr *hdr;
@@ -811,7 +811,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
811 rx->key->u.ccmp.rx_pn[rx->u.rx.queue], 811 rx->key->u.ccmp.rx_pn[rx->u.rx.queue],
812 CCMP_PN_LEN); 812 CCMP_PN_LEN);
813 } 813 }
814 return TXRX_QUEUED; 814 return RX_QUEUED;
815 } 815 }
816 816
817 /* This is a fragment for a frame that should already be pending in 817 /* This is a fragment for a frame that should already be pending in
@@ -821,7 +821,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
821 rx->u.rx.queue, hdr); 821 rx->u.rx.queue, hdr);
822 if (!entry) { 822 if (!entry) {
823 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); 823 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag);
824 return TXRX_DROP; 824 return RX_DROP;
825 } 825 }
826 826
827 /* Verify that MPDUs within one MSDU have sequential PN values. 827 /* Verify that MPDUs within one MSDU have sequential PN values.
@@ -830,7 +830,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
830 int i; 830 int i;
831 u8 pn[CCMP_PN_LEN], *rpn; 831 u8 pn[CCMP_PN_LEN], *rpn;
832 if (!rx->key || rx->key->conf.alg != ALG_CCMP) 832 if (!rx->key || rx->key->conf.alg != ALG_CCMP)
833 return TXRX_DROP; 833 return RX_DROP;
834 memcpy(pn, entry->last_pn, CCMP_PN_LEN); 834 memcpy(pn, entry->last_pn, CCMP_PN_LEN);
835 for (i = CCMP_PN_LEN - 1; i >= 0; i--) { 835 for (i = CCMP_PN_LEN - 1; i >= 0; i--) {
836 pn[i]++; 836 pn[i]++;
@@ -848,7 +848,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
848 rpn[0], rpn[1], rpn[2], rpn[3], rpn[4], 848 rpn[0], rpn[1], rpn[2], rpn[3], rpn[4],
849 rpn[5], pn[0], pn[1], pn[2], pn[3], 849 rpn[5], pn[0], pn[1], pn[2], pn[3],
850 pn[4], pn[5]); 850 pn[4], pn[5]);
851 return TXRX_DROP; 851 return RX_DROP;
852 } 852 }
853 memcpy(entry->last_pn, pn, CCMP_PN_LEN); 853 memcpy(entry->last_pn, pn, CCMP_PN_LEN);
854 } 854 }
@@ -859,7 +859,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
859 entry->extra_len += rx->skb->len; 859 entry->extra_len += rx->skb->len;
860 if (rx->fc & IEEE80211_FCTL_MOREFRAGS) { 860 if (rx->fc & IEEE80211_FCTL_MOREFRAGS) {
861 rx->skb = NULL; 861 rx->skb = NULL;
862 return TXRX_QUEUED; 862 return RX_QUEUED;
863 } 863 }
864 864
865 rx->skb = __skb_dequeue(&entry->skb_list); 865 rx->skb = __skb_dequeue(&entry->skb_list);
@@ -869,7 +869,7 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
869 GFP_ATOMIC))) { 869 GFP_ATOMIC))) {
870 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); 870 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag);
871 __skb_queue_purge(&entry->skb_list); 871 __skb_queue_purge(&entry->skb_list);
872 return TXRX_DROP; 872 return RX_DROP;
873 } 873 }
874 } 874 }
875 while ((skb = __skb_dequeue(&entry->skb_list))) { 875 while ((skb = __skb_dequeue(&entry->skb_list))) {
@@ -887,10 +887,10 @@ ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx)
887 rx->local->dot11MulticastReceivedFrameCount++; 887 rx->local->dot11MulticastReceivedFrameCount++;
888 else 888 else
889 ieee80211_led_rx(rx->local); 889 ieee80211_led_rx(rx->local);
890 return TXRX_CONTINUE; 890 return RX_CONTINUE;
891} 891}
892 892
893static ieee80211_txrx_result 893static ieee80211_rx_result
894ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx) 894ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
895{ 895{
896 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); 896 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev);
@@ -902,11 +902,11 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
902 (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL || 902 (rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL ||
903 (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PSPOLL || 903 (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PSPOLL ||
904 !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH))) 904 !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)))
905 return TXRX_CONTINUE; 905 return RX_CONTINUE;
906 906
907 if ((sdata->vif.type != IEEE80211_IF_TYPE_AP) && 907 if ((sdata->vif.type != IEEE80211_IF_TYPE_AP) &&
908 (sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) 908 (sdata->vif.type != IEEE80211_IF_TYPE_VLAN))
909 return TXRX_DROP; 909 return RX_DROP;
910 910
911 skb = skb_dequeue(&rx->sta->tx_filtered); 911 skb = skb_dequeue(&rx->sta->tx_filtered);
912 if (!skb) { 912 if (!skb) {
@@ -957,14 +957,14 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
957 957
958 } 958 }
959 959
960 /* Free PS Poll skb here instead of returning TXRX_DROP that would 960 /* Free PS Poll skb here instead of returning RX_DROP that would
961 * count as an dropped frame. */ 961 * count as an dropped frame. */
962 dev_kfree_skb(rx->skb); 962 dev_kfree_skb(rx->skb);
963 963
964 return TXRX_QUEUED; 964 return RX_QUEUED;
965} 965}
966 966
967static ieee80211_txrx_result 967static ieee80211_rx_result
968ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx) 968ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx)
969{ 969{
970 u16 fc = rx->fc; 970 u16 fc = rx->fc;
@@ -972,7 +972,7 @@ ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx)
972 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) data; 972 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) data;
973 973
974 if (!WLAN_FC_IS_QOS_DATA(fc)) 974 if (!WLAN_FC_IS_QOS_DATA(fc))
975 return TXRX_CONTINUE; 975 return RX_CONTINUE;
976 976
977 /* remove the qos control field, update frame type and meta-data */ 977 /* remove the qos control field, update frame type and meta-data */
978 memmove(data + 2, data, ieee80211_get_hdrlen(fc) - 2); 978 memmove(data + 2, data, ieee80211_get_hdrlen(fc) - 2);
@@ -981,7 +981,7 @@ ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx)
981 rx->fc = fc &= ~IEEE80211_STYPE_QOS_DATA; 981 rx->fc = fc &= ~IEEE80211_STYPE_QOS_DATA;
982 hdr->frame_control = cpu_to_le16(fc); 982 hdr->frame_control = cpu_to_le16(fc);
983 983
984 return TXRX_CONTINUE; 984 return RX_CONTINUE;
985} 985}
986 986
987static int 987static int
@@ -1238,7 +1238,7 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx)
1238 } 1238 }
1239} 1239}
1240 1240
1241static ieee80211_txrx_result 1241static ieee80211_rx_result
1242ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) 1242ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1243{ 1243{
1244 struct net_device *dev = rx->dev; 1244 struct net_device *dev = rx->dev;
@@ -1254,17 +1254,17 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1254 1254
1255 fc = rx->fc; 1255 fc = rx->fc;
1256 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)) 1256 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA))
1257 return TXRX_CONTINUE; 1257 return RX_CONTINUE;
1258 1258
1259 if (unlikely(!WLAN_FC_DATA_PRESENT(fc))) 1259 if (unlikely(!WLAN_FC_DATA_PRESENT(fc)))
1260 return TXRX_DROP; 1260 return RX_DROP;
1261 1261
1262 if (!(rx->flags & IEEE80211_TXRXD_RX_AMSDU)) 1262 if (!(rx->flags & IEEE80211_TXRXD_RX_AMSDU))
1263 return TXRX_CONTINUE; 1263 return RX_CONTINUE;
1264 1264
1265 err = ieee80211_data_to_8023(rx); 1265 err = ieee80211_data_to_8023(rx);
1266 if (unlikely(err)) 1266 if (unlikely(err))
1267 return TXRX_DROP; 1267 return RX_DROP;
1268 1268
1269 skb->dev = dev; 1269 skb->dev = dev;
1270 1270
@@ -1274,7 +1274,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1274 /* skip the wrapping header */ 1274 /* skip the wrapping header */
1275 eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr)); 1275 eth = (struct ethhdr *) skb_pull(skb, sizeof(struct ethhdr));
1276 if (!eth) 1276 if (!eth)
1277 return TXRX_DROP; 1277 return RX_DROP;
1278 1278
1279 while (skb != frame) { 1279 while (skb != frame) {
1280 u8 padding; 1280 u8 padding;
@@ -1289,7 +1289,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1289 /* the last MSDU has no padding */ 1289 /* the last MSDU has no padding */
1290 if (subframe_len > remaining) { 1290 if (subframe_len > remaining) {
1291 printk(KERN_DEBUG "%s: wrong buffer size", dev->name); 1291 printk(KERN_DEBUG "%s: wrong buffer size", dev->name);
1292 return TXRX_DROP; 1292 return RX_DROP;
1293 } 1293 }
1294 1294
1295 skb_pull(skb, sizeof(struct ethhdr)); 1295 skb_pull(skb, sizeof(struct ethhdr));
@@ -1301,7 +1301,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1301 subframe_len); 1301 subframe_len);
1302 1302
1303 if (frame == NULL) 1303 if (frame == NULL)
1304 return TXRX_DROP; 1304 return RX_DROP;
1305 1305
1306 skb_reserve(frame, local->hw.extra_tx_headroom + 1306 skb_reserve(frame, local->hw.extra_tx_headroom +
1307 sizeof(struct ethhdr)); 1307 sizeof(struct ethhdr));
@@ -1314,7 +1314,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1314 printk(KERN_DEBUG "%s: wrong buffer size ", 1314 printk(KERN_DEBUG "%s: wrong buffer size ",
1315 dev->name); 1315 dev->name);
1316 dev_kfree_skb(frame); 1316 dev_kfree_skb(frame);
1317 return TXRX_DROP; 1317 return RX_DROP;
1318 } 1318 }
1319 } 1319 }
1320 1320
@@ -1344,7 +1344,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1344 1344
1345 if (!ieee80211_frame_allowed(rx)) { 1345 if (!ieee80211_frame_allowed(rx)) {
1346 if (skb == frame) /* last frame */ 1346 if (skb == frame) /* last frame */
1347 return TXRX_DROP; 1347 return RX_DROP;
1348 dev_kfree_skb(frame); 1348 dev_kfree_skb(frame);
1349 continue; 1349 continue;
1350 } 1350 }
@@ -1352,10 +1352,10 @@ ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx)
1352 ieee80211_deliver_skb(rx); 1352 ieee80211_deliver_skb(rx);
1353 } 1353 }
1354 1354
1355 return TXRX_QUEUED; 1355 return RX_QUEUED;
1356} 1356}
1357 1357
1358static ieee80211_txrx_result 1358static ieee80211_rx_result
1359ieee80211_rx_h_data(struct ieee80211_txrx_data *rx) 1359ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
1360{ 1360{
1361 struct net_device *dev = rx->dev; 1361 struct net_device *dev = rx->dev;
@@ -1364,17 +1364,17 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
1364 1364
1365 fc = rx->fc; 1365 fc = rx->fc;
1366 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)) 1366 if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA))
1367 return TXRX_CONTINUE; 1367 return RX_CONTINUE;
1368 1368
1369 if (unlikely(!WLAN_FC_DATA_PRESENT(fc))) 1369 if (unlikely(!WLAN_FC_DATA_PRESENT(fc)))
1370 return TXRX_DROP; 1370 return RX_DROP;
1371 1371
1372 err = ieee80211_data_to_8023(rx); 1372 err = ieee80211_data_to_8023(rx);
1373 if (unlikely(err)) 1373 if (unlikely(err))
1374 return TXRX_DROP; 1374 return RX_DROP;
1375 1375
1376 if (!ieee80211_frame_allowed(rx)) 1376 if (!ieee80211_frame_allowed(rx))
1377 return TXRX_DROP; 1377 return RX_DROP;
1378 1378
1379 rx->skb->dev = dev; 1379 rx->skb->dev = dev;
1380 1380
@@ -1383,10 +1383,10 @@ ieee80211_rx_h_data(struct ieee80211_txrx_data *rx)
1383 1383
1384 ieee80211_deliver_skb(rx); 1384 ieee80211_deliver_skb(rx);
1385 1385
1386 return TXRX_QUEUED; 1386 return RX_QUEUED;
1387} 1387}
1388 1388
1389static ieee80211_txrx_result 1389static ieee80211_rx_result
1390ieee80211_rx_h_ctrl(struct ieee80211_txrx_data *rx) 1390ieee80211_rx_h_ctrl(struct ieee80211_txrx_data *rx)
1391{ 1391{
1392 struct ieee80211_local *local = rx->local; 1392 struct ieee80211_local *local = rx->local;
@@ -1398,15 +1398,15 @@ ieee80211_rx_h_ctrl(struct ieee80211_txrx_data *rx)
1398 u16 tid; 1398 u16 tid;
1399 1399
1400 if (likely((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL)) 1400 if (likely((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_CTL))
1401 return TXRX_CONTINUE; 1401 return RX_CONTINUE;
1402 1402
1403 if ((rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BACK_REQ) { 1403 if ((rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BACK_REQ) {
1404 if (!rx->sta) 1404 if (!rx->sta)
1405 return TXRX_CONTINUE; 1405 return RX_CONTINUE;
1406 tid = le16_to_cpu(bar->control) >> 12; 1406 tid = le16_to_cpu(bar->control) >> 12;
1407 tid_agg_rx = &(rx->sta->ampdu_mlme.tid_rx[tid]); 1407 tid_agg_rx = &(rx->sta->ampdu_mlme.tid_rx[tid]);
1408 if (tid_agg_rx->state != HT_AGG_STATE_OPERATIONAL) 1408 if (tid_agg_rx->state != HT_AGG_STATE_OPERATIONAL)
1409 return TXRX_CONTINUE; 1409 return RX_CONTINUE;
1410 1410
1411 start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4; 1411 start_seq_num = le16_to_cpu(bar->start_seq_num) >> 4;
1412 1412
@@ -1423,19 +1423,19 @@ ieee80211_rx_h_ctrl(struct ieee80211_txrx_data *rx)
1423 ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, NULL, 1423 ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, NULL,
1424 start_seq_num, 1); 1424 start_seq_num, 1);
1425 rcu_read_unlock(); 1425 rcu_read_unlock();
1426 return TXRX_DROP; 1426 return RX_DROP;
1427 } 1427 }
1428 1428
1429 return TXRX_CONTINUE; 1429 return RX_CONTINUE;
1430} 1430}
1431 1431
1432static ieee80211_txrx_result 1432static ieee80211_rx_result
1433ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx) 1433ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx)
1434{ 1434{
1435 struct ieee80211_sub_if_data *sdata; 1435 struct ieee80211_sub_if_data *sdata;
1436 1436
1437 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) 1437 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH))
1438 return TXRX_DROP; 1438 return RX_DROP;
1439 1439
1440 sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); 1440 sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev);
1441 if ((sdata->vif.type == IEEE80211_IF_TYPE_STA || 1441 if ((sdata->vif.type == IEEE80211_IF_TYPE_STA ||
@@ -1443,39 +1443,39 @@ ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx)
1443 !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) 1443 !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME))
1444 ieee80211_sta_rx_mgmt(rx->dev, rx->skb, rx->u.rx.status); 1444 ieee80211_sta_rx_mgmt(rx->dev, rx->skb, rx->u.rx.status);
1445 else 1445 else
1446 return TXRX_DROP; 1446 return RX_DROP;
1447 1447
1448 return TXRX_QUEUED; 1448 return RX_QUEUED;
1449} 1449}
1450 1450
1451static inline ieee80211_txrx_result __ieee80211_invoke_rx_handlers( 1451static inline ieee80211_rx_result __ieee80211_invoke_rx_handlers(
1452 struct ieee80211_local *local, 1452 struct ieee80211_local *local,
1453 ieee80211_rx_handler *handlers, 1453 ieee80211_rx_handler *handlers,
1454 struct ieee80211_txrx_data *rx, 1454 struct ieee80211_txrx_data *rx,
1455 struct sta_info *sta) 1455 struct sta_info *sta)
1456{ 1456{
1457 ieee80211_rx_handler *handler; 1457 ieee80211_rx_handler *handler;
1458 ieee80211_txrx_result res = TXRX_DROP; 1458 ieee80211_rx_result res = RX_DROP;
1459 1459
1460 for (handler = handlers; *handler != NULL; handler++) { 1460 for (handler = handlers; *handler != NULL; handler++) {
1461 res = (*handler)(rx); 1461 res = (*handler)(rx);
1462 1462
1463 switch (res) { 1463 switch (res) {
1464 case TXRX_CONTINUE: 1464 case RX_CONTINUE:
1465 continue; 1465 continue;
1466 case TXRX_DROP: 1466 case RX_DROP:
1467 I802_DEBUG_INC(local->rx_handlers_drop); 1467 I802_DEBUG_INC(local->rx_handlers_drop);
1468 if (sta) 1468 if (sta)
1469 sta->rx_dropped++; 1469 sta->rx_dropped++;
1470 break; 1470 break;
1471 case TXRX_QUEUED: 1471 case RX_QUEUED:
1472 I802_DEBUG_INC(local->rx_handlers_queued); 1472 I802_DEBUG_INC(local->rx_handlers_queued);
1473 break; 1473 break;
1474 } 1474 }
1475 break; 1475 break;
1476 } 1476 }
1477 1477
1478 if (res == TXRX_DROP) 1478 if (res == RX_DROP)
1479 dev_kfree_skb(rx->skb); 1479 dev_kfree_skb(rx->skb);
1480 return res; 1480 return res;
1481} 1481}
@@ -1486,7 +1486,7 @@ static inline void ieee80211_invoke_rx_handlers(struct ieee80211_local *local,
1486 struct sta_info *sta) 1486 struct sta_info *sta)
1487{ 1487{
1488 if (__ieee80211_invoke_rx_handlers(local, handlers, rx, sta) == 1488 if (__ieee80211_invoke_rx_handlers(local, handlers, rx, sta) ==
1489 TXRX_CONTINUE) 1489 RX_CONTINUE)
1490 dev_kfree_skb(rx->skb); 1490 dev_kfree_skb(rx->skb);
1491} 1491}
1492 1492
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2b4746441232..0cba4a214876 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -232,7 +232,7 @@ static int inline is_ieee80211_device(struct net_device *dev,
232 232
233/* tx handlers */ 233/* tx handlers */
234 234
235static ieee80211_txrx_result 235static ieee80211_tx_result
236ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx) 236ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
237{ 237{
238#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 238#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -242,15 +242,15 @@ ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
242 u32 sta_flags; 242 u32 sta_flags;
243 243
244 if (unlikely(tx->flags & IEEE80211_TXRXD_TX_INJECTED)) 244 if (unlikely(tx->flags & IEEE80211_TXRXD_TX_INJECTED))
245 return TXRX_CONTINUE; 245 return TX_CONTINUE;
246 246
247 if (unlikely(tx->local->sta_sw_scanning) && 247 if (unlikely(tx->local->sta_sw_scanning) &&
248 ((tx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || 248 ((tx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT ||
249 (tx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PROBE_REQ)) 249 (tx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_PROBE_REQ))
250 return TXRX_DROP; 250 return TX_DROP;
251 251
252 if (tx->flags & IEEE80211_TXRXD_TXPS_BUFFERED) 252 if (tx->flags & IEEE80211_TXRXD_TXPS_BUFFERED)
253 return TXRX_CONTINUE; 253 return TX_CONTINUE;
254 254
255 sta_flags = tx->sta ? tx->sta->flags : 0; 255 sta_flags = tx->sta ? tx->sta->flags : 0;
256 256
@@ -265,7 +265,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
265 tx->dev->name, print_mac(mac, hdr->addr1)); 265 tx->dev->name, print_mac(mac, hdr->addr1));
266#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 266#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
267 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); 267 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc);
268 return TXRX_DROP; 268 return TX_DROP;
269 } 269 }
270 } else { 270 } else {
271 if (unlikely((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA && 271 if (unlikely((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA &&
@@ -275,15 +275,15 @@ ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
275 * No associated STAs - no need to send multicast 275 * No associated STAs - no need to send multicast
276 * frames. 276 * frames.
277 */ 277 */
278 return TXRX_DROP; 278 return TX_DROP;
279 } 279 }
280 return TXRX_CONTINUE; 280 return TX_CONTINUE;
281 } 281 }
282 282
283 return TXRX_CONTINUE; 283 return TX_CONTINUE;
284} 284}
285 285
286static ieee80211_txrx_result 286static ieee80211_tx_result
287ieee80211_tx_h_sequence(struct ieee80211_txrx_data *tx) 287ieee80211_tx_h_sequence(struct ieee80211_txrx_data *tx)
288{ 288{
289 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; 289 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
@@ -291,7 +291,7 @@ ieee80211_tx_h_sequence(struct ieee80211_txrx_data *tx)
291 if (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control)) >= 24) 291 if (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control)) >= 24)
292 ieee80211_include_sequence(tx->sdata, hdr); 292 ieee80211_include_sequence(tx->sdata, hdr);
293 293
294 return TXRX_CONTINUE; 294 return TX_CONTINUE;
295} 295}
296 296
297/* This function is called whenever the AP is about to exceed the maximum limit 297/* This function is called whenever the AP is about to exceed the maximum limit
@@ -341,7 +341,7 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
341 wiphy_name(local->hw.wiphy), purged); 341 wiphy_name(local->hw.wiphy), purged);
342} 342}
343 343
344static ieee80211_txrx_result 344static ieee80211_tx_result
345ieee80211_tx_h_multicast_ps_buf(struct ieee80211_txrx_data *tx) 345ieee80211_tx_h_multicast_ps_buf(struct ieee80211_txrx_data *tx)
346{ 346{
347 /* 347 /*
@@ -354,11 +354,11 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_txrx_data *tx)
354 354
355 /* not AP/IBSS or ordered frame */ 355 /* not AP/IBSS or ordered frame */
356 if (!tx->sdata->bss || (tx->fc & IEEE80211_FCTL_ORDER)) 356 if (!tx->sdata->bss || (tx->fc & IEEE80211_FCTL_ORDER))
357 return TXRX_CONTINUE; 357 return TX_CONTINUE;
358 358
359 /* no stations in PS mode */ 359 /* no stations in PS mode */
360 if (!atomic_read(&tx->sdata->bss->num_sta_ps)) 360 if (!atomic_read(&tx->sdata->bss->num_sta_ps))
361 return TXRX_CONTINUE; 361 return TX_CONTINUE;
362 362
363 /* buffered in mac80211 */ 363 /* buffered in mac80211 */
364 if (tx->local->hw.flags & IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING) { 364 if (tx->local->hw.flags & IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING) {
@@ -375,16 +375,16 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_txrx_data *tx)
375 } else 375 } else
376 tx->local->total_ps_buffered++; 376 tx->local->total_ps_buffered++;
377 skb_queue_tail(&tx->sdata->bss->ps_bc_buf, tx->skb); 377 skb_queue_tail(&tx->sdata->bss->ps_bc_buf, tx->skb);
378 return TXRX_QUEUED; 378 return TX_QUEUED;
379 } 379 }
380 380
381 /* buffered in hardware */ 381 /* buffered in hardware */
382 tx->u.tx.control->flags |= IEEE80211_TXCTL_SEND_AFTER_DTIM; 382 tx->u.tx.control->flags |= IEEE80211_TXCTL_SEND_AFTER_DTIM;
383 383
384 return TXRX_CONTINUE; 384 return TX_CONTINUE;
385} 385}
386 386
387static ieee80211_txrx_result 387static ieee80211_tx_result
388ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx) 388ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
389{ 389{
390 struct sta_info *sta = tx->sta; 390 struct sta_info *sta = tx->sta;
@@ -393,7 +393,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
393 if (unlikely(!sta || 393 if (unlikely(!sta ||
394 ((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && 394 ((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT &&
395 (tx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP))) 395 (tx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP)))
396 return TXRX_CONTINUE; 396 return TX_CONTINUE;
397 397
398 if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) { 398 if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) {
399 struct ieee80211_tx_packet_data *pkt_data; 399 struct ieee80211_tx_packet_data *pkt_data;
@@ -427,7 +427,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
427 pkt_data = (struct ieee80211_tx_packet_data *)tx->skb->cb; 427 pkt_data = (struct ieee80211_tx_packet_data *)tx->skb->cb;
428 pkt_data->jiffies = jiffies; 428 pkt_data->jiffies = jiffies;
429 skb_queue_tail(&sta->ps_tx_buf, tx->skb); 429 skb_queue_tail(&sta->ps_tx_buf, tx->skb);
430 return TXRX_QUEUED; 430 return TX_QUEUED;
431 } 431 }
432#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 432#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
433 else if (unlikely(sta->flags & WLAN_STA_PS)) { 433 else if (unlikely(sta->flags & WLAN_STA_PS)) {
@@ -438,14 +438,14 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
438#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 438#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
439 sta->pspoll = 0; 439 sta->pspoll = 0;
440 440
441 return TXRX_CONTINUE; 441 return TX_CONTINUE;
442} 442}
443 443
444static ieee80211_txrx_result 444static ieee80211_tx_result
445ieee80211_tx_h_ps_buf(struct ieee80211_txrx_data *tx) 445ieee80211_tx_h_ps_buf(struct ieee80211_txrx_data *tx)
446{ 446{
447 if (unlikely(tx->flags & IEEE80211_TXRXD_TXPS_BUFFERED)) 447 if (unlikely(tx->flags & IEEE80211_TXRXD_TXPS_BUFFERED))
448 return TXRX_CONTINUE; 448 return TX_CONTINUE;
449 449
450 if (tx->flags & IEEE80211_TXRXD_TXUNICAST) 450 if (tx->flags & IEEE80211_TXRXD_TXUNICAST)
451 return ieee80211_tx_h_unicast_ps_buf(tx); 451 return ieee80211_tx_h_unicast_ps_buf(tx);
@@ -453,7 +453,7 @@ ieee80211_tx_h_ps_buf(struct ieee80211_txrx_data *tx)
453 return ieee80211_tx_h_multicast_ps_buf(tx); 453 return ieee80211_tx_h_multicast_ps_buf(tx);
454} 454}
455 455
456static ieee80211_txrx_result 456static ieee80211_tx_result
457ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx) 457ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx)
458{ 458{
459 struct ieee80211_key *key; 459 struct ieee80211_key *key;
@@ -469,7 +469,7 @@ ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx)
469 !(tx->u.tx.control->flags & IEEE80211_TXCTL_EAPOL_FRAME) && 469 !(tx->u.tx.control->flags & IEEE80211_TXCTL_EAPOL_FRAME) &&
470 !(tx->flags & IEEE80211_TXRXD_TX_INJECTED)) { 470 !(tx->flags & IEEE80211_TXRXD_TX_INJECTED)) {
471 I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted); 471 I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted);
472 return TXRX_DROP; 472 return TX_DROP;
473 } else 473 } else
474 tx->key = NULL; 474 tx->key = NULL;
475 475
@@ -498,10 +498,10 @@ ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx)
498 if (!tx->key || !(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) 498 if (!tx->key || !(tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
499 tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT; 499 tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
500 500
501 return TXRX_CONTINUE; 501 return TX_CONTINUE;
502} 502}
503 503
504static ieee80211_txrx_result 504static ieee80211_tx_result
505ieee80211_tx_h_fragment(struct ieee80211_txrx_data *tx) 505ieee80211_tx_h_fragment(struct ieee80211_txrx_data *tx)
506{ 506{
507 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data; 507 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data;
@@ -513,7 +513,7 @@ ieee80211_tx_h_fragment(struct ieee80211_txrx_data *tx)
513 int frag_threshold = tx->local->fragmentation_threshold; 513 int frag_threshold = tx->local->fragmentation_threshold;
514 514
515 if (!(tx->flags & IEEE80211_TXRXD_FRAGMENTED)) 515 if (!(tx->flags & IEEE80211_TXRXD_FRAGMENTED))
516 return TXRX_CONTINUE; 516 return TX_CONTINUE;
517 517
518 first = tx->skb; 518 first = tx->skb;
519 519
@@ -567,7 +567,7 @@ ieee80211_tx_h_fragment(struct ieee80211_txrx_data *tx)
567 tx->u.tx.num_extra_frag = num_fragm - 1; 567 tx->u.tx.num_extra_frag = num_fragm - 1;
568 tx->u.tx.extra_frag = frags; 568 tx->u.tx.extra_frag = frags;
569 569
570 return TXRX_CONTINUE; 570 return TX_CONTINUE;
571 571
572 fail: 572 fail:
573 printk(KERN_DEBUG "%s: failed to fragment frame\n", tx->dev->name); 573 printk(KERN_DEBUG "%s: failed to fragment frame\n", tx->dev->name);
@@ -578,14 +578,14 @@ ieee80211_tx_h_fragment(struct ieee80211_txrx_data *tx)
578 kfree(frags); 578 kfree(frags);
579 } 579 }
580 I802_DEBUG_INC(tx->local->tx_handlers_drop_fragment); 580 I802_DEBUG_INC(tx->local->tx_handlers_drop_fragment);
581 return TXRX_DROP; 581 return TX_DROP;
582} 582}
583 583
584static ieee80211_txrx_result 584static ieee80211_tx_result
585ieee80211_tx_h_encrypt(struct ieee80211_txrx_data *tx) 585ieee80211_tx_h_encrypt(struct ieee80211_txrx_data *tx)
586{ 586{
587 if (!tx->key) 587 if (!tx->key)
588 return TXRX_CONTINUE; 588 return TX_CONTINUE;
589 589
590 switch (tx->key->conf.alg) { 590 switch (tx->key->conf.alg) {
591 case ALG_WEP: 591 case ALG_WEP:
@@ -598,10 +598,10 @@ ieee80211_tx_h_encrypt(struct ieee80211_txrx_data *tx)
598 598
599 /* not reached */ 599 /* not reached */
600 WARN_ON(1); 600 WARN_ON(1);
601 return TXRX_DROP; 601 return TX_DROP;
602} 602}
603 603
604static ieee80211_txrx_result 604static ieee80211_tx_result
605ieee80211_tx_h_rate_ctrl(struct ieee80211_txrx_data *tx) 605ieee80211_tx_h_rate_ctrl(struct ieee80211_txrx_data *tx)
606{ 606{
607 struct rate_selection rsel; 607 struct rate_selection rsel;
@@ -622,7 +622,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_txrx_data *tx)
622 tx->u.tx.control->alt_retry_rate = NULL; 622 tx->u.tx.control->alt_retry_rate = NULL;
623 623
624 if (!tx->u.tx.rate) 624 if (!tx->u.tx.rate)
625 return TXRX_DROP; 625 return TX_DROP;
626 } else 626 } else
627 tx->u.tx.control->alt_retry_rate = NULL; 627 tx->u.tx.control->alt_retry_rate = NULL;
628 628
@@ -642,10 +642,10 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_txrx_data *tx)
642 } 642 }
643 tx->u.tx.control->tx_rate = tx->u.tx.rate; 643 tx->u.tx.control->tx_rate = tx->u.tx.rate;
644 644
645 return TXRX_CONTINUE; 645 return TX_CONTINUE;
646} 646}
647 647
648static ieee80211_txrx_result 648static ieee80211_tx_result
649ieee80211_tx_h_misc(struct ieee80211_txrx_data *tx) 649ieee80211_tx_h_misc(struct ieee80211_txrx_data *tx)
650{ 650{
651 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data; 651 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data;
@@ -754,10 +754,10 @@ ieee80211_tx_h_misc(struct ieee80211_txrx_data *tx)
754 } 754 }
755 } 755 }
756 756
757 return TXRX_CONTINUE; 757 return TX_CONTINUE;
758} 758}
759 759
760static ieee80211_txrx_result 760static ieee80211_tx_result
761ieee80211_tx_h_load_stats(struct ieee80211_txrx_data *tx) 761ieee80211_tx_h_load_stats(struct ieee80211_txrx_data *tx)
762{ 762{
763 struct ieee80211_local *local = tx->local; 763 struct ieee80211_local *local = tx->local;
@@ -810,7 +810,7 @@ ieee80211_tx_h_load_stats(struct ieee80211_txrx_data *tx)
810 tx->sta->channel_use_raw += load; 810 tx->sta->channel_use_raw += load;
811 tx->sdata->channel_use_raw += load; 811 tx->sdata->channel_use_raw += load;
812 812
813 return TXRX_CONTINUE; 813 return TX_CONTINUE;
814} 814}
815 815
816/* TODO: implement register/unregister functions for adding TX/RX handlers 816/* TODO: implement register/unregister functions for adding TX/RX handlers
@@ -837,7 +837,7 @@ ieee80211_tx_handler ieee80211_tx_handlers[] =
837 * deal with packet injection down monitor interface 837 * deal with packet injection down monitor interface
838 * with Radiotap Header -- only called for monitor mode interface 838 * with Radiotap Header -- only called for monitor mode interface
839 */ 839 */
840static ieee80211_txrx_result 840static ieee80211_tx_result
841__ieee80211_parse_tx_radiotap(struct ieee80211_txrx_data *tx, 841__ieee80211_parse_tx_radiotap(struct ieee80211_txrx_data *tx,
842 struct sk_buff *skb) 842 struct sk_buff *skb)
843{ 843{
@@ -926,7 +926,7 @@ __ieee80211_parse_tx_radiotap(struct ieee80211_txrx_data *tx,
926 * on transmission 926 * on transmission
927 */ 927 */
928 if (skb->len < (iterator.max_length + FCS_LEN)) 928 if (skb->len < (iterator.max_length + FCS_LEN))
929 return TXRX_DROP; 929 return TX_DROP;
930 930
931 skb_trim(skb, skb->len - FCS_LEN); 931 skb_trim(skb, skb->len - FCS_LEN);
932 } 932 }
@@ -949,7 +949,7 @@ __ieee80211_parse_tx_radiotap(struct ieee80211_txrx_data *tx,
949 } 949 }
950 950
951 if (ret != -ENOENT) /* ie, if we didn't simply run out of fields */ 951 if (ret != -ENOENT) /* ie, if we didn't simply run out of fields */
952 return TXRX_DROP; 952 return TX_DROP;
953 953
954 /* 954 /*
955 * remove the radiotap header 955 * remove the radiotap header
@@ -958,13 +958,13 @@ __ieee80211_parse_tx_radiotap(struct ieee80211_txrx_data *tx,
958 */ 958 */
959 skb_pull(skb, iterator.max_length); 959 skb_pull(skb, iterator.max_length);
960 960
961 return TXRX_CONTINUE; 961 return TX_CONTINUE;
962} 962}
963 963
964/* 964/*
965 * initialises @tx 965 * initialises @tx
966 */ 966 */
967static ieee80211_txrx_result 967static ieee80211_tx_result
968__ieee80211_tx_prepare(struct ieee80211_txrx_data *tx, 968__ieee80211_tx_prepare(struct ieee80211_txrx_data *tx,
969 struct sk_buff *skb, 969 struct sk_buff *skb,
970 struct net_device *dev, 970 struct net_device *dev,
@@ -991,8 +991,8 @@ __ieee80211_tx_prepare(struct ieee80211_txrx_data *tx,
991 /* process and remove the injection radiotap header */ 991 /* process and remove the injection radiotap header */
992 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 992 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
993 if (unlikely(sdata->vif.type == IEEE80211_IF_TYPE_MNTR)) { 993 if (unlikely(sdata->vif.type == IEEE80211_IF_TYPE_MNTR)) {
994 if (__ieee80211_parse_tx_radiotap(tx, skb) == TXRX_DROP) 994 if (__ieee80211_parse_tx_radiotap(tx, skb) == TX_DROP)
995 return TXRX_DROP; 995 return TX_DROP;
996 996
997 /* 997 /*
998 * __ieee80211_parse_tx_radiotap has now removed 998 * __ieee80211_parse_tx_radiotap has now removed
@@ -1037,7 +1037,7 @@ __ieee80211_tx_prepare(struct ieee80211_txrx_data *tx,
1037 } 1037 }
1038 control->flags |= IEEE80211_TXCTL_FIRST_FRAGMENT; 1038 control->flags |= IEEE80211_TXCTL_FIRST_FRAGMENT;
1039 1039
1040 return TXRX_CONTINUE; 1040 return TX_CONTINUE;
1041} 1041}
1042 1042
1043/* 1043/*
@@ -1131,7 +1131,7 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb,
1131 struct sta_info *sta; 1131 struct sta_info *sta;
1132 ieee80211_tx_handler *handler; 1132 ieee80211_tx_handler *handler;
1133 struct ieee80211_txrx_data tx; 1133 struct ieee80211_txrx_data tx;
1134 ieee80211_txrx_result res = TXRX_DROP, res_prepare; 1134 ieee80211_tx_result res = TX_DROP, res_prepare;
1135 int ret, i; 1135 int ret, i;
1136 1136
1137 WARN_ON(__ieee80211_queue_pending(local, control->queue)); 1137 WARN_ON(__ieee80211_queue_pending(local, control->queue));
@@ -1144,7 +1144,7 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb,
1144 /* initialises tx */ 1144 /* initialises tx */
1145 res_prepare = __ieee80211_tx_prepare(&tx, skb, dev, control); 1145 res_prepare = __ieee80211_tx_prepare(&tx, skb, dev, control);
1146 1146
1147 if (res_prepare == TXRX_DROP) { 1147 if (res_prepare == TX_DROP) {
1148 dev_kfree_skb(skb); 1148 dev_kfree_skb(skb);
1149 return 0; 1149 return 0;
1150 } 1150 }
@@ -1161,7 +1161,7 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb,
1161 for (handler = local->tx_handlers; *handler != NULL; 1161 for (handler = local->tx_handlers; *handler != NULL;
1162 handler++) { 1162 handler++) {
1163 res = (*handler)(&tx); 1163 res = (*handler)(&tx);
1164 if (res != TXRX_CONTINUE) 1164 if (res != TX_CONTINUE)
1165 break; 1165 break;
1166 } 1166 }
1167 1167
@@ -1170,12 +1170,12 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb,
1170 if (sta) 1170 if (sta)
1171 sta_info_put(sta); 1171 sta_info_put(sta);
1172 1172
1173 if (unlikely(res == TXRX_DROP)) { 1173 if (unlikely(res == TX_DROP)) {
1174 I802_DEBUG_INC(local->tx_handlers_drop); 1174 I802_DEBUG_INC(local->tx_handlers_drop);
1175 goto drop; 1175 goto drop;
1176 } 1176 }
1177 1177
1178 if (unlikely(res == TXRX_QUEUED)) { 1178 if (unlikely(res == TX_QUEUED)) {
1179 I802_DEBUG_INC(local->tx_handlers_queued); 1179 I802_DEBUG_INC(local->tx_handlers_queued);
1180 rcu_read_unlock(); 1180 rcu_read_unlock();
1181 return 0; 1181 return 0;
@@ -1864,7 +1864,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw,
1864 struct sta_info *sta; 1864 struct sta_info *sta;
1865 ieee80211_tx_handler *handler; 1865 ieee80211_tx_handler *handler;
1866 struct ieee80211_txrx_data tx; 1866 struct ieee80211_txrx_data tx;
1867 ieee80211_txrx_result res = TXRX_DROP; 1867 ieee80211_tx_result res = TX_DROP;
1868 struct net_device *bdev; 1868 struct net_device *bdev;
1869 struct ieee80211_sub_if_data *sdata; 1869 struct ieee80211_sub_if_data *sdata;
1870 struct ieee80211_if_ap *bss = NULL; 1870 struct ieee80211_if_ap *bss = NULL;
@@ -1916,16 +1916,16 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw,
1916 1916
1917 for (handler = local->tx_handlers; *handler != NULL; handler++) { 1917 for (handler = local->tx_handlers; *handler != NULL; handler++) {
1918 res = (*handler)(&tx); 1918 res = (*handler)(&tx);
1919 if (res == TXRX_DROP || res == TXRX_QUEUED) 1919 if (res == TX_DROP || res == TX_QUEUED)
1920 break; 1920 break;
1921 } 1921 }
1922 skb = tx.skb; /* handlers are allowed to change skb */ 1922 skb = tx.skb; /* handlers are allowed to change skb */
1923 1923
1924 if (res == TXRX_DROP) { 1924 if (res == TX_DROP) {
1925 I802_DEBUG_INC(local->tx_handlers_drop); 1925 I802_DEBUG_INC(local->tx_handlers_drop);
1926 dev_kfree_skb(skb); 1926 dev_kfree_skb(skb);
1927 skb = NULL; 1927 skb = NULL;
1928 } else if (res == TXRX_QUEUED) { 1928 } else if (res == TX_QUEUED) {
1929 I802_DEBUG_INC(local->tx_handlers_queued); 1929 I802_DEBUG_INC(local->tx_handlers_queued);
1930 skb = NULL; 1930 skb = NULL;
1931 } 1931 }
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index a0cff72a580b..8b0015302645 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -305,13 +305,13 @@ u8 * ieee80211_wep_is_weak_iv(struct sk_buff *skb, struct ieee80211_key *key)
305 return NULL; 305 return NULL;
306} 306}
307 307
308ieee80211_txrx_result 308ieee80211_rx_result
309ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx) 309ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx)
310{ 310{
311 if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA && 311 if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA &&
312 ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || 312 ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT ||
313 (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_AUTH)) 313 (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_AUTH))
314 return TXRX_CONTINUE; 314 return RX_CONTINUE;
315 315
316 if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { 316 if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) {
317 if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { 317 if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) {
@@ -320,7 +320,7 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx)
320 printk(KERN_DEBUG "%s: RX WEP frame, decrypt " 320 printk(KERN_DEBUG "%s: RX WEP frame, decrypt "
321 "failed\n", rx->dev->name); 321 "failed\n", rx->dev->name);
322#endif /* CONFIG_MAC80211_DEBUG */ 322#endif /* CONFIG_MAC80211_DEBUG */
323 return TXRX_DROP; 323 return RX_DROP;
324 } 324 }
325 } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) { 325 } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) {
326 ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); 326 ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key);
@@ -328,7 +328,7 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx)
328 skb_trim(rx->skb, rx->skb->len - 4); 328 skb_trim(rx->skb, rx->skb->len - 4);
329 } 329 }
330 330
331 return TXRX_CONTINUE; 331 return RX_CONTINUE;
332} 332}
333 333
334static int wep_encrypt_skb(struct ieee80211_txrx_data *tx, struct sk_buff *skb) 334static int wep_encrypt_skb(struct ieee80211_txrx_data *tx, struct sk_buff *skb)
@@ -346,7 +346,7 @@ static int wep_encrypt_skb(struct ieee80211_txrx_data *tx, struct sk_buff *skb)
346 return 0; 346 return 0;
347} 347}
348 348
349ieee80211_txrx_result 349ieee80211_tx_result
350ieee80211_crypto_wep_encrypt(struct ieee80211_txrx_data *tx) 350ieee80211_crypto_wep_encrypt(struct ieee80211_txrx_data *tx)
351{ 351{
352 tx->u.tx.control->iv_len = WEP_IV_LEN; 352 tx->u.tx.control->iv_len = WEP_IV_LEN;
@@ -355,7 +355,7 @@ ieee80211_crypto_wep_encrypt(struct ieee80211_txrx_data *tx)
355 355
356 if (wep_encrypt_skb(tx, tx->skb) < 0) { 356 if (wep_encrypt_skb(tx, tx->skb) < 0) {
357 I802_DEBUG_INC(tx->local->tx_handlers_drop_wep); 357 I802_DEBUG_INC(tx->local->tx_handlers_drop_wep);
358 return TXRX_DROP; 358 return TX_DROP;
359 } 359 }
360 360
361 if (tx->u.tx.extra_frag) { 361 if (tx->u.tx.extra_frag) {
@@ -364,10 +364,10 @@ ieee80211_crypto_wep_encrypt(struct ieee80211_txrx_data *tx)
364 if (wep_encrypt_skb(tx, tx->u.tx.extra_frag[i]) < 0) { 364 if (wep_encrypt_skb(tx, tx->u.tx.extra_frag[i]) < 0) {
365 I802_DEBUG_INC(tx->local-> 365 I802_DEBUG_INC(tx->local->
366 tx_handlers_drop_wep); 366 tx_handlers_drop_wep);
367 return TXRX_DROP; 367 return TX_DROP;
368 } 368 }
369 } 369 }
370 } 370 }
371 371
372 return TXRX_CONTINUE; 372 return TX_CONTINUE;
373} 373}
diff --git a/net/mac80211/wep.h b/net/mac80211/wep.h
index 785fbb4e0dd7..43aef50cd0d6 100644
--- a/net/mac80211/wep.h
+++ b/net/mac80211/wep.h
@@ -28,9 +28,9 @@ int ieee80211_wep_decrypt(struct ieee80211_local *local, struct sk_buff *skb,
28 struct ieee80211_key *key); 28 struct ieee80211_key *key);
29u8 * ieee80211_wep_is_weak_iv(struct sk_buff *skb, struct ieee80211_key *key); 29u8 * ieee80211_wep_is_weak_iv(struct sk_buff *skb, struct ieee80211_key *key);
30 30
31ieee80211_txrx_result 31ieee80211_rx_result
32ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx); 32ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx);
33ieee80211_txrx_result 33ieee80211_tx_result
34ieee80211_crypto_wep_encrypt(struct ieee80211_txrx_data *tx); 34ieee80211_crypto_wep_encrypt(struct ieee80211_txrx_data *tx);
35 35
36#endif /* WEP_H */ 36#endif /* WEP_H */
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 6f04311cf0a0..c628fa93f574 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -70,7 +70,7 @@ static int ieee80211_get_hdr_info(const struct sk_buff *skb, u8 **sa, u8 **da,
70} 70}
71 71
72 72
73ieee80211_txrx_result 73ieee80211_tx_result
74ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx) 74ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx)
75{ 75{
76 u8 *data, *sa, *da, *key, *mic, qos_tid; 76 u8 *data, *sa, *da, *key, *mic, qos_tid;
@@ -84,10 +84,10 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx)
84 84
85 if (!tx->key || tx->key->conf.alg != ALG_TKIP || skb->len < 24 || 85 if (!tx->key || tx->key->conf.alg != ALG_TKIP || skb->len < 24 ||
86 !WLAN_FC_DATA_PRESENT(fc)) 86 !WLAN_FC_DATA_PRESENT(fc))
87 return TXRX_CONTINUE; 87 return TX_CONTINUE;
88 88
89 if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len)) 89 if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len))
90 return TXRX_DROP; 90 return TX_DROP;
91 91
92 if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && 92 if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) &&
93 !(tx->flags & IEEE80211_TXRXD_FRAGMENTED) && 93 !(tx->flags & IEEE80211_TXRXD_FRAGMENTED) &&
@@ -95,7 +95,7 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx)
95 !wpa_test) { 95 !wpa_test) {
96 /* hwaccel - with no need for preallocated room for Michael MIC 96 /* hwaccel - with no need for preallocated room for Michael MIC
97 */ 97 */
98 return TXRX_CONTINUE; 98 return TX_CONTINUE;
99 } 99 }
100 100
101 if (skb_tailroom(skb) < MICHAEL_MIC_LEN) { 101 if (skb_tailroom(skb) < MICHAEL_MIC_LEN) {
@@ -105,7 +105,7 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx)
105 GFP_ATOMIC))) { 105 GFP_ATOMIC))) {
106 printk(KERN_DEBUG "%s: failed to allocate more memory " 106 printk(KERN_DEBUG "%s: failed to allocate more memory "
107 "for Michael MIC\n", tx->dev->name); 107 "for Michael MIC\n", tx->dev->name);
108 return TXRX_DROP; 108 return TX_DROP;
109 } 109 }
110 } 110 }
111 111
@@ -119,11 +119,11 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx)
119 mic = skb_put(skb, MICHAEL_MIC_LEN); 119 mic = skb_put(skb, MICHAEL_MIC_LEN);
120 michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic); 120 michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic);
121 121
122 return TXRX_CONTINUE; 122 return TX_CONTINUE;
123} 123}
124 124
125 125
126ieee80211_txrx_result 126ieee80211_rx_result
127ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) 127ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx)
128{ 128{
129 u8 *data, *sa, *da, *key = NULL, qos_tid; 129 u8 *data, *sa, *da, *key = NULL, qos_tid;
@@ -140,15 +140,15 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx)
140 * No way to verify the MIC if the hardware stripped it 140 * No way to verify the MIC if the hardware stripped it
141 */ 141 */
142 if (rx->u.rx.status->flag & RX_FLAG_MMIC_STRIPPED) 142 if (rx->u.rx.status->flag & RX_FLAG_MMIC_STRIPPED)
143 return TXRX_CONTINUE; 143 return RX_CONTINUE;
144 144
145 if (!rx->key || rx->key->conf.alg != ALG_TKIP || 145 if (!rx->key || rx->key->conf.alg != ALG_TKIP ||
146 !(rx->fc & IEEE80211_FCTL_PROTECTED) || !WLAN_FC_DATA_PRESENT(fc)) 146 !(rx->fc & IEEE80211_FCTL_PROTECTED) || !WLAN_FC_DATA_PRESENT(fc))
147 return TXRX_CONTINUE; 147 return RX_CONTINUE;
148 148
149 if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len) 149 if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len)
150 || data_len < MICHAEL_MIC_LEN) 150 || data_len < MICHAEL_MIC_LEN)
151 return TXRX_DROP; 151 return RX_DROP;
152 152
153 data_len -= MICHAEL_MIC_LEN; 153 data_len -= MICHAEL_MIC_LEN;
154 154
@@ -162,14 +162,14 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx)
162 michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic); 162 michael_mic(key, da, sa, qos_tid & 0x0f, data, data_len, mic);
163 if (memcmp(mic, data + data_len, MICHAEL_MIC_LEN) != 0 || wpa_test) { 163 if (memcmp(mic, data + data_len, MICHAEL_MIC_LEN) != 0 || wpa_test) {
164 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) 164 if (!(rx->flags & IEEE80211_TXRXD_RXRA_MATCH))
165 return TXRX_DROP; 165 return RX_DROP;
166 166
167 printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " 167 printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from "
168 "%s\n", rx->dev->name, print_mac(mac, sa)); 168 "%s\n", rx->dev->name, print_mac(mac, sa));
169 169
170 mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, 170 mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx,
171 (void *) skb->data); 171 (void *) skb->data);
172 return TXRX_DROP; 172 return RX_DROP;
173 } 173 }
174 174
175 /* remove Michael MIC from payload */ 175 /* remove Michael MIC from payload */
@@ -179,7 +179,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx)
179 rx->key->u.tkip.iv32_rx[rx->u.rx.queue] = rx->u.rx.tkip_iv32; 179 rx->key->u.tkip.iv32_rx[rx->u.rx.queue] = rx->u.rx.tkip_iv32;
180 rx->key->u.tkip.iv16_rx[rx->u.rx.queue] = rx->u.rx.tkip_iv16; 180 rx->key->u.tkip.iv16_rx[rx->u.rx.queue] = rx->u.rx.tkip_iv16;
181 181
182 return TXRX_CONTINUE; 182 return RX_CONTINUE;
183} 183}
184 184
185 185
@@ -242,7 +242,7 @@ static int tkip_encrypt_skb(struct ieee80211_txrx_data *tx,
242} 242}
243 243
244 244
245ieee80211_txrx_result 245ieee80211_tx_result
246ieee80211_crypto_tkip_encrypt(struct ieee80211_txrx_data *tx) 246ieee80211_crypto_tkip_encrypt(struct ieee80211_txrx_data *tx)
247{ 247{
248 struct sk_buff *skb = tx->skb; 248 struct sk_buff *skb = tx->skb;
@@ -257,26 +257,26 @@ ieee80211_crypto_tkip_encrypt(struct ieee80211_txrx_data *tx)
257 !wpa_test) { 257 !wpa_test) {
258 /* hwaccel - with no need for preallocated room for IV/ICV */ 258 /* hwaccel - with no need for preallocated room for IV/ICV */
259 tx->u.tx.control->key_idx = tx->key->conf.hw_key_idx; 259 tx->u.tx.control->key_idx = tx->key->conf.hw_key_idx;
260 return TXRX_CONTINUE; 260 return TX_CONTINUE;
261 } 261 }
262 262
263 if (tkip_encrypt_skb(tx, skb, test) < 0) 263 if (tkip_encrypt_skb(tx, skb, test) < 0)
264 return TXRX_DROP; 264 return TX_DROP;
265 265
266 if (tx->u.tx.extra_frag) { 266 if (tx->u.tx.extra_frag) {
267 int i; 267 int i;
268 for (i = 0; i < tx->u.tx.num_extra_frag; i++) { 268 for (i = 0; i < tx->u.tx.num_extra_frag; i++) {
269 if (tkip_encrypt_skb(tx, tx->u.tx.extra_frag[i], test) 269 if (tkip_encrypt_skb(tx, tx->u.tx.extra_frag[i], test)
270 < 0) 270 < 0)
271 return TXRX_DROP; 271 return TX_DROP;
272 } 272 }
273 } 273 }
274 274
275 return TXRX_CONTINUE; 275 return TX_CONTINUE;
276} 276}
277 277
278 278
279ieee80211_txrx_result 279ieee80211_rx_result
280ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx) 280ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx)
281{ 281{
282 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; 282 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data;
@@ -290,10 +290,10 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx)
290 hdrlen = ieee80211_get_hdrlen(fc); 290 hdrlen = ieee80211_get_hdrlen(fc);
291 291
292 if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) 292 if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)
293 return TXRX_CONTINUE; 293 return RX_CONTINUE;
294 294
295 if (!rx->sta || skb->len - hdrlen < 12) 295 if (!rx->sta || skb->len - hdrlen < 12)
296 return TXRX_DROP; 296 return RX_DROP;
297 297
298 if (rx->u.rx.status->flag & RX_FLAG_DECRYPTED) { 298 if (rx->u.rx.status->flag & RX_FLAG_DECRYPTED) {
299 if (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED) { 299 if (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED) {
@@ -302,7 +302,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx)
302 * replay protection, and stripped the ICV/IV so 302 * replay protection, and stripped the ICV/IV so
303 * we cannot do any checks here. 303 * we cannot do any checks here.
304 */ 304 */
305 return TXRX_CONTINUE; 305 return RX_CONTINUE;
306 } 306 }
307 307
308 /* let TKIP code verify IV, but skip decryption */ 308 /* let TKIP code verify IV, but skip decryption */
@@ -322,7 +322,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx)
322 "frame from %s (res=%d)\n", rx->dev->name, 322 "frame from %s (res=%d)\n", rx->dev->name,
323 print_mac(mac, rx->sta->addr), res); 323 print_mac(mac, rx->sta->addr), res);
324#endif /* CONFIG_MAC80211_DEBUG */ 324#endif /* CONFIG_MAC80211_DEBUG */
325 return TXRX_DROP; 325 return RX_DROP;
326 } 326 }
327 327
328 /* Trim ICV */ 328 /* Trim ICV */
@@ -332,7 +332,7 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx)
332 memmove(skb->data + TKIP_IV_LEN, skb->data, hdrlen); 332 memmove(skb->data + TKIP_IV_LEN, skb->data, hdrlen);
333 skb_pull(skb, TKIP_IV_LEN); 333 skb_pull(skb, TKIP_IV_LEN);
334 334
335 return TXRX_CONTINUE; 335 return RX_CONTINUE;
336} 336}
337 337
338 338
@@ -491,7 +491,7 @@ static int ccmp_encrypt_skb(struct ieee80211_txrx_data *tx,
491} 491}
492 492
493 493
494ieee80211_txrx_result 494ieee80211_tx_result
495ieee80211_crypto_ccmp_encrypt(struct ieee80211_txrx_data *tx) 495ieee80211_crypto_ccmp_encrypt(struct ieee80211_txrx_data *tx)
496{ 496{
497 struct sk_buff *skb = tx->skb; 497 struct sk_buff *skb = tx->skb;
@@ -506,26 +506,26 @@ ieee80211_crypto_ccmp_encrypt(struct ieee80211_txrx_data *tx)
506 /* hwaccel - with no need for preallocated room for CCMP " 506 /* hwaccel - with no need for preallocated room for CCMP "
507 * header or MIC fields */ 507 * header or MIC fields */
508 tx->u.tx.control->key_idx = tx->key->conf.hw_key_idx; 508 tx->u.tx.control->key_idx = tx->key->conf.hw_key_idx;
509 return TXRX_CONTINUE; 509 return TX_CONTINUE;
510 } 510 }
511 511
512 if (ccmp_encrypt_skb(tx, skb, test) < 0) 512 if (ccmp_encrypt_skb(tx, skb, test) < 0)
513 return TXRX_DROP; 513 return TX_DROP;
514 514
515 if (tx->u.tx.extra_frag) { 515 if (tx->u.tx.extra_frag) {
516 int i; 516 int i;
517 for (i = 0; i < tx->u.tx.num_extra_frag; i++) { 517 for (i = 0; i < tx->u.tx.num_extra_frag; i++) {
518 if (ccmp_encrypt_skb(tx, tx->u.tx.extra_frag[i], test) 518 if (ccmp_encrypt_skb(tx, tx->u.tx.extra_frag[i], test)
519 < 0) 519 < 0)
520 return TXRX_DROP; 520 return TX_DROP;
521 } 521 }
522 } 522 }
523 523
524 return TXRX_CONTINUE; 524 return TX_CONTINUE;
525} 525}
526 526
527 527
528ieee80211_txrx_result 528ieee80211_rx_result
529ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) 529ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx)
530{ 530{
531 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data; 531 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) rx->skb->data;
@@ -541,15 +541,15 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx)
541 hdrlen = ieee80211_get_hdrlen(fc); 541 hdrlen = ieee80211_get_hdrlen(fc);
542 542
543 if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) 543 if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)
544 return TXRX_CONTINUE; 544 return RX_CONTINUE;
545 545
546 data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN; 546 data_len = skb->len - hdrlen - CCMP_HDR_LEN - CCMP_MIC_LEN;
547 if (!rx->sta || data_len < 0) 547 if (!rx->sta || data_len < 0)
548 return TXRX_DROP; 548 return RX_DROP;
549 549
550 if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && 550 if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) &&
551 (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) 551 (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED))
552 return TXRX_CONTINUE; 552 return RX_CONTINUE;
553 553
554 (void) ccmp_hdr2pn(pn, skb->data + hdrlen); 554 (void) ccmp_hdr2pn(pn, skb->data + hdrlen);
555 555
@@ -565,7 +565,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx)
565 ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); 565 ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]);
566#endif /* CONFIG_MAC80211_DEBUG */ 566#endif /* CONFIG_MAC80211_DEBUG */
567 key->u.ccmp.replays++; 567 key->u.ccmp.replays++;
568 return TXRX_DROP; 568 return RX_DROP;
569 } 569 }
570 570
571 if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { 571 if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) {
@@ -589,7 +589,7 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx)
589 "for RX frame from %s\n", rx->dev->name, 589 "for RX frame from %s\n", rx->dev->name,
590 print_mac(mac, rx->sta->addr)); 590 print_mac(mac, rx->sta->addr));
591#endif /* CONFIG_MAC80211_DEBUG */ 591#endif /* CONFIG_MAC80211_DEBUG */
592 return TXRX_DROP; 592 return RX_DROP;
593 } 593 }
594 } 594 }
595 595
@@ -600,5 +600,5 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx)
600 memmove(skb->data + CCMP_HDR_LEN, skb->data, hdrlen); 600 memmove(skb->data + CCMP_HDR_LEN, skb->data, hdrlen);
601 skb_pull(skb, CCMP_HDR_LEN); 601 skb_pull(skb, CCMP_HDR_LEN);
602 602
603 return TXRX_CONTINUE; 603 return RX_CONTINUE;
604} 604}
diff --git a/net/mac80211/wpa.h b/net/mac80211/wpa.h
index 49d80cf0cd75..16e4dba4aa70 100644
--- a/net/mac80211/wpa.h
+++ b/net/mac80211/wpa.h
@@ -13,19 +13,19 @@
13#include <linux/types.h> 13#include <linux/types.h>
14#include "ieee80211_i.h" 14#include "ieee80211_i.h"
15 15
16ieee80211_txrx_result 16ieee80211_tx_result
17ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx); 17ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx);
18ieee80211_txrx_result 18ieee80211_rx_result
19ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx); 19ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx);
20 20
21ieee80211_txrx_result 21ieee80211_tx_result
22ieee80211_crypto_tkip_encrypt(struct ieee80211_txrx_data *tx); 22ieee80211_crypto_tkip_encrypt(struct ieee80211_txrx_data *tx);
23ieee80211_txrx_result 23ieee80211_rx_result
24ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx); 24ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx);
25 25
26ieee80211_txrx_result 26ieee80211_tx_result
27ieee80211_crypto_ccmp_encrypt(struct ieee80211_txrx_data *tx); 27ieee80211_crypto_ccmp_encrypt(struct ieee80211_txrx_data *tx);
28ieee80211_txrx_result 28ieee80211_rx_result
29ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx); 29ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx);
30 30
31#endif /* WPA_H */ 31#endif /* WPA_H */