Browse Source

Quick hack to avoid trying to use an uninitialised net device.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
6ab4b99f41
1 changed files with 16 additions and 4 deletions
  1. 16
    4
      src/core/main.c

+ 16
- 4
src/core/main.c View File

27
 #include "image.h"
27
 #include "image.h"
28
 #include <stdarg.h>
28
 #include <stdarg.h>
29
 
29
 
30
+#include <gpxe/device.h>
31
+#include <gpxe/heap.h>
32
+#include <gpxe/netdevice.h>
33
+
30
 #ifdef CONFIG_FILO
34
 #ifdef CONFIG_FILO
31
 #include <lib.h>
35
 #include <lib.h>
32
 #endif
36
 #endif
148
 MAIN - Kick off routine
152
 MAIN - Kick off routine
149
 **************************************************************************/
153
 **************************************************************************/
150
 int main ( void ) {
154
 int main ( void ) {
151
-	struct image *image;
152
-	void *image_context;
153
-	int skip = 0;
155
+	struct net_device *netdev;
154
 
156
 
155
 	/* Call all registered initialisation functions */
157
 	/* Call all registered initialisation functions */
156
 	init_heap();
158
 	init_heap();
157
 	call_init_fns ();
159
 	call_init_fns ();
158
 	probe_devices();
160
 	probe_devices();
159
 
161
 
160
-	test_aoeboot ( &static_single_netdev );
162
+	/* Quick hack until netdevice.c uses proper dynamic registration */
163
+	netdev = &static_single_netdev;
164
+	if ( ! netdev->poll )
165
+		netdev = NULL;
166
+
167
+	if ( netdev ) {
168
+		test_aoeboot ( &static_single_netdev );
169
+	} else {
170
+		printf ( "No network device found\n" );
171
+	}
172
+
161
 	printf ( "Press any key to exit\n" );
173
 	printf ( "Press any key to exit\n" );
162
 	getchar();
174
 	getchar();
163
 
175
 

Loading…
Cancel
Save