diff options
author | Michael Brown | 2017-03-27 17:20:34 +0200 |
---|---|---|
committer | Michael Brown | 2017-03-28 18:12:48 +0200 |
commit | 7cfdd769aac76d605aa31146c69ba518b194bea7 (patch) | |
tree | 7c09e144792833f81297e6dacf0823733a2a399a /src/include/ipxe/sanboot.h | |
parent | [block] Ignore redundant xfer_window_changed() messages (diff) | |
download | ipxe-7cfdd769aac76d605aa31146c69ba518b194bea7.tar.gz ipxe-7cfdd769aac76d605aa31146c69ba518b194bea7.tar.xz ipxe-7cfdd769aac76d605aa31146c69ba518b194bea7.zip |
[block] Describe all SAN devices via ACPI tables
Describe all SAN devices via ACPI tables such as the iBFT. For tables
that can describe only a single device (i.e. the aBFT and sBFT), one
table is installed per device. For multi-device tables (i.e. the
iBFT), all devices are described in a single table.
An underlying SAN device connection may be closed at the time that we
need to construct an ACPI table. We therefore introduce the concept
of an "ACPI descriptor" which enables the SAN boot code to maintain an
opaque pointer to the underlying object, and an "ACPI model" which can
build tables from a list of such descriptors. This separates the
lifecycles of ACPI descriptions from the lifecycles of the block
device interfaces, and allows for construction of the ACPI tables even
if the block device interface has been closed.
For a multipath SAN device, iPXE will wait until sufficient
information is available to describe all devices but will not wait for
all paths to connect successfully. For example: with a multipath
iSCSI boot iPXE will wait until at least one path has become available
and name resolution has completed on all other paths. We do this
since the iBFT has to include IP addresses rather than DNS names. We
will commence booting without waiting for the inactive paths to either
become available or close; this avoids unnecessary boot delays.
Note that the Linux kernel will refuse to accept an iBFT with more
than two NIC or target structures. We therefore describe only the
NICs that are actually required in order to reach the described
targets. Any iBFT with at most two targets is therefore guaranteed to
describe at most two NICs.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/sanboot.h')
-rw-r--r-- | src/include/ipxe/sanboot.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/include/ipxe/sanboot.h b/src/include/ipxe/sanboot.h index 64b665a5..8737bbc0 100644 --- a/src/include/ipxe/sanboot.h +++ b/src/include/ipxe/sanboot.h @@ -18,6 +18,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/retry.h> #include <ipxe/process.h> #include <ipxe/blockdev.h> +#include <ipxe/acpi.h> #include <config/sanboot.h> /** A SAN path */ @@ -37,6 +38,9 @@ struct san_path { struct process process; /** Path status */ int path_rc; + + /** ACPI descriptor (if applicable) */ + struct acpi_descriptor *desc; }; /** A SAN device */ @@ -48,6 +52,8 @@ struct san_device { /** Drive number */ unsigned int drive; + /** Flags */ + unsigned int flags; /** Command interface */ struct interface command; @@ -83,6 +89,12 @@ struct san_device { struct san_path path[0]; }; +/** SAN device flags */ +enum san_device_flags { + /** Device should not be included in description tables */ + SAN_NO_DESCRIBE = 0x0001, +}; + /** * Calculate static inline sanboot API function name * @@ -126,9 +138,11 @@ struct san_device { * @v drive Drive number * @v uris List of URIs * @v count Number of URIs + * @v flags Flags * @ret drive Drive number, or negative error */ -int san_hook ( unsigned int drive, struct uri **uris, unsigned int count ); +int san_hook ( unsigned int drive, struct uri **uris, unsigned int count, + unsigned int flags ); /** * Unhook SAN device @@ -146,12 +160,11 @@ void san_unhook ( unsigned int drive ); int san_boot ( unsigned int drive ); /** - * Describe SAN device for SAN-booted operating system + * Describe SAN devices for SAN-booted operating system * - * @v drive Drive number * @ret rc Return status code */ -int san_describe ( unsigned int drive ); +int san_describe ( void ); extern struct list_head san_devices; @@ -230,7 +243,8 @@ extern int sandev_rw ( struct san_device *sandev, uint64_t lba, userptr_t buffer, size_t len ) ); extern struct san_device * alloc_sandev ( struct uri **uris, unsigned int count, size_t priv_size ); -extern int register_sandev ( struct san_device *sandev ); +extern int register_sandev ( struct san_device *sandev, unsigned int drive, + unsigned int flags ); extern void unregister_sandev ( struct san_device *sandev ); extern unsigned int san_default_drive ( void ); |