Ticket #302: pci-header-update.diff
File pci-header-update.diff, 1.7 KB (added by , 19 years ago) |
---|
-
pci-header.awk
8 8 # 9 9 # Use with http://pciids.sourceforge.net/pci.ids 10 10 # run as: awk -v HEADERFILE=pcihdr.h -f pci-header.awk pci.ids 11 # Updated to run with non-posix / traditional awk 11 12 12 13 BEGIN { 13 14 … … (this hunk was shorter than expected) 26 27 print "#if 0" > ofile 27 28 print "#\tPCIHDR.H: PCI Vendors, Devices, and Class Type information\n#" > ofile 28 29 print "#\tGenerated by pci-header.awk, source data from the following URI:\n#\thttp://pciids.sourceforge.net/pci.ids\n#" > ofile 29 print "#\tHeader created on " strftime( "%A, %d %b %Y %H:%M:%S %Z", systime() ) > ofile30 # print "#\tHeader created on " strftime( "%A, %d %b %Y %H:%M:%S %Z", systime() ) > ofile 30 31 print "#endif" > ofile 31 32 32 33 # and we start with vendors.. … … 36 38 37 39 # matches vendor - starts with an id as first thing on the line 38 40 # because this occurs first in the header file, we output it without worry 39 /^[ [:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]] / {41 /^[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F] / { 40 42 41 43 if ( vendorcount++ > 0 ) { 42 44 formatting = ",\n" … … 77 79 } 78 80 79 81 # match device class - store data for later 80 /^C [ [:xdigit:]][[:xdigit:]] / {82 /^C [0-9a-fA-F][0-9a-fA-F] / { 81 83 82 84 class = $2 83 85 classname = substr($0, 7) … … 85 87 } 86 88 87 89 # match subclass, use device class data captured earlier, and output 88 /^\t[ [:xdigit:]][[:xdigit:]] / {90 /^\t[0-9a-fA-F][0-9a-fA-F] / { 89 91 90 92 subclass = $1 91 93 subclassname = substr($0, 6) … … 101 103 } 102 104 103 105 # match programming interface 104 /^\t\t[ [:xdigit:]][[:xdigit:]] / {106 /^\t\t[0-9a-fA-F][0-9a-fA-F] / { 105 107 106 108 proginterface = $1 107 109 proginterfacename = substr($0, 7)