Parcourir la source

print_drivers() is now unified.

tags/v0.9.3
Michael Brown il y a 19 ans
Parent
révision
6f37dc410a
1 fichiers modifiés avec 6 ajouts et 67 suppressions
  1. 6
    67
      src/core/config.c

+ 6
- 67
src/core/config.c Voir le fichier

@@ -5,17 +5,16 @@
5 5
  * your option) any later version.
6 6
  */
7 7
 
8
-#include	"etherboot.h"
9
-#include	"nic.h"
10
-#include	"console.h"
8
+#include "etherboot.h"
9
+#include "dev.h"
10
+#include "console.h"
11 11
 #ifdef BUILD_SERIAL
12
-#include	".buildserial.h"
12
+#include ".buildserial.h"
13 13
 #define xstr(s) str(s)
14 14
 #define str(s) #s
15 15
 #endif
16 16
 
17
-void print_config(void)
18
-{
17
+void print_config ( void ) {
19 18
 	printf( "Etherboot " VERSION
20 19
 #ifdef BUILD_SERIAL
21 20
 		" [build " 
@@ -26,12 +25,7 @@ void print_config(void)
26 25
 #endif /* BUILD_SERIAL */
27 26
 		" (GPL) http://etherboot.org\n"
28 27
 		"Drivers: " );
29
-#ifdef CONFIG_PCI
30
-	pci_enumerate();
31
-#endif	
32
-#ifdef CONFIG_ISA
33
-	isa_enumerate();
34
-#endif	
28
+	print_drivers();
35 29
 	printf( "  Images: " 
36 30
 #ifdef	TAGGED_IMAGE
37 31
 		"NBI "
@@ -110,61 +104,6 @@ void print_config(void)
110 104
 #endif
111 105
 }
112 106
 
113
-static const char *driver_name[] = {
114
-	"nic", 
115
-	"disk", 
116
-	"floppy",
117
-};
118
-
119
-int probe(struct dev *dev)
120
-{
121
-	const char *type_name;
122
-	type_name = "";
123
-	if ((dev->type >= 0) && 
124
-		((unsigned)dev->type < sizeof(driver_name)/sizeof(driver_name[0]))) {
125
-		type_name = driver_name[dev->type];
126
-	}
127
-	if (dev->how_probe == PROBE_FIRST) {
128
-		dev->to_probe = PROBE_PCI;
129
-		memset(&dev->state, 0, sizeof(dev->state));
130
-	}
131
-	if (dev->to_probe == PROBE_PCI) {
132
-#ifdef	CONFIG_PCI
133
-		dev->how_probe = pci_probe(dev, type_name);
134
-#else
135
-		dev->how_probe = PROBE_FAILED;
136
-#endif
137
-		if (dev->how_probe == PROBE_FAILED) {
138
-			dev->to_probe = PROBE_ISA;
139
-		}
140
-	}
141
-	if (dev->to_probe == PROBE_ISA) {
142
-#ifdef	CONFIG_ISA
143
-		dev->how_probe = isa_probe(dev, type_name);
144
-#else
145
-		dev->how_probe = PROBE_FAILED;
146
-#endif
147
-		if (dev->how_probe == PROBE_FAILED) {
148
-			dev->to_probe = PROBE_NONE;
149
-		}
150
-	}
151
-	if ((dev->to_probe != PROBE_PCI) &&
152
-		(dev->to_probe != PROBE_ISA)) {
153
-		dev->how_probe = PROBE_FAILED;
154
-		
155
-	}
156
-	return dev->how_probe;
157
-}
158
-
159
-void disable(struct dev *dev)
160
-{
161
-	if (dev->disable) {
162
-		dev->disable(dev);
163
-		dev->disable = 0;
164
-	}
165
-}
166
-
167
-
168 107
 /*
169 108
  * Drag in all requested console types
170 109
  *

Chargement…
Annuler
Enregistrer