summaryrefslogtreecommitdiffstats
path: root/src/core/device.c
diff options
context:
space:
mode:
authorMichael Brown2010-09-22 01:12:23 +0200
committerMichael Brown2010-09-22 18:09:56 +0200
commit3c35ae2f3b67fcd8f1ded0431fbaca05fa7fd3a0 (patch)
tree32a19df0bb5fcb3c7fe9bc3b2db886adbbee04fe /src/core/device.c
parent[aoe] Fail immediately when network device is closed (diff)
downloadipxe-3c35ae2f3b67fcd8f1ded0431fbaca05fa7fd3a0.tar.gz
ipxe-3c35ae2f3b67fcd8f1ded0431fbaca05fa7fd3a0.tar.xz
ipxe-3c35ae2f3b67fcd8f1ded0431fbaca05fa7fd3a0.zip
[int13] Add infrastructure to support EDD version 4.0
Support the extensions mandated by EDD 4.0, including: o the ability to specify a flat physical address in a disk address packet, o the ability to specify a sector count greater than 127 in a disk address packet, o support for all functions within the Fixed Disk Access and EDD Support subsets, o the ability to describe a device using EDD Device Path Information. This implementation is based on draft revision 3 of the EDD 4.0 specification, with reference to the EDD 3.0 specification. It is possible that this implementation may need to change in order to conform to the final published EDD 4.0 specification. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 1a227fd9..cb2c23b0 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -21,8 +21,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <string.h>
#include <ipxe/list.h>
#include <ipxe/tables.h>
-#include <ipxe/device.h>
#include <ipxe/init.h>
+#include <ipxe/interface.h>
+#include <ipxe/device.h>
/**
* @file
@@ -105,3 +106,27 @@ struct startup_fn startup_devices __startup_fn ( STARTUP_NORMAL ) = {
.startup = probe_devices,
.shutdown = remove_devices,
};
+
+/**
+ * Identify a device behind an interface
+ *
+ * @v intf Interface
+ * @ret device Device, or NULL
+ */
+struct device * identify_device ( struct interface *intf ) {
+ struct interface *dest;
+ identify_device_TYPE ( void * ) *op =
+ intf_get_dest_op ( intf, identify_device, &dest );
+ void *object = intf_object ( dest );
+ void *device;
+
+ if ( op ) {
+ device = op ( object );
+ } else {
+ /* Default is to return NULL */
+ device = NULL;
+ }
+
+ intf_put ( dest );
+ return device;
+}