/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright (C) 2024-2025 Intel Corporation
+ * Copyright (C) 2024-2026 Intel Corporation
*/
#ifndef __iwl_mld_iface_h__
#define __iwl_mld_iface_h__
return container_of((void *)mld_vif, struct ieee80211_vif, drv_priv);
}
+/* Call only for interfaces that were added to the driver! */
+static inline bool iwl_mld_vif_fw_id_valid(struct iwl_mld_vif *mld_vif)
+{
+ if (WARN_ON(mld_vif->fw_id >= ARRAY_SIZE(mld_vif->mld->fw_id_to_vif)))
+ return false;
+
+ return true;
+}
+
#define iwl_mld_link_dereference_check(mld_vif, link_id) \
rcu_dereference_check((mld_vif)->link[link_id], \
lockdep_is_held(&mld_vif->mld->wiphy->mtx))
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
- * Copyright (C) 2024-2025 Intel Corporation
+ * Copyright (C) 2024-2026 Intel Corporation
*/
#include "mld.h"
#include "iface.h"
bool prev = mld_vif->low_latency_causes & LOW_LATENCY_TRAFFIC;
bool low_latency;
- if (WARN_ON(mld_vif->fw_id >= ARRAY_SIZE(mld->low_latency.result)))
+ if (!iwl_mld_vif_fw_id_valid(mld_vif))
return;
+ BUILD_BUG_ON(ARRAY_SIZE(mld->fw_id_to_vif) !=
+ ARRAY_SIZE(mld->low_latency.result));
+
low_latency = mld->low_latency.result[mld_vif->fw_id];
if (prev != low_latency)
if (WARN_ON_ONCE(!mld->low_latency.pkts_counters))
return;
- if (WARN_ON_ONCE(fw_id >= ARRAY_SIZE(counters->vo_vi) ||
- queue >= mld->trans->info.num_rxqs))
+ if (!iwl_mld_vif_fw_id_valid(mld_vif))
+ return;
+
+ if (WARN_ON_ONCE(queue >= mld->trans->info.num_rxqs))
return;
if (mld->low_latency.stopped)