aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/agg-tx.c2
-rw-r--r--net/mac80211/debugfs_key.c17
-rw-r--r--net/mac80211/ibss.c14
-rw-r--r--net/mac80211/iface.c2
-rw-r--r--net/mac80211/key.h3
-rw-r--r--net/mac80211/mlme.c4
-rw-r--r--net/mac80211/rc80211_minstrel.c9
-rw-r--r--net/mac80211/rx.c9
-rw-r--r--net/mac80211/scan.c2
-rw-r--r--net/mac80211/status.c6
-rw-r--r--net/mac80211/wpa.c5
11 files changed, 58 insertions, 15 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index 4152ed1034b8..eb9df22418f0 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -445,7 +445,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
445 445
446 trace_api_start_tx_ba_session(pubsta, tid); 446 trace_api_start_tx_ba_session(pubsta, tid);
447 447
448 if (WARN_ON(!local->ops->ampdu_action)) 448 if (WARN_ON_ONCE(!local->ops->ampdu_action))
449 return -EINVAL; 449 return -EINVAL;
450 450
451 if ((tid >= IEEE80211_NUM_TIDS) || 451 if ((tid >= IEEE80211_NUM_TIDS) ||
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 2d4235497f1b..c3a3082b72e5 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -199,6 +199,22 @@ static ssize_t key_icverrors_read(struct file *file, char __user *userbuf,
199} 199}
200KEY_OPS(icverrors); 200KEY_OPS(icverrors);
201 201
202static ssize_t key_mic_failures_read(struct file *file, char __user *userbuf,
203 size_t count, loff_t *ppos)
204{
205 struct ieee80211_key *key = file->private_data;
206 char buf[20];
207 int len;
208
209 if (key->conf.cipher != WLAN_CIPHER_SUITE_TKIP)
210 return -EINVAL;
211
212 len = scnprintf(buf, sizeof(buf), "%u\n", key->u.tkip.mic_failures);
213
214 return simple_read_from_buffer(userbuf, count, ppos, buf, len);
215}
216KEY_OPS(mic_failures);
217
202static ssize_t key_key_read(struct file *file, char __user *userbuf, 218static ssize_t key_key_read(struct file *file, char __user *userbuf,
203 size_t count, loff_t *ppos) 219 size_t count, loff_t *ppos)
204{ 220{
@@ -260,6 +276,7 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
260 DEBUGFS_ADD(rx_spec); 276 DEBUGFS_ADD(rx_spec);
261 DEBUGFS_ADD(replays); 277 DEBUGFS_ADD(replays);
262 DEBUGFS_ADD(icverrors); 278 DEBUGFS_ADD(icverrors);
279 DEBUGFS_ADD(mic_failures);
263 DEBUGFS_ADD(key); 280 DEBUGFS_ADD(key);
264 DEBUGFS_ADD(ifindex); 281 DEBUGFS_ADD(ifindex);
265}; 282};
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index fa862b24a7e0..8881fc77fb13 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -201,6 +201,20 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
201 bss_change |= BSS_CHANGED_BASIC_RATES; 201 bss_change |= BSS_CHANGED_BASIC_RATES;
202 bss_change |= BSS_CHANGED_HT; 202 bss_change |= BSS_CHANGED_HT;
203 bss_change |= BSS_CHANGED_IBSS; 203 bss_change |= BSS_CHANGED_IBSS;
204
205 /*
206 * In 5 GHz/802.11a, we can always use short slot time.
207 * (IEEE 802.11-2012 18.3.8.7)
208 *
209 * In 2.4GHz, we must always use long slots in IBSS for compatibility
210 * reasons.
211 * (IEEE 802.11-2012 19.4.5)
212 *
213 * HT follows these specifications (IEEE 802.11-2012 20.3.18)
214 */
215 sdata->vif.bss_conf.use_short_slot = chan->band == IEEE80211_BAND_5GHZ;
216 bss_change |= BSS_CHANGED_ERP_SLOT;
217
204 sdata->vif.bss_conf.ibss_joined = true; 218 sdata->vif.bss_conf.ibss_joined = true;
205 sdata->vif.bss_conf.ibss_creator = creator; 219 sdata->vif.bss_conf.ibss_creator = creator;
206 ieee80211_bss_info_change_notify(sdata, bss_change); 220 ieee80211_bss_info_change_notify(sdata, bss_change);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 40c36d5d7377..09a80b55cf5a 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -862,7 +862,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
862 rcu_assign_pointer(local->p2p_sdata, NULL); 862 rcu_assign_pointer(local->p2p_sdata, NULL);
863 /* fall through */ 863 /* fall through */
864 default: 864 default:
865 flush_work(&sdata->work); 865 cancel_work_sync(&sdata->work);
866 /* 866 /*
867 * When we get here, the interface is marked down. 867 * When we get here, the interface is marked down.
868 * Call rcu_barrier() to wait both for the RX path 868 * Call rcu_barrier() to wait both for the RX path
diff --git a/net/mac80211/key.h b/net/mac80211/key.h
index 7cff0d3a519c..382dc44ed330 100644
--- a/net/mac80211/key.h
+++ b/net/mac80211/key.h
@@ -81,6 +81,9 @@ struct ieee80211_key {
81 81
82 /* last received RSC */ 82 /* last received RSC */
83 struct tkip_ctx rx[IEEE80211_NUM_TIDS]; 83 struct tkip_ctx rx[IEEE80211_NUM_TIDS];
84
85 /* number of mic failures */
86 u32 mic_failures;
84 } tkip; 87 } tkip;
85 struct { 88 struct {
86 atomic64_t tx_pn; 89 atomic64_t tx_pn;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 09556303c7e1..7753a9ca98a6 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2360,9 +2360,9 @@ ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2360 2360
2361 return RX_MGMT_CFG80211_RX_ASSOC; 2361 return RX_MGMT_CFG80211_RX_ASSOC;
2362} 2362}
2363
2363static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, 2364static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
2364 struct ieee80211_mgmt *mgmt, 2365 struct ieee80211_mgmt *mgmt, size_t len,
2365 size_t len,
2366 struct ieee80211_rx_status *rx_status, 2366 struct ieee80211_rx_status *rx_status,
2367 struct ieee802_11_elems *elems, 2367 struct ieee802_11_elems *elems,
2368 bool beacon) 2368 bool beacon)
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 79633ae06fd6..8c5acdc06226 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -154,6 +154,7 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
154 struct ieee80211_sta *sta, void *priv_sta, 154 struct ieee80211_sta *sta, void *priv_sta,
155 struct sk_buff *skb) 155 struct sk_buff *skb)
156{ 156{
157 struct minstrel_priv *mp = priv;
157 struct minstrel_sta_info *mi = priv_sta; 158 struct minstrel_sta_info *mi = priv_sta;
158 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 159 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
159 struct ieee80211_tx_rate *ar = info->status.rates; 160 struct ieee80211_tx_rate *ar = info->status.rates;
@@ -181,6 +182,10 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
181 182
182 if (mi->sample_deferred > 0) 183 if (mi->sample_deferred > 0)
183 mi->sample_deferred--; 184 mi->sample_deferred--;
185
186 if (time_after(jiffies, mi->stats_update +
187 (mp->update_interval * HZ) / 1000))
188 minstrel_update_stats(mp, mi);
184} 189}
185 190
186 191
@@ -235,10 +240,6 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
235 240
236 mrr = mp->has_mrr && !txrc->rts && !txrc->bss_conf->use_cts_prot; 241 mrr = mp->has_mrr && !txrc->rts && !txrc->bss_conf->use_cts_prot;
237 242
238 if (time_after(jiffies, mi->stats_update + (mp->update_interval *
239 HZ) / 1000))
240 minstrel_update_stats(mp, mi);
241
242 ndx = mi->max_tp_rate; 243 ndx = mi->max_tp_rate;
243 244
244 if (mrr) 245 if (mrr)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index db343fa8033c..580704eba8b8 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -378,9 +378,6 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
378 * the SKB because it has a bad FCS/PLCP checksum. 378 * the SKB because it has a bad FCS/PLCP checksum.
379 */ 379 */
380 380
381 /* room for the radiotap header based on driver features */
382 needed_headroom = ieee80211_rx_radiotap_space(local, status);
383
384 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) 381 if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)
385 present_fcs_len = FCS_LEN; 382 present_fcs_len = FCS_LEN;
386 383
@@ -399,6 +396,9 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
399 return remove_monitor_info(local, origskb); 396 return remove_monitor_info(local, origskb);
400 } 397 }
401 398
399 /* room for the radiotap header based on driver features */
400 needed_headroom = ieee80211_rx_radiotap_space(local, status);
401
402 if (should_drop_frame(origskb, present_fcs_len)) { 402 if (should_drop_frame(origskb, present_fcs_len)) {
403 /* only need to expand headroom if necessary */ 403 /* only need to expand headroom if necessary */
404 skb = origskb; 404 skb = origskb;
@@ -2333,7 +2333,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2333 if (len < IEEE80211_MIN_ACTION_SIZE) 2333 if (len < IEEE80211_MIN_ACTION_SIZE)
2334 return RX_DROP_UNUSABLE; 2334 return RX_DROP_UNUSABLE;
2335 2335
2336 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC) 2336 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC &&
2337 mgmt->u.action.category != WLAN_CATEGORY_SELF_PROTECTED)
2337 return RX_DROP_UNUSABLE; 2338 return RX_DROP_UNUSABLE;
2338 2339
2339 if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 2340 if (!(status->rx_flags & IEEE80211_RX_RA_MATCH))
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index f7176ac5a535..8ed83dcc149f 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -118,7 +118,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
118 struct ieee80211_tim_ie *tim_ie = elems->tim; 118 struct ieee80211_tim_ie *tim_ie = elems->tim;
119 bss->dtim_period = tim_ie->dtim_period; 119 bss->dtim_period = tim_ie->dtim_period;
120 if (!elems->parse_error) 120 if (!elems->parse_error)
121 bss->valid_data |= IEEE80211_BSS_VALID_DTIM; 121 bss->valid_data |= IEEE80211_BSS_VALID_DTIM;
122 } 122 }
123 123
124 /* If the beacon had no TIM IE, or it was invalid, use 1 */ 124 /* If the beacon had no TIM IE, or it was invalid, use 1 */
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index ab50285fcbab..07d99578a2b1 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -502,7 +502,11 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
502 IEEE80211_BAR_CTRL_TID_INFO_MASK) >> 502 IEEE80211_BAR_CTRL_TID_INFO_MASK) >>
503 IEEE80211_BAR_CTRL_TID_INFO_SHIFT; 503 IEEE80211_BAR_CTRL_TID_INFO_SHIFT;
504 504
505 ieee80211_set_bar_pending(sta, tid, ssn); 505 if (local->hw.flags &
506 IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL)
507 ieee80211_stop_tx_ba_session(&sta->sta, tid);
508 else
509 ieee80211_set_bar_pending(sta, tid, ssn);
506 } 510 }
507 } 511 }
508 512
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 8bd2f5c6a56e..c175ee866ff4 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -104,7 +104,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx)
104 */ 104 */
105 if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) { 105 if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) {
106 if (status->flag & RX_FLAG_MMIC_ERROR) 106 if (status->flag & RX_FLAG_MMIC_ERROR)
107 goto mic_fail; 107 goto mic_fail_no_key;
108 108
109 if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key && 109 if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key &&
110 rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) 110 rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)
@@ -161,6 +161,9 @@ update_iv:
161 return RX_CONTINUE; 161 return RX_CONTINUE;
162 162
163mic_fail: 163mic_fail:
164 rx->key->u.tkip.mic_failures++;
165
166mic_fail_no_key:
164 /* 167 /*
165 * In some cases the key can be unset - e.g. a multicast packet, in 168 * In some cases the key can be unset - e.g. a multicast packet, in
166 * a driver that supports HW encryption. Send up the key idx only if 169 * a driver that supports HW encryption. Send up the key idx only if