in reply to Re: pci.ids to a complex data structure
in thread pci.ids to a complex data structure

From /usr/share/misc/pci.ids on my (Debian) Linux box:
# Vendors, devices and subsystems. Please keep sorted. # Syntax: # vendor vendor_name # device device_name <-- single tab # subvendor subdevice subsystem_name <-- two tabs
And some sample data:
# Formerly NCR 1000 LSI Logic / Symbios Logic 0001 53c810 1000 1000 LSI53C810AE PCI to SCSI I/O Processor 0002 53c820 0003 53c825 1000 1000 LSI53C825AE PCI to SCSI I/O Processor (Ultr +a Wide) 0004 53c815 0005 53c810AP 0006 53c860 1000 1000 LSI53C860E PCI to Ultra SCSI I/O Processor 000a 53c1510 1000 1000 LSI53C1510 PCI to Dual Channel Wide Ultra2 +SCSI Controller (Nonintelligent mode) 000b 53C896/897 1000 1000 LSI53C896/7 PCI to Dual Channel Ultra2 SCSI + Multifunction Controller 1000 1010 LSI22910 PCI to Dual Channel Ultra2 SCSI ho +st adapter 1000 1020 LSI21002 PCI to Dual Channel Ultra2 SCSI ho +st adapter # multifunction PCI card: Dual U2W SCSI, dual 10/100TX, graphics 13e9 1000 6221L-4U 000c 53c895 1000 1010 LSI8951U PCI to Ultra2 SCSI host adapter 1000 1020 LSI8952U PCI to Ultra2 SCSI host adapter 1de1 3906 DC-390U2B SCSI adapter 1de1 3907 DC-390U2W 000d 53c885 000f 53c875 0e11 7004 Embedded Ultra Wide SCSI Controller 1000 1000 LSI53C876/E PCI to Dual Channel SCSI Contro +ller 1000 1010 LSI22801 PCI to Dual Channel Ultra SCSI hos +t adapter 1000 1020 LSI22802 PCI to Dual Channel Ultra SCSI hos +t adapter 1092 8760 FirePort 40 Dual SCSI Controller 1de1 3904 DC390F/U Ultra Wide SCSI Adapter 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 4c53 1050 CT7 mainboard

I started to have a play around with this earlier this morning, but I'm afraid that I'm a bit busy at work now. If I get time to have another go at it later I'll update.

Replies are listed 'Best First'.
Re^3: pci.ids to a complex data structure
by graff (Chancellor) on Aug 21, 2006 at 02:58 UTC
    The following might not be exactly the structure that you really want, but it does store all the pci.id file content without loss of information or structure. It differs from the OP layout (which maybe wasn't what you really wanted either) in that here, the various ID field values from the file are used as hash keys.

    It's a bit clunky, because the "descriptive" fields are held as values of "special" hash keys ("vendor_name" and "device_name"), and these keys are siblings to the hash keys that happen to be ID fields. But the structure is both adequate and fairly simple.

    (I had to make sure the data sample contained tab characters as described.)