Ver código fonte

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

tags/v0.9.3
Michael Brown 18 anos atrás
pai
commit
6ab4b99f41
1 arquivos alterados com 16 adições e 4 exclusões
  1. 16
    4
      src/core/main.c

+ 16
- 4
src/core/main.c Ver arquivo

@@ -27,6 +27,10 @@ Literature dealing with the network protocols:
27 27
 #include "image.h"
28 28
 #include <stdarg.h>
29 29
 
30
+#include <gpxe/device.h>
31
+#include <gpxe/heap.h>
32
+#include <gpxe/netdevice.h>
33
+
30 34
 #ifdef CONFIG_FILO
31 35
 #include <lib.h>
32 36
 #endif
@@ -148,16 +152,24 @@ extern struct net_device static_single_netdev;
148 152
 MAIN - Kick off routine
149 153
 **************************************************************************/
150 154
 int main ( void ) {
151
-	struct image *image;
152
-	void *image_context;
153
-	int skip = 0;
155
+	struct net_device *netdev;
154 156
 
155 157
 	/* Call all registered initialisation functions */
156 158
 	init_heap();
157 159
 	call_init_fns ();
158 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 173
 	printf ( "Press any key to exit\n" );
162 174
 	getchar();
163 175
 

Carregando…
Cancelar
Salvar