summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-02-27 13:12:03 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-02-27 13:12:03 +0000
commita6682583fc15396f9e1464b6c59acc6db4d32442 (patch)
tree3328def9cc54608b332388493715bc6073526c4c /mdk-stage1
parent7626091cb188de5c1d014755ec8a892e72fa2f69 (diff)
downloaddrakx-a6682583fc15396f9e1464b6c59acc6db4d32442.tar
drakx-a6682583fc15396f9e1464b6c59acc6db4d32442.tar.gz
drakx-a6682583fc15396f9e1464b6c59acc6db4d32442.tar.bz2
drakx-a6682583fc15396f9e1464b6c59acc6db4d32442.tar.xz
drakx-a6682583fc15396f9e1464b6c59acc6db4d32442.zip
write a short perl program to easily merge new
cardbus controllers from pcitable into probe.c
Diffstat (limited to 'mdk-stage1')
-rwxr-xr-xmdk-stage1/pcmcia_/merge_from_pcitable33
1 files changed, 33 insertions, 0 deletions
diff --git a/mdk-stage1/pcmcia_/merge_from_pcitable b/mdk-stage1/pcmcia_/merge_from_pcitable
new file mode 100755
index 000000000..f91002517
--- /dev/null
+++ b/mdk-stage1/pcmcia_/merge_from_pcitable
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+# This program will show on stdout yenta_socket stuff from pcitable
+# which is not in probe.c
+
+use MDK::Common;
+
+my @probelines = cat_('probe.c');
+my $status = 0;
+foreach (@probelines) {
+ if ($status == 0) {
+ /^pci_id_t pci_id\[\] = {/ and $status = 1;
+ } elsif ($status == 1) {
+ /^\s*{\s*0x([\da-f]+),\s*0x([\da-f]+),\s*"([^"]*)",\s*"([^"]*)"\s*}/
+ and push @probes, { vendor => $1, device => $2, tag => $3, name => $4, vd => "$1$2" };
+ /^};/ and last;
+ }
+}
+
+require '/usr/bin/merge2pcitable.pl';
+my $drivers = read_pcitable("/usr/share/ldetect-lst/pcitable");
+
+foreach my $k (sort keys %$drivers) {
+ $v = $drivers->{$k};
+ $k =~ /^(....)(....)/;
+ push @pcitable, { vendor => $1, device => $2, driver => $v->[0], name => $v->[1], vd => "$1$2" };
+}
+
+foreach my $p (@pcitable) {
+ next if $p->{driver} ne 'yenta_socket';
+ member($p->{vd}, map { $_->{vd} } @probes) or
+ print " { 0x$p->{vendor}, 0x$p->{device}, \"..\", \"$p->{name}\" },\n";
+}