2 The device path protocol as defined in UEFI 2.0.
4 The device path represents a programmatic path to a device,
5 from a software point of view. The path must persist from boot to boot, so
6 it can not contain things like PCI bus numbers that change from boot to boot.
8 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #ifndef __EFI_DEVICE_PATH_H__
14 #define __EFI_DEVICE_PATH_H__
16 #include <Guid/PcAnsi.h>
17 #include <IndustryStandard/Acpi3_0.h>
18 #include <IndustryStandard/Bluetooth.h>
21 /// Device Path protocol.
23 #define EFI_DEVICE_PATH_PROTOCOL_GUID \
25 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
29 /// Device Path guid definition for backward-compatible with EFI1.1.
31 #define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
35 #if defined(_MSC_EXTENSIONS)
37 // Disable warning when last field of data structure is a zero sized array.
39 #pragma warning ( disable : 4200 )
43 This protocol can be used on any device handle to obtain generic path/location
44 information concerning the physical device or logical device. If the handle does
45 not logically map to a physical device, the handle may not necessarily support
46 the device path protocol. The device path describes the location of the device
47 the handle is for. The size of the Device Path can be determined from the structures
48 that make up the Device Path.
51 UINT8 Type
; ///< 0x01 Hardware Device Path.
52 ///< 0x02 ACPI Device Path.
53 ///< 0x03 Messaging Device Path.
54 ///< 0x04 Media Device Path.
55 ///< 0x05 BIOS Boot Specification Device Path.
56 ///< 0x7F End of Hardware Device Path.
58 UINT8 SubType
; ///< Varies by Type
59 ///< 0xFF End Entire Device Path, or
60 ///< 0x01 End This Instance of a Device Path and start a new
63 UINT8 Length
[2]; ///< Specific Device Path data. Type and Sub-Type define
64 ///< type of data. Size of data is included in Length.
66 } EFI_DEVICE_PATH_PROTOCOL
;
69 /// Device Path protocol definition for backward-compatible with EFI1.1.
71 typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH
;
74 /// Hardware Device Paths.
76 #define HARDWARE_DEVICE_PATH 0x01
79 /// PCI Device Path SubType.
81 #define HW_PCI_DP 0x01
87 EFI_DEVICE_PATH_PROTOCOL Header
;
89 /// PCI Function Number.
93 /// PCI Device Number.
99 /// PCCARD Device Path SubType.
101 #define HW_PCCARD_DP 0x02
104 /// PCCARD Device Path.
107 EFI_DEVICE_PATH_PROTOCOL Header
;
109 /// Function Number (0 = First Function).
111 UINT8 FunctionNumber
;
112 } PCCARD_DEVICE_PATH
;
115 /// Memory Mapped Device Path SubType.
117 #define HW_MEMMAP_DP 0x03
120 /// Memory Mapped Device Path.
123 EFI_DEVICE_PATH_PROTOCOL Header
;
129 /// Starting Memory Address.
131 EFI_PHYSICAL_ADDRESS StartingAddress
;
133 /// Ending Memory Address.
135 EFI_PHYSICAL_ADDRESS EndingAddress
;
136 } MEMMAP_DEVICE_PATH
;
139 /// Hardware Vendor Device Path SubType.
141 #define HW_VENDOR_DP 0x04
144 /// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
145 /// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the
146 /// contents on the n bytes that follow in the Vendor Device Path node.
149 EFI_DEVICE_PATH_PROTOCOL Header
;
151 /// Vendor-assigned GUID that defines the data that follows.
155 /// Vendor-defined variable size data.
157 } VENDOR_DEVICE_PATH
;
160 /// Controller Device Path SubType.
162 #define HW_CONTROLLER_DP 0x05
165 /// Controller Device Path.
168 EFI_DEVICE_PATH_PROTOCOL Header
;
170 /// Controller number.
172 UINT32 ControllerNumber
;
173 } CONTROLLER_DEVICE_PATH
;
176 /// BMC Device Path SubType.
178 #define HW_BMC_DP 0x06
184 EFI_DEVICE_PATH_PROTOCOL Header
;
192 UINT8 BaseAddress
[8];
196 /// ACPI Device Paths.
198 #define ACPI_DEVICE_PATH 0x02
201 /// ACPI Device Path SubType.
205 EFI_DEVICE_PATH_PROTOCOL Header
;
207 /// Device's PnP hardware ID stored in a numeric 32-bit
208 /// compressed EISA-type ID. This value must match the
209 /// corresponding _HID in the ACPI name space.
213 /// Unique ID that is required by ACPI if two devices have the
214 /// same _HID. This value must also match the corresponding
215 /// _UID/_HID pair in the ACPI name space. Only the 32-bit
216 /// numeric value type of _UID is supported. Thus, strings must
217 /// not be used for the _UID in the ACPI name space.
220 } ACPI_HID_DEVICE_PATH
;
223 /// Expanded ACPI Device Path SubType.
225 #define ACPI_EXTENDED_DP 0x02
227 EFI_DEVICE_PATH_PROTOCOL Header
;
229 /// Device's PnP hardware ID stored in a numeric 32-bit
230 /// compressed EISA-type ID. This value must match the
231 /// corresponding _HID in the ACPI name space.
235 /// Unique ID that is required by ACPI if two devices have the
236 /// same _HID. This value must also match the corresponding
237 /// _UID/_HID pair in the ACPI name space.
241 /// Device's compatible PnP hardware ID stored in a numeric
242 /// 32-bit compressed EISA-type ID. This value must match at
243 /// least one of the compatible device IDs returned by the
244 /// corresponding _CID in the ACPI name space.
248 /// Optional variable length _HIDSTR.
249 /// Optional variable length _UIDSTR.
250 /// Optional variable length _CIDSTR.
252 } ACPI_EXTENDED_HID_DEVICE_PATH
;
256 // EISA ID Definition 32-bits
257 // bits[15:0] - three character compressed ASCII EISA ID.
258 // bits[31:16] - binary number
259 // Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
261 #define PNP_EISA_ID_CONST 0x41d0
262 #define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16))
263 #define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
264 #define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
266 #define PNP_EISA_ID_MASK 0xffff
267 #define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
270 /// ACPI _ADR Device Path SubType.
272 #define ACPI_ADR_DP 0x03
275 /// The _ADR device path is used to contain video output device attributes to support the Graphics
276 /// Output Protocol. The device path can contain multiple _ADR entries if multiple video output
277 /// devices are displaying the same output.
280 EFI_DEVICE_PATH_PROTOCOL Header
;
282 /// _ADR value. For video output devices the value of this
283 /// field comes from Table B-2 of the ACPI 3.0 specification. At
284 /// least one _ADR value is required.
288 // This device path may optionally contain more than one _ADR entry.
290 } ACPI_ADR_DEVICE_PATH
;
292 #define ACPI_ADR_DISPLAY_TYPE_OTHER 0
293 #define ACPI_ADR_DISPLAY_TYPE_VGA 1
294 #define ACPI_ADR_DISPLAY_TYPE_TV 2
295 #define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3
296 #define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4
298 #define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
299 ((UINT32)( ((UINT32)((_DeviceIdScheme) & 0x1) << 31) | \
300 (((_HeadId) & 0x7) << 18) | \
301 (((_NonVgaOutput) & 0x1) << 17) | \
302 (((_BiosCanDetect) & 0x1) << 16) | \
303 (((_VendorInfo) & 0xf) << 12) | \
304 (((_Type) & 0xf) << 8) | \
305 (((_Port) & 0xf) << 4) | \
309 /// Messaging Device Paths.
310 /// This Device Path is used to describe the connection of devices outside the resource domain of the
311 /// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
312 /// information like networking protocol IP addresses.
314 #define MESSAGING_DEVICE_PATH 0x03
317 /// ATAPI Device Path SubType
319 #define MSG_ATAPI_DP 0x01
321 EFI_DEVICE_PATH_PROTOCOL Header
;
323 /// Set to zero for primary, or one for secondary.
325 UINT8 PrimarySecondary
;
327 /// Set to zero for master, or one for slave mode.
331 /// Logical Unit Number.
337 /// SCSI Device Path SubType.
339 #define MSG_SCSI_DP 0x02
341 EFI_DEVICE_PATH_PROTOCOL Header
;
343 /// Target ID on the SCSI bus (PUN).
347 /// Logical Unit Number (LUN).
353 /// Fibre Channel SubType.
355 #define MSG_FIBRECHANNEL_DP 0x03
357 EFI_DEVICE_PATH_PROTOCOL Header
;
359 /// Reserved for the future.
363 /// Fibre Channel World Wide Number.
367 /// Fibre Channel Logical Unit Number.
370 } FIBRECHANNEL_DEVICE_PATH
;
373 /// Fibre Channel Ex SubType.
375 #define MSG_FIBRECHANNELEX_DP 0x15
377 EFI_DEVICE_PATH_PROTOCOL Header
;
379 /// Reserved for the future.
383 /// 8 byte array containing Fibre Channel End Device Port Name.
387 /// 8 byte array containing Fibre Channel Logical Unit Number.
390 } FIBRECHANNELEX_DEVICE_PATH
;
393 /// 1394 Device Path SubType
395 #define MSG_1394_DP 0x04
397 EFI_DEVICE_PATH_PROTOCOL Header
;
399 /// Reserved for the future.
403 /// 1394 Global Unique ID (GUID).
409 /// USB Device Path SubType.
411 #define MSG_USB_DP 0x05
413 EFI_DEVICE_PATH_PROTOCOL Header
;
415 /// USB Parent Port Number.
417 UINT8 ParentPortNumber
;
419 /// USB Interface Number.
421 UINT8 InterfaceNumber
;
425 /// USB Class Device Path SubType.
427 #define MSG_USB_CLASS_DP 0x0f
429 EFI_DEVICE_PATH_PROTOCOL Header
;
431 /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
432 /// match any Vendor ID.
436 /// Product ID assigned by USB-IF. A value of 0xFFFF will
437 /// match any Product ID.
441 /// The class code assigned by the USB-IF. A value of 0xFF
442 /// will match any class code.
446 /// The subclass code assigned by the USB-IF. A value of
447 /// 0xFF will match any subclass code.
449 UINT8 DeviceSubClass
;
451 /// The protocol code assigned by the USB-IF. A value of
452 /// 0xFF will match any protocol code.
454 UINT8 DeviceProtocol
;
455 } USB_CLASS_DEVICE_PATH
;
458 /// USB WWID Device Path SubType.
460 #define MSG_USB_WWID_DP 0x10
463 /// This device path describes a USB device using its serial number.
466 EFI_DEVICE_PATH_PROTOCOL Header
;
468 /// USB interface number.
470 UINT16 InterfaceNumber
;
472 /// USB vendor id of the device.
476 /// USB product id of the device.
480 /// Last 64-or-fewer UTF-16 characters of the USB
481 /// serial number. The length of the string is
482 /// determined by the Length field less the offset of the
483 /// Serial Number field (10)
485 /// CHAR16 SerialNumber[...];
486 } USB_WWID_DEVICE_PATH
;
489 /// Device Logical Unit SubType.
491 #define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
493 EFI_DEVICE_PATH_PROTOCOL Header
;
495 /// Logical Unit Number for the interface.
498 } DEVICE_LOGICAL_UNIT_DEVICE_PATH
;
501 /// SATA Device Path SubType.
503 #define MSG_SATA_DP 0x12
505 EFI_DEVICE_PATH_PROTOCOL Header
;
507 /// The HBA port number that facilitates the connection to the
508 /// device or a port multiplier. The value 0xFFFF is reserved.
510 UINT16 HBAPortNumber
;
512 /// The Port multiplier port number that facilitates the connection
513 /// to the device. Must be set to 0xFFFF if the device is directly
514 /// connected to the HBA.
516 UINT16 PortMultiplierPortNumber
;
518 /// Logical Unit Number.
524 /// Flag for if the device is directly connected to the HBA.
526 #define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
529 /// I2O Device Path SubType.
531 #define MSG_I2O_DP 0x06
533 EFI_DEVICE_PATH_PROTOCOL Header
;
535 /// Target ID (TID) for a device.
541 /// MAC Address Device Path SubType.
543 #define MSG_MAC_ADDR_DP 0x0b
545 EFI_DEVICE_PATH_PROTOCOL Header
;
547 /// The MAC address for a network interface padded with 0s.
549 EFI_MAC_ADDRESS MacAddress
;
551 /// Network interface type(i.e. 802.3, FDDI).
554 } MAC_ADDR_DEVICE_PATH
;
557 /// IPv4 Device Path SubType
559 #define MSG_IPv4_DP 0x0c
561 EFI_DEVICE_PATH_PROTOCOL Header
;
563 /// The local IPv4 address.
565 EFI_IPv4_ADDRESS LocalIpAddress
;
567 /// The remote IPv4 address.
569 EFI_IPv4_ADDRESS RemoteIpAddress
;
571 /// The local port number.
575 /// The remote port number.
579 /// The network protocol(i.e. UDP, TCP).
583 /// 0x00 - The Source IP Address was assigned though DHCP.
584 /// 0x01 - The Source IP Address is statically bound.
586 BOOLEAN StaticIpAddress
;
588 /// The gateway IP address
590 EFI_IPv4_ADDRESS GatewayIpAddress
;
594 EFI_IPv4_ADDRESS SubnetMask
;
598 /// IPv6 Device Path SubType.
600 #define MSG_IPv6_DP 0x0d
602 EFI_DEVICE_PATH_PROTOCOL Header
;
604 /// The local IPv6 address.
606 EFI_IPv6_ADDRESS LocalIpAddress
;
608 /// The remote IPv6 address.
610 EFI_IPv6_ADDRESS RemoteIpAddress
;
612 /// The local port number.
616 /// The remote port number.
620 /// The network protocol(i.e. UDP, TCP).
624 /// 0x00 - The Local IP Address was manually configured.
625 /// 0x01 - The Local IP Address is assigned through IPv6
626 /// stateless auto-configuration.
627 /// 0x02 - The Local IP Address is assigned through IPv6
628 /// stateful configuration.
630 UINT8 IpAddressOrigin
;
632 /// The prefix length
636 /// The gateway IP address
638 EFI_IPv6_ADDRESS GatewayIpAddress
;
642 /// InfiniBand Device Path SubType.
644 #define MSG_INFINIBAND_DP 0x09
646 EFI_DEVICE_PATH_PROTOCOL Header
;
648 /// Flags to help identify/manage InfiniBand device path elements:
649 /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).
650 /// Bit 1 - Extend Boot Environment.
651 /// Bit 2 - Console Protocol.
652 /// Bit 3 - Storage Protocol.
653 /// Bit 4 - Network Protocol.
654 /// All other bits are reserved.
656 UINT32 ResourceFlags
;
658 /// 128-bit Global Identifier for remote fabric port.
662 /// 64-bit unique identifier to remote IOC or server process.
663 /// Interpretation of field specified by Resource Flags (bit 0).
667 /// 64-bit persistent ID of remote IOC port.
671 /// 64-bit persistent ID of remote device.
674 } INFINIBAND_DEVICE_PATH
;
676 #define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
677 #define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
678 #define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
679 #define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
680 #define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
683 /// UART Device Path SubType.
685 #define MSG_UART_DP 0x0e
687 EFI_DEVICE_PATH_PROTOCOL Header
;
693 /// The baud rate setting for the UART style device. A value of 0
694 /// means that the device's default baud rate will be used.
698 /// The number of data bits for the UART style device. A value
699 /// of 0 means that the device's default number of data bits will be used.
703 /// The parity setting for the UART style device.
704 /// Parity 0x00 - Default Parity.
705 /// Parity 0x01 - No Parity.
706 /// Parity 0x02 - Even Parity.
707 /// Parity 0x03 - Odd Parity.
708 /// Parity 0x04 - Mark Parity.
709 /// Parity 0x05 - Space Parity.
713 /// The number of stop bits for the UART style device.
714 /// Stop Bits 0x00 - Default Stop Bits.
715 /// Stop Bits 0x01 - 1 Stop Bit.
716 /// Stop Bits 0x02 - 1.5 Stop Bits.
717 /// Stop Bits 0x03 - 2 Stop Bits.
723 // Use VENDOR_DEVICE_PATH struct
725 #define MSG_VENDOR_DP 0x0a
726 typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH
;
728 #define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID
729 #define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID
730 #define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
731 #define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID
734 /// A new device path node is defined to declare flow control characteristics.
735 /// UART Flow Control Messaging Device Path
738 EFI_DEVICE_PATH_PROTOCOL Header
;
740 /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
744 /// Bitmap of supported flow control types.
745 /// Bit 0 set indicates hardware flow control.
746 /// Bit 1 set indicates Xon/Xoff flow control.
747 /// All other bits are reserved and are clear.
749 UINT32 FlowControlMap
;
750 } UART_FLOW_CONTROL_DEVICE_PATH
;
752 #define UART_FLOW_CONTROL_HARDWARE 0x00000001
753 #define UART_FLOW_CONTROL_XON_XOFF 0x00000010
755 #define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID
757 /// Serial Attached SCSI (SAS) Device Path.
760 EFI_DEVICE_PATH_PROTOCOL Header
;
762 /// DEVICE_PATH_MESSAGING_SAS GUID.
766 /// Reserved for future use.
770 /// SAS Address for Serial Attached SCSI Target.
774 /// SAS Logical Unit Number.
778 /// More Information about the device and its interconnect.
780 UINT16 DeviceTopology
;
782 /// Relative Target Port (RTP).
784 UINT16 RelativeTargetPort
;
788 /// Serial Attached SCSI (SAS) Ex Device Path SubType
790 #define MSG_SASEX_DP 0x16
792 EFI_DEVICE_PATH_PROTOCOL Header
;
794 /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
798 /// 8-byte array of the SAS Logical Unit Number.
802 /// More Information about the device and its interconnect.
804 UINT16 DeviceTopology
;
806 /// Relative Target Port (RTP).
808 UINT16 RelativeTargetPort
;
812 /// NvmExpress Namespace Device Path SubType.
814 #define MSG_NVME_NAMESPACE_DP 0x17
816 EFI_DEVICE_PATH_PROTOCOL Header
;
818 UINT64 NamespaceUuid
;
819 } NVME_NAMESPACE_DEVICE_PATH
;
822 /// DNS Device Path SubType
824 #define MSG_DNS_DP 0x1F
826 EFI_DEVICE_PATH_PROTOCOL Header
;
828 /// Indicates the DNS server address is IPv4 or IPv6 address.
832 /// Instance of the DNS server address.
834 EFI_IP_ADDRESS DnsServerIp
[];
838 /// Uniform Resource Identifiers (URI) Device Path SubType
840 #define MSG_URI_DP 0x18
842 EFI_DEVICE_PATH_PROTOCOL Header
;
844 /// Instance of the URI pursuant to RFC 3986.
850 /// Universal Flash Storage (UFS) Device Path SubType.
852 #define MSG_UFS_DP 0x19
854 EFI_DEVICE_PATH_PROTOCOL Header
;
856 /// Target ID on the UFS bus (PUN).
860 /// Logical Unit Number (LUN).
866 /// SD (Secure Digital) Device Path SubType.
868 #define MSG_SD_DP 0x1A
870 EFI_DEVICE_PATH_PROTOCOL Header
;
875 /// EMMC (Embedded MMC) Device Path SubType.
877 #define MSG_EMMC_DP 0x1D
879 EFI_DEVICE_PATH_PROTOCOL Header
;
884 /// iSCSI Device Path SubType
886 #define MSG_ISCSI_DP 0x13
888 EFI_DEVICE_PATH_PROTOCOL Header
;
890 /// Network Protocol (0 = TCP, 1+ = reserved).
892 UINT16 NetworkProtocol
;
894 /// iSCSI Login Options.
898 /// iSCSI Logical Unit Number.
902 /// iSCSI Target Portal group tag the initiator intends
903 /// to establish a session with.
905 UINT16 TargetPortalGroupTag
;
907 /// iSCSI NodeTarget Name. The length of the name
908 /// is determined by subtracting the offset of this field from Length.
910 /// CHAR8 iSCSI Target Name.
913 #define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000
914 #define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002
915 #define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000
916 #define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008
917 #define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000
918 #define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000
919 #define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
920 #define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
923 /// VLAN Device Path SubType.
925 #define MSG_VLAN_DP 0x14
927 EFI_DEVICE_PATH_PROTOCOL Header
;
929 /// VLAN identifier (0-4094).
935 /// Bluetooth Device Path SubType.
937 #define MSG_BLUETOOTH_DP 0x1b
939 EFI_DEVICE_PATH_PROTOCOL Header
;
941 /// 48bit Bluetooth device address.
943 BLUETOOTH_ADDRESS BD_ADDR
;
944 } BLUETOOTH_DEVICE_PATH
;
947 /// Wi-Fi Device Path SubType.
949 #define MSG_WIFI_DP 0x1C
951 EFI_DEVICE_PATH_PROTOCOL Header
;
953 /// Service set identifier. A 32-byte octets string.
959 /// Bluetooth LE Device Path SubType.
961 #define MSG_BLUETOOTH_LE_DP 0x1E
963 EFI_DEVICE_PATH_PROTOCOL Header
;
964 BLUETOOTH_LE_ADDRESS Address
;
965 } BLUETOOTH_LE_DEVICE_PATH
;
970 #define MEDIA_DEVICE_PATH 0x04
973 /// Hard Drive Media Device Path SubType.
975 #define MEDIA_HARDDRIVE_DP 0x01
978 /// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
981 EFI_DEVICE_PATH_PROTOCOL Header
;
983 /// Describes the entry in a partition table, starting with entry 1.
984 /// Partition number zero represents the entire device. Valid
985 /// partition numbers for a MBR partition are [1, 4]. Valid
986 /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
988 UINT32 PartitionNumber
;
990 /// Starting LBA of the partition on the hard drive.
992 UINT64 PartitionStart
;
994 /// Size of the partition in units of Logical Blocks.
996 UINT64 PartitionSize
;
998 /// Signature unique to this partition:
999 /// If SignatureType is 0, this field has to be initialized with 16 zeros.
1000 /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.
1001 /// The other 12 bytes are initialized with zeros.
1002 /// If SignatureType is 2, this field contains a 16 byte signature.
1004 UINT8 Signature
[16];
1006 /// Partition Format: (Unused values reserved).
1007 /// 0x01 - PC-AT compatible legacy MBR.
1008 /// 0x02 - GUID Partition Table.
1012 /// Type of Disk Signature: (Unused values reserved).
1013 /// 0x00 - No Disk Signature.
1014 /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
1015 /// 0x02 - GUID signature.
1017 UINT8 SignatureType
;
1018 } HARDDRIVE_DEVICE_PATH
;
1020 #define MBR_TYPE_PCAT 0x01
1021 #define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
1023 #define NO_DISK_SIGNATURE 0x00
1024 #define SIGNATURE_TYPE_MBR 0x01
1025 #define SIGNATURE_TYPE_GUID 0x02
1028 /// CD-ROM Media Device Path SubType.
1030 #define MEDIA_CDROM_DP 0x02
1033 /// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
1036 EFI_DEVICE_PATH_PROTOCOL Header
;
1038 /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
1042 /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
1044 UINT64 PartitionStart
;
1046 /// Size of the partition in units of Blocks, also called Sectors.
1048 UINT64 PartitionSize
;
1049 } CDROM_DEVICE_PATH
;
1052 // Use VENDOR_DEVICE_PATH struct
1054 #define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype.
1057 /// File Path Media Device Path SubType
1059 #define MEDIA_FILEPATH_DP 0x04
1061 EFI_DEVICE_PATH_PROTOCOL Header
;
1063 /// A NULL-terminated Path string including directory and file names.
1066 } FILEPATH_DEVICE_PATH
;
1068 #define SIZE_OF_FILEPATH_DEVICE_PATH OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)
1071 /// Media Protocol Device Path SubType.
1073 #define MEDIA_PROTOCOL_DP 0x05
1076 /// The Media Protocol Device Path is used to denote the protocol that is being
1077 /// used in a device path at the location of the path specified.
1078 /// Many protocols are inherent to the style of device path.
1081 EFI_DEVICE_PATH_PROTOCOL Header
;
1083 /// The ID of the protocol.
1086 } MEDIA_PROTOCOL_DEVICE_PATH
;
1089 /// PIWG Firmware File SubType.
1091 #define MEDIA_PIWG_FW_FILE_DP 0x06
1094 /// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
1097 EFI_DEVICE_PATH_PROTOCOL Header
;
1099 /// Firmware file name
1101 EFI_GUID FvFileName
;
1102 } MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
;
1105 /// PIWG Firmware Volume Device Path SubType.
1107 #define MEDIA_PIWG_FW_VOL_DP 0x07
1110 /// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
1113 EFI_DEVICE_PATH_PROTOCOL Header
;
1115 /// Firmware volume name.
1118 } MEDIA_FW_VOL_DEVICE_PATH
;
1121 /// Media relative offset range device path.
1123 #define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
1126 /// Used to describe the offset range of media relative.
1129 EFI_DEVICE_PATH_PROTOCOL Header
;
1131 UINT64 StartingOffset
;
1132 UINT64 EndingOffset
;
1133 } MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
;
1136 /// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.
1138 #define EFI_VIRTUAL_DISK_GUID \
1140 0x77AB535A, 0x45FC, 0x624B, {0x55, 0x60, 0xF7, 0xB2, 0x81, 0xD1, 0xF9, 0x6E } \
1143 extern EFI_GUID gEfiVirtualDiskGuid
;
1146 /// This GUID defines a RAM Disk supporting an ISO image in volatile memory.
1148 #define EFI_VIRTUAL_CD_GUID \
1150 0x3D5ABD30, 0x4175, 0x87CE, {0x6D, 0x64, 0xD2, 0xAD, 0xE5, 0x23, 0xC4, 0xBB } \
1152 extern EFI_GUID gEfiVirtualCdGuid
;
1155 /// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.
1157 #define EFI_PERSISTENT_VIRTUAL_DISK_GUID \
1159 0x5CEA02C9, 0x4D07, 0x69D3, {0x26, 0x9F ,0x44, 0x96, 0xFB, 0xE0, 0x96, 0xF9 } \
1162 extern EFI_GUID gEfiPersistentVirtualDiskGuid
;
1165 /// This GUID defines a RAM Disk supporting an ISO image in persistent memory.
1167 #define EFI_PERSISTENT_VIRTUAL_CD_GUID \
1169 0x08018188, 0x42CD, 0xBB48, {0x10, 0x0F, 0x53, 0x87, 0xD5, 0x3D, 0xED, 0x3D } \
1172 extern EFI_GUID gEfiPersistentVirtualCdGuid
;
1175 /// Media ram disk device path.
1177 #define MEDIA_RAM_DISK_DP 0x09
1180 /// Used to describe the ram disk device path.
1183 EFI_DEVICE_PATH_PROTOCOL Header
;
1185 /// Starting Memory Address.
1187 UINT32 StartingAddr
[2];
1189 /// Ending Memory Address.
1191 UINT32 EndingAddr
[2];
1193 /// GUID that defines the type of the RAM Disk.
1197 /// RAM Diskinstance number, if supported. The default value is zero.
1200 } MEDIA_RAM_DISK_DEVICE_PATH
;
1203 /// BIOS Boot Specification Device Path.
1205 #define BBS_DEVICE_PATH 0x05
1208 /// BIOS Boot Specification Device Path SubType.
1210 #define BBS_BBS_DP 0x01
1213 /// This Device Path is used to describe the booting of non-EFI-aware operating systems.
1216 EFI_DEVICE_PATH_PROTOCOL Header
;
1218 /// Device Type as defined by the BIOS Boot Specification.
1222 /// Status Flags as defined by the BIOS Boot Specification.
1226 /// Null-terminated ASCII string that describes the boot device to a user.
1229 } BBS_BBS_DEVICE_PATH
;
1232 // DeviceType definitions - from BBS specification
1234 #define BBS_TYPE_FLOPPY 0x01
1235 #define BBS_TYPE_HARDDRIVE 0x02
1236 #define BBS_TYPE_CDROM 0x03
1237 #define BBS_TYPE_PCMCIA 0x04
1238 #define BBS_TYPE_USB 0x05
1239 #define BBS_TYPE_EMBEDDED_NETWORK 0x06
1240 #define BBS_TYPE_BEV 0x80
1241 #define BBS_TYPE_UNKNOWN 0xFF
1245 /// Union of all possible Device Paths and pointers to Device Paths.
1248 EFI_DEVICE_PATH_PROTOCOL DevPath
;
1249 PCI_DEVICE_PATH Pci
;
1250 PCCARD_DEVICE_PATH PcCard
;
1251 MEMMAP_DEVICE_PATH MemMap
;
1252 VENDOR_DEVICE_PATH Vendor
;
1254 CONTROLLER_DEVICE_PATH Controller
;
1255 BMC_DEVICE_PATH Bmc
;
1256 ACPI_HID_DEVICE_PATH Acpi
;
1257 ACPI_EXTENDED_HID_DEVICE_PATH ExtendedAcpi
;
1258 ACPI_ADR_DEVICE_PATH AcpiAdr
;
1260 ATAPI_DEVICE_PATH Atapi
;
1261 SCSI_DEVICE_PATH Scsi
;
1262 ISCSI_DEVICE_PATH Iscsi
;
1263 FIBRECHANNEL_DEVICE_PATH FibreChannel
;
1264 FIBRECHANNELEX_DEVICE_PATH FibreChannelEx
;
1266 F1394_DEVICE_PATH F1394
;
1267 USB_DEVICE_PATH Usb
;
1268 SATA_DEVICE_PATH Sata
;
1269 USB_CLASS_DEVICE_PATH UsbClass
;
1270 USB_WWID_DEVICE_PATH UsbWwid
;
1271 DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit
;
1272 I2O_DEVICE_PATH I2O
;
1273 MAC_ADDR_DEVICE_PATH MacAddr
;
1274 IPv4_DEVICE_PATH Ipv4
;
1275 IPv6_DEVICE_PATH Ipv6
;
1276 VLAN_DEVICE_PATH Vlan
;
1277 INFINIBAND_DEVICE_PATH InfiniBand
;
1278 UART_DEVICE_PATH Uart
;
1279 UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl
;
1280 SAS_DEVICE_PATH Sas
;
1281 SASEX_DEVICE_PATH SasEx
;
1282 NVME_NAMESPACE_DEVICE_PATH NvmeNamespace
;
1283 DNS_DEVICE_PATH Dns
;
1284 URI_DEVICE_PATH Uri
;
1285 BLUETOOTH_DEVICE_PATH Bluetooth
;
1286 WIFI_DEVICE_PATH WiFi
;
1287 UFS_DEVICE_PATH Ufs
;
1289 EMMC_DEVICE_PATH Emmc
;
1290 HARDDRIVE_DEVICE_PATH HardDrive
;
1291 CDROM_DEVICE_PATH CD
;
1293 FILEPATH_DEVICE_PATH FilePath
;
1294 MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol
;
1296 MEDIA_FW_VOL_DEVICE_PATH FirmwareVolume
;
1297 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FirmwareFile
;
1298 MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset
;
1299 MEDIA_RAM_DISK_DEVICE_PATH RamDisk
;
1300 BBS_BBS_DEVICE_PATH Bbs
;
1306 EFI_DEVICE_PATH_PROTOCOL
*DevPath
;
1307 PCI_DEVICE_PATH
*Pci
;
1308 PCCARD_DEVICE_PATH
*PcCard
;
1309 MEMMAP_DEVICE_PATH
*MemMap
;
1310 VENDOR_DEVICE_PATH
*Vendor
;
1312 CONTROLLER_DEVICE_PATH
*Controller
;
1313 BMC_DEVICE_PATH
*Bmc
;
1314 ACPI_HID_DEVICE_PATH
*Acpi
;
1315 ACPI_EXTENDED_HID_DEVICE_PATH
*ExtendedAcpi
;
1316 ACPI_ADR_DEVICE_PATH
*AcpiAdr
;
1318 ATAPI_DEVICE_PATH
*Atapi
;
1319 SCSI_DEVICE_PATH
*Scsi
;
1320 ISCSI_DEVICE_PATH
*Iscsi
;
1321 FIBRECHANNEL_DEVICE_PATH
*FibreChannel
;
1322 FIBRECHANNELEX_DEVICE_PATH
*FibreChannelEx
;
1324 F1394_DEVICE_PATH
*F1394
;
1325 USB_DEVICE_PATH
*Usb
;
1326 SATA_DEVICE_PATH
*Sata
;
1327 USB_CLASS_DEVICE_PATH
*UsbClass
;
1328 USB_WWID_DEVICE_PATH
*UsbWwid
;
1329 DEVICE_LOGICAL_UNIT_DEVICE_PATH
*LogicUnit
;
1330 I2O_DEVICE_PATH
*I2O
;
1331 MAC_ADDR_DEVICE_PATH
*MacAddr
;
1332 IPv4_DEVICE_PATH
*Ipv4
;
1333 IPv6_DEVICE_PATH
*Ipv6
;
1334 VLAN_DEVICE_PATH
*Vlan
;
1335 INFINIBAND_DEVICE_PATH
*InfiniBand
;
1336 UART_DEVICE_PATH
*Uart
;
1337 UART_FLOW_CONTROL_DEVICE_PATH
*UartFlowControl
;
1338 SAS_DEVICE_PATH
*Sas
;
1339 SASEX_DEVICE_PATH
*SasEx
;
1340 NVME_NAMESPACE_DEVICE_PATH
*NvmeNamespace
;
1341 DNS_DEVICE_PATH
*Dns
;
1342 URI_DEVICE_PATH
*Uri
;
1343 BLUETOOTH_DEVICE_PATH
*Bluetooth
;
1344 WIFI_DEVICE_PATH
*WiFi
;
1345 UFS_DEVICE_PATH
*Ufs
;
1347 EMMC_DEVICE_PATH
*Emmc
;
1348 HARDDRIVE_DEVICE_PATH
*HardDrive
;
1349 CDROM_DEVICE_PATH
*CD
;
1351 FILEPATH_DEVICE_PATH
*FilePath
;
1352 MEDIA_PROTOCOL_DEVICE_PATH
*MediaProtocol
;
1354 MEDIA_FW_VOL_DEVICE_PATH
*FirmwareVolume
;
1355 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FirmwareFile
;
1356 MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
*Offset
;
1357 MEDIA_RAM_DISK_DEVICE_PATH
*RamDisk
;
1358 BBS_BBS_DEVICE_PATH
*Bbs
;
1362 #define EFI_DEBUGPORT_PROTOCOL_GUID \
1364 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
1367 // DEBUGPORT variable definitions...
1369 #define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
1370 #define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
1371 extern EFI_GUID gEfiDebugPortVariableGuid
;
1374 // DebugPort device path definitions...
1376 #define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
1377 extern EFI_GUID gEfiDebugPortProtocolGuid
;
1380 EFI_DEVICE_PATH_PROTOCOL Header
;
1382 } DEBUGPORT_DEVICE_PATH
;
1386 #define END_DEVICE_PATH_TYPE 0x7f
1387 #define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
1388 #define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
1390 extern EFI_GUID gEfiDevicePathProtocolGuid
;