aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/ibft.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2017-03-27 18:20:34 +0300
committerMichael Brown <mcb30@ipxe.org>2017-03-28 19:12:48 +0300
commit7cfdd769aac76d605aa31146c69ba518b194bea7 (patch)
tree7c09e144792833f81297e6dacf0823733a2a399a /src/include/ipxe/ibft.h
parent414b4fc9c531ceb15607f7c6edd8a959e0bd3065 (diff)
downloadipxe-7cfdd769aac76d605aa31146c69ba518b194bea7.tar.gz
[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/ibft.h')
-rw-r--r--src/include/ipxe/ibft.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/include/ipxe/ibft.h b/src/include/ipxe/ibft.h
index 35f15105c..51ce781a6 100644
--- a/src/include/ipxe/ibft.h
+++ b/src/include/ipxe/ibft.h
@@ -49,6 +49,9 @@ FILE_LICENCE ( BSD2 );
/** iSCSI Boot Firmware Table signature */
#define IBFT_SIG ACPI_SIGNATURE ( 'i', 'B', 'F', 'T' )
+/** Alignment of structures within iBFT */
+#define IBFT_ALIGN 16
+
/** An offset from the start of the iBFT */
typedef uint16_t ibft_off_t;
@@ -98,6 +101,20 @@ struct ibft_header {
} __attribute__ (( packed ));
/**
+ * iBFT NIC and Target offset pair
+ *
+ * There is no implicit relation between the NIC and the Target, but
+ * using this structure simplifies the table construction code while
+ * matching the expected table layout.
+ */
+struct ibft_offset_pair {
+ /** Offset to NIC structure */
+ ibft_off_t nic;
+ /** Offset to Target structure */
+ ibft_off_t target;
+} __attribute__ (( packed ));
+
+/**
* iBFT Control structure
*
*/
@@ -108,14 +125,8 @@ struct ibft_control {
uint16_t extensions;
/** Offset to Initiator structure */
ibft_off_t initiator;
- /** Offset to NIC structure for NIC 0 */
- ibft_off_t nic_0;
- /** Offset to Target structure for target 0 */
- ibft_off_t target_0;
- /** Offset to NIC structure for NIC 1 */
- ibft_off_t nic_1;
- /** Offset to Target structure for target 1 */
- ibft_off_t target_1;
+ /** Offsets to NIC and Target structures */
+ struct ibft_offset_pair pair[2];
} __attribute__ (( packed ));
/** Structure ID for Control section */
@@ -262,18 +273,13 @@ struct ibft_target {
*/
struct ibft_table {
/** ACPI header */
- struct acpi_description_header acpi;
+ struct acpi_header acpi;
/** Reserved */
uint8_t reserved[12];
/** Control structure */
struct ibft_control control;
} __attribute__ (( packed ));
-struct iscsi_session;
-struct net_device;
-
-extern int ibft_describe ( struct iscsi_session *iscsi,
- struct acpi_description_header *acpi,
- size_t len );
+extern struct acpi_model ibft_model __acpi_model;
#endif /* _IPXE_IBFT_H */