wifi: mac80211: Rename and update IEEE80211_VIF_DISABLE_SMPS_OVERRIDE
authorIlan Peer <ilan.peer@intel.com>
Thu, 28 Sep 2023 14:35:27 +0000 (17:35 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 23 Oct 2023 09:43:27 +0000 (11:43 +0200)
EMLSR operation and SMPS operation cannot coexist. Thus, when EMLSR is
enabled, all SMPS signaling towards the AP should be stopped (it is
expected that the AP will consider SMPS to be off).

Rename IEEE80211_VIF_DISABLE_SMPS_OVERRIDE to IEEE80211_VIF_EML_ACTIVE
and use the flag as an indication from the driver that EMLSR is enabled.
When EMLSR is enabled SMPS flows towards the AP MLD should be stopped.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.fb2c2f9a0645.If6df5357568abd623a081f0f33b07e63fb8bba99@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
include/net/mac80211.h
net/mac80211/cfg.c
net/mac80211/debugfs_netdev.c

index 46e207211f21d19b186599207f5b9c1dc40cb7c2..6b4b32b5350b2b4221c0e6ab63f63595802fdb19 100644 (file)
@@ -240,8 +240,8 @@ static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm,
 
        mvmvif->esr_active = true;
 
-       /* Disable SMPS overrideing by user */
-       vif->driver_flags |= IEEE80211_VIF_DISABLE_SMPS_OVERRIDE;
+       /* Indicate to mac80211 that EML is enabled */
+       vif->driver_flags |= IEEE80211_VIF_EML_ACTIVE;
 
        iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
                                            IEEE80211_SMPS_OFF);
@@ -399,7 +399,7 @@ static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm,
 
        mvmvif->esr_active = false;
 
-       vif->driver_flags &= ~IEEE80211_VIF_DISABLE_SMPS_OVERRIDE;
+       vif->driver_flags &= ~IEEE80211_VIF_EML_ACTIVE;
 
        iwl_mvm_update_smps_on_active_links(mvm, vif, IWL_MVM_SMPS_REQ_FW,
                                            IEEE80211_SMPS_AUTOMATIC);
index a9b73e35746295c601a79546eb3501ba74a83511..7dae9aac089ca3d976e6215a7f07abfe02327821 100644 (file)
@@ -1767,15 +1767,15 @@ struct ieee80211_channel_switch {
  * @IEEE80211_VIF_GET_NOA_UPDATE: request to handle NOA attributes
  *     and send P2P_PS notification to the driver if NOA changed, even
  *     this is not pure P2P vif.
- * @IEEE80211_VIF_DISABLE_SMPS_OVERRIDE: disable user configuration of
- *     SMPS mode via debugfs.
+ * @IEEE80211_VIF_EML_ACTIVE: The driver indicates that EML operation is
+ *      enabled for the interface.
  */
 enum ieee80211_vif_flags {
        IEEE80211_VIF_BEACON_FILTER             = BIT(0),
        IEEE80211_VIF_SUPPORTS_CQM_RSSI         = BIT(1),
        IEEE80211_VIF_SUPPORTS_UAPSD            = BIT(2),
        IEEE80211_VIF_GET_NOA_UPDATE            = BIT(3),
-       IEEE80211_VIF_DISABLE_SMPS_OVERRIDE     = BIT(4),
+       IEEE80211_VIF_EML_ACTIVE                = BIT(4),
 };
 
 
index 5cec0c251e86ac0ba3f6c3737ccc70083e459824..606b1b2e41235e4491518cf849aa3b6cb0adaabb 100644 (file)
@@ -3158,6 +3158,12 @@ int __ieee80211_request_smps_mgd(struct ieee80211_sub_if_data *sdata,
        old_req = link->u.mgd.req_smps;
        link->u.mgd.req_smps = smps_mode;
 
+       /* The driver indicated that EML is enabled for the interface, which
+        * implies that SMPS flows towards the AP should be stopped.
+        */
+       if (sdata->vif.driver_flags & IEEE80211_VIF_EML_ACTIVE)
+               return 0;
+
        if (old_req == smps_mode &&
            smps_mode != IEEE80211_SMPS_AUTOMATIC)
                return 0;
index b383dad18841e8a2eddc6742455a4ac89712f8f9..ec91e131b29e5aa8e5e2baf177819fcf6d973fe0 100644 (file)
@@ -323,7 +323,10 @@ static int ieee80211_set_smps(struct ieee80211_link_data *link,
        struct ieee80211_sub_if_data *sdata = link->sdata;
        struct ieee80211_local *local = sdata->local;
 
-       if (sdata->vif.driver_flags & IEEE80211_VIF_DISABLE_SMPS_OVERRIDE)
+       /* The driver indicated that EML is enabled for the interface, thus do
+        * not allow to override the SMPS state.
+        */
+       if (sdata->vif.driver_flags & IEEE80211_VIF_EML_ACTIVE)
                return -EOPNOTSUPP;
 
        if (!(local->hw.wiphy->features & NL80211_FEATURE_STATIC_SMPS) &&