diff mbox series

[iwlwifi-next,15/15] wifi: iwlwifi: cfg: remove MAC type/step matching

Message ID 20250510214621.fca99a5ab315.Iae27b781221fd29845493adf2c29d9e4f7a9c33b@changeid
State New
Headers show
Series wifi: iwlwifi: updates - 2025-05-10 | expand

Commit Message

Miri Korenblit May 10, 2025, 6:48 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Now that it's all split into MAC and RF configs, remove
the matching on MAC type and step. If we ever need to do
something based on the MAC step, we'll have to find some
new mechanism (since the MAC type is known already from
the PCI IDs table, but not the step), or just handle the
(likely small) differences in code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-config.h |  5 +----
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c   | 17 +----------------
 .../net/wireless/intel/iwlwifi/tests/devinfo.c  |  5 ++---
 3 files changed, 4 insertions(+), 23 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index b1caa7205850..0b18f44af774 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -482,9 +482,7 @@  struct iwl_dev_info {
 	u16 subdevice;
 	u16 subdevice_mask;
 	u16 rf_type;
-	u8 mac_type;
 	u8 bw_limit;
-	u8 mac_step;
 	u8 rf_step;
 	u8 rf_id;
 	u8 cores;
@@ -498,8 +496,7 @@  struct iwl_dev_info {
 extern const struct iwl_dev_info iwl_dev_info_table[];
 extern const unsigned int iwl_dev_info_table_size;
 const struct iwl_dev_info *
-iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
-		      u8 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
+iwl_pci_find_dev_info(u16 device, u16 subsystem_device, u16 rf_type, u8 cdb,
 		      u8 jacket, u8 rf_id, u8 bw_limit, u8 cores, u8 rf_step);
 extern const struct pci_device_id iwl_hw_card_ids[];
 #endif
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 39d46b83b5da..1d149843f335 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -561,8 +561,6 @@  EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_hw_card_ids);
 	.device = IWL_CFG_ANY,			\
 	.subdevice = IWL_CFG_ANY,		\
 	.subdevice_mask = ~0,			\
-	.mac_type = IWL_CFG_ANY,		\
-	.mac_step = IWL_CFG_ANY,		\
 	.rf_type = IWL_CFG_ANY,			\
 	.rf_step = IWL_CFG_ANY,			\
 	.bw_limit = IWL_CFG_ANY,		\
@@ -580,8 +578,6 @@  EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_hw_card_ids);
 #define SUBDEV_MASKED(v, m)			\
 			.subdevice = (v),	\
 			.subdevice_mask = (m)
-#define MAC_TYPE(n)	.mac_type = IWL_CFG_MAC_TYPE_##n
-#define MAC_STEP(n)	.mac_step = SILICON_##n##_STEP
 #define RF_TYPE(n)	.rf_type = IWL_CFG_RF_TYPE_##n
 #define RF_STEP(n)	.rf_step = SILICON_##n##_STEP
 #define CORES(n)	.cores = IWL_CFG_CORES_##n
@@ -1220,8 +1216,7 @@  static int map_crf_id(struct iwl_trans *iwl_trans,
 #define PCI_CFG_RETRY_TIMEOUT	0x041
 
 VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info *
-iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
-		      u8 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
+iwl_pci_find_dev_info(u16 device, u16 subsystem_device, u16 rf_type, u8 cdb,
 		      u8 jacket, u8 rf_id, u8 bw_limit, u8 cores, u8 rf_step)
 {
 	int num_devices = ARRAY_SIZE(iwl_dev_info_table);
@@ -1241,14 +1236,6 @@  iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
 		    dev_info->subdevice != (subsystem_device & dev_info->subdevice_mask))
 			continue;
 
-		if (dev_info->mac_type != (u8)IWL_CFG_ANY &&
-		    dev_info->mac_type != mac_type)
-			continue;
-
-		if (dev_info->mac_step != (u8)IWL_CFG_ANY &&
-		    dev_info->mac_step != mac_step)
-			continue;
-
 		if (dev_info->rf_type != (u16)IWL_CFG_ANY &&
 		    dev_info->rf_type != rf_type)
 			continue;
@@ -1392,8 +1379,6 @@  static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		 info.hw_rev, info.hw_rf_id);
 
 	dev_info = iwl_pci_find_dev_info(pdev->device, pdev->subsystem_device,
-					 CSR_HW_REV_TYPE(info.hw_rev),
-					 info.hw_rev_step,
 					 CSR_HW_RFID_TYPE(info.hw_rf_id),
 					 CSR_HW_RFID_IS_CDB(info.hw_rf_id),
 					 CSR_HW_RFID_IS_JACKET(info.hw_rf_id),
diff --git a/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c b/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c
index bd0102ef7384..69b26de4aff8 100644
--- a/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c
+++ b/drivers/net/wireless/intel/iwlwifi/tests/devinfo.c
@@ -13,8 +13,8 @@  MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
 
 static void iwl_pci_print_dev_info(const char *pfx, const struct iwl_dev_info *di)
 {
-	printk(KERN_DEBUG "%sdev=%.4x,subdev=%.4x,mac_type=%.4x,mac_step=%.4x,rf_type=%.4x,cdb=%d,jacket=%d,rf_id=%.2x,bw_limit=%d,cores=%.2x\n",
-	       pfx, di->device, di->subdevice, di->mac_type, di->mac_step,
+	printk(KERN_DEBUG "%sdev=%.4x subdev=%.4x rf_type=%.4x cdb=%d jacket=%d rf_id=%.2x bw_limit=%d cores=%.2x\n",
+	       pfx, di->device, di->subdevice,
 	       di->rf_type, di->cdb, di->jacket, di->rf_id, di->bw_limit,
 	       di->cores);
 }
@@ -28,7 +28,6 @@  static void devinfo_table_order(struct kunit *test)
 		const struct iwl_dev_info *ret;
 
 		ret = iwl_pci_find_dev_info(di->device, di->subdevice,
-					    di->mac_type, di->mac_step,
 					    di->rf_type, di->cdb,
 					    di->jacket, di->rf_id,
 					    di->bw_limit,