aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c79
1 files changed, 30 insertions, 49 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index bfbb1acafdd1..281b8d6e5109 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -6,7 +6,7 @@
6 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 6 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
7 * Copyright 2007, Michael Wu <flamingice@sourmilk.net> 7 * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
8 * Copyright 2013-2014 Intel Mobile Communications GmbH 8 * Copyright 2013-2014 Intel Mobile Communications GmbH
9 * Copyright (C) 2015 Intel Deutschland GmbH 9 * Copyright (C) 2015 - 2016 Intel Deutschland GmbH
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -196,16 +196,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
196 196
197 /* check 40 MHz support, if we have it */ 197 /* check 40 MHz support, if we have it */
198 if (sta_ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { 198 if (sta_ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
199 switch (ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { 199 ieee80211_chandef_ht_oper(ht_oper, chandef);
200 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
201 chandef->width = NL80211_CHAN_WIDTH_40;
202 chandef->center_freq1 += 10;
203 break;
204 case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
205 chandef->width = NL80211_CHAN_WIDTH_40;
206 chandef->center_freq1 -= 10;
207 break;
208 }
209 } else { 200 } else {
210 /* 40 MHz (and 80 MHz) must be supported for VHT */ 201 /* 40 MHz (and 80 MHz) must be supported for VHT */
211 ret = IEEE80211_STA_DISABLE_VHT; 202 ret = IEEE80211_STA_DISABLE_VHT;
@@ -219,35 +210,11 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
219 goto out; 210 goto out;
220 } 211 }
221 212
222 vht_chandef.chan = channel; 213 vht_chandef = *chandef;
223 vht_chandef.center_freq1 = 214 if (!ieee80211_chandef_vht_oper(vht_oper, &vht_chandef)) {
224 ieee80211_channel_to_frequency(vht_oper->center_freq_seg1_idx,
225 channel->band);
226 vht_chandef.center_freq2 = 0;
227
228 switch (vht_oper->chan_width) {
229 case IEEE80211_VHT_CHANWIDTH_USE_HT:
230 vht_chandef.width = chandef->width;
231 vht_chandef.center_freq1 = chandef->center_freq1;
232 break;
233 case IEEE80211_VHT_CHANWIDTH_80MHZ:
234 vht_chandef.width = NL80211_CHAN_WIDTH_80;
235 break;
236 case IEEE80211_VHT_CHANWIDTH_160MHZ:
237 vht_chandef.width = NL80211_CHAN_WIDTH_160;
238 break;
239 case IEEE80211_VHT_CHANWIDTH_80P80MHZ:
240 vht_chandef.width = NL80211_CHAN_WIDTH_80P80;
241 vht_chandef.center_freq2 =
242 ieee80211_channel_to_frequency(
243 vht_oper->center_freq_seg2_idx,
244 channel->band);
245 break;
246 default:
247 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) 215 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
248 sdata_info(sdata, 216 sdata_info(sdata,
249 "AP VHT operation IE has invalid channel width (%d), disable VHT\n", 217 "AP VHT information is invalid, disable VHT\n");
250 vht_oper->chan_width);
251 ret = IEEE80211_STA_DISABLE_VHT; 218 ret = IEEE80211_STA_DISABLE_VHT;
252 goto out; 219 goto out;
253 } 220 }
@@ -592,7 +559,7 @@ static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
592 struct ieee80211_sub_if_data *other; 559 struct ieee80211_sub_if_data *other;
593 560
594 list_for_each_entry_rcu(other, &local->interfaces, list) { 561 list_for_each_entry_rcu(other, &local->interfaces, list) {
595 if (other->flags & IEEE80211_SDATA_MU_MIMO_OWNER) { 562 if (other->vif.mu_mimo_owner) {
596 disable_mu_mimo = true; 563 disable_mu_mimo = true;
597 break; 564 break;
598 } 565 }
@@ -600,7 +567,7 @@ static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
600 if (disable_mu_mimo) 567 if (disable_mu_mimo)
601 cap &= ~IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE; 568 cap &= ~IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
602 else 569 else
603 sdata->flags |= IEEE80211_SDATA_MU_MIMO_OWNER; 570 sdata->vif.mu_mimo_owner = true;
604 } 571 }
605 572
606 mask = IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK; 573 mask = IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
@@ -1638,8 +1605,7 @@ void ieee80211_dynamic_ps_timer(unsigned long data)
1638 1605
1639void ieee80211_dfs_cac_timer_work(struct work_struct *work) 1606void ieee80211_dfs_cac_timer_work(struct work_struct *work)
1640{ 1607{
1641 struct delayed_work *delayed_work = 1608 struct delayed_work *delayed_work = to_delayed_work(work);
1642 container_of(work, struct delayed_work, work);
1643 struct ieee80211_sub_if_data *sdata = 1609 struct ieee80211_sub_if_data *sdata =
1644 container_of(delayed_work, struct ieee80211_sub_if_data, 1610 container_of(delayed_work, struct ieee80211_sub_if_data,
1645 dfs_cac_timer_work); 1611 dfs_cac_timer_work);
@@ -2079,7 +2045,14 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
2079 memset(&ifmgd->ht_capa_mask, 0, sizeof(ifmgd->ht_capa_mask)); 2045 memset(&ifmgd->ht_capa_mask, 0, sizeof(ifmgd->ht_capa_mask));
2080 memset(&ifmgd->vht_capa, 0, sizeof(ifmgd->vht_capa)); 2046 memset(&ifmgd->vht_capa, 0, sizeof(ifmgd->vht_capa));
2081 memset(&ifmgd->vht_capa_mask, 0, sizeof(ifmgd->vht_capa_mask)); 2047 memset(&ifmgd->vht_capa_mask, 0, sizeof(ifmgd->vht_capa_mask));
2082 sdata->flags &= ~IEEE80211_SDATA_MU_MIMO_OWNER; 2048
2049 /* reset MU-MIMO ownership and group data */
2050 memset(sdata->vif.bss_conf.mu_group.membership, 0,
2051 sizeof(sdata->vif.bss_conf.mu_group.membership));
2052 memset(sdata->vif.bss_conf.mu_group.position, 0,
2053 sizeof(sdata->vif.bss_conf.mu_group.position));
2054 changed |= BSS_CHANGED_MU_GROUPS;
2055 sdata->vif.mu_mimo_owner = false;
2083 2056
2084 sdata->ap_power_level = IEEE80211_UNSET_POWER_LEVEL; 2057 sdata->ap_power_level = IEEE80211_UNSET_POWER_LEVEL;
2085 2058
@@ -2536,7 +2509,8 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
2536 eth_zero_addr(sdata->u.mgd.bssid); 2509 eth_zero_addr(sdata->u.mgd.bssid);
2537 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); 2510 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
2538 sdata->u.mgd.flags = 0; 2511 sdata->u.mgd.flags = 0;
2539 sdata->flags &= ~IEEE80211_SDATA_MU_MIMO_OWNER; 2512 sdata->vif.mu_mimo_owner = false;
2513
2540 mutex_lock(&sdata->local->mtx); 2514 mutex_lock(&sdata->local->mtx);
2541 ieee80211_vif_release_channel(sdata); 2515 ieee80211_vif_release_channel(sdata);
2542 mutex_unlock(&sdata->local->mtx); 2516 mutex_unlock(&sdata->local->mtx);
@@ -3571,6 +3545,9 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
3571 elems.ht_cap_elem, elems.ht_operation, 3545 elems.ht_cap_elem, elems.ht_operation,
3572 elems.vht_operation, bssid, &changed)) { 3546 elems.vht_operation, bssid, &changed)) {
3573 mutex_unlock(&local->sta_mtx); 3547 mutex_unlock(&local->sta_mtx);
3548 sdata_info(sdata,
3549 "failed to follow AP %pM bandwidth change, disconnect\n",
3550 bssid);
3574 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 3551 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
3575 WLAN_REASON_DEAUTH_LEAVING, 3552 WLAN_REASON_DEAUTH_LEAVING,
3576 true, deauth_buf); 3553 true, deauth_buf);
@@ -3946,11 +3923,9 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
3946 * We actually lost the connection ... or did we? 3923 * We actually lost the connection ... or did we?
3947 * Let's make sure! 3924 * Let's make sure!
3948 */ 3925 */
3949 wiphy_debug(local->hw.wiphy, 3926 mlme_dbg(sdata,
3950 "%s: No probe response from AP %pM" 3927 "No probe response from AP %pM after %dms, disconnecting.\n",
3951 " after %dms, disconnecting.\n", 3928 bssid, probe_wait_ms);
3952 sdata->name,
3953 bssid, probe_wait_ms);
3954 3929
3955 ieee80211_sta_connection_lost(sdata, bssid, 3930 ieee80211_sta_connection_lost(sdata, bssid,
3956 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); 3931 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false);
@@ -4536,6 +4511,9 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
4536 if (ifmgd->associated) { 4511 if (ifmgd->associated) {
4537 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; 4512 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
4538 4513
4514 sdata_info(sdata,
4515 "disconnect from AP %pM for new auth to %pM\n",
4516 ifmgd->associated->bssid, req->bss->bssid);
4539 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 4517 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
4540 WLAN_REASON_UNSPECIFIED, 4518 WLAN_REASON_UNSPECIFIED,
4541 false, frame_buf); 4519 false, frame_buf);
@@ -4604,6 +4582,9 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
4604 if (ifmgd->associated) { 4582 if (ifmgd->associated) {
4605 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; 4583 u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
4606 4584
4585 sdata_info(sdata,
4586 "disconnect from AP %pM for new assoc to %pM\n",
4587 ifmgd->associated->bssid, req->bss->bssid);
4607 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 4588 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
4608 WLAN_REASON_UNSPECIFIED, 4589 WLAN_REASON_UNSPECIFIED,
4609 false, frame_buf); 4590 false, frame_buf);