summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2025-09-15 11:34:28 +0300
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>2025-10-28 16:05:18 +0200
commitef56bbed4c03fc272c65da821d31094b63a8461e (patch)
treef7152cb22559e866ab7df9cca7fef26d00c92a03 /drivers/net/wireless/intel
parent30d47d8fe781469ebd4e38240999767f139effb2 (diff)
wifi: iwlwifi: tests: check listed PCI IDs have configs
Add a test that checks, for the old pre-CNVI devices, that PCI IDs listed in the PCI IDs table will also match in the config table. Newer ones we test against our database of devices, but the current database doesn't go back that far, so at least this checks against the PCI IDs the driver has. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250915113137.eb728b270d46.Ie5754f4201b807eb0d55feb339a728fc0b42e8bf@changeid
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/cfg/bz.c1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/tests/devinfo.c27
2 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/bz.c b/drivers/net/wireless/intel/iwlwifi/cfg/bz.c
index 3e6206e739f6..18c9244ee8ef 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/bz.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/bz.c
@@ -90,6 +90,7 @@ const struct iwl_mac_cfg iwl_bz_mac_cfg = {
.low_latency_xtal = true,
.ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US,
};
+EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_bz_mac_cfg);
const struct iwl_mac_cfg iwl_gl_mac_cfg = {
.device_family = IWL_DEVICE_FAMILY_BZ,
diff --git a/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c b/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c
index c31bbd4e7a4a..3054bc0a9c67 100644
--- a/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c
+++ b/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c
@@ -265,6 +265,32 @@ static void devinfo_api_range(struct kunit *test)
}
}
+static void devinfo_pci_ids_config(struct kunit *test)
+{
+ for (int i = 0; iwl_hw_card_ids[i].vendor; i++) {
+ const struct pci_device_id *s = &iwl_hw_card_ids[i];
+ const struct iwl_dev_info *di;
+
+ if (s->device == PCI_ANY_ID || s->subdevice == PCI_ANY_ID)
+ continue;
+
+ /*
+ * The check below only works for old (pre-CNVI) devices. Most
+ * new have subdevice==ANY, so are already skipped, but for some
+ * Bz platform(s) we list all the RF PCI IDs. Skip those too.
+ */
+ if (s->driver_data == (kernel_ulong_t)&iwl_bz_mac_cfg)
+ continue;
+
+ di = iwl_pci_find_dev_info(s->device, s->subdevice,
+ 0, 0, 0, 0, true);
+
+ KUNIT_EXPECT_PTR_NE_MSG(test, di, NULL,
+ "PCI ID %04x:%04x not found\n",
+ s->device, s->subdevice);
+ }
+}
+
static struct kunit_case devinfo_test_cases[] = {
KUNIT_CASE(devinfo_table_order),
KUNIT_CASE(devinfo_discrete_match),
@@ -276,6 +302,7 @@ static struct kunit_case devinfo_test_cases[] = {
KUNIT_CASE(devinfo_pci_ids),
KUNIT_CASE(devinfo_no_mac_cfg_dups),
KUNIT_CASE(devinfo_api_range),
+ KUNIT_CASE(devinfo_pci_ids_config),
{}
};