@@ -941,29 +941,18 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
941941};
942942MODULE_DEVICE_TABLE (pci , iwl_hw_card_ids );
943943
944- #define IWL_DEV_INFO (_device , _subdevice , _cfg , _name ) \
945- { .device = (_device), .subdevice = (_subdevice), .cfg = &(_cfg), \
946- .name = _name }
944+ #define _IWL_DEV_INFO (_device , _subdevice , _mac_type , _rf_type , _no_160 , \
945+ _cfg , _name ) \
946+ { .device = (_device), .subdevice = (_subdevice), .cfg = &(_cfg), \
947+ .name = _name, .mac_type = _mac_type, .rf_type = _rf_type, \
948+ .no_160 = _no_160, }
949+
950+ #define IWL_DEV_INFO (_device , _subdevice , _cfg , _name ) \
951+ _IWL_DEV_INFO(_device, _subdevice, IWL_CFG_ANY, IWL_CFG_ANY, \
952+ IWL_CFG_ANY, _cfg, _name)
947953
948954static const struct iwl_dev_info iwl_dev_info_table [] = {
949955#if IS_ENABLED (CONFIG_IWLMVM )
950- IWL_DEV_INFO (0x2526 , 0x0010 , iwl9260_2ac_cfg , iwl9260_160_name ),
951- IWL_DEV_INFO (0x2526 , 0x0014 , iwl9260_2ac_cfg , iwl9260_160_name ),
952- IWL_DEV_INFO (0x2526 , 0x0018 , iwl9260_2ac_cfg , iwl9260_160_name ),
953- IWL_DEV_INFO (0x2526 , 0x001C , iwl9260_2ac_cfg , iwl9260_160_name ),
954- IWL_DEV_INFO (0x2526 , 0x6010 , iwl9260_2ac_cfg , iwl9260_160_name ),
955- IWL_DEV_INFO (0x2526 , 0x6014 , iwl9260_2ac_cfg , iwl9260_160_name ),
956- IWL_DEV_INFO (0x2526 , 0x8014 , iwl9260_2ac_cfg , iwl9260_160_name ),
957- IWL_DEV_INFO (0x2526 , 0x8010 , iwl9260_2ac_cfg , iwl9260_160_name ),
958- IWL_DEV_INFO (0x2526 , 0xA014 , iwl9260_2ac_cfg , iwl9260_160_name ),
959- IWL_DEV_INFO (0x2526 , 0xE010 , iwl9260_2ac_cfg , iwl9260_160_name ),
960- IWL_DEV_INFO (0x2526 , 0xE014 , iwl9260_2ac_cfg , iwl9260_160_name ),
961-
962- IWL_DEV_INFO (0x2526 , 0x0210 , iwl9260_2ac_cfg , iwl9260_name ),
963- IWL_DEV_INFO (0x2526 , 0x0214 , iwl9260_2ac_cfg , iwl9260_name ),
964- IWL_DEV_INFO (0x2526 , 0x1010 , iwl9260_2ac_cfg , iwl9260_name ),
965- IWL_DEV_INFO (0x2526 , 0x1210 , iwl9260_2ac_cfg , iwl9260_name ),
966-
967956 IWL_DEV_INFO (0x2526 , 0x1410 , iwl9260_2ac_cfg , iwl9270_name ),
968957 IWL_DEV_INFO (0x2526 , 0x1610 , iwl9260_2ac_cfg , iwl9270_name ),
969958
@@ -999,6 +988,13 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
999988
1000989 IWL_DEV_INFO (0x2526 , 0x1551 , iwl9560_2ac_cfg_soc , iwl9560_killer_1550s_name ),
1001990 IWL_DEV_INFO (0x2526 , 0x1552 , iwl9560_2ac_cfg_soc , iwl9560_killer_1550i_name ),
991+
992+ _IWL_DEV_INFO (0x2526 , IWL_CFG_ANY ,
993+ IWL_CFG_MAC_TYPE_TH , IWL_CFG_RF_TYPE_TH , IWL_CFG_160 ,
994+ iwl9260_2ac_cfg , iwl9260_160_name ),
995+ _IWL_DEV_INFO (0x2526 , IWL_CFG_ANY ,
996+ IWL_CFG_MAC_TYPE_TH , IWL_CFG_RF_TYPE_TH , IWL_CFG_NO_160 ,
997+ iwl9260_2ac_cfg , iwl9260_name ),
1002998#endif /* CONFIG_IWLMVM */
1003999};
10041000
@@ -1034,13 +1030,23 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
10341030 /* the trans_cfg should never change, so set it now */
10351031 iwl_trans -> trans_cfg = trans ;
10361032
1033+ iwl_trans -> hw_rf_id = iwl_read32 (iwl_trans , CSR_HW_RF_ID );
1034+
10371035 for (i = 0 ; i < ARRAY_SIZE (iwl_dev_info_table ); i ++ ) {
10381036 const struct iwl_dev_info * dev_info = & iwl_dev_info_table [i ];
1039-
1040- if ((dev_info -> device == IWL_CFG_ANY ||
1037+ if ((dev_info -> device == (u16 )IWL_CFG_ANY ||
10411038 dev_info -> device == pdev -> device ) &&
1042- (dev_info -> subdevice == IWL_CFG_ANY ||
1043- dev_info -> subdevice == pdev -> subsystem_device )) {
1039+ (dev_info -> subdevice == (u16 )IWL_CFG_ANY ||
1040+ dev_info -> subdevice == pdev -> subsystem_device ) &&
1041+ (dev_info -> mac_type == (u16 )IWL_CFG_ANY ||
1042+ dev_info -> mac_type ==
1043+ CSR_HW_REV_TYPE (iwl_trans -> hw_rev )) &&
1044+ (dev_info -> rf_type == (u16 )IWL_CFG_ANY ||
1045+ dev_info -> rf_type ==
1046+ CSR_HW_RFID_TYPE (iwl_trans -> hw_rf_id )) &&
1047+ (dev_info -> no_160 == (u8 )IWL_CFG_ANY ||
1048+ dev_info -> no_160 ==
1049+ IWL_SUBDEVICE_NO_160 (pdev -> subsystem_device ))) {
10441050 iwl_trans -> cfg = dev_info -> cfg ;
10451051 iwl_trans -> name = dev_info -> name ;
10461052 goto found ;
@@ -1065,8 +1071,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
10651071 (iwl_trans -> hw_rev & CSR_HW_REV_TYPE_MSK ) == CSR_HW_REV_TYPE_7265D )
10661072 iwl_trans -> cfg = cfg_7265d ;
10671073
1068- iwl_trans -> hw_rf_id = iwl_read32 (iwl_trans , CSR_HW_RF_ID );
1069-
10701074 if (cfg == & iwlax210_2ax_cfg_so_hr_a0 ) {
10711075 if (iwl_trans -> hw_rev == CSR_HW_REV_TYPE_TY ) {
10721076 iwl_trans -> cfg = & iwlax210_2ax_cfg_ty_gf_a0 ;
0 commit comments