OSDN Git Service

iwlwifi: mvm: add support for OCE scan
authorAvraham Stern <avraham.stern@intel.com>
Fri, 10 Dec 2021 09:12:43 +0000 (11:12 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Tue, 21 Dec 2021 10:35:05 +0000 (12:35 +0200)
In case the fw supports OCE scan and one of the OCE feature flags
are set in the scan request, set the corresponding flag in the
firmware scan request.
Note that new firmware that indicates OCE support does not support
the probe deferral and suppression feature (which is optional).

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211210110539.3dd63c381839.Id79b39f650103bb9b851e31ed6a0178e81988587@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/scan.c

index 9aa7d0b..175e2ce 100644 (file)
@@ -640,6 +640,10 @@ enum iwl_umac_scan_general_flags2 {
  * @IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN_FILTER_IN: in case
  *      &IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN is enabled and scan is
  *      activated over 6GHz PSC channels, filter in beacons and probe responses.
+ * @IWL_UMAC_SCAN_GEN_FLAGS_V2_OCE: if set, send probe requests in a minimum
+ *      rate of 5.5Mpbs, filter in broadcast probe responses and set the max
+ *      channel time indication field in the FILS request parameters element
+ *      (if included by the driver in the probe request IEs).
  */
 enum iwl_umac_scan_general_flags_v2 {
        IWL_UMAC_SCAN_GEN_FLAGS_V2_PERIODIC             = BIT(0),
@@ -657,6 +661,7 @@ enum iwl_umac_scan_general_flags_v2 {
        IWL_UMAC_SCAN_GEN_FLAGS_V2_TRIGGER_UHB_SCAN     = BIT(12),
        IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN    = BIT(13),
        IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN_FILTER_IN = BIT(14),
+       IWL_UMAC_SCAN_GEN_FLAGS_V2_OCE                  = BIT(15),
 };
 
 /**
index 08177e9..d1ab166 100644 (file)
@@ -641,14 +641,21 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
        }
 
        if (iwl_mvm_is_oce_supported(mvm)) {
+               u8 scan_ver = iwl_fw_lookup_cmd_ver(mvm->fw,
+                                                   IWL_ALWAYS_LONG_GROUP,
+                                                   SCAN_REQ_UMAC, 0);
+
                wiphy_ext_feature_set(hw->wiphy,
                        NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP);
                wiphy_ext_feature_set(hw->wiphy,
                        NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME);
                wiphy_ext_feature_set(hw->wiphy,
-                       NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION);
-               wiphy_ext_feature_set(hw->wiphy,
                        NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE);
+
+               /* Old firmware also supports probe deferral and suppression */
+               if (scan_ver < 15)
+                       wiphy_ext_feature_set(hw->wiphy,
+                                             NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION);
        }
 
        if (mvm->nvm_data->sku_cap_11ax_enable &&
index 693afd7..b401ab6 100644 (file)
@@ -2037,6 +2037,12 @@ static u16 iwl_mvm_scan_umac_flags_v2(struct iwl_mvm *mvm,
        if (params->enable_6ghz_passive)
                flags |= IWL_UMAC_SCAN_GEN_FLAGS_V2_6GHZ_PASSIVE_SCAN;
 
+       if (iwl_mvm_is_oce_supported(mvm) &&
+           (params->flags & (NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP |
+                             NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE |
+                             NL80211_SCAN_FLAG_FILS_MAX_CHANNEL_TIME)))
+               flags |= IWL_UMAC_SCAN_GEN_FLAGS_V2_OCE;
+
        return flags;
 }