4
# read gcc -E {aic79xx_pci.c,aic7xxx_pci.c} and extract module info
11
if(/^struct.*ah[cd]_pci_ident_table\s*\[\s*\]\s*=\s*$/ .. /^\}/) {
12
if(/^struct.*ah([cd])_pci_ident_table\s*\[\s*\]\s*=\s*$/) {
13
$mod = $1 eq "c" ? "aic7xxx" : "aic79xx";
16
if(/^\s+\{/ .. /^\s+\}/) {
18
if($field && $field != 4) {
19
die "oops, unexpected line $.: $_";
22
# print "id = $id, id_mask = $id_mask, mask = $mask, name = $name, func = $func\n";
34
if($field == 0 && /^\s+0x([0-9A-Fa-f]{16})ull\s*,\s*$/) {
38
elsif($field == 0 && /^\s+0x([0-9A-Fa-f]{16})ull\s*\&\s*0x([0-9A-Fa-f]{16})ull\s*,\s*$/) {
43
elsif($field == 1 && /^\s+0x([0-9A-Fa-f]{16})ull\s*,\s*$/) {
47
elsif($field == 2 && /^\s+((NULL|\(\(void\s*\*\)\s*0\))|(\".+\"))\s*,\s*$/) {
51
elsif($field == 3 && /^\s+((NULL|\(\(void\s*\*\)\s*0\))|([a-z].+))\s*,?\s*$/) {
69
printf " & 0x%04x", $r;
80
my ($v, $d, $sv, $sd);
81
my ($vm, $dm, $svm, $sdm);
84
$id_mask = "F" x 16 unless defined $id_mask;
86
$d = hex(substr $id, 0, 4) & hex(substr $id_mask, 0, 4);
87
$v = hex(substr $id, 4, 4) & hex(substr $id_mask, 4, 4);
88
$sd = hex(substr $id, 8, 4) & hex(substr $id_mask, 8, 4);
89
$sv = hex(substr $id, 12, 4) & hex(substr $id_mask, 12, 4);
91
$dm = hex(substr $mask, 0, 4);
92
$vm = hex(substr $mask, 4, 4);
93
$sdm = hex(substr $mask, 8, 4);
94
$svm = hex(substr $mask, 12, 4);
98
if($func !~ /^[a-z]/) {
99
print STDERR "entry \"$name\" dropped\n";
108
printf "${tag}vendor.id\t\tpci 0x%04x", $v;
116
printf "${tag}device.id\t\tpci 0x%04x", $d;
124
printf "${tag}subvendor.id\t\tpci 0x%04x", $sv;
132
printf "${tag}subdevice.id\t\tpci 0x%04x", $sd;
139
printf "+driver.module.modprobe\t%s\n", $mod;