- 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])
- else:
- print "not network or scsi: 0x%x" % classid
- break
+ modules = pcimap.get(dev)
+ if len(modules) > 0:
+ if base == PCI_BASE_CLASS_NETWORK:
+ network_mods.append(modules[0])
+ elif base == PCI_BASE_CLASS_STORAGE:
+ scsi_mods.append(modules[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 dev[0] == 0x8086 and (dev[1] == 0x2652 or dev[1] == 0x2653):
+ if modules[0] == "ahci":
+ scsi_mods.append("ata_piix")
+ elif modules[0] == "ata_piix":
+ scsi_mods.append("ahci")