summaryrefslogtreecommitdiffstats
path: root/src/core/device.c
diff options
context:
space:
mode:
authorMichael Brown2008-07-17 18:45:17 +0200
committerMichael Brown2008-07-17 18:45:17 +0200
commit03c80c12b8e9019554c3bd4545cf68926ee1ce47 (patch)
treead2217eda5c315775a86708e166c85a9f04926ff /src/core/device.c
parent[phantom] Guard against partially-written status descriptors (diff)
downloadipxe-03c80c12b8e9019554c3bd4545cf68926ee1ce47.tar.gz
ipxe-03c80c12b8e9019554c3bd4545cf68926ee1ce47.tar.xz
ipxe-03c80c12b8e9019554c3bd4545cf68926ee1ce47.zip
[iSCSI] Support Windows Server 2008 direct iSCSI installation
Add yet another ugly hack to iscsiboot.c, this time to allow the user to inhibit the shutdown/removal of the iSCSI INT13 device (and the network devices, since they are required for the iSCSI device to function). On the plus side, the fact that shutdown() now takes flags to differentiate between shutdown-for-exit and shutdown-for-boot means that another ugly hack (to allow returning via the PXE stack on BIOSes that have broken INT 18 calls) will be easier. I feel dirty.
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/device.c b/src/core/device.c
index b1b148e8..84915c2d 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -20,6 +20,7 @@
#include <gpxe/list.h>
#include <gpxe/tables.h>
#include <gpxe/device.h>
+#include <gpxe/init.h>
/**
* @file
@@ -68,13 +69,11 @@ static void rootdev_remove ( struct root_device *rootdev ) {
/**
* Probe all devices
*
- * @ret rc Return status code
- *
* This initiates probing for all devices in the system. After this
* call, the device hierarchy will be populated, and all hardware
* should be ready to use.
*/
-int probe_devices ( void ) {
+static void probe_devices ( void ) {
struct root_device *rootdev;
int rc;
@@ -84,19 +83,28 @@ int probe_devices ( void ) {
if ( ( rc = rootdev_probe ( rootdev ) ) != 0 )
list_del ( &rootdev->dev.siblings );
}
- return 0;
}
/**
* Remove all devices
*
*/
-void remove_devices ( void ) {
+static void remove_devices ( int flags ) {
struct root_device *rootdev;
struct root_device *tmp;
+ if ( flags & SHUTDOWN_KEEP_DEVICES ) {
+ DBG ( "Refusing to remove devices on shutdown\n" );
+ return;
+ }
+
list_for_each_entry_safe ( rootdev, tmp, &devices, dev.siblings ) {
rootdev_remove ( rootdev );
list_del ( &rootdev->dev.siblings );
}
}
+
+struct startup_fn startup_devices __startup_fn ( STARTUP_NORMAL ) = {
+ .startup = probe_devices,
+ .shutdown = remove_devices,
+};