aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c77
1 files changed, 27 insertions, 50 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index cf6b121e1bbf..648a1d0e6c82 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -26,10 +26,11 @@
26#include "tkip.h" 26#include "tkip.h"
27#include "wme.h" 27#include "wme.h"
28 28
29u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, 29static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw,
30 struct tid_ampdu_rx *tid_agg_rx, 30 struct tid_ampdu_rx *tid_agg_rx,
31 struct sk_buff *skb, u16 mpdu_seq_num, 31 struct sk_buff *skb,
32 int bar_req); 32 u16 mpdu_seq_num,
33 int bar_req);
33/* 34/*
34 * monitor mode reception 35 * monitor mode reception
35 * 36 *
@@ -653,13 +654,12 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
653static void ap_sta_ps_start(struct sta_info *sta) 654static void ap_sta_ps_start(struct sta_info *sta)
654{ 655{
655 struct ieee80211_sub_if_data *sdata = sta->sdata; 656 struct ieee80211_sub_if_data *sdata = sta->sdata;
656 DECLARE_MAC_BUF(mac);
657 657
658 atomic_inc(&sdata->bss->num_sta_ps); 658 atomic_inc(&sdata->bss->num_sta_ps);
659 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL); 659 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL);
660#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 660#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
661 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n", 661 printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n",
662 sdata->dev->name, print_mac(mac, sta->sta.addr), sta->sta.aid); 662 sdata->dev->name, sta->sta.addr, sta->sta.aid);
663#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 663#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
664} 664}
665 665
@@ -669,8 +669,6 @@ static int ap_sta_ps_end(struct sta_info *sta)
669 struct ieee80211_local *local = sdata->local; 669 struct ieee80211_local *local = sdata->local;
670 struct sk_buff *skb; 670 struct sk_buff *skb;
671 int sent = 0; 671 int sent = 0;
672 struct ieee80211_tx_info *info;
673 DECLARE_MAC_BUF(mac);
674 672
675 atomic_dec(&sdata->bss->num_sta_ps); 673 atomic_dec(&sdata->bss->num_sta_ps);
676 674
@@ -680,27 +678,25 @@ static int ap_sta_ps_end(struct sta_info *sta)
680 sta_info_clear_tim_bit(sta); 678 sta_info_clear_tim_bit(sta);
681 679
682#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 680#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
683 printk(KERN_DEBUG "%s: STA %s aid %d exits power save mode\n", 681 printk(KERN_DEBUG "%s: STA %pM aid %d exits power save mode\n",
684 sdata->dev->name, print_mac(mac, sta->sta.addr), sta->sta.aid); 682 sdata->dev->name, sta->sta.addr, sta->sta.aid);
685#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 683#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
686 684
687 /* Send all buffered frames to the station */ 685 /* Send all buffered frames to the station */
688 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) { 686 while ((skb = skb_dequeue(&sta->tx_filtered)) != NULL) {
689 info = IEEE80211_SKB_CB(skb);
690 sent++; 687 sent++;
691 info->flags |= IEEE80211_TX_CTL_REQUEUE; 688 skb->requeue = 1;
692 dev_queue_xmit(skb); 689 dev_queue_xmit(skb);
693 } 690 }
694 while ((skb = skb_dequeue(&sta->ps_tx_buf)) != NULL) { 691 while ((skb = skb_dequeue(&sta->ps_tx_buf)) != NULL) {
695 info = IEEE80211_SKB_CB(skb);
696 local->total_ps_buffered--; 692 local->total_ps_buffered--;
697 sent++; 693 sent++;
698#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 694#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
699 printk(KERN_DEBUG "%s: STA %s aid %d send PS frame " 695 printk(KERN_DEBUG "%s: STA %pM aid %d send PS frame "
700 "since STA not sleeping anymore\n", sdata->dev->name, 696 "since STA not sleeping anymore\n", sdata->dev->name,
701 print_mac(mac, sta->sta.addr), sta->sta.aid); 697 sta->sta.addr, sta->sta.aid);
702#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 698#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
703 info->flags |= IEEE80211_TX_CTL_REQUEUE; 699 skb->requeue = 1;
704 dev_queue_xmit(skb); 700 dev_queue_xmit(skb);
705 } 701 }
706 702
@@ -789,15 +785,12 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
789#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 785#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
790 struct ieee80211_hdr *hdr = 786 struct ieee80211_hdr *hdr =
791 (struct ieee80211_hdr *) entry->skb_list.next->data; 787 (struct ieee80211_hdr *) entry->skb_list.next->data;
792 DECLARE_MAC_BUF(mac);
793 DECLARE_MAC_BUF(mac2);
794 printk(KERN_DEBUG "%s: RX reassembly removed oldest " 788 printk(KERN_DEBUG "%s: RX reassembly removed oldest "
795 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d " 789 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d "
796 "addr1=%s addr2=%s\n", 790 "addr1=%pM addr2=%pM\n",
797 sdata->dev->name, idx, 791 sdata->dev->name, idx,
798 jiffies - entry->first_frag_time, entry->seq, 792 jiffies - entry->first_frag_time, entry->seq,
799 entry->last_frag, print_mac(mac, hdr->addr1), 793 entry->last_frag, hdr->addr1, hdr->addr2);
800 print_mac(mac2, hdr->addr2));
801#endif 794#endif
802 __skb_queue_purge(&entry->skb_list); 795 __skb_queue_purge(&entry->skb_list);
803 } 796 }
@@ -866,7 +859,6 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
866 unsigned int frag, seq; 859 unsigned int frag, seq;
867 struct ieee80211_fragment_entry *entry; 860 struct ieee80211_fragment_entry *entry;
868 struct sk_buff *skb; 861 struct sk_buff *skb;
869 DECLARE_MAC_BUF(mac);
870 862
871 hdr = (struct ieee80211_hdr *)rx->skb->data; 863 hdr = (struct ieee80211_hdr *)rx->skb->data;
872 fc = hdr->frame_control; 864 fc = hdr->frame_control;
@@ -970,7 +962,6 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
970 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); 962 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev);
971 struct sk_buff *skb; 963 struct sk_buff *skb;
972 int no_pending_pkts; 964 int no_pending_pkts;
973 DECLARE_MAC_BUF(mac);
974 __le16 fc = ((struct ieee80211_hdr *)rx->skb->data)->frame_control; 965 __le16 fc = ((struct ieee80211_hdr *)rx->skb->data)->frame_control;
975 966
976 if (likely(!rx->sta || !ieee80211_is_pspoll(fc) || 967 if (likely(!rx->sta || !ieee80211_is_pspoll(fc) ||
@@ -1001,8 +992,8 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
1001 set_sta_flags(rx->sta, WLAN_STA_PSPOLL); 992 set_sta_flags(rx->sta, WLAN_STA_PSPOLL);
1002 993
1003#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 994#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
1004 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n", 995 printk(KERN_DEBUG "STA %pM aid %d: PS Poll (entries after %d)\n",
1005 print_mac(mac, rx->sta->sta.addr), rx->sta->sta.aid, 996 rx->sta->sta.addr, rx->sta->sta.aid,
1006 skb_queue_len(&rx->sta->ps_tx_buf)); 997 skb_queue_len(&rx->sta->ps_tx_buf));
1007#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 998#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
1008 999
@@ -1025,9 +1016,9 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
1025 * Should we send it a null-func frame indicating we 1016 * Should we send it a null-func frame indicating we
1026 * have nothing buffered for it? 1017 * have nothing buffered for it?
1027 */ 1018 */
1028 printk(KERN_DEBUG "%s: STA %s sent PS Poll even " 1019 printk(KERN_DEBUG "%s: STA %pM sent PS Poll even "
1029 "though there are no buffered frames for it\n", 1020 "though there are no buffered frames for it\n",
1030 rx->dev->name, print_mac(mac, rx->sta->sta.addr)); 1021 rx->dev->name, rx->sta->sta.addr);
1031#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1022#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
1032 } 1023 }
1033 1024
@@ -1097,10 +1088,6 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
1097 u8 src[ETH_ALEN] __aligned(2); 1088 u8 src[ETH_ALEN] __aligned(2);
1098 struct sk_buff *skb = rx->skb; 1089 struct sk_buff *skb = rx->skb;
1099 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1090 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1100 DECLARE_MAC_BUF(mac);
1101 DECLARE_MAC_BUF(mac2);
1102 DECLARE_MAC_BUF(mac3);
1103 DECLARE_MAC_BUF(mac4);
1104 1091
1105 if (unlikely(!ieee80211_is_data_present(hdr->frame_control))) 1092 if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
1106 return -1; 1093 return -1;
@@ -1279,7 +1266,6 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
1279 int remaining, err; 1266 int remaining, err;
1280 u8 dst[ETH_ALEN]; 1267 u8 dst[ETH_ALEN];
1281 u8 src[ETH_ALEN]; 1268 u8 src[ETH_ALEN];
1282 DECLARE_MAC_BUF(mac);
1283 1269
1284 if (unlikely(!ieee80211_is_data(fc))) 1270 if (unlikely(!ieee80211_is_data(fc)))
1285 return RX_CONTINUE; 1271 return RX_CONTINUE;
@@ -1552,14 +1538,6 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
1552 if (len < IEEE80211_MIN_ACTION_SIZE + 1) 1538 if (len < IEEE80211_MIN_ACTION_SIZE + 1)
1553 return RX_DROP_MONITOR; 1539 return RX_DROP_MONITOR;
1554 1540
1555 /*
1556 * FIXME: revisit this, I'm sure we should handle most
1557 * of these frames in other modes as well!
1558 */
1559 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
1560 sdata->vif.type != NL80211_IFTYPE_ADHOC)
1561 return RX_CONTINUE;
1562
1563 switch (mgmt->u.action.category) { 1541 switch (mgmt->u.action.category) {
1564 case WLAN_CATEGORY_BACK: 1542 case WLAN_CATEGORY_BACK:
1565 switch (mgmt->u.action.u.addba_req.action_code) { 1543 switch (mgmt->u.action.u.addba_req.action_code) {
@@ -1632,8 +1610,6 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1632{ 1610{
1633 int keyidx; 1611 int keyidx;
1634 unsigned int hdrlen; 1612 unsigned int hdrlen;
1635 DECLARE_MAC_BUF(mac);
1636 DECLARE_MAC_BUF(mac2);
1637 1613
1638 hdrlen = ieee80211_hdrlen(hdr->frame_control); 1614 hdrlen = ieee80211_hdrlen(hdr->frame_control);
1639 if (rx->skb->len >= hdrlen + 4) 1615 if (rx->skb->len >= hdrlen + 4)
@@ -2002,17 +1978,17 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
2002 1978
2003static inline int seq_less(u16 sq1, u16 sq2) 1979static inline int seq_less(u16 sq1, u16 sq2)
2004{ 1980{
2005 return (((sq1 - sq2) & SEQ_MASK) > (SEQ_MODULO >> 1)); 1981 return ((sq1 - sq2) & SEQ_MASK) > (SEQ_MODULO >> 1);
2006} 1982}
2007 1983
2008static inline u16 seq_inc(u16 sq) 1984static inline u16 seq_inc(u16 sq)
2009{ 1985{
2010 return ((sq + 1) & SEQ_MASK); 1986 return (sq + 1) & SEQ_MASK;
2011} 1987}
2012 1988
2013static inline u16 seq_sub(u16 sq1, u16 sq2) 1989static inline u16 seq_sub(u16 sq1, u16 sq2)
2014{ 1990{
2015 return ((sq1 - sq2) & SEQ_MASK); 1991 return (sq1 - sq2) & SEQ_MASK;
2016} 1992}
2017 1993
2018 1994
@@ -2020,10 +1996,11 @@ static inline u16 seq_sub(u16 sq1, u16 sq2)
2020 * As it function blongs to Rx path it must be called with 1996 * As it function blongs to Rx path it must be called with
2021 * the proper rcu_read_lock protection for its flow. 1997 * the proper rcu_read_lock protection for its flow.
2022 */ 1998 */
2023u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, 1999static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw,
2024 struct tid_ampdu_rx *tid_agg_rx, 2000 struct tid_ampdu_rx *tid_agg_rx,
2025 struct sk_buff *skb, u16 mpdu_seq_num, 2001 struct sk_buff *skb,
2026 int bar_req) 2002 u16 mpdu_seq_num,
2003 int bar_req)
2027{ 2004{
2028 struct ieee80211_local *local = hw_to_local(hw); 2005 struct ieee80211_local *local = hw_to_local(hw);
2029 struct ieee80211_rx_status status; 2006 struct ieee80211_rx_status status;