From f56eaf9328fdfbf64482b22b9014a3e5225f4f2d Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 18 Mar 2008 16:34:31 +0000 Subject: extract probe_pci_modules functions (will be reused to load media controllers in two times, IDE first, other then) --- mdk-stage1/probing.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'mdk-stage1/probing.c') diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c index 035ddb106..2f5f3b9fc 100644 --- a/mdk-stage1/probing.c +++ b/mdk-stage1/probing.c @@ -293,6 +293,22 @@ void discovered_device(enum driver_type type, const char * description, const ch #endif } +void probe_pci_modules(enum driver_type type, char **pci_modules, unsigned int pci_modules_len) { + struct pciusb_entries entries; + int i; + + entries = pci_probe(); + for (i = 0; i < entries.nb; i++) { + struct pciusb_entry *e = &entries.entries[i]; + if (device_match_modules_list(e, pci_modules, pci_modules_len)) { + log_message("PCI: device %04x %04x %04x %04x is \"%s\", driver is %s", + e->vendor, e->device, e->subvendor, e->subdevice, e->text, e->module); + discovered_device(type, e->text, e->module); + } + } + pciusb_free(&entries); +} + #ifdef ENABLE_USB void probe_that_type(enum driver_type type, enum media_bus bus) #else @@ -304,10 +320,8 @@ void probe_that_type(enum driver_type type, enum media_bus bus __attribute__ ((u /* ---- PCI probe ---------------------------------------------- */ if (bus != BUS_USB) { - struct pciusb_entries entries; char **pci_modules; unsigned int pci_modules_len = 0; - int i; switch (type) { #ifndef DISABLE_PCIADAPTERS @@ -341,16 +355,7 @@ void probe_that_type(enum driver_type type, enum media_bus bus __attribute__ ((u goto end_pci_probe; } - entries = pci_probe(); - for (i = 0; i < entries.nb; i++) { - struct pciusb_entry *e = &entries.entries[i]; - if (device_match_modules_list(e, pci_modules, pci_modules_len)) { - log_message("PCI: device %04x %04x %04x %04x is \"%s\", driver is %s", - e->vendor, e->device, e->subvendor, e->subdevice, e->text, e->module); - discovered_device(type, e->text, e->module); - } - } - pciusb_free(&entries); + probe_pci_modules(type, pci_modules, pci_modules_len); end_pci_probe:; } -- cgit v1.2.1