DevicePath.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
The device path protocol as defined in UEFI 2.0.
The device path represents a programmatic path to a device,
from a software point of view. The path must persist from boot to boot, so
it can not contain things like PCI bus numbers that change from boot to boot.
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__
#define __EFI_DEVICE_PATH_PROTOCOL_H__
///
/// Device Path protocol.
///
#define EFI_DEVICE_PATH_PROTOCOL_GUID \
{ \
0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
}
///
/// Device Path guid definition for backward-compatible with EFI1.1.
///
#pragma pack(1)
/**
information concerning the physical device or logical device. If the handle does
not logically map to a physical device, the handle may not necessarily support
the device path protocol. The device path describes the location of the device
the handle is for. The size of the Device Path can be determined from the structures
that make up the Device Path.
**/
typedef struct {
///< 0x02 ACPI Device Path.
///< 0x03 Messaging Device Path.
///< 0x04 Media Device Path.
///< 0x05 BIOS Boot Specification Device Path.
///< 0x7F End of Hardware Device Path.
///< 0xFF End Entire Device Path, or
///< 0x01 End This Instance of a Device Path and start a new
///< Device Path.
///< type of data. Size of data is included in Length.
///
/// Device Path protocol definition for backward-compatible with EFI1.1.
///
typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;
///
/// Hardware Device Paths.
///
#define HARDWARE_DEVICE_PATH 0x01
///
/// PCI Device Path SubType.
///
#define HW_PCI_DP 0x01
///
/// PCI Device Path.
///
typedef struct {
///
/// PCI Function Number.
///
///
/// PCI Device Number.
///
///
/// PCCARD Device Path SubType.
///
#define HW_PCCARD_DP 0x02
///
/// PCCARD Device Path.
///
typedef struct {
///
/// Function Number (0 = First Function).
///
///
/// Memory Mapped Device Path SubType.
///
#define HW_MEMMAP_DP 0x03
///
/// Memory Mapped Device Path.
///
typedef struct {
///
/// EFI_MEMORY_TYPE
///
///
/// Starting Memory Address.
///
///
/// Ending Memory Address.
///
///
/// Hardware Vendor Device Path SubType.
///
#define HW_VENDOR_DP 0x04
///
/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
/// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the
/// contents on the n bytes that follow in the Vendor Device Path node.
///
typedef struct {
///
/// Vendor-assigned GUID that defines the data that follows.
///
///
/// Vendor-defined variable size data.
///
///
/// Controller Device Path SubType.
///
#define HW_CONTROLLER_DP 0x05
///
/// Controller Device Path.
///
typedef struct {
///
/// Controller number.
///
///
/// ACPI Device Paths.
///
#define ACPI_DEVICE_PATH 0x02
///
/// ACPI Device Path SubType.
///
#define ACPI_DP 0x01
typedef struct {
///
/// Device's PnP hardware ID stored in a numeric 32-bit
/// compressed EISA-type ID. This value must match the
/// corresponding _HID in the ACPI name space.
///
///
/// Unique ID that is required by ACPI if two devices have the
/// same _HID. This value must also match the corresponding
/// _UID/_HID pair in the ACPI name space. Only the 32-bit
/// numeric value type of _UID is supported. Thus, strings must
/// not be used for the _UID in the ACPI name space.
///
///
/// Expanded ACPI Device Path SubType.
///
#define ACPI_EXTENDED_DP 0x02
typedef struct {
///
/// Device's PnP hardware ID stored in a numeric 32-bit
/// compressed EISA-type ID. This value must match the
/// corresponding _HID in the ACPI name space.
///
///
/// Unique ID that is required by ACPI if two devices have the
/// same _HID. This value must also match the corresponding
/// _UID/_HID pair in the ACPI name space.
///
///
/// Device's compatible PnP hardware ID stored in a numeric
/// 32-bit compressed EISA-type ID. This value must match at
/// least one of the compatible device IDs returned by the
/// corresponding _CID in the ACPI name space.
///
///
/// Optional variable length _HIDSTR.
/// Optional variable length _UIDSTR.
/// Optional variable length _CIDSTR.
///
//
// EISA ID Macro
// EISA ID Definition 32-bits
// bits[15:0] - three character compressed ASCII EISA ID.
// bits[31:16] - binary number
// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
//
#define PNP_EISA_ID_CONST 0x41d0
#define PNP_EISA_ID_MASK 0xffff
///
/// ACPI _ADR Device Path SubType.
///
#define ACPI_ADR_DP 0x03
///
/// The _ADR device path is used to contain video output device attributes to support the Graphics
/// Output Protocol. The device path can contain multiple _ADR entries if multiple video output
/// devices are displaying the same output.
///
typedef struct {
///
/// _ADR value. For video output devices the value of this
/// field comes from Table B-2 of the ACPI 3.0 specification. At
/// least one _ADR value is required.
///
//
// This device path may optionally contain more than one _ADR entry.
//
#define ACPI_ADR_DISPLAY_TYPE_OTHER 0
#define ACPI_ADR_DISPLAY_TYPE_VGA 1
#define ACPI_ADR_DISPLAY_TYPE_TV 2
#define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3
#define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4
#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
((_Index) & 0xf) ))
///
/// Messaging Device Paths.
/// This Device Path is used to describe the connection of devices outside the resource domain of the
/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
/// information like networking protocol IP addresses.
///
#define MESSAGING_DEVICE_PATH 0x03
///
/// ATAPI Device Path SubType
///
#define MSG_ATAPI_DP 0x01
typedef struct {
///
/// Set to zero for primary, or one for secondary.
///
///
/// Set to zero for master, or one for slave mode.
///
///
/// Logical Unit Number.
///
///
/// SCSI Device Path SubType.
///
#define MSG_SCSI_DP 0x02
typedef struct {
///
/// Target ID on the SCSI bus (PUN).
///
///
/// Logical Unit Number (LUN).
///
///
/// Fibre Channel SubType.
///
#define MSG_FIBRECHANNEL_DP 0x03
typedef struct {
///
/// Reserved for the future.
///
///
/// Fibre Channel World Wide Number.
///
///
/// Fibre Channel Logical Unit Number.
///
///
/// Fibre Channel Ex SubType.
///
#define MSG_FIBRECHANNELEX_DP 0x15
typedef struct {
///
/// Reserved for the future.
///
///
/// 8 byte array containing Fibre Channel End Device Port Name.
///
///
/// 8 byte array containing Fibre Channel Logical Unit Number.
///
///
/// 1394 Device Path SubType
///
#define MSG_1394_DP 0x04
typedef struct {
///
/// Reserved for the future.
///
///
/// 1394 Global Unique ID (GUID).
///
///
/// USB Device Path SubType.
///
#define MSG_USB_DP 0x05
typedef struct {
///
/// USB Parent Port Number.
///
///
/// USB Interface Number.
///
///
/// USB Class Device Path SubType.
///
#define MSG_USB_CLASS_DP 0x0f
typedef struct {
///
/// Vendor ID assigned by USB-IF. A value of 0xFFFF will
/// match any Vendor ID.
///
///
/// Product ID assigned by USB-IF. A value of 0xFFFF will
/// match any Product ID.
///
///
/// The class code assigned by the USB-IF. A value of 0xFF
/// will match any class code.
///
///
/// The subclass code assigned by the USB-IF. A value of
/// 0xFF will match any subclass code.
///
///
/// The protocol code assigned by the USB-IF. A value of
/// 0xFF will match any protocol code.
///
///
/// USB WWID Device Path SubType.
///
#define MSG_USB_WWID_DP 0x10
///
/// This device path describes a USB device using its serial number.
///
typedef struct {
///
/// USB interface number.
///
///
/// USB vendor id of the device.
///
///
/// USB product id of the device.
///
///
/// Last 64-or-fewer UTF-16 characters of the USB
/// serial number. The length of the string is
/// determined by the Length field less the offset of the
/// Serial Number field (10)
///
/// CHAR16 SerialNumber[...];
///
/// Device Logical Unit SubType.
///
#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
typedef struct {
///
/// Logical Unit Number for the interface.
///
///
/// SATA Device Path SubType.
///
#define MSG_SATA_DP 0x12
typedef struct {
///
/// The HBA port number that facilitates the connection to the
/// device or a port multiplier. The value 0xFFFF is reserved.
///
///
/// The Port multiplier port number that facilitates the connection
/// to the device. Bit 15 should be set if the device is directly
/// connected to the HBA.
///
///
/// Logical Unit Number.
///
///
/// Flag for if the device is directly connected to the HBA.
///
#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
///
/// I2O Device Path SubType.
///
#define MSG_I2O_DP 0x06
typedef struct {
///
/// Target ID (TID) for a device.
///
///
/// MAC Address Device Path SubType.
///
#define MSG_MAC_ADDR_DP 0x0b
typedef struct {
///
/// The MAC address for a network interface padded with 0s.
///
///
/// Network interface type(i.e. 802.3, FDDI).
///
///
/// IPv4 Device Path SubType
///
#define MSG_IPv4_DP 0x0c
typedef struct {
///
/// The local IPv4 address.
///
///
/// The remote IPv4 address.
///
///
/// The local port number.
///
///
/// The remote port number.
///
///
/// The network protocol(i.e. UDP, TCP).
///
///
/// 0x00 - The Source IP Address was assigned though DHCP.
/// 0x01 - The Source IP Address is statically bound.
///
///
/// The gateway IP address
///
///
/// The subnet mask
///
///
/// IPv6 Device Path SubType.
///
#define MSG_IPv6_DP 0x0d
typedef struct {
///
/// The local IPv6 address.
///
///
/// The remote IPv6 address.
///
///
/// The local port number.
///
///
/// The remote port number.
///
///
/// The network protocol(i.e. UDP, TCP).
///
///
/// 0x00 - The Local IP Address was manually configured.
/// 0x01 - The Local IP Address is assigned through IPv6
/// stateless auto-configuration.
/// 0x02 - The Local IP Address is assigned through IPv6
/// stateful configuration.
///
///
/// The prefix length
///
///
/// The gateway IP address
///
///
/// InfiniBand Device Path SubType.
///
#define MSG_INFINIBAND_DP 0x09
typedef struct {
///
/// Bit 1 - Extend Boot Environment.
/// Bit 2 - Console Protocol.
/// Bit 3 - Storage Protocol.
/// Bit 4 - Network Protocol.
/// All other bits are reserved.
///
///
/// 128-bit Global Identifier for remote fabric port.
///
///
/// 64-bit unique identifier to remote IOC or server process.
/// Interpretation of field specified by Resource Flags (bit 0).
///
///
/// 64-bit persistent ID of remote IOC port.
///
///
/// 64-bit persistent ID of remote device.
///
#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
///
/// UART Device Path SubType.
///
#define MSG_UART_DP 0x0e
typedef struct {
///
/// Reserved.
///
///
/// The baud rate setting for the UART style device. A value of 0
/// means that the device's default baud rate will be used.
///
///
/// The number of data bits for the UART style device. A value
/// of 0 means that the device's default number of data bits will be used.
///
///
/// The parity setting for the UART style device.
/// Parity 0x00 - Default Parity.
/// Parity 0x01 - No Parity.
/// Parity 0x02 - Even Parity.
/// Parity 0x03 - Odd Parity.
/// Parity 0x04 - Mark Parity.
/// Parity 0x05 - Space Parity.
///
///
/// The number of stop bits for the UART style device.
/// Stop Bits 0x00 - Default Stop Bits.
/// Stop Bits 0x01 - 1 Stop Bit.
/// Stop Bits 0x02 - 1.5 Stop Bits.
/// Stop Bits 0x03 - 2 Stop Bits.
///
//
// Use VENDOR_DEVICE_PATH struct
//
#define MSG_VENDOR_DP 0x0a
///
/// A new device path node is defined to declare flow control characteristics.
/// UART Flow Control Messaging Device Path
///
typedef struct {
///
/// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
///
///
/// Bitmap of supported flow control types.
/// Bit 0 set indicates hardware flow control.
/// All other bits are reserved and are clear.
///
#define UART_FLOW_CONTROL_HARDWARE 0x00000001
#define UART_FLOW_CONTROL_XON_XOFF 0x00000010
///
/// Serial Attached SCSI (SAS) Device Path.
///
typedef struct {
///
/// DEVICE_PATH_MESSAGING_SAS GUID.
///
///
/// Reserved for future use.
///
///
/// SAS Address for Serial Attached SCSI Target.
///
///
/// SAS Logical Unit Number.
///
///
/// More Information about the device and its interconnect.
///
///
/// Relative Target Port (RTP).
///
///
/// Serial Attached SCSI (SAS) Ex Device Path SubType
///
#define MSG_SASEX_DP 0x16
typedef struct {
///
/// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
///
///
/// 8-byte array of the SAS Logical Unit Number.
///
///
/// More Information about the device and its interconnect.
///
///
/// Relative Target Port (RTP).
///
///
/// iSCSI Device Path SubType
///
#define MSG_ISCSI_DP 0x13
typedef struct {
///
/// Network Protocol (0 = TCP, 1+ = reserved).
///
///
/// iSCSI Login Options.
///
///
/// iSCSI Logical Unit Number.
///
///
/// iSCSI Target Portal group tag the initiator intends
/// to establish a session with.
///
///
/// iSCSI NodeTarget Name. The length of the name
/// is determined by subtracting the offset of this field from Length.
///
/// CHAR8 iSCSI Target Name.
#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000
#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002
#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000
#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000
#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
///
/// VLAN Device Path SubType.
///
#define MSG_VLAN_DP 0x14
typedef struct {
///
/// VLAN identifier (0-4094).
///
//
// Media Device Path
//
#define MEDIA_DEVICE_PATH 0x04
///
/// Hard Drive Media Device Path SubType.
///
#define MEDIA_HARDDRIVE_DP 0x01
///
/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
///
typedef struct {
///
/// Describes the entry in a partition table, starting with entry 1.
/// Partition number zero represents the entire device. Valid
/// partition numbers for a MBR partition are [1, 4]. Valid
/// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
///
///
/// Starting LBA of the partition on the hard drive.
///
///
/// Size of the partition in units of Logical Blocks.
///
///
/// Signature unique to this partition:
/// If SignatureType is 0, this field has to be initialized with 16 zeros.
/// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.
/// The other 12 bytes are initialized with zeros.
/// If SignatureType is 2, this field contains a 16 byte signature.
///
///
/// Partition Format: (Unused values reserved).
/// 0x01 - PC-AT compatible legacy MBR.
/// 0x02 - GUID Partition Table.
///
///
/// Type of Disk Signature: (Unused values reserved).
/// 0x00 - No Disk Signature.
/// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
/// 0x02 - GUID signature.
///
#define MBR_TYPE_PCAT 0x01
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
#define NO_DISK_SIGNATURE 0x00
#define SIGNATURE_TYPE_MBR 0x01
#define SIGNATURE_TYPE_GUID 0x02
///
/// CD-ROM Media Device Path SubType.
///
#define MEDIA_CDROM_DP 0x02
///
/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
///
typedef struct {
///
///
///
/// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
///
///
/// Size of the partition in units of Blocks, also called Sectors.
///
//
// Use VENDOR_DEVICE_PATH struct
//
///
/// File Path Media Device Path SubType
///
#define MEDIA_FILEPATH_DP 0x04
typedef struct {
///
/// A NULL-terminated Path string including directory and file names.
///
///
/// Media Protocol Device Path SubType.
///
#define MEDIA_PROTOCOL_DP 0x05
///
/// The Media Protocol Device Path is used to denote the protocol that is being
/// used in a device path at the location of the path specified.
/// Many protocols are inherent to the style of device path.
///
typedef struct {
///
/// The ID of the protocol.
///
///
/// PIWG Firmware File SubType.
///
#define MEDIA_PIWG_FW_FILE_DP 0x06
///
/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
///
typedef struct {
///
/// Firmware file name
///
///
/// PIWG Firmware Volume Device Path SubType.
///
#define MEDIA_PIWG_FW_VOL_DP 0x07
///
/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
///
typedef struct {
///
/// Firmware volume name.
///
///
/// Media relative offset range device path.
///
#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
///
/// Used to describe the offset range of media relative.
///
typedef struct {
///
/// BIOS Boot Specification Device Path.
///
#define BBS_DEVICE_PATH 0x05
///
/// BIOS Boot Specification Device Path SubType.
///
#define BBS_BBS_DP 0x01
///
/// This Device Path is used to describe the booting of non-EFI-aware operating systems.
///
typedef struct {
///
/// Device Type as defined by the BIOS Boot Specification.
///
///
/// Status Flags as defined by the BIOS Boot Specification.
///
///
/// Null-terminated ASCII string that describes the boot device to a user.
///
//
// DeviceType definitions - from BBS specification
//
#define BBS_TYPE_FLOPPY 0x01
#define BBS_TYPE_HARDDRIVE 0x02
#define BBS_TYPE_CDROM 0x03
#define BBS_TYPE_PCMCIA 0x04
#define BBS_TYPE_USB 0x05
#define BBS_TYPE_EMBEDDED_NETWORK 0x06
#define BBS_TYPE_BEV 0x80
#define BBS_TYPE_UNKNOWN 0xFF
///
/// Union of all possible Device Paths and pointers to Device Paths.
///
typedef union {
} EFI_DEV_PATH;
typedef union {
#pragma pack()
#define END_DEVICE_PATH_TYPE 0x7f
#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
extern EFI_GUID gEfiDevicePathProtocolGuid;
#endif