From 78e15e782cd5c7c9b89d954d88709927d092cce5 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 14 Aug 2007 16:40:53 +0000 Subject: - 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) --- mdk-stage1/usb-resource/update-usb-ids.pl | 55 +++++++------------------------ 1 file changed, 12 insertions(+), 43 deletions(-) (limited to 'mdk-stage1/usb-resource') diff --git a/mdk-stage1/usb-resource/update-usb-ids.pl b/mdk-stage1/usb-resource/update-usb-ids.pl index b938cdb1a..3938a54f7 100755 --- a/mdk-stage1/usb-resource/update-usb-ids.pl +++ b/mdk-stage1/usb-resource/update-usb-ids.pl @@ -3,52 +3,21 @@ use strict; use MDK::Common; -require '/usr/bin/merge2pcitable.pl'; -my $pci = read_pcitable("/usr/share/ldetect-lst/pcitable"); -my $usb = read_pcitable("/usr/share/ldetect-lst/usbtable"); - -print ' - - -struct usb_module_map { - unsigned short vendor; /* vendor */ - unsigned short id; /* device */ - const char *name; /* human readable name */ - const char *module; /* module to load */ -}; - -'; - -print "struct pci_module_map usb_pci_ids[] = { - +my @modules = chomp_(`perl ../../kernel/modules.pl pci_modules4stage1 "bus/usb"`) + or die "unable to get USB controller modules"; +print "char *usb_controller_modules[] = { "; - -foreach my $k (sort keys %$pci) { - my $v = $pci->{$k}; - $v->[0] =~ /^usb-|^ehci-hcd|^ohci1394/ or next; - $k =~ /^(....)(....)/; - printf qq|\t{ 0x%s, 0x%s, "", "%s" },\n|, - $1, $2, $v->[0]; -} - +printf qq|\t"%s",\n|, $_ foreach @modules; print "}; -int usb_num_ids=sizeof(usb_pci_ids)/sizeof(struct pci_module_map); -"; - -print "struct usb_module_map usb_usb_ids[] = { +unsigned int usb_controller_modules_len = sizeof(usb_controller_modules) / sizeof(char *); "; -my @modules = chomp_(`perl ../../kernel/modules.pl pci_modules4stage1 "network/usb disk/usb"`) -or die "unable to get USB modules"; +@modules = chomp_(`perl ../../kernel/modules.pl pci_modules4stage1 "network/usb disk/usb"`) + or die "unable to get USB modules"; - foreach my $k (sort keys %$usb) { - my $v = $usb->{$k}; - member($v->[0], @modules) or next; - $k =~ /^(....)(....)/; - printf qq|\t{ 0x%s, 0x%s, "%s", "%s" },\n|, - $1, $2, $v->[1], $v->[0]; - } - - print "}; -int usb_usb_num_ids=sizeof(usb_usb_ids)/sizeof(struct usb_module_map); +print "char *usb_modules[] = { +"; +printf qq|\t"%s",\n|, $_ foreach @modules; +print "}; +unsigned int usb_modules_len = sizeof(usb_modules) / sizeof(char *); "; -- cgit v1.2.1