summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2006-06-01 17:53:05 +0200
committerMichael Brown2006-06-01 17:53:05 +0200
commit6ab4b99f41d22bb4d401d15c5a44160bf800c34c (patch)
tree1c0b897c5afed683803ca07dd8ec1d00a29f23dd /src/core/main.c
parentUpdated retry timer mechanism to incorporate smoothed RTT estimation. (diff)
downloadipxe-6ab4b99f41d22bb4d401d15c5a44160bf800c34c.tar.gz
ipxe-6ab4b99f41d22bb4d401d15c5a44160bf800c34c.tar.xz
ipxe-6ab4b99f41d22bb4d401d15c5a44160bf800c34c.zip
Quick hack to avoid trying to use an uninitialised net device.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 3e8221cf..71300a85 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -27,6 +27,10 @@ Literature dealing with the network protocols:
#include "image.h"
#include <stdarg.h>
+#include <gpxe/device.h>
+#include <gpxe/heap.h>
+#include <gpxe/netdevice.h>
+
#ifdef CONFIG_FILO
#include <lib.h>
#endif
@@ -148,16 +152,24 @@ extern struct net_device static_single_netdev;
MAIN - Kick off routine
**************************************************************************/
int main ( void ) {
- struct image *image;
- void *image_context;
- int skip = 0;
+ struct net_device *netdev;
/* Call all registered initialisation functions */
init_heap();
call_init_fns ();
probe_devices();
- test_aoeboot ( &static_single_netdev );
+ /* Quick hack until netdevice.c uses proper dynamic registration */
+ netdev = &static_single_netdev;
+ if ( ! netdev->poll )
+ netdev = NULL;
+
+ if ( netdev ) {
+ test_aoeboot ( &static_single_netdev );
+ } else {
+ printf ( "No network device found\n" );
+ }
+
printf ( "Press any key to exit\n" );
getchar();