OSDN Git Service

iwlwifi: mvm: rely on mac80211 to configure TWT support
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 12 Sep 2018 13:25:27 +0000 (16:25 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 25 Jan 2019 18:57:18 +0000 (20:57 +0200)
Mac80211 will check both the HE Capability IE and the
Extended Capability IE, so set the TWT support bit when
mac80211 tells us to.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c

index 7779951..eb66269 100644 (file)
@@ -778,27 +778,9 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm,
 
        if (vif->bss_conf.assoc && vif->bss_conf.he_support &&
            !iwlwifi_mod_params.disable_11ax) {
-               struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-               u8 sta_id = mvmvif->ap_sta_id;
-
                cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_11AX);
-               if (sta_id != IWL_MVM_INVALID_STA) {
-                       struct ieee80211_sta *sta;
-
-                       sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id],
-                               lockdep_is_held(&mvm->mutex));
-
-                       /*
-                        * TODO: we should check the ext cap IE but it is
-                        * unclear why the spec requires two bits (one in HE
-                        * cap IE, and one in the ext cap IE). In the meantime
-                        * rely on the HE cap IE only.
-                        */
-                       if (sta && (sta->he_cap.he_cap_elem.mac_cap_info[0] &
-                                   IEEE80211_HE_MAC_CAP0_TWT_RES))
-                               ctxt_sta->data_policy |=
-                                       cpu_to_le32(TWT_SUPPORTED);
-               }
+               if (vif->bss_conf.twt_requester)
+                       ctxt_sta->data_policy |= cpu_to_le32(TWT_SUPPORTED);
        }