diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-06-30 09:10:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-02 15:48:33 -0400 |
commit | f4ea83dd743d3e1bec8fdf954ac911c6b12ae87a (patch) | |
tree | 2db594d668648779e1932981410e37258df76b2c /net | |
parent | 49461622edf74cd1e1a1056cee3ca8dd90cd9556 (diff) |
mac80211: rework debug settings and make debugging safer
This patch reworks the mac80211 debug settings making them more focused
and adding help text for those that didn't have one. It also removes a
number of printks that can be triggered remotely and add no value, e.g.
"too short deauthentication frame received - ignoring".
If somebody really needs to debug that they should just add a monitor
interface and look at the frames in wireshark.
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/Kconfig | 130 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/iface.c | 6 | ||||
-rw-r--r-- | net/mac80211/main.c | 35 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 206 | ||||
-rw-r--r-- | net/mac80211/rx.c | 106 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 2 | ||||
-rw-r--r-- | net/mac80211/tx.c | 9 | ||||
-rw-r--r-- | net/mac80211/wep.c | 13 | ||||
-rw-r--r-- | net/mac80211/wme.c | 1 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 28 |
11 files changed, 196 insertions, 342 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 661d3c291482..11a1e7fa195d 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -88,10 +88,16 @@ config MAC80211_DEBUGFS | |||
88 | 88 | ||
89 | Say N unless you know you need this. | 89 | Say N unless you know you need this. |
90 | 90 | ||
91 | menuconfig MAC80211_DEBUG_MENU | ||
92 | bool "Select mac80211 debugging features" | ||
93 | depends on MAC80211 | ||
94 | ---help--- | ||
95 | This option collects various mac80211 debug settings. | ||
96 | |||
91 | config MAC80211_DEBUG_PACKET_ALIGNMENT | 97 | config MAC80211_DEBUG_PACKET_ALIGNMENT |
92 | bool "Enable packet alignment debugging" | 98 | bool "Enable packet alignment debugging" |
93 | depends on MAC80211 | 99 | depends on MAC80211_DEBUG_MENU |
94 | help | 100 | ---help--- |
95 | This option is recommended for driver authors and strongly | 101 | This option is recommended for driver authors and strongly |
96 | discouraged for everybody else, it will trigger a warning | 102 | discouraged for everybody else, it will trigger a warning |
97 | when a driver hands mac80211 a buffer that is aligned in | 103 | when a driver hands mac80211 a buffer that is aligned in |
@@ -100,33 +106,95 @@ config MAC80211_DEBUG_PACKET_ALIGNMENT | |||
100 | 106 | ||
101 | Say N unless you're writing a mac80211 based driver. | 107 | Say N unless you're writing a mac80211 based driver. |
102 | 108 | ||
103 | config MAC80211_DEBUG | 109 | config MAC80211_NOINLINE |
104 | bool "Enable debugging output" | 110 | bool "Do not inline TX/RX handlers" |
105 | depends on MAC80211 | 111 | depends on MAC80211_DEBUG_MENU |
106 | ---help--- | 112 | ---help--- |
107 | This option will enable debug tracing output for the | 113 | This option affects code generation in mac80211, when |
108 | ieee80211 network stack. | 114 | selected some functions are marked "noinline" to allow |
115 | easier debugging of problems in the transmit and receive | ||
116 | paths. | ||
117 | |||
118 | This option increases code size a bit and inserts a lot | ||
119 | of function calls in the code, but is otherwise safe to | ||
120 | enable. | ||
109 | 121 | ||
110 | If you are not trying to debug or develop the ieee80211 | 122 | If unsure, say N unless you expect to be finding problems |
111 | subsystem, you most likely want to say N here. | 123 | in mac80211. |
124 | |||
125 | config MAC80211_VERBOSE_DEBUG | ||
126 | bool "Verbose debugging output" | ||
127 | depends on MAC80211_DEBUG_MENU | ||
128 | ---help--- | ||
129 | Selecting this option causes mac80211 to print out | ||
130 | many debugging messages. It should not be selected | ||
131 | on production systems as some of the messages are | ||
132 | remotely triggerable. | ||
133 | |||
134 | Do not select this option. | ||
112 | 135 | ||
113 | config MAC80211_HT_DEBUG | 136 | config MAC80211_HT_DEBUG |
114 | bool "Enable HT debugging output" | 137 | bool "Verbose HT debugging" |
115 | depends on MAC80211_DEBUG | 138 | depends on MAC80211_DEBUG_MENU |
116 | ---help--- | 139 | ---help--- |
117 | This option enables 802.11n High Throughput features | 140 | This option enables 802.11n High Throughput features |
118 | debug tracing output. | 141 | debug tracing output. |
119 | 142 | ||
120 | If you are not trying to debug of develop the ieee80211 | 143 | It should not be selected on production systems as some |
121 | subsystem, you most likely want to say N here. | 144 | of the messages are remotely triggerable. |
122 | 145 | ||
123 | config MAC80211_VERBOSE_DEBUG | 146 | Do not select this option. |
124 | bool "Verbose debugging output" | 147 | |
125 | depends on MAC80211_DEBUG | 148 | config MAC80211_TKIP_DEBUG |
149 | bool "Verbose TKIP debugging" | ||
150 | depends on MAC80211_DEBUG_MENU | ||
151 | ---help--- | ||
152 | Selecting this option causes mac80211 to print out | ||
153 | very verbose TKIP debugging messages. It should not | ||
154 | be selected on production systems as those messages | ||
155 | are remotely triggerable. | ||
156 | |||
157 | Do not select this option. | ||
158 | |||
159 | config MAC80211_IBSS_DEBUG | ||
160 | bool "Verbose IBSS debugging" | ||
161 | depends on MAC80211_DEBUG_MENU | ||
162 | ---help--- | ||
163 | Selecting this option causes mac80211 to print out | ||
164 | very verbose IBSS debugging messages. It should not | ||
165 | be selected on production systems as those messages | ||
166 | are remotely triggerable. | ||
167 | |||
168 | Do not select this option. | ||
169 | |||
170 | config MAC80211_VERBOSE_PS_DEBUG | ||
171 | bool "Verbose powersave mode debugging" | ||
172 | depends on MAC80211_DEBUG_MENU | ||
173 | ---help--- | ||
174 | Selecting this option causes mac80211 to print out very | ||
175 | verbose power save mode debugging messages (when mac80211 | ||
176 | is an AP and has power saving stations.) | ||
177 | It should not be selected on production systems as those | ||
178 | messages are remotely triggerable. | ||
179 | |||
180 | Do not select this option. | ||
181 | |||
182 | config MAC80211_VERBOSE_MPL_DEBUG | ||
183 | bool "Verbose mesh peer link debugging" | ||
184 | depends on MAC80211_DEBUG_MENU | ||
185 | depends on MAC80211_MESH | ||
186 | ---help--- | ||
187 | Selecting this option causes mac80211 to print out very | ||
188 | verbose mesh peer link debugging messages (when mac80211 | ||
189 | is taking part in a mesh network). | ||
190 | It should not be selected on production systems as those | ||
191 | messages are remotely triggerable. | ||
192 | |||
193 | Do not select this option. | ||
126 | 194 | ||
127 | config MAC80211_LOWTX_FRAME_DUMP | 195 | config MAC80211_LOWTX_FRAME_DUMP |
128 | bool "Debug frame dumping" | 196 | bool "Debug frame dumping" |
129 | depends on MAC80211_DEBUG | 197 | depends on MAC80211_DEBUG_MENU |
130 | ---help--- | 198 | ---help--- |
131 | Selecting this option will cause the stack to | 199 | Selecting this option will cause the stack to |
132 | print a message for each frame that is handed | 200 | print a message for each frame that is handed |
@@ -137,33 +205,17 @@ config MAC80211_LOWTX_FRAME_DUMP | |||
137 | If unsure, say N and insert the debugging code | 205 | If unsure, say N and insert the debugging code |
138 | you require into the driver you are debugging. | 206 | you require into the driver you are debugging. |
139 | 207 | ||
140 | config MAC80211_TKIP_DEBUG | ||
141 | bool "TKIP debugging" | ||
142 | depends on MAC80211_DEBUG | ||
143 | |||
144 | config MAC80211_DEBUG_COUNTERS | 208 | config MAC80211_DEBUG_COUNTERS |
145 | bool "Extra statistics for TX/RX debugging" | 209 | bool "Extra statistics for TX/RX debugging" |
146 | depends on MAC80211_DEBUG | 210 | depends on MAC80211_DEBUG |
147 | 211 | depends on MAC80211_DEBUG_MENU | |
148 | config MAC80211_IBSS_DEBUG | 212 | depends on MAC80211_DEBUGFS |
149 | bool "Support for IBSS testing" | ||
150 | depends on MAC80211_DEBUG | ||
151 | ---help--- | ||
152 | Say Y here if you intend to debug the IBSS code. | ||
153 | |||
154 | config MAC80211_VERBOSE_PS_DEBUG | ||
155 | bool "Verbose powersave mode debugging" | ||
156 | depends on MAC80211_DEBUG | ||
157 | ---help--- | 213 | ---help--- |
158 | Say Y here to print out verbose powersave | 214 | Selecting this option causes mac80211 to keep additional |
159 | mode debug messages. | 215 | and very verbose statistics about TX and RX handler use |
216 | and show them in debugfs. | ||
160 | 217 | ||
161 | config MAC80211_VERBOSE_MPL_DEBUG | 218 | If unsure, say N. |
162 | bool "Verbose mesh peer link debugging" | ||
163 | depends on MAC80211_DEBUG && MAC80211_MESH | ||
164 | ---help--- | ||
165 | Say Y here to print out verbose mesh peer link | ||
166 | debug messages. | ||
167 | 219 | ||
168 | config MAC80211_VERBOSE_SPECT_MGMT_DEBUG | 220 | config MAC80211_VERBOSE_SPECT_MGMT_DEBUG |
169 | bool "Verbose Spectrum Management (IEEE 802.11h)debugging" | 221 | bool "Verbose Spectrum Management (IEEE 802.11h)debugging" |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 46705ae7a847..f90da1bbec49 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -954,7 +954,7 @@ int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, | |||
954 | void mac80211_ev_michael_mic_failure(struct net_device *dev, int keyidx, | 954 | void mac80211_ev_michael_mic_failure(struct net_device *dev, int keyidx, |
955 | struct ieee80211_hdr *hdr); | 955 | struct ieee80211_hdr *hdr); |
956 | 956 | ||
957 | #ifdef CONFIG_MAC80211_DEBUG | 957 | #ifdef CONFIG_MAC80211_NOINLINE |
958 | #define debug_noinline noinline | 958 | #define debug_noinline noinline |
959 | #else | 959 | #else |
960 | #define debug_noinline | 960 | #define debug_noinline |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 984472702381..eeb16926aa7d 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -184,9 +184,9 @@ void ieee80211_if_set_type(struct net_device *dev, int type) | |||
184 | sdata->u.mntr_flags = MONITOR_FLAG_CONTROL | | 184 | sdata->u.mntr_flags = MONITOR_FLAG_CONTROL | |
185 | MONITOR_FLAG_OTHER_BSS; | 185 | MONITOR_FLAG_OTHER_BSS; |
186 | break; | 186 | break; |
187 | default: | 187 | case IEEE80211_IF_TYPE_INVALID: |
188 | printk(KERN_WARNING "%s: %s: Unknown interface type 0x%x", | 188 | BUG(); |
189 | dev->name, __func__, type); | 189 | break; |
190 | } | 190 | } |
191 | ieee80211_debugfs_change_if_type(sdata, oldtype); | 191 | ieee80211_debugfs_change_if_type(sdata, oldtype); |
192 | } | 192 | } |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index b661ee5bb824..f18cfd727872 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -151,9 +151,7 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) | |||
151 | /* FIX: what would be proper limits for MTU? | 151 | /* FIX: what would be proper limits for MTU? |
152 | * This interface uses 802.3 frames. */ | 152 | * This interface uses 802.3 frames. */ |
153 | if (new_mtu < 256 || | 153 | if (new_mtu < 256 || |
154 | new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) { | 154 | new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) { |
155 | printk(KERN_WARNING "%s: invalid MTU %d\n", | ||
156 | dev->name, new_mtu); | ||
157 | return -EINVAL; | 155 | return -EINVAL; |
158 | } | 156 | } |
159 | 157 | ||
@@ -589,7 +587,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
589 | 587 | ||
590 | sta = sta_info_get(local, ra); | 588 | sta = sta_info_get(local, ra); |
591 | if (!sta) { | 589 | if (!sta) { |
590 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
592 | printk(KERN_DEBUG "Could not find the station\n"); | 591 | printk(KERN_DEBUG "Could not find the station\n"); |
592 | #endif | ||
593 | ret = -ENOENT; | 593 | ret = -ENOENT; |
594 | goto exit; | 594 | goto exit; |
595 | } | 595 | } |
@@ -617,9 +617,11 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
617 | sta->ampdu_mlme.tid_tx[tid] = | 617 | sta->ampdu_mlme.tid_tx[tid] = |
618 | kmalloc(sizeof(struct tid_ampdu_tx), GFP_ATOMIC); | 618 | kmalloc(sizeof(struct tid_ampdu_tx), GFP_ATOMIC); |
619 | if (!sta->ampdu_mlme.tid_tx[tid]) { | 619 | if (!sta->ampdu_mlme.tid_tx[tid]) { |
620 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
620 | if (net_ratelimit()) | 621 | if (net_ratelimit()) |
621 | printk(KERN_ERR "allocate tx mlme to tid %d failed\n", | 622 | printk(KERN_ERR "allocate tx mlme to tid %d failed\n", |
622 | tid); | 623 | tid); |
624 | #endif | ||
623 | ret = -ENOMEM; | 625 | ret = -ENOMEM; |
624 | goto err_unlock_sta; | 626 | goto err_unlock_sta; |
625 | } | 627 | } |
@@ -689,7 +691,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
689 | sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer.expires = | 691 | sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer.expires = |
690 | jiffies + ADDBA_RESP_INTERVAL; | 692 | jiffies + ADDBA_RESP_INTERVAL; |
691 | add_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); | 693 | add_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); |
694 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
692 | printk(KERN_DEBUG "activated addBA response timer on tid %d\n", tid); | 695 | printk(KERN_DEBUG "activated addBA response timer on tid %d\n", tid); |
696 | #endif | ||
693 | goto exit; | 697 | goto exit; |
694 | 698 | ||
695 | err_unlock_queue: | 699 | err_unlock_queue: |
@@ -771,8 +775,10 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
771 | DECLARE_MAC_BUF(mac); | 775 | DECLARE_MAC_BUF(mac); |
772 | 776 | ||
773 | if (tid >= STA_TID_NUM) { | 777 | if (tid >= STA_TID_NUM) { |
778 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
774 | printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", | 779 | printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", |
775 | tid, STA_TID_NUM); | 780 | tid, STA_TID_NUM); |
781 | #endif | ||
776 | return; | 782 | return; |
777 | } | 783 | } |
778 | 784 | ||
@@ -780,8 +786,10 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
780 | sta = sta_info_get(local, ra); | 786 | sta = sta_info_get(local, ra); |
781 | if (!sta) { | 787 | if (!sta) { |
782 | rcu_read_unlock(); | 788 | rcu_read_unlock(); |
789 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
783 | printk(KERN_DEBUG "Could not find station: %s\n", | 790 | printk(KERN_DEBUG "Could not find station: %s\n", |
784 | print_mac(mac, ra)); | 791 | print_mac(mac, ra)); |
792 | #endif | ||
785 | return; | 793 | return; |
786 | } | 794 | } |
787 | 795 | ||
@@ -789,8 +797,10 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
789 | spin_lock_bh(&sta->lock); | 797 | spin_lock_bh(&sta->lock); |
790 | 798 | ||
791 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) { | 799 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) { |
800 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
792 | printk(KERN_DEBUG "addBA was not requested yet, state is %d\n", | 801 | printk(KERN_DEBUG "addBA was not requested yet, state is %d\n", |
793 | *state); | 802 | *state); |
803 | #endif | ||
794 | spin_unlock_bh(&sta->lock); | 804 | spin_unlock_bh(&sta->lock); |
795 | rcu_read_unlock(); | 805 | rcu_read_unlock(); |
796 | return; | 806 | return; |
@@ -801,7 +811,9 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid) | |||
801 | *state |= HT_ADDBA_DRV_READY_MSK; | 811 | *state |= HT_ADDBA_DRV_READY_MSK; |
802 | 812 | ||
803 | if (*state == HT_AGG_STATE_OPERATIONAL) { | 813 | if (*state == HT_AGG_STATE_OPERATIONAL) { |
814 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
804 | printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid); | 815 | printk(KERN_DEBUG "Aggregation is on for tid %d \n", tid); |
816 | #endif | ||
805 | ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); | 817 | ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); |
806 | } | 818 | } |
807 | spin_unlock_bh(&sta->lock); | 819 | spin_unlock_bh(&sta->lock); |
@@ -818,8 +830,10 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid) | |||
818 | DECLARE_MAC_BUF(mac); | 830 | DECLARE_MAC_BUF(mac); |
819 | 831 | ||
820 | if (tid >= STA_TID_NUM) { | 832 | if (tid >= STA_TID_NUM) { |
833 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
821 | printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", | 834 | printk(KERN_DEBUG "Bad TID value: tid = %d (>= %d)\n", |
822 | tid, STA_TID_NUM); | 835 | tid, STA_TID_NUM); |
836 | #endif | ||
823 | return; | 837 | return; |
824 | } | 838 | } |
825 | 839 | ||
@@ -831,8 +845,10 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid) | |||
831 | rcu_read_lock(); | 845 | rcu_read_lock(); |
832 | sta = sta_info_get(local, ra); | 846 | sta = sta_info_get(local, ra); |
833 | if (!sta) { | 847 | if (!sta) { |
848 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
834 | printk(KERN_DEBUG "Could not find station: %s\n", | 849 | printk(KERN_DEBUG "Could not find station: %s\n", |
835 | print_mac(mac, ra)); | 850 | print_mac(mac, ra)); |
851 | #endif | ||
836 | rcu_read_unlock(); | 852 | rcu_read_unlock(); |
837 | return; | 853 | return; |
838 | } | 854 | } |
@@ -842,7 +858,9 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid) | |||
842 | * ieee80211_stop_tx_ba_session will let only | 858 | * ieee80211_stop_tx_ba_session will let only |
843 | * one stop call to pass through per sta/tid */ | 859 | * one stop call to pass through per sta/tid */ |
844 | if ((*state & HT_AGG_STATE_REQ_STOP_BA_MSK) == 0) { | 860 | if ((*state & HT_AGG_STATE_REQ_STOP_BA_MSK) == 0) { |
861 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
845 | printk(KERN_DEBUG "unexpected callback to A-MPDU stop\n"); | 862 | printk(KERN_DEBUG "unexpected callback to A-MPDU stop\n"); |
863 | #endif | ||
846 | rcu_read_unlock(); | 864 | rcu_read_unlock(); |
847 | return; | 865 | return; |
848 | } | 866 | } |
@@ -884,9 +902,11 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, | |||
884 | struct sk_buff *skb = dev_alloc_skb(0); | 902 | struct sk_buff *skb = dev_alloc_skb(0); |
885 | 903 | ||
886 | if (unlikely(!skb)) { | 904 | if (unlikely(!skb)) { |
905 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
887 | if (net_ratelimit()) | 906 | if (net_ratelimit()) |
888 | printk(KERN_WARNING "%s: Not enough memory, " | 907 | printk(KERN_WARNING "%s: Not enough memory, " |
889 | "dropping start BA session", skb->dev->name); | 908 | "dropping start BA session", skb->dev->name); |
909 | #endif | ||
890 | return; | 910 | return; |
891 | } | 911 | } |
892 | ra_tid = (struct ieee80211_ra_tid *) &skb->cb; | 912 | ra_tid = (struct ieee80211_ra_tid *) &skb->cb; |
@@ -907,9 +927,11 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, | |||
907 | struct sk_buff *skb = dev_alloc_skb(0); | 927 | struct sk_buff *skb = dev_alloc_skb(0); |
908 | 928 | ||
909 | if (unlikely(!skb)) { | 929 | if (unlikely(!skb)) { |
930 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
910 | if (net_ratelimit()) | 931 | if (net_ratelimit()) |
911 | printk(KERN_WARNING "%s: Not enough memory, " | 932 | printk(KERN_WARNING "%s: Not enough memory, " |
912 | "dropping stop BA session", skb->dev->name); | 933 | "dropping stop BA session", skb->dev->name); |
934 | #endif | ||
913 | return; | 935 | return; |
914 | } | 936 | } |
915 | ra_tid = (struct ieee80211_ra_tid *) &skb->cb; | 937 | ra_tid = (struct ieee80211_ra_tid *) &skb->cb; |
@@ -1236,9 +1258,8 @@ static void ieee80211_tasklet_handler(unsigned long data) | |||
1236 | ra_tid->ra, ra_tid->tid); | 1258 | ra_tid->ra, ra_tid->tid); |
1237 | dev_kfree_skb(skb); | 1259 | dev_kfree_skb(skb); |
1238 | break ; | 1260 | break ; |
1239 | default: /* should never get here! */ | 1261 | default: |
1240 | printk(KERN_ERR "%s: Unknown message type (%d)\n", | 1262 | WARN_ON(1); |
1241 | wiphy_name(local->hw.wiphy), skb->pkt_type); | ||
1242 | dev_kfree_skb(skb); | 1263 | dev_kfree_skb(skb); |
1243 | break; | 1264 | break; |
1244 | } | 1265 | } |
@@ -1365,12 +1386,14 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local, | |||
1365 | return; | 1386 | return; |
1366 | } | 1387 | } |
1367 | 1388 | ||
1389 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | ||
1368 | if (net_ratelimit()) | 1390 | if (net_ratelimit()) |
1369 | printk(KERN_DEBUG "%s: dropped TX filtered frame, " | 1391 | printk(KERN_DEBUG "%s: dropped TX filtered frame, " |
1370 | "queue_len=%d PS=%d @%lu\n", | 1392 | "queue_len=%d PS=%d @%lu\n", |
1371 | wiphy_name(local->hw.wiphy), | 1393 | wiphy_name(local->hw.wiphy), |
1372 | skb_queue_len(&sta->tx_filtered), | 1394 | skb_queue_len(&sta->tx_filtered), |
1373 | !!test_sta_flags(sta, WLAN_STA_PS), jiffies); | 1395 | !!test_sta_flags(sta, WLAN_STA_PS), jiffies); |
1396 | #endif | ||
1374 | dev_kfree_skb(skb); | 1397 | dev_kfree_skb(skb); |
1375 | } | 1398 | } |
1376 | 1399 | ||
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 0a310d09ab07..4a3bddd206d8 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -346,7 +346,7 @@ static void ieee80211_sta_wmm_params(struct net_device *dev, | |||
346 | params.cw_max = ecw2cw((pos[1] & 0xf0) >> 4); | 346 | params.cw_max = ecw2cw((pos[1] & 0xf0) >> 4); |
347 | params.cw_min = ecw2cw(pos[1] & 0x0f); | 347 | params.cw_min = ecw2cw(pos[1] & 0x0f); |
348 | params.txop = pos[2] | (pos[3] << 8); | 348 | params.txop = pos[2] | (pos[3] << 8); |
349 | #ifdef CONFIG_MAC80211_DEBUG | 349 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
350 | printk(KERN_DEBUG "%s: WMM queue=%d aci=%d acm=%d aifs=%d " | 350 | printk(KERN_DEBUG "%s: WMM queue=%d aci=%d acm=%d aifs=%d " |
351 | "cWmin=%d cWmax=%d txop=%d\n", | 351 | "cWmin=%d cWmax=%d txop=%d\n", |
352 | dev->name, queue, aci, acm, params.aifs, params.cw_min, | 352 | dev->name, queue, aci, acm, params.aifs, params.cw_min, |
@@ -371,6 +371,7 @@ static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata, | |||
371 | u32 changed = 0; | 371 | u32 changed = 0; |
372 | 372 | ||
373 | if (use_protection != bss_conf->use_cts_prot) { | 373 | if (use_protection != bss_conf->use_cts_prot) { |
374 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | ||
374 | if (net_ratelimit()) { | 375 | if (net_ratelimit()) { |
375 | printk(KERN_DEBUG "%s: CTS protection %s (BSSID=" | 376 | printk(KERN_DEBUG "%s: CTS protection %s (BSSID=" |
376 | "%s)\n", | 377 | "%s)\n", |
@@ -378,11 +379,13 @@ static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata, | |||
378 | use_protection ? "enabled" : "disabled", | 379 | use_protection ? "enabled" : "disabled", |
379 | print_mac(mac, ifsta->bssid)); | 380 | print_mac(mac, ifsta->bssid)); |
380 | } | 381 | } |
382 | #endif | ||
381 | bss_conf->use_cts_prot = use_protection; | 383 | bss_conf->use_cts_prot = use_protection; |
382 | changed |= BSS_CHANGED_ERP_CTS_PROT; | 384 | changed |= BSS_CHANGED_ERP_CTS_PROT; |
383 | } | 385 | } |
384 | 386 | ||
385 | if (use_short_preamble != bss_conf->use_short_preamble) { | 387 | if (use_short_preamble != bss_conf->use_short_preamble) { |
388 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | ||
386 | if (net_ratelimit()) { | 389 | if (net_ratelimit()) { |
387 | printk(KERN_DEBUG "%s: switched to %s barker preamble" | 390 | printk(KERN_DEBUG "%s: switched to %s barker preamble" |
388 | " (BSSID=%s)\n", | 391 | " (BSSID=%s)\n", |
@@ -390,6 +393,7 @@ static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata, | |||
390 | use_short_preamble ? "short" : "long", | 393 | use_short_preamble ? "short" : "long", |
391 | print_mac(mac, ifsta->bssid)); | 394 | print_mac(mac, ifsta->bssid)); |
392 | } | 395 | } |
396 | #endif | ||
393 | bss_conf->use_short_preamble = use_short_preamble; | 397 | bss_conf->use_short_preamble = use_short_preamble; |
394 | changed |= BSS_CHANGED_ERP_PREAMBLE; | 398 | changed |= BSS_CHANGED_ERP_PREAMBLE; |
395 | } | 399 | } |
@@ -1175,14 +1179,10 @@ static void ieee80211_auth_challenge(struct net_device *dev, | |||
1175 | u8 *pos; | 1179 | u8 *pos; |
1176 | struct ieee802_11_elems elems; | 1180 | struct ieee802_11_elems elems; |
1177 | 1181 | ||
1178 | printk(KERN_DEBUG "%s: replying to auth challenge\n", dev->name); | ||
1179 | pos = mgmt->u.auth.variable; | 1182 | pos = mgmt->u.auth.variable; |
1180 | ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems); | 1183 | ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems); |
1181 | if (!elems.challenge) { | 1184 | if (!elems.challenge) |
1182 | printk(KERN_DEBUG "%s: no challenge IE in shared key auth " | ||
1183 | "frame\n", dev->name); | ||
1184 | return; | 1185 | return; |
1185 | } | ||
1186 | ieee80211_send_auth(dev, ifsta, 3, elems.challenge - 2, | 1186 | ieee80211_send_auth(dev, ifsta, 3, elems.challenge - 2, |
1187 | elems.challenge_len + 2, 1); | 1187 | elems.challenge_len + 2, 1); |
1188 | } | 1188 | } |
@@ -1364,9 +1364,11 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev, | |||
1364 | sta->ampdu_mlme.tid_rx[tid] = | 1364 | sta->ampdu_mlme.tid_rx[tid] = |
1365 | kmalloc(sizeof(struct tid_ampdu_rx), GFP_ATOMIC); | 1365 | kmalloc(sizeof(struct tid_ampdu_rx), GFP_ATOMIC); |
1366 | if (!sta->ampdu_mlme.tid_rx[tid]) { | 1366 | if (!sta->ampdu_mlme.tid_rx[tid]) { |
1367 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
1367 | if (net_ratelimit()) | 1368 | if (net_ratelimit()) |
1368 | printk(KERN_ERR "allocate rx mlme to tid %d failed\n", | 1369 | printk(KERN_ERR "allocate rx mlme to tid %d failed\n", |
1369 | tid); | 1370 | tid); |
1371 | #endif | ||
1370 | goto end; | 1372 | goto end; |
1371 | } | 1373 | } |
1372 | /* rx timer */ | 1374 | /* rx timer */ |
@@ -1382,9 +1384,11 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev, | |||
1382 | tid_agg_rx->reorder_buf = | 1384 | tid_agg_rx->reorder_buf = |
1383 | kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC); | 1385 | kmalloc(buf_size * sizeof(struct sk_buff *), GFP_ATOMIC); |
1384 | if (!tid_agg_rx->reorder_buf) { | 1386 | if (!tid_agg_rx->reorder_buf) { |
1387 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
1385 | if (net_ratelimit()) | 1388 | if (net_ratelimit()) |
1386 | printk(KERN_ERR "can not allocate reordering buffer " | 1389 | printk(KERN_ERR "can not allocate reordering buffer " |
1387 | "to tid %d\n", tid); | 1390 | "to tid %d\n", tid); |
1391 | #endif | ||
1388 | kfree(sta->ampdu_mlme.tid_rx[tid]); | 1392 | kfree(sta->ampdu_mlme.tid_rx[tid]); |
1389 | goto end; | 1393 | goto end; |
1390 | } | 1394 | } |
@@ -1451,8 +1455,6 @@ static void ieee80211_sta_process_addba_resp(struct net_device *dev, | |||
1451 | 1455 | ||
1452 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) { | 1456 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) { |
1453 | spin_unlock_bh(&sta->lock); | 1457 | spin_unlock_bh(&sta->lock); |
1454 | printk(KERN_DEBUG "state not HT_ADDBA_REQUESTED_MSK:" | ||
1455 | "%d\n", *state); | ||
1456 | goto addba_resp_exit; | 1458 | goto addba_resp_exit; |
1457 | } | 1459 | } |
1458 | 1460 | ||
@@ -1471,22 +1473,14 @@ static void ieee80211_sta_process_addba_resp(struct net_device *dev, | |||
1471 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | 1473 | #endif /* CONFIG_MAC80211_HT_DEBUG */ |
1472 | if (le16_to_cpu(mgmt->u.action.u.addba_resp.status) | 1474 | if (le16_to_cpu(mgmt->u.action.u.addba_resp.status) |
1473 | == WLAN_STATUS_SUCCESS) { | 1475 | == WLAN_STATUS_SUCCESS) { |
1474 | if (*state & HT_ADDBA_RECEIVED_MSK) | ||
1475 | printk(KERN_DEBUG "double addBA response\n"); | ||
1476 | |||
1477 | *state |= HT_ADDBA_RECEIVED_MSK; | 1476 | *state |= HT_ADDBA_RECEIVED_MSK; |
1478 | sta->ampdu_mlme.addba_req_num[tid] = 0; | 1477 | sta->ampdu_mlme.addba_req_num[tid] = 0; |
1479 | 1478 | ||
1480 | if (*state == HT_AGG_STATE_OPERATIONAL) { | 1479 | if (*state == HT_AGG_STATE_OPERATIONAL) |
1481 | printk(KERN_DEBUG "Aggregation on for tid %d \n", tid); | ||
1482 | ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); | 1480 | ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); |
1483 | } | ||
1484 | 1481 | ||
1485 | spin_unlock_bh(&sta->lock); | 1482 | spin_unlock_bh(&sta->lock); |
1486 | printk(KERN_DEBUG "recipient accepted agg: tid %d \n", tid); | ||
1487 | } else { | 1483 | } else { |
1488 | printk(KERN_DEBUG "recipient rejected agg: tid %d \n", tid); | ||
1489 | |||
1490 | sta->ampdu_mlme.addba_req_num[tid]++; | 1484 | sta->ampdu_mlme.addba_req_num[tid]++; |
1491 | /* this will allow the state check in stop_BA_session */ | 1485 | /* this will allow the state check in stop_BA_session */ |
1492 | *state = HT_AGG_STATE_OPERATIONAL; | 1486 | *state = HT_AGG_STATE_OPERATIONAL; |
@@ -1585,7 +1579,7 @@ void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *ra, u16 tid, | |||
1585 | ra, tid, NULL); | 1579 | ra, tid, NULL); |
1586 | if (ret) | 1580 | if (ret) |
1587 | printk(KERN_DEBUG "HW problem - can not stop rx " | 1581 | printk(KERN_DEBUG "HW problem - can not stop rx " |
1588 | "aggergation for tid %d\n", tid); | 1582 | "aggregation for tid %d\n", tid); |
1589 | 1583 | ||
1590 | /* shutdown timer has not expired */ | 1584 | /* shutdown timer has not expired */ |
1591 | if (initiator != WLAN_BACK_TIMER) | 1585 | if (initiator != WLAN_BACK_TIMER) |
@@ -1691,12 +1685,16 @@ void sta_addba_resp_timer_expired(unsigned long data) | |||
1691 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) { | 1685 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) { |
1692 | spin_unlock_bh(&sta->lock); | 1686 | spin_unlock_bh(&sta->lock); |
1693 | *state = HT_AGG_STATE_IDLE; | 1687 | *state = HT_AGG_STATE_IDLE; |
1688 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
1694 | printk(KERN_DEBUG "timer expired on tid %d but we are not " | 1689 | printk(KERN_DEBUG "timer expired on tid %d but we are not " |
1695 | "expecting addBA response there", tid); | 1690 | "expecting addBA response there", tid); |
1691 | #endif | ||
1696 | goto timer_expired_exit; | 1692 | goto timer_expired_exit; |
1697 | } | 1693 | } |
1698 | 1694 | ||
1695 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
1699 | printk(KERN_DEBUG "addBA response timer expired on tid %d\n", tid); | 1696 | printk(KERN_DEBUG "addBA response timer expired on tid %d\n", tid); |
1697 | #endif | ||
1700 | 1698 | ||
1701 | /* go through the state check in stop_BA_session */ | 1699 | /* go through the state check in stop_BA_session */ |
1702 | *state = HT_AGG_STATE_OPERATIONAL; | 1700 | *state = HT_AGG_STATE_OPERATIONAL; |
@@ -1724,7 +1722,9 @@ static void sta_rx_agg_session_timer_expired(unsigned long data) | |||
1724 | struct sta_info *sta = container_of(timer_to_id, struct sta_info, | 1722 | struct sta_info *sta = container_of(timer_to_id, struct sta_info, |
1725 | timer_to_tid[0]); | 1723 | timer_to_tid[0]); |
1726 | 1724 | ||
1725 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
1727 | printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid); | 1726 | printk(KERN_DEBUG "rx session timer expired on tid %d\n", (u16)*ptid); |
1727 | #endif | ||
1728 | ieee80211_sta_stop_rx_ba_session(sta->sdata->dev, sta->addr, | 1728 | ieee80211_sta_stop_rx_ba_session(sta->sdata->dev, sta->addr, |
1729 | (u16)*ptid, WLAN_BACK_TIMER, | 1729 | (u16)*ptid, WLAN_BACK_TIMER, |
1730 | WLAN_REASON_QSTA_TIMEOUT); | 1730 | WLAN_REASON_QSTA_TIMEOUT); |
@@ -1819,47 +1819,24 @@ static void ieee80211_rx_mgmt_auth(struct net_device *dev, | |||
1819 | DECLARE_MAC_BUF(mac); | 1819 | DECLARE_MAC_BUF(mac); |
1820 | 1820 | ||
1821 | if (ifsta->state != IEEE80211_AUTHENTICATE && | 1821 | if (ifsta->state != IEEE80211_AUTHENTICATE && |
1822 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS) { | 1822 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS) |
1823 | printk(KERN_DEBUG "%s: authentication frame received from " | ||
1824 | "%s, but not in authenticate state - ignored\n", | ||
1825 | dev->name, print_mac(mac, mgmt->sa)); | ||
1826 | return; | 1823 | return; |
1827 | } | ||
1828 | 1824 | ||
1829 | if (len < 24 + 6) { | 1825 | if (len < 24 + 6) |
1830 | printk(KERN_DEBUG "%s: too short (%zd) authentication frame " | ||
1831 | "received from %s - ignored\n", | ||
1832 | dev->name, len, print_mac(mac, mgmt->sa)); | ||
1833 | return; | 1826 | return; |
1834 | } | ||
1835 | 1827 | ||
1836 | if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && | 1828 | if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && |
1837 | memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { | 1829 | memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) |
1838 | printk(KERN_DEBUG "%s: authentication frame received from " | ||
1839 | "unknown AP (SA=%s BSSID=%s) - " | ||
1840 | "ignored\n", dev->name, print_mac(mac, mgmt->sa), | ||
1841 | print_mac(mac, mgmt->bssid)); | ||
1842 | return; | 1830 | return; |
1843 | } | ||
1844 | 1831 | ||
1845 | if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && | 1832 | if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && |
1846 | memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0) { | 1833 | memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0) |
1847 | printk(KERN_DEBUG "%s: authentication frame received from " | ||
1848 | "unknown BSSID (SA=%s BSSID=%s) - " | ||
1849 | "ignored\n", dev->name, print_mac(mac, mgmt->sa), | ||
1850 | print_mac(mac, mgmt->bssid)); | ||
1851 | return; | 1834 | return; |
1852 | } | ||
1853 | 1835 | ||
1854 | auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg); | 1836 | auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg); |
1855 | auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); | 1837 | auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); |
1856 | status_code = le16_to_cpu(mgmt->u.auth.status_code); | 1838 | status_code = le16_to_cpu(mgmt->u.auth.status_code); |
1857 | 1839 | ||
1858 | printk(KERN_DEBUG "%s: RX authentication from %s (alg=%d " | ||
1859 | "transaction=%d status=%d)\n", | ||
1860 | dev->name, print_mac(mac, mgmt->sa), auth_alg, | ||
1861 | auth_transaction, status_code); | ||
1862 | |||
1863 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 1840 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { |
1864 | /* | 1841 | /* |
1865 | * IEEE 802.11 standard does not require authentication in IBSS | 1842 | * IEEE 802.11 standard does not require authentication in IBSS |
@@ -1867,26 +1844,16 @@ static void ieee80211_rx_mgmt_auth(struct net_device *dev, | |||
1867 | * However, try to reply to authentication attempts if someone | 1844 | * However, try to reply to authentication attempts if someone |
1868 | * has actually implemented this. | 1845 | * has actually implemented this. |
1869 | */ | 1846 | */ |
1870 | if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1) { | 1847 | if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1) |
1871 | printk(KERN_DEBUG "%s: unexpected IBSS authentication " | ||
1872 | "frame (alg=%d transaction=%d)\n", | ||
1873 | dev->name, auth_alg, auth_transaction); | ||
1874 | return; | 1848 | return; |
1875 | } | ||
1876 | ieee80211_send_auth(dev, ifsta, 2, NULL, 0, 0); | 1849 | ieee80211_send_auth(dev, ifsta, 2, NULL, 0, 0); |
1877 | } | 1850 | } |
1878 | 1851 | ||
1879 | if (auth_alg != ifsta->auth_alg || | 1852 | if (auth_alg != ifsta->auth_alg || |
1880 | auth_transaction != ifsta->auth_transaction) { | 1853 | auth_transaction != ifsta->auth_transaction) |
1881 | printk(KERN_DEBUG "%s: unexpected authentication frame " | ||
1882 | "(alg=%d transaction=%d)\n", | ||
1883 | dev->name, auth_alg, auth_transaction); | ||
1884 | return; | 1854 | return; |
1885 | } | ||
1886 | 1855 | ||
1887 | if (status_code != WLAN_STATUS_SUCCESS) { | 1856 | if (status_code != WLAN_STATUS_SUCCESS) { |
1888 | printk(KERN_DEBUG "%s: AP denied authentication (auth_alg=%d " | ||
1889 | "code=%d)\n", dev->name, ifsta->auth_alg, status_code); | ||
1890 | if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { | 1857 | if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { |
1891 | u8 algs[3]; | 1858 | u8 algs[3]; |
1892 | const int num_algs = ARRAY_SIZE(algs); | 1859 | const int num_algs = ARRAY_SIZE(algs); |
@@ -1915,9 +1882,6 @@ static void ieee80211_rx_mgmt_auth(struct net_device *dev, | |||
1915 | !ieee80211_sta_wep_configured(dev)) | 1882 | !ieee80211_sta_wep_configured(dev)) |
1916 | continue; | 1883 | continue; |
1917 | ifsta->auth_alg = algs[pos]; | 1884 | ifsta->auth_alg = algs[pos]; |
1918 | printk(KERN_DEBUG "%s: set auth_alg=%d for " | ||
1919 | "next try\n", | ||
1920 | dev->name, ifsta->auth_alg); | ||
1921 | break; | 1885 | break; |
1922 | } | 1886 | } |
1923 | } | 1887 | } |
@@ -1947,27 +1911,14 @@ static void ieee80211_rx_mgmt_deauth(struct net_device *dev, | |||
1947 | u16 reason_code; | 1911 | u16 reason_code; |
1948 | DECLARE_MAC_BUF(mac); | 1912 | DECLARE_MAC_BUF(mac); |
1949 | 1913 | ||
1950 | if (len < 24 + 2) { | 1914 | if (len < 24 + 2) |
1951 | printk(KERN_DEBUG "%s: too short (%zd) deauthentication frame " | ||
1952 | "received from %s - ignored\n", | ||
1953 | dev->name, len, print_mac(mac, mgmt->sa)); | ||
1954 | return; | 1915 | return; |
1955 | } | ||
1956 | 1916 | ||
1957 | if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { | 1917 | if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN)) |
1958 | printk(KERN_DEBUG "%s: deauthentication frame received from " | ||
1959 | "unknown AP (SA=%s BSSID=%s) - " | ||
1960 | "ignored\n", dev->name, print_mac(mac, mgmt->sa), | ||
1961 | print_mac(mac, mgmt->bssid)); | ||
1962 | return; | 1918 | return; |
1963 | } | ||
1964 | 1919 | ||
1965 | reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); | 1920 | reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); |
1966 | 1921 | ||
1967 | printk(KERN_DEBUG "%s: RX deauthentication from %s" | ||
1968 | " (reason=%d)\n", | ||
1969 | dev->name, print_mac(mac, mgmt->sa), reason_code); | ||
1970 | |||
1971 | if (ifsta->flags & IEEE80211_STA_AUTHENTICATED) | 1922 | if (ifsta->flags & IEEE80211_STA_AUTHENTICATED) |
1972 | printk(KERN_DEBUG "%s: deauthenticated\n", dev->name); | 1923 | printk(KERN_DEBUG "%s: deauthenticated\n", dev->name); |
1973 | 1924 | ||
@@ -1992,27 +1943,14 @@ static void ieee80211_rx_mgmt_disassoc(struct net_device *dev, | |||
1992 | u16 reason_code; | 1943 | u16 reason_code; |
1993 | DECLARE_MAC_BUF(mac); | 1944 | DECLARE_MAC_BUF(mac); |
1994 | 1945 | ||
1995 | if (len < 24 + 2) { | 1946 | if (len < 24 + 2) |
1996 | printk(KERN_DEBUG "%s: too short (%zd) disassociation frame " | ||
1997 | "received from %s - ignored\n", | ||
1998 | dev->name, len, print_mac(mac, mgmt->sa)); | ||
1999 | return; | 1947 | return; |
2000 | } | ||
2001 | 1948 | ||
2002 | if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { | 1949 | if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN)) |
2003 | printk(KERN_DEBUG "%s: disassociation frame received from " | ||
2004 | "unknown AP (SA=%s BSSID=%s) - " | ||
2005 | "ignored\n", dev->name, print_mac(mac, mgmt->sa), | ||
2006 | print_mac(mac, mgmt->bssid)); | ||
2007 | return; | 1950 | return; |
2008 | } | ||
2009 | 1951 | ||
2010 | reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); | 1952 | reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code); |
2011 | 1953 | ||
2012 | printk(KERN_DEBUG "%s: RX disassociation from %s" | ||
2013 | " (reason=%d)\n", | ||
2014 | dev->name, print_mac(mac, mgmt->sa), reason_code); | ||
2015 | |||
2016 | if (ifsta->flags & IEEE80211_STA_ASSOCIATED) | 1954 | if (ifsta->flags & IEEE80211_STA_ASSOCIATED) |
2017 | printk(KERN_DEBUG "%s: disassociated\n", dev->name); | 1955 | printk(KERN_DEBUG "%s: disassociated\n", dev->name); |
2018 | 1956 | ||
@@ -2048,27 +1986,14 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
2048 | /* AssocResp and ReassocResp have identical structure, so process both | 1986 | /* AssocResp and ReassocResp have identical structure, so process both |
2049 | * of them in this function. */ | 1987 | * of them in this function. */ |
2050 | 1988 | ||
2051 | if (ifsta->state != IEEE80211_ASSOCIATE) { | 1989 | if (ifsta->state != IEEE80211_ASSOCIATE) |
2052 | printk(KERN_DEBUG "%s: association frame received from " | ||
2053 | "%s, but not in associate state - ignored\n", | ||
2054 | dev->name, print_mac(mac, mgmt->sa)); | ||
2055 | return; | 1990 | return; |
2056 | } | ||
2057 | 1991 | ||
2058 | if (len < 24 + 6) { | 1992 | if (len < 24 + 6) |
2059 | printk(KERN_DEBUG "%s: too short (%zd) association frame " | ||
2060 | "received from %s - ignored\n", | ||
2061 | dev->name, len, print_mac(mac, mgmt->sa)); | ||
2062 | return; | 1993 | return; |
2063 | } | ||
2064 | 1994 | ||
2065 | if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) { | 1995 | if (memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) |
2066 | printk(KERN_DEBUG "%s: association frame received from " | ||
2067 | "unknown AP (SA=%s BSSID=%s) - " | ||
2068 | "ignored\n", dev->name, print_mac(mac, mgmt->sa), | ||
2069 | print_mac(mac, mgmt->bssid)); | ||
2070 | return; | 1996 | return; |
2071 | } | ||
2072 | 1997 | ||
2073 | capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info); | 1998 | capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info); |
2074 | status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code); | 1999 | status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code); |
@@ -2663,12 +2588,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
2663 | if (!beacon && memcmp(mgmt->da, dev->dev_addr, ETH_ALEN)) | 2588 | if (!beacon && memcmp(mgmt->da, dev->dev_addr, ETH_ALEN)) |
2664 | return; /* ignore ProbeResp to foreign address */ | 2589 | return; /* ignore ProbeResp to foreign address */ |
2665 | 2590 | ||
2666 | #if 0 | ||
2667 | printk(KERN_DEBUG "%s: RX %s from %s to %s\n", | ||
2668 | dev->name, beacon ? "Beacon" : "Probe Response", | ||
2669 | print_mac(mac, mgmt->sa), print_mac(mac2, mgmt->da)); | ||
2670 | #endif | ||
2671 | |||
2672 | beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp); | 2591 | beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp); |
2673 | 2592 | ||
2674 | if (ieee80211_vif_is_mesh(&sdata->vif) && elems->mesh_id && | 2593 | if (ieee80211_vif_is_mesh(&sdata->vif) && elems->mesh_id && |
@@ -2698,15 +2617,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
2698 | sta->supp_rates[rx_status->band] = | 2617 | sta->supp_rates[rx_status->band] = |
2699 | sdata->u.sta.supp_rates_bits[rx_status->band]; | 2618 | sdata->u.sta.supp_rates_bits[rx_status->band]; |
2700 | } | 2619 | } |
2701 | if (sta->supp_rates[rx_status->band] != prev_rates) { | ||
2702 | printk(KERN_DEBUG "%s: updated supp_rates set for " | ||
2703 | "%s based on beacon info (0x%llx & 0x%llx -> " | ||
2704 | "0x%llx)\n", | ||
2705 | dev->name, print_mac(mac, sta->addr), | ||
2706 | (unsigned long long) prev_rates, | ||
2707 | (unsigned long long) supp_rates, | ||
2708 | (unsigned long long) sta->supp_rates[rx_status->band]); | ||
2709 | } | ||
2710 | } | 2620 | } |
2711 | 2621 | ||
2712 | rcu_read_unlock(); | 2622 | rcu_read_unlock(); |
@@ -2962,11 +2872,10 @@ static void ieee80211_rx_bss_info(struct net_device *dev, | |||
2962 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 2872 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
2963 | if (beacon_timestamp > rx_timestamp) { | 2873 | if (beacon_timestamp > rx_timestamp) { |
2964 | #ifndef CONFIG_MAC80211_IBSS_DEBUG | 2874 | #ifndef CONFIG_MAC80211_IBSS_DEBUG |
2965 | if (net_ratelimit()) | 2875 | printk(KERN_DEBUG "%s: beacon TSF higher than " |
2876 | "local TSF - IBSS merge with BSSID %s\n", | ||
2877 | dev->name, print_mac(mac, mgmt->bssid)); | ||
2966 | #endif | 2878 | #endif |
2967 | printk(KERN_DEBUG "%s: beacon TSF higher than " | ||
2968 | "local TSF - IBSS merge with BSSID %s\n", | ||
2969 | dev->name, print_mac(mac, mgmt->bssid)); | ||
2970 | ieee80211_sta_join_ibss(dev, &sdata->u.sta, bss); | 2879 | ieee80211_sta_join_ibss(dev, &sdata->u.sta, bss); |
2971 | ieee80211_ibss_add_sta(dev, NULL, | 2880 | ieee80211_ibss_add_sta(dev, NULL, |
2972 | mgmt->bssid, mgmt->sa, | 2881 | mgmt->bssid, mgmt->sa, |
@@ -3106,11 +3015,11 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev, | |||
3106 | pos = mgmt->u.probe_req.variable; | 3015 | pos = mgmt->u.probe_req.variable; |
3107 | if (pos[0] != WLAN_EID_SSID || | 3016 | if (pos[0] != WLAN_EID_SSID || |
3108 | pos + 2 + pos[1] > end) { | 3017 | pos + 2 + pos[1] > end) { |
3109 | if (net_ratelimit()) { | 3018 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
3110 | printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " | 3019 | printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " |
3111 | "from %s\n", | 3020 | "from %s\n", |
3112 | dev->name, print_mac(mac, mgmt->sa)); | 3021 | dev->name, print_mac(mac, mgmt->sa)); |
3113 | } | 3022 | #endif |
3114 | return; | 3023 | return; |
3115 | } | 3024 | } |
3116 | if (pos[1] != 0 && | 3025 | if (pos[1] != 0 && |
@@ -3179,11 +3088,6 @@ static void ieee80211_rx_mgmt_action(struct net_device *dev, | |||
3179 | break; | 3088 | break; |
3180 | ieee80211_sta_process_delba(dev, mgmt, len); | 3089 | ieee80211_sta_process_delba(dev, mgmt, len); |
3181 | break; | 3090 | break; |
3182 | default: | ||
3183 | if (net_ratelimit()) | ||
3184 | printk(KERN_DEBUG "%s: Rx unknown A-MPDU action\n", | ||
3185 | dev->name); | ||
3186 | break; | ||
3187 | } | 3091 | } |
3188 | break; | 3092 | break; |
3189 | case PLINK_CATEGORY: | 3093 | case PLINK_CATEGORY: |
@@ -3194,11 +3098,6 @@ static void ieee80211_rx_mgmt_action(struct net_device *dev, | |||
3194 | if (ieee80211_vif_is_mesh(&sdata->vif)) | 3098 | if (ieee80211_vif_is_mesh(&sdata->vif)) |
3195 | mesh_rx_path_sel_frame(dev, mgmt, len); | 3099 | mesh_rx_path_sel_frame(dev, mgmt, len); |
3196 | break; | 3100 | break; |
3197 | default: | ||
3198 | if (net_ratelimit()) | ||
3199 | printk(KERN_DEBUG "%s: Rx unknown action frame - " | ||
3200 | "category=%d\n", dev->name, mgmt->u.action.category); | ||
3201 | break; | ||
3202 | } | 3101 | } |
3203 | } | 3102 | } |
3204 | 3103 | ||
@@ -3234,11 +3133,6 @@ void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb, | |||
3234 | skb_queue_tail(&ifsta->skb_queue, skb); | 3133 | skb_queue_tail(&ifsta->skb_queue, skb); |
3235 | queue_work(local->hw.workqueue, &ifsta->work); | 3134 | queue_work(local->hw.workqueue, &ifsta->work); |
3236 | return; | 3135 | return; |
3237 | default: | ||
3238 | printk(KERN_DEBUG "%s: received unknown management frame - " | ||
3239 | "stype=%d\n", dev->name, | ||
3240 | (fc & IEEE80211_FCTL_STYPE) >> 4); | ||
3241 | break; | ||
3242 | } | 3136 | } |
3243 | 3137 | ||
3244 | fail: | 3138 | fail: |
@@ -3367,8 +3261,10 @@ static void ieee80211_sta_expire(struct net_device *dev, unsigned long exp_time) | |||
3367 | spin_lock_irqsave(&local->sta_lock, flags); | 3261 | spin_lock_irqsave(&local->sta_lock, flags); |
3368 | list_for_each_entry_safe(sta, tmp, &local->sta_list, list) | 3262 | list_for_each_entry_safe(sta, tmp, &local->sta_list, list) |
3369 | if (time_after(jiffies, sta->last_rx + exp_time)) { | 3263 | if (time_after(jiffies, sta->last_rx + exp_time)) { |
3264 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | ||
3370 | printk(KERN_DEBUG "%s: expiring inactive STA %s\n", | 3265 | printk(KERN_DEBUG "%s: expiring inactive STA %s\n", |
3371 | dev->name, print_mac(mac, sta->addr)); | 3266 | dev->name, print_mac(mac, sta->addr)); |
3267 | #endif | ||
3372 | __sta_info_unlink(&sta); | 3268 | __sta_info_unlink(&sta); |
3373 | if (sta) | 3269 | if (sta) |
3374 | list_add(&sta->list, &tmp_list); | 3270 | list_add(&sta->list, &tmp_list); |
@@ -3451,13 +3347,10 @@ void ieee80211_sta_work(struct work_struct *work) | |||
3451 | if (local->sta_sw_scanning || local->sta_hw_scanning) | 3347 | if (local->sta_sw_scanning || local->sta_hw_scanning) |
3452 | return; | 3348 | return; |
3453 | 3349 | ||
3454 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA && | 3350 | if (WARN_ON(sdata->vif.type != IEEE80211_IF_TYPE_STA && |
3455 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS && | 3351 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS && |
3456 | sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) { | 3352 | sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)) |
3457 | printk(KERN_DEBUG "%s: ieee80211_sta_work: non-STA interface " | ||
3458 | "(type=%d)\n", dev->name, sdata->vif.type); | ||
3459 | return; | 3353 | return; |
3460 | } | ||
3461 | ifsta = &sdata->u.sta; | 3354 | ifsta = &sdata->u.sta; |
3462 | 3355 | ||
3463 | while ((skb = skb_dequeue(&ifsta->skb_queue))) | 3356 | while ((skb = skb_dequeue(&ifsta->skb_queue))) |
@@ -3511,8 +3404,7 @@ void ieee80211_sta_work(struct work_struct *work) | |||
3511 | break; | 3404 | break; |
3512 | #endif | 3405 | #endif |
3513 | default: | 3406 | default: |
3514 | printk(KERN_DEBUG "ieee80211_sta_work: Unknown state %d\n", | 3407 | WARN_ON(1); |
3515 | ifsta->state); | ||
3516 | break; | 3408 | break; |
3517 | } | 3409 | } |
3518 | 3410 | ||
@@ -3547,8 +3439,6 @@ static void ieee80211_sta_reset_auth(struct net_device *dev, | |||
3547 | ifsta->auth_alg = WLAN_AUTH_LEAP; | 3439 | ifsta->auth_alg = WLAN_AUTH_LEAP; |
3548 | else | 3440 | else |
3549 | ifsta->auth_alg = WLAN_AUTH_OPEN; | 3441 | ifsta->auth_alg = WLAN_AUTH_OPEN; |
3550 | printk(KERN_DEBUG "%s: Initial auth_alg=%d\n", dev->name, | ||
3551 | ifsta->auth_alg); | ||
3552 | ifsta->auth_transaction = -1; | 3442 | ifsta->auth_transaction = -1; |
3553 | ifsta->flags &= ~IEEE80211_STA_ASSOCIATED; | 3443 | ifsta->flags &= ~IEEE80211_STA_ASSOCIATED; |
3554 | ifsta->auth_tries = ifsta->assoc_tries = 0; | 3444 | ifsta->auth_tries = ifsta->assoc_tries = 0; |
@@ -4474,8 +4364,10 @@ struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev, | |||
4474 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) | 4364 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) |
4475 | return NULL; | 4365 | return NULL; |
4476 | 4366 | ||
4367 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | ||
4477 | printk(KERN_DEBUG "%s: Adding new IBSS station %s (dev=%s)\n", | 4368 | printk(KERN_DEBUG "%s: Adding new IBSS station %s (dev=%s)\n", |
4478 | wiphy_name(local->hw.wiphy), print_mac(mac, addr), dev->name); | 4369 | wiphy_name(local->hw.wiphy), print_mac(mac, addr), dev->name); |
4370 | #endif | ||
4479 | 4371 | ||
4480 | sta = sta_info_alloc(sdata, addr, GFP_ATOMIC); | 4372 | sta = sta_info_alloc(sdata, addr, GFP_ATOMIC); |
4481 | if (!sta) | 4373 | if (!sta) |
@@ -4502,7 +4394,7 @@ int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason) | |||
4502 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 4394 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
4503 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 4395 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
4504 | 4396 | ||
4505 | printk(KERN_DEBUG "%s: deauthenticate(reason=%d)\n", | 4397 | printk(KERN_DEBUG "%s: deauthenticating by local choice (reason=%d)\n", |
4506 | dev->name, reason); | 4398 | dev->name, reason); |
4507 | 4399 | ||
4508 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA && | 4400 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA && |
@@ -4520,7 +4412,7 @@ int ieee80211_sta_disassociate(struct net_device *dev, u16 reason) | |||
4520 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 4412 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
4521 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 4413 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
4522 | 4414 | ||
4523 | printk(KERN_DEBUG "%s: disassociate(reason=%d)\n", | 4415 | printk(KERN_DEBUG "%s: disassociating by local choice (reason=%d)\n", |
4524 | dev->name, reason); | 4416 | dev->name, reason); |
4525 | 4417 | ||
4526 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA) | 4418 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA) |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 289112777e90..6a88e8f9bff0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -613,11 +613,6 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx) | |||
613 | rx->key->tx_rx_count++; | 613 | rx->key->tx_rx_count++; |
614 | /* TODO: add threshold stuff again */ | 614 | /* TODO: add threshold stuff again */ |
615 | } else { | 615 | } else { |
616 | #ifdef CONFIG_MAC80211_DEBUG | ||
617 | if (net_ratelimit()) | ||
618 | printk(KERN_DEBUG "%s: RX protected frame," | ||
619 | " but have no key\n", rx->dev->name); | ||
620 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
621 | return RX_DROP_MONITOR; | 616 | return RX_DROP_MONITOR; |
622 | } | 617 | } |
623 | 618 | ||
@@ -789,7 +784,7 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata, | |||
789 | sdata->fragment_next = 0; | 784 | sdata->fragment_next = 0; |
790 | 785 | ||
791 | if (!skb_queue_empty(&entry->skb_list)) { | 786 | if (!skb_queue_empty(&entry->skb_list)) { |
792 | #ifdef CONFIG_MAC80211_DEBUG | 787 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
793 | struct ieee80211_hdr *hdr = | 788 | struct ieee80211_hdr *hdr = |
794 | (struct ieee80211_hdr *) entry->skb_list.next->data; | 789 | (struct ieee80211_hdr *) entry->skb_list.next->data; |
795 | DECLARE_MAC_BUF(mac); | 790 | DECLARE_MAC_BUF(mac); |
@@ -801,7 +796,7 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata, | |||
801 | jiffies - entry->first_frag_time, entry->seq, | 796 | jiffies - entry->first_frag_time, entry->seq, |
802 | entry->last_frag, print_mac(mac, hdr->addr1), | 797 | entry->last_frag, print_mac(mac, hdr->addr1), |
803 | print_mac(mac2, hdr->addr2)); | 798 | print_mac(mac2, hdr->addr2)); |
804 | #endif /* CONFIG_MAC80211_DEBUG */ | 799 | #endif |
805 | __skb_queue_purge(&entry->skb_list); | 800 | __skb_queue_purge(&entry->skb_list); |
806 | } | 801 | } |
807 | 802 | ||
@@ -922,18 +917,8 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) | |||
922 | break; | 917 | break; |
923 | } | 918 | } |
924 | rpn = rx->key->u.ccmp.rx_pn[rx->queue]; | 919 | rpn = rx->key->u.ccmp.rx_pn[rx->queue]; |
925 | if (memcmp(pn, rpn, CCMP_PN_LEN) != 0) { | 920 | if (memcmp(pn, rpn, CCMP_PN_LEN)) |
926 | if (net_ratelimit()) | ||
927 | printk(KERN_DEBUG "%s: defrag: CCMP PN not " | ||
928 | "sequential A2=%s" | ||
929 | " PN=%02x%02x%02x%02x%02x%02x " | ||
930 | "(expected %02x%02x%02x%02x%02x%02x)\n", | ||
931 | rx->dev->name, print_mac(mac, hdr->addr2), | ||
932 | rpn[0], rpn[1], rpn[2], rpn[3], rpn[4], | ||
933 | rpn[5], pn[0], pn[1], pn[2], pn[3], | ||
934 | pn[4], pn[5]); | ||
935 | return RX_DROP_UNUSABLE; | 921 | return RX_DROP_UNUSABLE; |
936 | } | ||
937 | memcpy(entry->last_pn, pn, CCMP_PN_LEN); | 922 | memcpy(entry->last_pn, pn, CCMP_PN_LEN); |
938 | } | 923 | } |
939 | 924 | ||
@@ -1037,7 +1022,7 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx) | |||
1037 | * have nothing buffered for it? | 1022 | * have nothing buffered for it? |
1038 | */ | 1023 | */ |
1039 | printk(KERN_DEBUG "%s: STA %s sent PS Poll even " | 1024 | printk(KERN_DEBUG "%s: STA %s sent PS Poll even " |
1040 | "though there is no buffered frames for it\n", | 1025 | "though there are no buffered frames for it\n", |
1041 | rx->dev->name, print_mac(mac, rx->sta->addr)); | 1026 | rx->dev->name, print_mac(mac, rx->sta->addr)); |
1042 | #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ | 1027 | #endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ |
1043 | } | 1028 | } |
@@ -1073,14 +1058,8 @@ static int | |||
1073 | ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx) | 1058 | ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx) |
1074 | { | 1059 | { |
1075 | if (unlikely(!rx->sta || | 1060 | if (unlikely(!rx->sta || |
1076 | !test_sta_flags(rx->sta, WLAN_STA_AUTHORIZED))) { | 1061 | !test_sta_flags(rx->sta, WLAN_STA_AUTHORIZED))) |
1077 | #ifdef CONFIG_MAC80211_DEBUG | ||
1078 | if (net_ratelimit()) | ||
1079 | printk(KERN_DEBUG "%s: dropped frame " | ||
1080 | "(unauthorized port)\n", rx->dev->name); | ||
1081 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
1082 | return -EACCES; | 1062 | return -EACCES; |
1083 | } | ||
1084 | 1063 | ||
1085 | return 0; | 1064 | return 0; |
1086 | } | 1065 | } |
@@ -1160,16 +1139,8 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx) | |||
1160 | memcpy(src, hdr->addr2, ETH_ALEN); | 1139 | memcpy(src, hdr->addr2, ETH_ALEN); |
1161 | 1140 | ||
1162 | if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_AP && | 1141 | if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_AP && |
1163 | sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) { | 1142 | sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) |
1164 | if (net_ratelimit()) | ||
1165 | printk(KERN_DEBUG "%s: dropped ToDS frame " | ||
1166 | "(BSSID=%s SA=%s DA=%s)\n", | ||
1167 | dev->name, | ||
1168 | print_mac(mac, hdr->addr1), | ||
1169 | print_mac(mac2, hdr->addr2), | ||
1170 | print_mac(mac3, hdr->addr3)); | ||
1171 | return -1; | 1143 | return -1; |
1172 | } | ||
1173 | break; | 1144 | break; |
1174 | case (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS): | 1145 | case (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS): |
1175 | /* RA TA DA SA */ | 1146 | /* RA TA DA SA */ |
@@ -1177,17 +1148,8 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx) | |||
1177 | memcpy(src, hdr->addr4, ETH_ALEN); | 1148 | memcpy(src, hdr->addr4, ETH_ALEN); |
1178 | 1149 | ||
1179 | if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_WDS && | 1150 | if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_WDS && |
1180 | sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)) { | 1151 | sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)) |
1181 | if (net_ratelimit()) | ||
1182 | printk(KERN_DEBUG "%s: dropped FromDS&ToDS " | ||
1183 | "frame (RA=%s TA=%s DA=%s SA=%s)\n", | ||
1184 | rx->dev->name, | ||
1185 | print_mac(mac, hdr->addr1), | ||
1186 | print_mac(mac2, hdr->addr2), | ||
1187 | print_mac(mac3, hdr->addr3), | ||
1188 | print_mac(mac4, hdr->addr4)); | ||
1189 | return -1; | 1152 | return -1; |
1190 | } | ||
1191 | break; | 1153 | break; |
1192 | case IEEE80211_FCTL_FROMDS: | 1154 | case IEEE80211_FCTL_FROMDS: |
1193 | /* DA BSSID SA */ | 1155 | /* DA BSSID SA */ |
@@ -1204,27 +1166,13 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx) | |||
1204 | memcpy(dst, hdr->addr1, ETH_ALEN); | 1166 | memcpy(dst, hdr->addr1, ETH_ALEN); |
1205 | memcpy(src, hdr->addr2, ETH_ALEN); | 1167 | memcpy(src, hdr->addr2, ETH_ALEN); |
1206 | 1168 | ||
1207 | if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS) { | 1169 | if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS) |
1208 | if (net_ratelimit()) { | ||
1209 | printk(KERN_DEBUG "%s: dropped IBSS frame " | ||
1210 | "(DA=%s SA=%s BSSID=%s)\n", | ||
1211 | dev->name, | ||
1212 | print_mac(mac, hdr->addr1), | ||
1213 | print_mac(mac2, hdr->addr2), | ||
1214 | print_mac(mac3, hdr->addr3)); | ||
1215 | } | ||
1216 | return -1; | 1170 | return -1; |
1217 | } | ||
1218 | break; | 1171 | break; |
1219 | } | 1172 | } |
1220 | 1173 | ||
1221 | if (unlikely(skb->len - hdrlen < 8)) { | 1174 | if (unlikely(skb->len - hdrlen < 8)) |
1222 | if (net_ratelimit()) { | ||
1223 | printk(KERN_DEBUG "%s: RX too short data frame " | ||
1224 | "payload\n", dev->name); | ||
1225 | } | ||
1226 | return -1; | 1175 | return -1; |
1227 | } | ||
1228 | 1176 | ||
1229 | payload = skb->data + hdrlen; | 1177 | payload = skb->data + hdrlen; |
1230 | ethertype = (payload[6] << 8) | payload[7]; | 1178 | ethertype = (payload[6] << 8) | payload[7]; |
@@ -1416,10 +1364,8 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) | |||
1416 | 1364 | ||
1417 | padding = ((4 - subframe_len) & 0x3); | 1365 | padding = ((4 - subframe_len) & 0x3); |
1418 | /* the last MSDU has no padding */ | 1366 | /* the last MSDU has no padding */ |
1419 | if (subframe_len > remaining) { | 1367 | if (subframe_len > remaining) |
1420 | printk(KERN_DEBUG "%s: wrong buffer size\n", dev->name); | ||
1421 | return RX_DROP_UNUSABLE; | 1368 | return RX_DROP_UNUSABLE; |
1422 | } | ||
1423 | 1369 | ||
1424 | skb_pull(skb, sizeof(struct ethhdr)); | 1370 | skb_pull(skb, sizeof(struct ethhdr)); |
1425 | /* if last subframe reuse skb */ | 1371 | /* if last subframe reuse skb */ |
@@ -1440,8 +1386,6 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) | |||
1440 | eth = (struct ethhdr *) skb_pull(skb, ntohs(len) + | 1386 | eth = (struct ethhdr *) skb_pull(skb, ntohs(len) + |
1441 | padding); | 1387 | padding); |
1442 | if (!eth) { | 1388 | if (!eth) { |
1443 | printk(KERN_DEBUG "%s: wrong buffer size\n", | ||
1444 | dev->name); | ||
1445 | dev_kfree_skb(frame); | 1389 | dev_kfree_skb(frame); |
1446 | return RX_DROP_UNUSABLE; | 1390 | return RX_DROP_UNUSABLE; |
1447 | } | 1391 | } |
@@ -1593,31 +1537,16 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev, | |||
1593 | else | 1537 | else |
1594 | keyidx = -1; | 1538 | keyidx = -1; |
1595 | 1539 | ||
1596 | if (net_ratelimit()) | ||
1597 | printk(KERN_DEBUG "%s: TKIP hwaccel reported Michael MIC " | ||
1598 | "failure from %s to %s keyidx=%d\n", | ||
1599 | dev->name, print_mac(mac, hdr->addr2), | ||
1600 | print_mac(mac2, hdr->addr1), keyidx); | ||
1601 | |||
1602 | if (!rx->sta) { | 1540 | if (!rx->sta) { |
1603 | /* | 1541 | /* |
1604 | * Some hardware seem to generate incorrect Michael MIC | 1542 | * Some hardware seem to generate incorrect Michael MIC |
1605 | * reports; ignore them to avoid triggering countermeasures. | 1543 | * reports; ignore them to avoid triggering countermeasures. |
1606 | */ | 1544 | */ |
1607 | if (net_ratelimit()) | ||
1608 | printk(KERN_DEBUG "%s: ignored spurious Michael MIC " | ||
1609 | "error for unknown address %s\n", | ||
1610 | dev->name, print_mac(mac, hdr->addr2)); | ||
1611 | goto ignore; | 1545 | goto ignore; |
1612 | } | 1546 | } |
1613 | 1547 | ||
1614 | if (!(rx->fc & IEEE80211_FCTL_PROTECTED)) { | 1548 | if (!(rx->fc & IEEE80211_FCTL_PROTECTED)) |
1615 | if (net_ratelimit()) | ||
1616 | printk(KERN_DEBUG "%s: ignored spurious Michael MIC " | ||
1617 | "error for a frame with no PROTECTED flag (src " | ||
1618 | "%s)\n", dev->name, print_mac(mac, hdr->addr2)); | ||
1619 | goto ignore; | 1549 | goto ignore; |
1620 | } | ||
1621 | 1550 | ||
1622 | if (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP && keyidx) { | 1551 | if (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP && keyidx) { |
1623 | /* | 1552 | /* |
@@ -1626,24 +1555,13 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev, | |||
1626 | * group keys and only the AP is sending real multicast | 1555 | * group keys and only the AP is sending real multicast |
1627 | * frames in the BSS. | 1556 | * frames in the BSS. |
1628 | */ | 1557 | */ |
1629 | if (net_ratelimit()) | ||
1630 | printk(KERN_DEBUG "%s: ignored Michael MIC error for " | ||
1631 | "a frame with non-zero keyidx (%d)" | ||
1632 | " (src %s)\n", dev->name, keyidx, | ||
1633 | print_mac(mac, hdr->addr2)); | ||
1634 | goto ignore; | 1558 | goto ignore; |
1635 | } | 1559 | } |
1636 | 1560 | ||
1637 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA && | 1561 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA && |
1638 | ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || | 1562 | ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT || |
1639 | (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_AUTH)) { | 1563 | (rx->fc & IEEE80211_FCTL_STYPE) != IEEE80211_STYPE_AUTH)) |
1640 | if (net_ratelimit()) | ||
1641 | printk(KERN_DEBUG "%s: ignored spurious Michael MIC " | ||
1642 | "error for a frame that cannot be encrypted " | ||
1643 | "(fc=0x%04x) (src %s)\n", | ||
1644 | dev->name, rx->fc, print_mac(mac, hdr->addr2)); | ||
1645 | goto ignore; | 1564 | goto ignore; |
1646 | } | ||
1647 | 1565 | ||
1648 | mac80211_ev_michael_mic_failure(rx->dev, keyidx, hdr); | 1566 | mac80211_ev_michael_mic_failure(rx->dev, keyidx, hdr); |
1649 | ignore: | 1567 | ignore: |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index b3c733162fc1..d8a16b7f6a6b 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -554,8 +554,10 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local, | |||
554 | 554 | ||
555 | sdata = sta->sdata; | 555 | sdata = sta->sdata; |
556 | local->total_ps_buffered--; | 556 | local->total_ps_buffered--; |
557 | #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG | ||
557 | printk(KERN_DEBUG "Buffered frame expired (STA " | 558 | printk(KERN_DEBUG "Buffered frame expired (STA " |
558 | "%s)\n", print_mac(mac, sta->addr)); | 559 | "%s)\n", print_mac(mac, sta->addr)); |
560 | #endif | ||
559 | dev_kfree_skb(skb); | 561 | dev_kfree_skb(skb); |
560 | 562 | ||
561 | if (skb_queue_empty(&sta->ps_tx_buf)) | 563 | if (skb_queue_empty(&sta->ps_tx_buf)) |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 7b930d3c2fba..9bd9faac3c3c 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -327,8 +327,10 @@ static void purge_old_ps_buffers(struct ieee80211_local *local) | |||
327 | rcu_read_unlock(); | 327 | rcu_read_unlock(); |
328 | 328 | ||
329 | local->total_ps_buffered = total; | 329 | local->total_ps_buffered = total; |
330 | #ifdef MAC80211_VERBOSE_PS_DEBUG | ||
330 | printk(KERN_DEBUG "%s: PS buffers full - purged %d frames\n", | 331 | printk(KERN_DEBUG "%s: PS buffers full - purged %d frames\n", |
331 | wiphy_name(local->hw.wiphy), purged); | 332 | wiphy_name(local->hw.wiphy), purged); |
333 | #endif | ||
332 | } | 334 | } |
333 | 335 | ||
334 | static ieee80211_tx_result | 336 | static ieee80211_tx_result |
@@ -358,11 +360,13 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx) | |||
358 | purge_old_ps_buffers(tx->local); | 360 | purge_old_ps_buffers(tx->local); |
359 | if (skb_queue_len(&tx->sdata->bss->ps_bc_buf) >= | 361 | if (skb_queue_len(&tx->sdata->bss->ps_bc_buf) >= |
360 | AP_MAX_BC_BUFFER) { | 362 | AP_MAX_BC_BUFFER) { |
363 | #ifdef MAC80211_VERBOSE_PS_DEBUG | ||
361 | if (net_ratelimit()) { | 364 | if (net_ratelimit()) { |
362 | printk(KERN_DEBUG "%s: BC TX buffer full - " | 365 | printk(KERN_DEBUG "%s: BC TX buffer full - " |
363 | "dropping the oldest frame\n", | 366 | "dropping the oldest frame\n", |
364 | tx->dev->name); | 367 | tx->dev->name); |
365 | } | 368 | } |
369 | #endif | ||
366 | dev_kfree_skb(skb_dequeue(&tx->sdata->bss->ps_bc_buf)); | 370 | dev_kfree_skb(skb_dequeue(&tx->sdata->bss->ps_bc_buf)); |
367 | } else | 371 | } else |
368 | tx->local->total_ps_buffered++; | 372 | tx->local->total_ps_buffered++; |
@@ -403,11 +407,13 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) | |||
403 | purge_old_ps_buffers(tx->local); | 407 | purge_old_ps_buffers(tx->local); |
404 | if (skb_queue_len(&sta->ps_tx_buf) >= STA_MAX_TX_BUFFER) { | 408 | if (skb_queue_len(&sta->ps_tx_buf) >= STA_MAX_TX_BUFFER) { |
405 | struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf); | 409 | struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf); |
410 | #ifdef MAC80211_VERBOSE_PS_DEBUG | ||
406 | if (net_ratelimit()) { | 411 | if (net_ratelimit()) { |
407 | printk(KERN_DEBUG "%s: STA %s TX " | 412 | printk(KERN_DEBUG "%s: STA %s TX " |
408 | "buffer full - dropping oldest frame\n", | 413 | "buffer full - dropping oldest frame\n", |
409 | tx->dev->name, print_mac(mac, sta->addr)); | 414 | tx->dev->name, print_mac(mac, sta->addr)); |
410 | } | 415 | } |
416 | #endif | ||
411 | dev_kfree_skb(old); | 417 | dev_kfree_skb(old); |
412 | } else | 418 | } else |
413 | tx->local->total_ps_buffered++; | 419 | tx->local->total_ps_buffered++; |
@@ -713,7 +719,6 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) | |||
713 | return TX_CONTINUE; | 719 | return TX_CONTINUE; |
714 | 720 | ||
715 | fail: | 721 | fail: |
716 | printk(KERN_DEBUG "%s: failed to fragment frame\n", tx->dev->name); | ||
717 | if (frags) { | 722 | if (frags) { |
718 | for (i = 0; i < num_fragm - 1; i++) | 723 | for (i = 0; i < num_fragm - 1; i++) |
719 | if (frags[i]) | 724 | if (frags[i]) |
@@ -1404,8 +1409,6 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1404 | 1409 | ||
1405 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1410 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1406 | if (unlikely(skb->len < ETH_HLEN)) { | 1411 | if (unlikely(skb->len < ETH_HLEN)) { |
1407 | printk(KERN_DEBUG "%s: short skb (len=%d)\n", | ||
1408 | dev->name, skb->len); | ||
1409 | ret = 0; | 1412 | ret = 0; |
1410 | goto fail; | 1413 | goto fail; |
1411 | } | 1414 | } |
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index 35b664d00e23..872d2fcd1a5b 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
@@ -253,11 +253,8 @@ int ieee80211_wep_decrypt(struct ieee80211_local *local, struct sk_buff *skb, | |||
253 | 253 | ||
254 | if (ieee80211_wep_decrypt_data(local->wep_rx_tfm, rc4key, klen, | 254 | if (ieee80211_wep_decrypt_data(local->wep_rx_tfm, rc4key, klen, |
255 | skb->data + hdrlen + WEP_IV_LEN, | 255 | skb->data + hdrlen + WEP_IV_LEN, |
256 | len)) { | 256 | len)) |
257 | if (net_ratelimit()) | ||
258 | printk(KERN_DEBUG "WEP decrypt failed (ICV)\n"); | ||
259 | ret = -1; | 257 | ret = -1; |
260 | } | ||
261 | 258 | ||
262 | kfree(rc4key); | 259 | kfree(rc4key); |
263 | 260 | ||
@@ -301,14 +298,8 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_rx_data *rx) | |||
301 | return RX_CONTINUE; | 298 | return RX_CONTINUE; |
302 | 299 | ||
303 | if (!(rx->status->flag & RX_FLAG_DECRYPTED)) { | 300 | if (!(rx->status->flag & RX_FLAG_DECRYPTED)) { |
304 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { | 301 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) |
305 | #ifdef CONFIG_MAC80211_DEBUG | ||
306 | if (net_ratelimit()) | ||
307 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " | ||
308 | "failed\n", rx->dev->name); | ||
309 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
310 | return RX_DROP_UNUSABLE; | 302 | return RX_DROP_UNUSABLE; |
311 | } | ||
312 | } else if (!(rx->status->flag & RX_FLAG_IV_STRIPPED)) { | 303 | } else if (!(rx->status->flag & RX_FLAG_IV_STRIPPED)) { |
313 | ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); | 304 | ieee80211_wep_remove_iv(rx->local, rx->skb, rx->key); |
314 | /* remove ICV */ | 305 | /* remove ICV */ |
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index cfa8fbb0736a..f23b5a4d4ac9 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -680,7 +680,6 @@ void ieee80211_requeue(struct ieee80211_local *local, int queue) | |||
680 | if (!qdisc || !qdisc->dequeue) | 680 | if (!qdisc || !qdisc->dequeue) |
681 | return; | 681 | return; |
682 | 682 | ||
683 | printk(KERN_DEBUG "requeue: qlen = %d\n", qdisc->q.qlen); | ||
684 | for (len = qdisc->q.qlen; len > 0; len--) { | 683 | for (len = qdisc->q.qlen; len > 0; len--) { |
685 | skb = qdisc->dequeue(qdisc); | 684 | skb = qdisc->dequeue(qdisc); |
686 | root_qd->q.qlen--; | 685 | root_qd->q.qlen--; |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index f809761fbfb5..b414d5d92f38 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -146,9 +146,6 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) | |||
146 | if (!(rx->flags & IEEE80211_RX_RA_MATCH)) | 146 | if (!(rx->flags & IEEE80211_RX_RA_MATCH)) |
147 | return RX_DROP_UNUSABLE; | 147 | return RX_DROP_UNUSABLE; |
148 | 148 | ||
149 | printk(KERN_DEBUG "%s: invalid Michael MIC in data frame from " | ||
150 | "%s\n", rx->dev->name, print_mac(mac, sa)); | ||
151 | |||
152 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, | 149 | mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx, |
153 | (void *) skb->data); | 150 | (void *) skb->data); |
154 | return RX_DROP_UNUSABLE; | 151 | return RX_DROP_UNUSABLE; |
@@ -282,15 +279,8 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx) | |||
282 | hdr->addr1, hwaccel, rx->queue, | 279 | hdr->addr1, hwaccel, rx->queue, |
283 | &rx->tkip_iv32, | 280 | &rx->tkip_iv32, |
284 | &rx->tkip_iv16); | 281 | &rx->tkip_iv16); |
285 | if (res != TKIP_DECRYPT_OK || wpa_test) { | 282 | if (res != TKIP_DECRYPT_OK || wpa_test) |
286 | #ifdef CONFIG_MAC80211_DEBUG | ||
287 | if (net_ratelimit()) | ||
288 | printk(KERN_DEBUG "%s: TKIP decrypt failed for RX " | ||
289 | "frame from %s (res=%d)\n", rx->dev->name, | ||
290 | print_mac(mac, rx->sta->addr), res); | ||
291 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
292 | return RX_DROP_UNUSABLE; | 283 | return RX_DROP_UNUSABLE; |
293 | } | ||
294 | 284 | ||
295 | /* Trim ICV */ | 285 | /* Trim ICV */ |
296 | skb_trim(skb, skb->len - TKIP_ICV_LEN); | 286 | skb_trim(skb, skb->len - TKIP_ICV_LEN); |
@@ -512,16 +502,6 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | |||
512 | (void) ccmp_hdr2pn(pn, skb->data + hdrlen); | 502 | (void) ccmp_hdr2pn(pn, skb->data + hdrlen); |
513 | 503 | ||
514 | if (memcmp(pn, key->u.ccmp.rx_pn[rx->queue], CCMP_PN_LEN) <= 0) { | 504 | if (memcmp(pn, key->u.ccmp.rx_pn[rx->queue], CCMP_PN_LEN) <= 0) { |
515 | #ifdef CONFIG_MAC80211_DEBUG | ||
516 | u8 *ppn = key->u.ccmp.rx_pn[rx->queue]; | ||
517 | |||
518 | printk(KERN_DEBUG "%s: CCMP replay detected for RX frame from " | ||
519 | "%s (RX PN %02x%02x%02x%02x%02x%02x <= prev. PN " | ||
520 | "%02x%02x%02x%02x%02x%02x)\n", rx->dev->name, | ||
521 | print_mac(mac, rx->sta->addr), | ||
522 | pn[0], pn[1], pn[2], pn[3], pn[4], pn[5], | ||
523 | ppn[0], ppn[1], ppn[2], ppn[3], ppn[4], ppn[5]); | ||
524 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
525 | key->u.ccmp.replays++; | 505 | key->u.ccmp.replays++; |
526 | return RX_DROP_UNUSABLE; | 506 | return RX_DROP_UNUSABLE; |
527 | } | 507 | } |
@@ -541,12 +521,6 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | |||
541 | skb->data + hdrlen + CCMP_HDR_LEN, data_len, | 521 | skb->data + hdrlen + CCMP_HDR_LEN, data_len, |
542 | skb->data + skb->len - CCMP_MIC_LEN, | 522 | skb->data + skb->len - CCMP_MIC_LEN, |
543 | skb->data + hdrlen + CCMP_HDR_LEN)) { | 523 | skb->data + hdrlen + CCMP_HDR_LEN)) { |
544 | #ifdef CONFIG_MAC80211_DEBUG | ||
545 | if (net_ratelimit()) | ||
546 | printk(KERN_DEBUG "%s: CCMP decrypt failed " | ||
547 | "for RX frame from %s\n", rx->dev->name, | ||
548 | print_mac(mac, rx->sta->addr)); | ||
549 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
550 | return RX_DROP_UNUSABLE; | 524 | return RX_DROP_UNUSABLE; |
551 | } | 525 | } |
552 | } | 526 | } |