]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: mld: use the dedicated helper to extract a link
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sat, 21 Mar 2026 17:29:13 +0000 (19:29 +0200)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 25 Mar 2026 09:31:57 +0000 (11:31 +0200)
There is a helper, iwl_mld_fw_id_to_link_conf, that converts a fw link
id into the bss_conf structure. Use it in two more places instead of
retrieving the bss_conf directly from the fw-id-to-bss_conf mapping array.

This required changing the loop bound in iwl_mld_process_per_link_stats()
to ucode_capa.num_links, to avoid hitting a IWL_FW_CHECK for link ids
> ucode_capa.num_links and < ARRAY_SIZE(fw_id_to_bss_conf), but this
change makes sense anyway (there is no reason to iterate links that
cannot be valid).

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260321192637.f8da2cd2a873.I7fbd3b4a86a5695206bb5083fdac49de9acc9dca@changeid
drivers/net/wireless/intel/iwlwifi/mld/scan.c
drivers/net/wireless/intel/iwlwifi/mld/stats.c

index 17e0b13b5ce8f9dfd96e96d42d8c032915bae7cb..7ed107fb0e8d478aa9fe69a6f6db06fae03c8e4b 100644 (file)
@@ -2055,9 +2055,7 @@ void iwl_mld_handle_scan_complete_notif(struct iwl_mld *mld,
                struct ieee80211_bss_conf *link_conf = NULL;
 
                if (fw_link_id != IWL_MLD_INVALID_FW_ID)
-                       link_conf =
-                               wiphy_dereference(mld->wiphy,
-                                                 mld->fw_id_to_bss_conf[fw_link_id]);
+                       link_conf = iwl_mld_fw_id_to_link_conf(mld, fw_link_id);
 
                /* It is possible that by the time the scan is complete the
                 * link was already removed and is not valid.
index 9b3149b9d2c22cca8602c7f3c5837782fb8f3dac..54eb0ead78eee701db92e14ff9200aa4a1b29252 100644 (file)
@@ -431,14 +431,13 @@ iwl_mld_process_per_link_stats(struct iwl_mld *mld,
        u32 total_airtime_usec = 0;
 
        for (u32 fw_id = 0;
-            fw_id < ARRAY_SIZE(mld->fw_id_to_bss_conf);
+            fw_id < mld->fw->ucode_capa.num_links;
             fw_id++) {
                const struct iwl_stats_ntfy_per_link *link_stats;
                struct ieee80211_bss_conf *bss_conf;
                int sig;
 
-               bss_conf = wiphy_dereference(mld->wiphy,
-                                            mld->fw_id_to_bss_conf[fw_id]);
+               bss_conf = iwl_mld_fw_id_to_link_conf(mld, fw_id);
                if (!bss_conf || bss_conf->vif->type != NL80211_IFTYPE_STATION)
                        continue;