diff mbox series

[5/5] wifi: iwlwifi: mvm: Add support for interface usage notification

Message ID 20240605140556.21582e74a0e0.I7c423d03b4412d77509bd31bd41e4573f76c0e84@changeid (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series wifi: iwlwifi: updates - 2024-06-05 | expand

Commit Message

Korenblit, Miriam Rachel June 5, 2024, 11:07 a.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

When an interface usage notification indicates that a P2P group
interface is about to be started and there is an ongoing MLD
connection with active EMLSR, exit EMLSR.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
---
depends on the patchs adding this API in the mac80211 patchset

 .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index d972fcbc2cf7..68cd5b621ed8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -1354,6 +1354,20 @@  iwl_mvm_mld_mac_pre_channel_switch(struct ieee80211_hw *hw,
 	return ret;
 }
 
+static void iwl_mvm_mld_iface_usage(struct ieee80211_hw *hw,
+				    struct cfg80211_iface_usage *iface_usage)
+{
+	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+	u32 p2p_iftypes = BIT(NL80211_IFTYPE_P2P_GO) |
+		BIT(NL80211_IFTYPE_P2P_CLIENT);
+
+	IWL_DEBUG_MAC80211(mvm, "iface_usage_notif: mask=0x%x\n",
+			   iface_usage->types_mask);
+
+	if (iface_usage->types_mask & p2p_iftypes)
+		iwl_mvm_esr_non_bss_link(mvm, NULL, 0, true);
+}
+
 const struct ieee80211_ops iwl_mvm_mld_hw_ops = {
 	.tx = iwl_mvm_mac_tx,
 	.wake_tx_queue = iwl_mvm_mac_wake_tx_queue,
@@ -1450,4 +1464,5 @@  const struct ieee80211_ops iwl_mvm_mld_hw_ops = {
 	.change_sta_links = iwl_mvm_mld_change_sta_links,
 	.can_activate_links = iwl_mvm_mld_can_activate_links,
 	.can_neg_ttlm = iwl_mvm_mld_can_neg_ttlm,
+	.iface_usage = iwl_mvm_mld_iface_usage,
 };