diff options
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 150 |
1 files changed, 75 insertions, 75 deletions
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 | ||
354 | static ieee80211_txrx_result | 354 | static ieee80211_rx_result |
355 | ieee80211_rx_h_if_stats(struct ieee80211_txrx_data *rx) | 355 | ieee80211_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 | ||
363 | static ieee80211_txrx_result | 363 | static ieee80211_rx_result |
364 | ieee80211_rx_h_passive_scan(struct ieee80211_txrx_data *rx) | 364 | ieee80211_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 | ||
389 | static ieee80211_txrx_result | 389 | static ieee80211_rx_result |
390 | ieee80211_rx_h_check(struct ieee80211_txrx_data *rx) | 390 | ieee80211_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 | ||
443 | static ieee80211_txrx_result | 443 | static ieee80211_rx_result |
444 | ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) | 444 | ieee80211_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 | ||
632 | static ieee80211_txrx_result | 632 | static ieee80211_rx_result |
633 | ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx) | 633 | ieee80211_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 | ||
694 | static inline struct ieee80211_fragment_entry * | 694 | static 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 | ||
777 | static ieee80211_txrx_result | 777 | static ieee80211_rx_result |
778 | ieee80211_rx_h_defragment(struct ieee80211_txrx_data *rx) | 778 | ieee80211_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 | ||
893 | static ieee80211_txrx_result | 893 | static ieee80211_rx_result |
894 | ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx) | 894 | ieee80211_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 | ||
967 | static ieee80211_txrx_result | 967 | static ieee80211_rx_result |
968 | ieee80211_rx_h_remove_qos_control(struct ieee80211_txrx_data *rx) | 968 | ieee80211_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 | ||
987 | static int | 987 | static int |
@@ -1238,7 +1238,7 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx) | |||
1238 | } | 1238 | } |
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | static ieee80211_txrx_result | 1241 | static ieee80211_rx_result |
1242 | ieee80211_rx_h_amsdu(struct ieee80211_txrx_data *rx) | 1242 | ieee80211_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 | ||
1358 | static ieee80211_txrx_result | 1358 | static ieee80211_rx_result |
1359 | ieee80211_rx_h_data(struct ieee80211_txrx_data *rx) | 1359 | ieee80211_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 | ||
1389 | static ieee80211_txrx_result | 1389 | static ieee80211_rx_result |
1390 | ieee80211_rx_h_ctrl(struct ieee80211_txrx_data *rx) | 1390 | ieee80211_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 | ||
1432 | static ieee80211_txrx_result | 1432 | static ieee80211_rx_result |
1433 | ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx) | 1433 | ieee80211_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 | ||
1451 | static inline ieee80211_txrx_result __ieee80211_invoke_rx_handlers( | 1451 | static 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 | ||