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
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.
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;