| 127 | } |
| 128 | |
| 129 | bool |
| 130 | mlx5_dev_pci_match(const struct mlx5_class_driver *drv, |
| 131 | const struct rte_device *dev) |
| 132 | { |
| 133 | const struct rte_pci_device *pci_dev; |
| 134 | const struct rte_pci_id *id_table; |
| 135 | |
| 136 | if (!mlx5_dev_is_pci(dev)) |
| 137 | return false; |
| 138 | pci_dev = RTE_DEV_TO_PCI_CONST(dev); |
| 139 | for (id_table = drv->id_table; id_table->vendor_id != 0; |
| 140 | id_table++) { |
| 141 | /* Check if device's ids match the class driver's ids. */ |
| 142 | if (id_table->vendor_id != pci_dev->id.vendor_id && |
| 143 | id_table->vendor_id != RTE_PCI_ANY_ID) |
| 144 | continue; |
| 145 | if (id_table->device_id != pci_dev->id.device_id && |
| 146 | id_table->device_id != RTE_PCI_ANY_ID) |
| 147 | continue; |
| 148 | if (id_table->subsystem_vendor_id != |
| 149 | pci_dev->id.subsystem_vendor_id && |
| 150 | id_table->subsystem_vendor_id != RTE_PCI_ANY_ID) |
| 151 | continue; |
| 152 | if (id_table->subsystem_device_id != |
| 153 | pci_dev->id.subsystem_device_id && |
| 154 | id_table->subsystem_device_id != RTE_PCI_ANY_ID) |
| 155 | continue; |
| 156 | if (id_table->class_id != pci_dev->id.class_id && |
| 157 | id_table->class_id != RTE_CLASS_ANY_ID) |
| 158 | continue; |
| 159 | return true; |
| 160 | } |
| 161 | return false; |
| 162 | } |
| 163 | |
| 164 | static int |
| 165 | mlx5_common_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, |
no test coverage detected