Commit ac1ee813 authored by Johannes Berg's avatar Johannes Berg Committed by Miri Korenblit
Browse files

wifi: iwlwifi: cfg: clean up BW limit and subdev matching



The BW limit, cores and RF ID are matched in the subdevice ID,
so it doesn't really make sense to have both SUBDEV() match and
a match on any of those three. In particular, for Killer devices
the subdevice ID doesn't even follow the layout, so no matching
should be on those three values at all, only with SUBDEV().

Change the logic around the BW limit to have it more like all
the other things: only a bw_limit match in the dev_info, and
put the actual bandwidth into struct iwl_cfg. This duplicates a
number of those values, but that way the logic is clearer.

Add a test that checks that the three matches mentioned above
are not used in conjunction with SUBDEV(), and check that if
the bw_limit is matched, a BW limit is provided in the config.
Also check that the "Killer" devices have a SUBDEV() match.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250502155404.a185eac2736c.I87ee87300c92518a1d3296d3eda9fd4163e9085e@changeid
parent 337faf17
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -175,12 +175,25 @@ const struct iwl_cfg iwl9560_qu_jf_cfg = {
	.num_rbds = IWL_NUM_RBDS_NON_HE,
};

const struct iwl_cfg iwl9560_qu_jf_cfg_80mhz = {
	IWL_DEVICE_22500,
	.num_rbds = IWL_NUM_RBDS_NON_HE,
	.bw_limit = 80,
};

const struct iwl_cfg iwl9560_quz_a0_jf_b0_cfg = {
	.fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
	IWL_DEVICE_22500,
	.num_rbds = IWL_NUM_RBDS_NON_HE,
};

const struct iwl_cfg iwl9560_quz_a0_jf_b0_cfg_80mhz = {
	.fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
	IWL_DEVICE_22500,
	.num_rbds = IWL_NUM_RBDS_NON_HE,
	.bw_limit = 80,
};

const struct iwl_cfg_trans_params iwl_ax200_trans_cfg = {
	.device_family = IWL_DEVICE_FAMILY_22000,
	.base_params = &iwl_22000_base_params,
@@ -215,6 +228,12 @@ const struct iwl_cfg iwl_qu_hr = {
	.num_rbds = IWL_NUM_RBDS_22000_HE,
};

const struct iwl_cfg iwl_qu_hr_80mhz = {
	IWL_DEVICE_22500,
	.num_rbds = IWL_NUM_RBDS_22000_HE,
	.bw_limit = 80,
};

const struct iwl_cfg iwl_ax200_cfg_cc = {
	.fw_name_pre = IWL_CC_A_FW_PRE,
	IWL_DEVICE_22500,
+13 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
 * Copyright (C) 2015-2017 Intel Deutschland GmbH
 * Copyright (C) 2018-2021, 2023 Intel Corporation
 * Copyright (C) 2018-2021, 2023, 2025 Intel Corporation
 */
#include <linux/module.h>
#include <linux/stringify.h>
@@ -183,10 +183,22 @@ const struct iwl_cfg iwl9260_2ac_cfg = {
	IWL_DEVICE_9000,
};

const struct iwl_cfg iwl9260_2ac_cfg_80mhz = {
	.fw_name_pre = IWL9260_FW_PRE,
	IWL_DEVICE_9000,
	.bw_limit = 80,
};

const struct iwl_cfg iwl9560_2ac_cfg_soc = {
	.fw_name_pre = IWL9000_FW_PRE,
	IWL_DEVICE_9000,
};

const struct iwl_cfg iwl9560_2ac_cfg_soc_80mhz = {
	.fw_name_pre = IWL9000_FW_PRE,
	IWL_DEVICE_9000,
	.bw_limit = 80,
};

MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
+14 −0
Original line number Diff line number Diff line
@@ -203,6 +203,13 @@ const struct iwl_cfg iwlax210_2ax_cfg_so_jf_b0 = {
	.num_rbds = IWL_NUM_RBDS_NON_HE,
};

const struct iwl_cfg iwlax210_2ax_cfg_so_jf_b0_80mhz = {
	.fw_name_pre = IWL_SO_A_JF_B_FW_PRE,
	IWL_DEVICE_AX210,
	.num_rbds = IWL_NUM_RBDS_NON_HE,
	.bw_limit = 80,
};

const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0 = {
	.name = iwl_ax211_name,
	.fw_name_pre = IWL_SO_A_GF_A_FW_PRE,
@@ -259,6 +266,13 @@ const struct iwl_cfg iwl_cfg_so_a0_hr_a0 = {
	.num_rbds = IWL_NUM_RBDS_AX210_HE,
};

const struct iwl_cfg iwl_cfg_so_a0_hr_a0_80mhz = {
	.fw_name_pre = IWL_SO_A_HR_B_FW_PRE,
	IWL_DEVICE_AX210,
	.num_rbds = IWL_NUM_RBDS_AX210_HE,
	.bw_limit = 80,
};

MODULE_FIRMWARE(IWL_SO_A_JF_B_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
MODULE_FIRMWARE(IWL_SO_A_HR_B_MODULE_FIRMWARE(IWL_AX210_UCODE_API_MAX));
IWL_FW_AND_PNVM(IWL_SO_A_GF_A_FW_PRE, IWL_AX210_UCODE_API_MAX);
+8 −0
Original line number Diff line number Diff line
@@ -169,6 +169,14 @@ const struct iwl_cfg iwl_cfg_bz = {
	.num_rbds = IWL_NUM_RBDS_BZ_EHT,
};

const struct iwl_cfg iwl_cfg_bz_160mhz = {
	.uhb_supported = true,
	IWL_DEVICE_BZ,
	.features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,
	.num_rbds = IWL_NUM_RBDS_BZ_EHT,
	.bw_limit = 160,
};

MODULE_FIRMWARE(IWL_BZ_A_HR_B_MODULE_FIRMWARE(IWL_BZ_UCODE_API_MAX));
IWL_FW_AND_PNVM(IWL_BZ_A_GF_A_FW_PRE, IWL_BZ_UCODE_API_MAX);
IWL_FW_AND_PNVM(IWL_BZ_A_GF4_A_FW_PRE, IWL_BZ_UCODE_API_MAX);
+5 −0
Original line number Diff line number Diff line
@@ -149,6 +149,11 @@ const struct iwl_cfg iwl_cfg_sc = {
	IWL_DEVICE_SC,
};

const struct iwl_cfg iwl_cfg_sc_160mhz = {
	IWL_DEVICE_SC,
	.bw_limit = 160,
};

IWL_FW_AND_PNVM(IWL_SC_A_FM_B_FW_PRE, IWL_SC_UCODE_API_MAX);
IWL_FW_AND_PNVM(IWL_SC_A_FM_C_FW_PRE, IWL_SC_UCODE_API_MAX);
MODULE_FIRMWARE(IWL_SC_A_HR_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
Loading