Subrata Banik | 20fe24b | 2021-12-09 02:46:38 +0530 | [diff] [blame] | 1 | /** @file |
| 2 | The definition for iSCSI Boot Firmware Table, it's defined in Microsoft's |
| 3 | iSCSI Boot Firmware Table(iBFT) as Defined in ACPI 3.0b Specification. |
| 4 | |
| 5 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> |
| 6 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 7 | |
| 8 | **/ |
| 9 | |
| 10 | #ifndef _ISCSI_BOOT_FIRMWARE_TABLE_H_ |
| 11 | #define _ISCSI_BOOT_FIRMWARE_TABLE_H_ |
| 12 | |
| 13 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_REVISION 0x01 |
| 14 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_STRUCTURE_ALIGNMENT 8 |
| 15 | |
| 16 | /// |
| 17 | /// Structure Type/ID |
| 18 | /// |
| 19 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_RESERVED_STRUCTURE_ID 0 |
| 20 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_ID 1 |
| 21 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_ID 2 |
| 22 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_ID 3 |
| 23 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_ID 4 |
| 24 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_EXTERNSIONS_STRUCTURE_ID 5 |
| 25 | |
| 26 | /// |
| 27 | /// from the definition of IP_PREFIX_ORIGIN Enumeration in MSDN, |
| 28 | /// not defined in Microsoft iBFT document. |
| 29 | /// |
| 30 | typedef enum { |
| 31 | IpPrefixOriginOther = 0, |
| 32 | IpPrefixOriginManual, |
| 33 | IpPrefixOriginWellKnown, |
| 34 | IpPrefixOriginDhcp, |
| 35 | IpPrefixOriginRouterAdvertisement, |
| 36 | IpPrefixOriginUnchanged = 16 |
| 37 | } IP_PREFIX_VALUE; |
| 38 | |
| 39 | #pragma pack(1) |
| 40 | |
| 41 | /// |
| 42 | /// iBF Table Header |
| 43 | /// |
| 44 | typedef struct { |
| 45 | UINT32 Signature; |
| 46 | UINT32 Length; |
| 47 | UINT8 Revision; |
| 48 | UINT8 Checksum; |
| 49 | UINT8 OemId[6]; |
| 50 | UINT64 OemTableId; |
| 51 | UINT8 Reserved[24]; |
| 52 | } EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER; |
| 53 | |
| 54 | /// |
| 55 | /// Common Header of Boot Firmware Table Structure |
| 56 | /// |
| 57 | typedef struct { |
| 58 | UINT8 StructureId; |
| 59 | UINT8 Version; |
| 60 | UINT16 Length; |
| 61 | UINT8 Index; |
| 62 | UINT8 Flags; |
| 63 | } EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_STRUCTURE_HEADER; |
| 64 | |
| 65 | /// |
| 66 | /// Control Structure |
| 67 | /// |
| 68 | typedef struct { |
| 69 | EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_STRUCTURE_HEADER Header; |
| 70 | UINT16 Extensions; |
| 71 | UINT16 InitiatorOffset; |
| 72 | UINT16 NIC0Offset; |
| 73 | UINT16 Target0Offset; |
| 74 | UINT16 NIC1Offset; |
| 75 | UINT16 Target1Offset; |
| 76 | } EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE; |
| 77 | |
| 78 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_VERSION 0x1 |
| 79 | |
| 80 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE_FLAG_BOOT_FAILOVER BIT0 |
| 81 | |
| 82 | /// |
| 83 | /// Initiator Structure |
| 84 | /// |
| 85 | typedef struct { |
| 86 | EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_STRUCTURE_HEADER Header; |
| 87 | EFI_IPv6_ADDRESS ISnsServer; |
| 88 | EFI_IPv6_ADDRESS SlpServer; |
| 89 | EFI_IPv6_ADDRESS PrimaryRadiusServer; |
| 90 | EFI_IPv6_ADDRESS SecondaryRadiusServer; |
| 91 | UINT16 IScsiNameLength; |
| 92 | UINT16 IScsiNameOffset; |
| 93 | } EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE; |
| 94 | |
| 95 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_VERSION 0x1 |
| 96 | |
| 97 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_FLAG_BLOCK_VALID BIT0 |
| 98 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE_FLAG_BOOT_SELECTED BIT1 |
| 99 | |
| 100 | /// |
| 101 | /// NIC Structure |
| 102 | /// |
| 103 | typedef struct { |
| 104 | EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_STRUCTURE_HEADER Header; |
| 105 | EFI_IPv6_ADDRESS Ip; |
| 106 | UINT8 SubnetMaskPrefixLength; |
| 107 | UINT8 Origin; |
| 108 | EFI_IPv6_ADDRESS Gateway; |
| 109 | EFI_IPv6_ADDRESS PrimaryDns; |
| 110 | EFI_IPv6_ADDRESS SecondaryDns; |
| 111 | EFI_IPv6_ADDRESS DhcpServer; |
| 112 | UINT16 VLanTag; |
| 113 | UINT8 Mac[6]; |
| 114 | UINT16 PciLocation; |
| 115 | UINT16 HostNameLength; |
| 116 | UINT16 HostNameOffset; |
| 117 | } EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE; |
| 118 | |
| 119 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_VERSION 0x1 |
| 120 | |
| 121 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_BLOCK_VALID BIT0 |
| 122 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_BOOT_SELECTED BIT1 |
| 123 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE_FLAG_GLOBAL BIT2 |
| 124 | |
| 125 | /// |
| 126 | /// Target Structure |
| 127 | /// |
| 128 | typedef struct { |
| 129 | EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_STRUCTURE_HEADER Header; |
| 130 | EFI_IPv6_ADDRESS Ip; |
| 131 | UINT16 Port; |
| 132 | UINT8 BootLun[8]; |
| 133 | UINT8 CHAPType; |
| 134 | UINT8 NicIndex; |
| 135 | UINT16 IScsiNameLength; |
| 136 | UINT16 IScsiNameOffset; |
| 137 | UINT16 CHAPNameLength; |
| 138 | UINT16 CHAPNameOffset; |
| 139 | UINT16 CHAPSecretLength; |
| 140 | UINT16 CHAPSecretOffset; |
| 141 | UINT16 ReverseCHAPNameLength; |
| 142 | UINT16 ReverseCHAPNameOffset; |
| 143 | UINT16 ReverseCHAPSecretLength; |
| 144 | UINT16 ReverseCHAPSecretOffset; |
| 145 | } EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE; |
| 146 | |
| 147 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_VERSION 0x1 |
| 148 | |
| 149 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BLOCK_VALID BIT0 |
| 150 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BOOT_SELECTED BIT1 |
| 151 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_CHAP BIT2 |
| 152 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_RCHAP BIT3 |
| 153 | |
| 154 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP 0 |
| 155 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_CHAP 1 |
| 156 | #define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP 2 |
| 157 | |
| 158 | #pragma pack() |
| 159 | |
| 160 | #endif |
| 161 | |