wifi: iwlwifi: cfg: remove MAC type/step matching

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>
Link: https://patch.msgid.link/20250510214621.fca99a5ab315.Iae27b781221fd29845493adf2c29d9e4f7a9c33b@changeid
This commit is contained in:
Johannes Berg 2025-05-10 21:48:27 +03:00 committed by Miri Korenblit
parent b745c307d0
commit d227b73f1e
3 changed files with 4 additions and 23 deletions

View File

@ -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

View File

@ -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),

View File

@ -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,