diff options
author | Michael Brown | 2005-04-14 15:33:03 +0200 |
---|---|---|
committer | Michael Brown | 2005-04-14 15:33:03 +0200 |
commit | ce8dea0dffea9076879bb0d38510c1f5f790820c (patch) | |
tree | 27985a7005db6b1a3b39f7fde4538e5790b537c9 /src/core/main.c | |
parent | Split 3c509.c into 3c509.9 and 3c529.c, with shared code in 3c5x9.c. (diff) | |
download | ipxe-ce8dea0dffea9076879bb0d38510c1f5f790820c.tar.gz ipxe-ce8dea0dffea9076879bb0d38510c1f5f790820c.tar.xz ipxe-ce8dea0dffea9076879bb0d38510c1f5f790820c.zip |
Separate out bus-scanning and device-probing logic.
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/main.c b/src/core/main.c index 3cc777a8..bf0a4b0e 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -144,7 +144,7 @@ static int initialized; /* Global instance of the current boot device */ -DEV_BUS(struct {}, dev_bus); +DEV_BUS(struct bus_device, dev_bus); struct dev dev = { .bus = &dev_bus, }; @@ -181,8 +181,17 @@ int main ( void ) { for ( ; ; disable ( &dev ), call_reset_fns() ) { /* Get next boot device */ - if ( ! probe ( &dev ) ) { + if ( ! find_boot_device ( &dev ) ) { /* Reached end of device list */ + printf ( "No more boot devices\n" ); + continue; + } + + /* Probe boot device */ + if ( ! probe ( &dev ) ) { + /* Device found on bus, but probe failed */ + printf ( "Probe failed on %s, trying next device\n", + dev.name ); continue; } @@ -192,12 +201,14 @@ int main ( void ) { /* Load configuration (e.g. DHCP) */ if ( ! load_configuration ( &dev ) ) { /* DHCP failed */ + printf ( "Could not configure device %s\n", dev.name ); continue; } /* Load image */ if ( ! load ( &dev ) ) /* Load failed */ + printf ( "Could not boot from device %s\n", dev.name ); continue; } |