- if classid not in (PCI_CLASS_NETWORK_ETHERNET,
- PCI_CLASS_STORAGE_SCSI,
- PCI_CLASS_STORAGE_SATA,
- PCI_CLASS_STORAGE_RAID,
- PCI_CLASS_STORAGE_OTHER,
- PCI_CLASS_STORAGE_IDE):
- continue
-
- # Device may have a subvendorid and subdeviceid
- try:
- subvendorid = long(parts[4], 16)
- subdeviceid = long(parts[5], 16)
- except:
- subvendorid = PCI_ANY
- subdeviceid = PCI_ANY
-
- # search for driver that most closely matches the full_id
- # to drivers that can handle any subvendor/subdevice
- # version of the hardware.
- full_ids = ((vendorid,deviceid,subvendorid,subdeviceid),
- (vendorid,deviceid,subvendorid,PCI_ANY),
- (vendorid,deviceid,PCI_ANY,PCI_ANY))
-
- for full_id in full_ids:
- module = all_pci_ids.get(full_id, None)
- if module is not None:
- if classid == PCI_CLASS_NETWORK_ETHERNET:
- network_mods.append(module[0])
- elif classid in (PCI_CLASS_STORAGE_SCSI,
- PCI_CLASS_STORAGE_SATA,
- PCI_CLASS_STORAGE_RAID,
- PCI_CLASS_STORAGE_OTHER,
- PCI_CLASS_STORAGE_IDE):
- scsi_mods.append(module[0])
-
- # XXX ata_piix and ahci both claim 8086:2652 and 8086:2653,
- # and it is usually a non-visible BIOS option that decides
- # which is appropriate. Just load both.
- if vendorid == 0x8086 and (deviceid == 0x2652 or deviceid == 0x2653):
- if module[0] == "ahci":
- scsi_mods.append("ata_piix")
- elif module[0] == "ata_piix":
- scsi_mods.append("ahci")
- else:
- print "not network or scsi: 0x%x" % classid
- break