summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-18 16:34:31 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-18 16:34:31 +0000
commitf56eaf9328fdfbf64482b22b9014a3e5225f4f2d (patch)
treedd2f53e54df50f54938ca3a577256bd654237aeb /mdk-stage1
parent29201016968c89b16af0c4367cede144d3510467 (diff)
downloaddrakx-f56eaf9328fdfbf64482b22b9014a3e5225f4f2d.tar
drakx-f56eaf9328fdfbf64482b22b9014a3e5225f4f2d.tar.gz
drakx-f56eaf9328fdfbf64482b22b9014a3e5225f4f2d.tar.bz2
drakx-f56eaf9328fdfbf64482b22b9014a3e5225f4f2d.tar.xz
drakx-f56eaf9328fdfbf64482b22b9014a3e5225f4f2d.zip
extract probe_pci_modules functions (will be reused to load media controllers in two times, IDE first, other then)
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/probing.c29
1 files changed, 17 insertions, 12 deletions
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:;
}