mac80211: move MU_MIMO_OWNER flag to ieee80211_vif
authorSara Sharon <sara.sharon@intel.com>
Tue, 16 Feb 2016 10:48:18 +0000 (12:48 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 24 Feb 2016 08:04:40 +0000 (09:04 +0100)
Drivers may need to track which vif is using VHT MU-MIMO.
Move the flag indicationg the ownership of MU_MIMO to
ieee80211_vif.

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>
include/net/mac80211.h
net/mac80211/ieee80211_i.h
net/mac80211/mlme.c
net/mac80211/util.c
net/mac80211/vht.c

index 23f2a5ecf669011ec5a448d46979b95e3dcaa466..0c09da34b67a7e7ca4ab45fd1da8f132d8bedc63 100644 (file)
@@ -1382,6 +1382,7 @@ enum ieee80211_vif_flags {
  * @csa_active: marks whether a channel switch is going on. Internally it is
  *     write-protected by sdata_lock and local->mtx so holding either is fine
  *     for read access.
+ * @mu_mimo_owner: indicates interface owns MU-MIMO capability
  * @driver_flags: flags/capabilities the driver has for this interface,
  *     these need to be set (or cleared) when the interface is added
  *     or, if supported by the driver, the interface type is changed
@@ -1408,6 +1409,7 @@ struct ieee80211_vif {
        u8 addr[ETH_ALEN];
        bool p2p;
        bool csa_active;
+       bool mu_mimo_owner;
 
        u8 cab_queue;
        u8 hw_queue[IEEE80211_NUM_ACS];
index a49c10361f1c2f58faa922eb5f9866cf43cbf842..1630975c89f159c613668692290450a7d60ed9ab 100644 (file)
@@ -716,7 +716,6 @@ struct ieee80211_if_mesh {
  *     back to wireless media and to the local net stack.
  * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume.
  * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver
- * @IEEE80211_SDATA_MU_MIMO_OWNER: indicates interface owns MU-MIMO capability
  */
 enum ieee80211_sub_if_data_flags {
        IEEE80211_SDATA_ALLMULTI                = BIT(0),
@@ -724,7 +723,6 @@ enum ieee80211_sub_if_data_flags {
        IEEE80211_SDATA_DONT_BRIDGE_PACKETS     = BIT(3),
        IEEE80211_SDATA_DISCONNECT_RESUME       = BIT(4),
        IEEE80211_SDATA_IN_DRIVER               = BIT(5),
-       IEEE80211_SDATA_MU_MIMO_OWNER           = BIT(6),
 };
 
 /**
index 857089de475f62a46fdf13055176aa3ea22a26a3..f41625bcd87905d679e6b09dc8b11113e9b07550 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
- * Copyright (C) 2015 Intel Deutschland GmbH
+ * Copyright (C) 2015 - 2016 Intel Deutschland GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -559,7 +559,7 @@ static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
                struct ieee80211_sub_if_data *other;
 
                list_for_each_entry_rcu(other, &local->interfaces, list) {
-                       if (other->flags & IEEE80211_SDATA_MU_MIMO_OWNER) {
+                       if (other->vif.mu_mimo_owner) {
                                disable_mu_mimo = true;
                                break;
                        }
@@ -567,7 +567,7 @@ static void ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
                if (disable_mu_mimo)
                        cap &= ~IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
                else
-                       sdata->flags |= IEEE80211_SDATA_MU_MIMO_OWNER;
+                       sdata->vif.mu_mimo_owner = true;
        }
 
        mask = IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
@@ -2052,7 +2052,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
        memset(sdata->vif.bss_conf.mu_group.position, 0,
               sizeof(sdata->vif.bss_conf.mu_group.position));
        changed |= BSS_CHANGED_MU_GROUPS;
-       sdata->flags &= ~IEEE80211_SDATA_MU_MIMO_OWNER;
+       sdata->vif.mu_mimo_owner = false;
 
        sdata->ap_power_level = IEEE80211_UNSET_POWER_LEVEL;
 
@@ -2509,7 +2509,8 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata,
                eth_zero_addr(sdata->u.mgd.bssid);
                ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
                sdata->u.mgd.flags = 0;
-               sdata->flags &= ~IEEE80211_SDATA_MU_MIMO_OWNER;
+               sdata->vif.mu_mimo_owner = false;
+
                mutex_lock(&sdata->local->mtx);
                ieee80211_vif_release_channel(sdata);
                mutex_unlock(&sdata->local->mtx);
index f1e5b76eda708b86ae4a35bbd225a2eeac141593..89f71799df841bdf5f107970e5617a77307257c8 100644 (file)
@@ -1928,7 +1928,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
                          BSS_CHANGED_IDLE |
                          BSS_CHANGED_TXPOWER;
 
-               if (sdata->flags & IEEE80211_SDATA_MU_MIMO_OWNER)
+               if (sdata->vif.mu_mimo_owner)
                        changed |= BSS_CHANGED_MU_GROUPS;
 
                switch (sdata->vif.type) {
index f8f161179b5de0157ca4043e1d453d053cbe9175..89e04d55aa1832e522f8e8f9619bfabc8c81ee93 100644 (file)
@@ -450,7 +450,7 @@ void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata,
 {
        struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
 
-       if (!(sdata->flags & IEEE80211_SDATA_MU_MIMO_OWNER))
+       if (!sdata->vif.mu_mimo_owner)
                return;
 
        if (!memcmp(mgmt->u.action.u.vht_group_notif.position,
@@ -472,10 +472,9 @@ void ieee80211_process_mu_groups(struct ieee80211_sub_if_data *sdata,
 void ieee80211_update_mu_groups(struct ieee80211_vif *vif,
                                const u8 *membership, const u8 *position)
 {
-       struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
-       struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
+       struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
 
-       if (WARN_ON_ONCE(!(sdata->flags & IEEE80211_SDATA_MU_MIMO_OWNER)))
+       if (WARN_ON_ONCE(!vif->mu_mimo_owner))
                return;
 
        memcpy(bss_conf->mu_group.membership, membership, WLAN_MEMBERSHIP_LEN);