summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/pci-resource/update-pci-ids.pl
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-14 16:40:53 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-14 16:40:53 +0000
commit78e15e782cd5c7c9b89d954d88709927d092cce5 (patch)
treed0e42197b940aaeb8dba92a5893179012e4a642d /mdk-stage1/pci-resource/update-pci-ids.pl
parent8db334284f5517b251584a336bc4361447e3bfce (diff)
downloaddrakx-backup-do-not-use-78e15e782cd5c7c9b89d954d88709927d092cce5.tar
drakx-backup-do-not-use-78e15e782cd5c7c9b89d954d88709927d092cce5.tar.gz
drakx-backup-do-not-use-78e15e782cd5c7c9b89d954d88709927d092cce5.tar.bz2
drakx-backup-do-not-use-78e15e782cd5c7c9b89d954d88709927d092cce5.tar.xz
drakx-backup-do-not-use-78e15e782cd5c7c9b89d954d88709927d092cce5.zip
- use ldetect/libmodprobe/libpci instead of custom pci/usb probe
- write the list of supported modules in pci-resource/ and usb-resource/ (instead of the list of support devices)
Diffstat (limited to 'mdk-stage1/pci-resource/update-pci-ids.pl')
-rwxr-xr-xmdk-stage1/pci-resource/update-pci-ids.pl54
1 files changed, 3 insertions, 51 deletions
diff --git a/mdk-stage1/pci-resource/update-pci-ids.pl b/mdk-stage1/pci-resource/update-pci-ids.pl
index 82eb060bf..311d33d0c 100755
--- a/mdk-stage1/pci-resource/update-pci-ids.pl
+++ b/mdk-stage1/pci-resource/update-pci-ids.pl
@@ -3,29 +3,6 @@
use strict;
use MDK::Common;
-require '/usr/bin/merge2pcitable.pl';
-my $pci = read_pcitable("/usr/share/ldetect-lst/pcitable");
-
-print '
-#define PCI_REVISION_ID 0x08 /* Revision ID */
-
-struct pci_module_map {
- unsigned short vendor; /* PCI vendor id */
- unsigned short device; /* PCI device id */
- const char *name; /* PCI human readable name */
- const char *module; /* module to load */
-};
-
-struct pci_module_map_full {
- unsigned short vendor; /* PCI vendor id */
- unsigned short device; /* PCI device id */
- unsigned short subvendor; /* PCI subvendor id */
- unsigned short subdevice; /* PCI subdevice id */
- const char *name; /* PCI human readable name */
- const char *module; /* module to load */
-};
-
-';
my %t = (
network => 'network/main|gigabit|tokenring|wireless|pcmcia',
@@ -36,37 +13,12 @@ foreach my $type (keys %t) {
my @modules = chomp_(`perl ../../kernel/modules.pl pci_modules4stage1 "$t{$type}"`)
or die "unable to get PCI modules";
- my (@entries, @entries_full);
-
- foreach my $k (sort keys %$pci) {
- my $v = $pci->{$k};
- member($v->[0], @modules) or next;
- $k =~ /^(....)(....)(....)(....)/;
- my $values = { vendor => $1, device => $2, subvendor => $3, subdevice => $4, driver => $v->[0], description => $v->[1] };
- if ($values->{subdevice} eq 'ffff' && $values->{subvendor} eq 'ffff') {
- push @entries, $values;
- } else {
- push @entries_full, $values;
- }
- }
-
print "#ifndef DISABLE_".uc($type)."
-struct pci_module_map ${type}_pci_ids[] = {
+char* ${type}_pci_modules[] = {
";
- printf qq|\t{ 0x%s, 0x%s, "%s", "%s" },\n|, $_->{vendor}, $_->{device}, $_->{description}, $_->{driver}
- foreach @entries;
+ printf qq|\t"%s",\n|, $_ foreach @modules;
print "};
-unsigned int ${type}_num_ids = sizeof(${type}_pci_ids) / sizeof(struct pci_module_map);
-";
-
- print "
-struct pci_module_map_full ${type}_pci_ids_full[] = {
-";
- printf qq|\t{ 0x%s, 0x%s, 0x%s, 0x%s, "%s", "%s" },\n|, $_->{vendor}, $_->{device}, $_->{subvendor}, $_->{subdevice}, $_->{description}, $_->{driver}
- foreach @entries_full;
- print "};
-unsigned int ${type}_num_ids_full = sizeof(${type}_pci_ids_full) / sizeof(struct pci_module_map_full);
-
+unsigned int ${type}_pci_modules_len = sizeof(${type}_pci_modules) / sizeof(char *);
#endif
";