]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/mvm/mac80211.c
iwlwifi: mvm: Refactor and fix max probe len computation
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / mvm / mac80211.c
index a3bb4a012bebbb5c24067d43ba06cafb85020896..c7a73c68bdabddcb2eb2536256e0a7736be06dc1 100644 (file)
@@ -279,14 +279,6 @@ static void iwl_mvm_reset_phy_ctxts(struct iwl_mvm *mvm)
        }
 }
 
-static int iwl_mvm_max_scan_ie_len(struct iwl_mvm *mvm)
-{
-       /* we create the 802.11 header and SSID element */
-       if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NO_BASIC_SSID)
-               return mvm->fw->ucode_capa.max_probe_length - 24 - 2;
-       return mvm->fw->ucode_capa.max_probe_length - 24 - 34;
-}
-
 int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 {
        struct ieee80211_hw *hw = mvm->hw;
@@ -304,8 +296,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
                    IEEE80211_HW_TIMING_BEACON_ONLY |
                    IEEE80211_HW_CONNECTION_MONITOR |
                    IEEE80211_HW_CHANCTX_STA_CSA |
-                   IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
-                   IEEE80211_HW_SUPPORTS_STATIC_SMPS;
+                   IEEE80211_HW_SUPPORTS_CLONED_SKBS;
 
        hw->queues = mvm->first_agg_queue;
        hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE;
@@ -327,7 +318,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
            IWL_UCODE_API(mvm->fw->ucode_ver) >= 9 &&
            !iwlwifi_mod_params.uapsd_disable) {
                hw->flags |= IEEE80211_HW_SUPPORTS_UAPSD;
-               hw->uapsd_queues = IWL_UAPSD_AC_INFO;
+               hw->uapsd_queues = IWL_MVM_UAPSD_QUEUES;
                hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP;
        }
 
@@ -380,7 +371,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 
        iwl_mvm_reset_phy_ctxts(mvm);
 
-       hw->wiphy->max_scan_ie_len = iwl_mvm_max_scan_ie_len(mvm);
+       hw->wiphy->max_scan_ie_len = iwl_mvm_max_scan_ie_len(mvm, false);
 
        hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
 
@@ -409,7 +400,25 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 
        hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN |
                               NL80211_FEATURE_LOW_PRIORITY_SCAN |
-                              NL80211_FEATURE_P2P_GO_OPPPS;
+                              NL80211_FEATURE_P2P_GO_OPPPS |
+                              NL80211_FEATURE_DYNAMIC_SMPS |
+                              NL80211_FEATURE_STATIC_SMPS;
+
+       if (mvm->fw->ucode_capa.capa[0] &
+           IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT)
+               hw->wiphy->features |= NL80211_FEATURE_TX_POWER_INSERTION;
+       if (mvm->fw->ucode_capa.capa[0] &
+           IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT)
+               hw->wiphy->features |= NL80211_FEATURE_QUIET;
+
+       if (mvm->fw->ucode_capa.capa[0] &
+           IWL_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)
+               hw->wiphy->features |=
+                       NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES;
+
+       if (mvm->fw->ucode_capa.capa[0] &
+           IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT)
+               hw->wiphy->features |= NL80211_FEATURE_WFA_TPC_IE_IN_PROBES;
 
        mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
 
@@ -2135,7 +2144,13 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw,
 
        mutex_lock(&mvm->mutex);
 
-       if (!iwl_mvm_is_idle(mvm)) {
+       /* Newest FW fixes sched scan while connected on another interface */
+       if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_LMAC_SCAN) {
+               if (!vif->bss_conf.idle) {
+                       ret = -EBUSY;
+                       goto out;
+               }
+       } else if (!iwl_mvm_is_idle(mvm)) {
                ret = -EBUSY;
                goto out;
        }