From: Miri Korenblit Date: Sun, 11 Jan 2026 17:39:15 +0000 (+0200) Subject: wifi: iwlwifi: mld: add an helper to update an EMLSR blocker X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81a33d0f3c69289c7555c4a40af1ce74e130e30e;p=thirdparty%2Fkernel%2Flinux.git wifi: iwlwifi: mld: add an helper to update an EMLSR blocker Add an helper function that iterates over all (relevant) interfaces and sets/unsets a given EMLSR blocker. For now use it only for IWL_MLD_EMLSR_BLOCKED_NON_BSS. Reviewed-by: Ilan Peer Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20260111193638.f87b347a5cf0.I6836ba40d21cca49401d1f88e03a37b00dd9f5c2@changeid --- diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mlo.c b/drivers/net/wireless/intel/iwlwifi/mld/mlo.c index 1efefc737248..87f67ddfced4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/mlo.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/mlo.c @@ -451,29 +451,49 @@ static void iwl_mld_count_non_bss_links(void *_data, u8 *mac, struct iwl_mld_update_emlsr_block_data { bool block; + enum iwl_mld_emlsr_blocked reason; int result; }; static void -iwl_mld_vif_iter_update_emlsr_non_bss_block(void *_data, u8 *mac, - struct ieee80211_vif *vif) +iwl_mld_vif_iter_update_emlsr_block(void *_data, u8 *mac, + struct ieee80211_vif *vif) { struct iwl_mld_update_emlsr_block_data *data = _data; struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif); int ret; + if (!iwl_mld_vif_has_emlsr_cap(vif)) + return; + if (data->block) { ret = iwl_mld_block_emlsr_sync(mld_vif->mld, vif, - IWL_MLD_EMLSR_BLOCKED_NON_BSS, + data->reason, iwl_mld_get_primary_link(vif)); if (ret) data->result = ret; } else { iwl_mld_unblock_emlsr(mld_vif->mld, vif, - IWL_MLD_EMLSR_BLOCKED_NON_BSS); + data->reason); } } +static int iwl_mld_update_emlsr_block(struct iwl_mld *mld, bool block, + enum iwl_mld_emlsr_blocked reason) +{ + struct iwl_mld_update_emlsr_block_data block_data = { + .block = block, + .reason = reason, + }; + + ieee80211_iterate_active_interfaces_mtx(mld->hw, + IEEE80211_IFACE_ITER_NORMAL, + iwl_mld_vif_iter_update_emlsr_block, + &block_data); + + return block_data.result; +} + int iwl_mld_emlsr_check_non_bss_block(struct iwl_mld *mld, int pending_link_changes) { @@ -481,7 +501,6 @@ int iwl_mld_emlsr_check_non_bss_block(struct iwl_mld *mld, * block EMLSR on the bss vif. Upon deactivation, check if this link * was the last non-station link active, and if so unblock the bss vif */ - struct iwl_mld_update_emlsr_block_data block_data = {}; int count = pending_link_changes; /* No need to count if we are activating a non-BSS link */ @@ -495,14 +514,8 @@ int iwl_mld_emlsr_check_non_bss_block(struct iwl_mld *mld, * We could skip updating it if the block change did not change (and * pending_link_changes is non-zero). */ - block_data.block = !!count; - - ieee80211_iterate_active_interfaces_mtx(mld->hw, - IEEE80211_IFACE_ITER_NORMAL, - iwl_mld_vif_iter_update_emlsr_non_bss_block, - &block_data); - - return block_data.result; + return iwl_mld_update_emlsr_block(mld, !!count, + IWL_MLD_EMLSR_BLOCKED_NON_BSS); } #define EMLSR_SEC_LINK_MIN_PERC 10