summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorSara Sharon <sara.sharon@intel.com>2015-07-08 08:41:43 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-07-17 09:38:29 -0400
commit322cd406da0b102dda9c0eec46181458a3667dbb (patch)
tree9806c5db21e6e507ae5a55cd784dec5bc0e14c73 /net/mac80211/mlme.c
parentccc6bb96ff058ad737fb8236e15aeaa56e822296 (diff)
mac80211: Add support for declaring MU-MIMO capability
Add support for declaring MU-MIMO beamformee capability for relevant hardware. When sending association request, the capability is included if both hardware and the AP support it, and no other virtual interface is using it. This is in order to avoid multiple interfaces using MU-MIMO in parallel which might lead to contradictions in the group-id mechanism. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 6332ff705ec3..705ef1d040ed 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -6,6 +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 * 10 *
10 * 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
11 * 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
@@ -538,11 +539,16 @@ static void ieee80211_add_ht_ie(struct ieee80211_sub_if_data *sdata,
538 ieee80211_ie_build_ht_cap(pos, &ht_cap, cap); 539 ieee80211_ie_build_ht_cap(pos, &ht_cap, cap);
539} 540}
540 541
542/* This function determines vht capability flags for the association
543 * and builds the IE.
544 * Note - the function may set the owner of the MU-MIMO capability
545 */
541static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata, 546static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
542 struct sk_buff *skb, 547 struct sk_buff *skb,
543 struct ieee80211_supported_band *sband, 548 struct ieee80211_supported_band *sband,
544 struct ieee80211_vht_cap *ap_vht_cap) 549 struct ieee80211_vht_cap *ap_vht_cap)
545{ 550{
551 struct ieee80211_local *local = sdata->local;
546 u8 *pos; 552 u8 *pos;
547 u32 cap; 553 u32 cap;
548 struct ieee80211_sta_vht_cap vht_cap; 554 struct ieee80211_sta_vht_cap vht_cap;
@@ -576,7 +582,34 @@ static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
576 */ 582 */
577 if (!(ap_vht_cap->vht_cap_info & 583 if (!(ap_vht_cap->vht_cap_info &
578 cpu_to_le32(IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE))) 584 cpu_to_le32(IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE)))
579 cap &= ~IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE; 585 cap &= ~(IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
586 IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
587 else if (!(ap_vht_cap->vht_cap_info &
588 cpu_to_le32(IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)))
589 cap &= ~IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
590
591 /*
592 * If some other vif is using the MU-MIMO capablity we cannot associate
593 * using MU-MIMO - this will lead to contradictions in the group-id
594 * mechanism.
595 * Ownership is defined since association request, in order to avoid
596 * simultaneous associations with MU-MIMO.
597 */
598 if (cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE) {
599 bool disable_mu_mimo = false;
600 struct ieee80211_sub_if_data *other;
601
602 list_for_each_entry_rcu(other, &local->interfaces, list) {
603 if (other->flags & IEEE80211_SDATA_MU_MIMO_OWNER) {
604 disable_mu_mimo = true;
605 break;
606 }
607 }
608 if (disable_mu_mimo)
609 cap &= ~IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
610 else
611 sdata->flags |= IEEE80211_SDATA_MU_MIMO_OWNER;
612 }
580 613
581 mask = IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK; 614 mask = IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
582 615
@@ -2058,6 +2091,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
2058 memset(&ifmgd->ht_capa_mask, 0, sizeof(ifmgd->ht_capa_mask)); 2091 memset(&ifmgd->ht_capa_mask, 0, sizeof(ifmgd->ht_capa_mask));
2059 memset(&ifmgd->vht_capa, 0, sizeof(ifmgd->vht_capa)); 2092 memset(&ifmgd->vht_capa, 0, sizeof(ifmgd->vht_capa));
2060 memset(&ifmgd->vht_capa_mask, 0, sizeof(ifmgd->vht_capa_mask)); 2093 memset(&ifmgd->vht_capa_mask, 0, sizeof(ifmgd->vht_capa_mask));
2094 sdata->flags &= ~IEEE80211_SDATA_MU_MIMO_OWNER;
2061 2095
2062 sdata->ap_power_level = IEEE80211_UNSET_POWER_LEVEL; 2096 sdata->ap_power_level = IEEE80211_UNSET_POWER_LEVEL;
2063 2097
@@ -2520,6 +2554,7 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
2520 eth_zero_addr(sdata->u.mgd.bssid); 2554 eth_zero_addr(sdata->u.mgd.bssid);
2521 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); 2555 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
2522 sdata->u.mgd.flags = 0; 2556 sdata->u.mgd.flags = 0;
2557 sdata->flags &= ~IEEE80211_SDATA_MU_MIMO_OWNER;
2523 mutex_lock(&sdata->local->mtx); 2558 mutex_lock(&sdata->local->mtx);
2524 ieee80211_vif_release_channel(sdata); 2559 ieee80211_vif_release_channel(sdata);
2525 mutex_unlock(&sdata->local->mtx); 2560 mutex_unlock(&sdata->local->mtx);