summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2026-03-20 11:09:07 +0300
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>2026-03-25 12:31:57 +0300
commit7fa6fcfca7ac3e09ae279f63111f59e990126a52 (patch)
tree5bb91571add6325b5aa6692eab0c221de493cc44
parentd60cbe9ef68c0fb2a46a5f89e8f77f419f62a1d6 (diff)
downloadlinux-7fa6fcfca7ac3e09ae279f63111f59e990126a52.tar.xz
wifi: iwlwifi: mld: support changing iftype at runtime
While the interface isn't really operating, which is already required by mac80211, we can simply remove the MAC and add it again to change the type. Implement this simple handling. We could almost consider moving this to mac80211 itself, as this kind of flow should be supportable by any device, but for now keep it here. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260320100746.2fb530f9d825.I7cc68fa36e40c9f3bef3be9c2982061cb9ea2300@changeid
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mld/mac80211.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
index 0c53d6bd9651..79f4dc271c34 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
@@ -754,6 +754,30 @@ void iwl_mld_mac80211_remove_interface(struct ieee80211_hw *hw,
mld->monitor.phy.valid = false;
}
+static
+int iwl_mld_mac80211_change_interface(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ enum nl80211_iftype new_type, bool p2p)
+{
+ enum nl80211_iftype old_type = vif->type;
+ bool old_p2p = vif->p2p;
+ int ret;
+
+ iwl_mld_mac80211_remove_interface(hw, vif);
+
+ /* set the new type for adding it cleanly */
+ vif->type = new_type;
+ vif->p2p = p2p;
+
+ ret = iwl_mld_mac80211_add_interface(hw, vif);
+
+ /* restore for mac80211, it will change it again */
+ vif->type = old_type;
+ vif->p2p = old_p2p;
+
+ return ret;
+}
+
struct iwl_mld_mc_iter_data {
struct iwl_mld *mld;
int port_id;
@@ -2716,6 +2740,7 @@ const struct ieee80211_ops iwl_mld_hw_ops = {
.get_antenna = iwl_mld_get_antenna,
.set_antenna = iwl_mld_set_antenna,
.add_interface = iwl_mld_mac80211_add_interface,
+ .change_interface = iwl_mld_mac80211_change_interface,
.remove_interface = iwl_mld_mac80211_remove_interface,
.conf_tx = iwl_mld_mac80211_conf_tx,
.prepare_multicast = iwl_mld_mac80211_prepare_multicast,