Path: blob/main/sys/contrib/edk2/Include/Protocol/DevicePath.h
48383 views
/** @file1The device path protocol as defined in UEFI 2.0.23The device path represents a programmatic path to a device,4from a software point of view. The path must persist from boot to boot, so5it can not contain things like PCI bus numbers that change from boot to boot.67Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>8SPDX-License-Identifier: BSD-2-Clause-Patent910**/1112#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__13#define __EFI_DEVICE_PATH_PROTOCOL_H__1415#include <Guid/PcAnsi.h>16#include <IndustryStandard/Bluetooth.h>17#include <IndustryStandard/Acpi60.h>1819///20/// Device Path protocol.21///22#define EFI_DEVICE_PATH_PROTOCOL_GUID \23{ \240x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \25}2627///28/// Device Path guid definition for backward-compatible with EFI1.1.29///30#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID3132#pragma pack(1)3334/**35This protocol can be used on any device handle to obtain generic path/location36information concerning the physical device or logical device. If the handle does37not logically map to a physical device, the handle may not necessarily support38the device path protocol. The device path describes the location of the device39the handle is for. The size of the Device Path can be determined from the structures40that make up the Device Path.41**/42typedef struct {43UINT8 Type; ///< 0x01 Hardware Device Path.44///< 0x02 ACPI Device Path.45///< 0x03 Messaging Device Path.46///< 0x04 Media Device Path.47///< 0x05 BIOS Boot Specification Device Path.48///< 0x7F End of Hardware Device Path.4950UINT8 SubType; ///< Varies by Type51///< 0xFF End Entire Device Path, or52///< 0x01 End This Instance of a Device Path and start a new53///< Device Path.5455UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define56///< type of data. Size of data is included in Length.57} EFI_DEVICE_PATH_PROTOCOL;5859///60/// Device Path protocol definition for backward-compatible with EFI1.1.61///62typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;6364///65/// Hardware Device Paths.66///67#define HARDWARE_DEVICE_PATH 0x016869///70/// PCI Device Path SubType.71///72#define HW_PCI_DP 0x017374///75/// PCI Device Path.76///77typedef struct {78EFI_DEVICE_PATH_PROTOCOL Header;79///80/// PCI Function Number.81///82UINT8 Function;83///84/// PCI Device Number.85///86UINT8 Device;87} PCI_DEVICE_PATH;8889///90/// PCCARD Device Path SubType.91///92#define HW_PCCARD_DP 0x029394///95/// PCCARD Device Path.96///97typedef struct {98EFI_DEVICE_PATH_PROTOCOL Header;99///100/// Function Number (0 = First Function).101///102UINT8 FunctionNumber;103} PCCARD_DEVICE_PATH;104105///106/// Memory Mapped Device Path SubType.107///108#define HW_MEMMAP_DP 0x03109110///111/// Memory Mapped Device Path.112///113typedef struct {114EFI_DEVICE_PATH_PROTOCOL Header;115///116/// EFI_MEMORY_TYPE117///118UINT32 MemoryType;119///120/// Starting Memory Address.121///122EFI_PHYSICAL_ADDRESS StartingAddress;123///124/// Ending Memory Address.125///126EFI_PHYSICAL_ADDRESS EndingAddress;127} MEMMAP_DEVICE_PATH;128129///130/// Hardware Vendor Device Path SubType.131///132#define HW_VENDOR_DP 0x04133134///135/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must136/// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the137/// contents on the n bytes that follow in the Vendor Device Path node.138///139typedef struct {140EFI_DEVICE_PATH_PROTOCOL Header;141///142/// Vendor-assigned GUID that defines the data that follows.143///144EFI_GUID Guid;145///146/// Vendor-defined variable size data.147///148} VENDOR_DEVICE_PATH;149150///151/// Controller Device Path SubType.152///153#define HW_CONTROLLER_DP 0x05154155///156/// Controller Device Path.157///158typedef struct {159EFI_DEVICE_PATH_PROTOCOL Header;160///161/// Controller number.162///163UINT32 ControllerNumber;164} CONTROLLER_DEVICE_PATH;165166///167/// BMC Device Path SubType.168///169#define HW_BMC_DP 0x06170171///172/// BMC Device Path.173///174typedef struct {175EFI_DEVICE_PATH_PROTOCOL Header;176///177/// Interface Type.178///179UINT8 InterfaceType;180///181/// Base Address.182///183UINT8 BaseAddress[8];184} BMC_DEVICE_PATH;185186///187/// ACPI Device Paths.188///189#define ACPI_DEVICE_PATH 0x02190191///192/// ACPI Device Path SubType.193///194#define ACPI_DP 0x01195typedef struct {196EFI_DEVICE_PATH_PROTOCOL Header;197///198/// Device's PnP hardware ID stored in a numeric 32-bit199/// compressed EISA-type ID. This value must match the200/// corresponding _HID in the ACPI name space.201///202UINT32 HID;203///204/// Unique ID that is required by ACPI if two devices have the205/// same _HID. This value must also match the corresponding206/// _UID/_HID pair in the ACPI name space. Only the 32-bit207/// numeric value type of _UID is supported. Thus, strings must208/// not be used for the _UID in the ACPI name space.209///210UINT32 UID;211} ACPI_HID_DEVICE_PATH;212213///214/// Expanded ACPI Device Path SubType.215///216#define ACPI_EXTENDED_DP 0x02217typedef struct {218EFI_DEVICE_PATH_PROTOCOL Header;219///220/// Device's PnP hardware ID stored in a numeric 32-bit221/// compressed EISA-type ID. This value must match the222/// corresponding _HID in the ACPI name space.223///224UINT32 HID;225///226/// Unique ID that is required by ACPI if two devices have the227/// same _HID. This value must also match the corresponding228/// _UID/_HID pair in the ACPI name space.229///230UINT32 UID;231///232/// Device's compatible PnP hardware ID stored in a numeric233/// 32-bit compressed EISA-type ID. This value must match at234/// least one of the compatible device IDs returned by the235/// corresponding _CID in the ACPI name space.236///237UINT32 CID;238///239/// Optional variable length _HIDSTR.240/// Optional variable length _UIDSTR.241/// Optional variable length _CIDSTR.242///243} ACPI_EXTENDED_HID_DEVICE_PATH;244245//246// EISA ID Macro247// EISA ID Definition 32-bits248// bits[15:0] - three character compressed ASCII EISA ID.249// bits[31:16] - binary number250// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'251//252#define PNP_EISA_ID_CONST 0x41d0253#define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16))254#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))255#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))256257#define PNP_EISA_ID_MASK 0xffff258#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)259260///261/// ACPI _ADR Device Path SubType.262///263#define ACPI_ADR_DP 0x03264265///266/// The _ADR device path is used to contain video output device attributes to support the Graphics267/// Output Protocol. The device path can contain multiple _ADR entries if multiple video output268/// devices are displaying the same output.269///270typedef struct {271EFI_DEVICE_PATH_PROTOCOL Header;272///273/// _ADR value. For video output devices the value of this274/// field comes from Table B-2 of the ACPI 3.0 specification. At275/// least one _ADR value is required.276///277UINT32 ADR;278//279// This device path may optionally contain more than one _ADR entry.280//281} ACPI_ADR_DEVICE_PATH;282283///284/// ACPI NVDIMM Device Path SubType.285///286#define ACPI_NVDIMM_DP 0x04287///288///289typedef struct {290EFI_DEVICE_PATH_PROTOCOL Header;291///292/// NFIT Device Handle, the _ADR of the NVDIMM device.293/// The value of this field comes from Section 9.20.3 of the ACPI 6.2A specification.294///295UINT32 NFITDeviceHandle;296} ACPI_NVDIMM_DEVICE_PATH;297298#define ACPI_ADR_DISPLAY_TYPE_OTHER 0299#define ACPI_ADR_DISPLAY_TYPE_VGA 1300#define ACPI_ADR_DISPLAY_TYPE_TV 2301#define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3302#define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4303304#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \305((UINT32)( ((UINT32)((_DeviceIdScheme) & 0x1) << 31) | \306(((_HeadId) & 0x7) << 18) | \307(((_NonVgaOutput) & 0x1) << 17) | \308(((_BiosCanDetect) & 0x1) << 16) | \309(((_VendorInfo) & 0xf) << 12) | \310(((_Type) & 0xf) << 8) | \311(((_Port) & 0xf) << 4) | \312((_Index) & 0xf) ))313314///315/// Messaging Device Paths.316/// This Device Path is used to describe the connection of devices outside the resource domain of the317/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract318/// information like networking protocol IP addresses.319///320#define MESSAGING_DEVICE_PATH 0x03321322///323/// ATAPI Device Path SubType324///325#define MSG_ATAPI_DP 0x01326typedef struct {327EFI_DEVICE_PATH_PROTOCOL Header;328///329/// Set to zero for primary, or one for secondary.330///331UINT8 PrimarySecondary;332///333/// Set to zero for master, or one for slave mode.334///335UINT8 SlaveMaster;336///337/// Logical Unit Number.338///339UINT16 Lun;340} ATAPI_DEVICE_PATH;341342///343/// SCSI Device Path SubType.344///345#define MSG_SCSI_DP 0x02346typedef struct {347EFI_DEVICE_PATH_PROTOCOL Header;348///349/// Target ID on the SCSI bus (PUN).350///351UINT16 Pun;352///353/// Logical Unit Number (LUN).354///355UINT16 Lun;356} SCSI_DEVICE_PATH;357358///359/// Fibre Channel SubType.360///361#define MSG_FIBRECHANNEL_DP 0x03362typedef struct {363EFI_DEVICE_PATH_PROTOCOL Header;364///365/// Reserved for the future.366///367UINT32 Reserved;368///369/// Fibre Channel World Wide Number.370///371UINT64 WWN;372///373/// Fibre Channel Logical Unit Number.374///375UINT64 Lun;376} FIBRECHANNEL_DEVICE_PATH;377378///379/// Fibre Channel Ex SubType.380///381#define MSG_FIBRECHANNELEX_DP 0x15382typedef struct {383EFI_DEVICE_PATH_PROTOCOL Header;384///385/// Reserved for the future.386///387UINT32 Reserved;388///389/// 8 byte array containing Fibre Channel End Device Port Name.390///391UINT8 WWN[8];392///393/// 8 byte array containing Fibre Channel Logical Unit Number.394///395UINT8 Lun[8];396} FIBRECHANNELEX_DEVICE_PATH;397398///399/// 1394 Device Path SubType400///401#define MSG_1394_DP 0x04402typedef struct {403EFI_DEVICE_PATH_PROTOCOL Header;404///405/// Reserved for the future.406///407UINT32 Reserved;408///409/// 1394 Global Unique ID (GUID).410///411UINT64 Guid;412} F1394_DEVICE_PATH;413414///415/// USB Device Path SubType.416///417#define MSG_USB_DP 0x05418typedef struct {419EFI_DEVICE_PATH_PROTOCOL Header;420///421/// USB Parent Port Number.422///423UINT8 ParentPortNumber;424///425/// USB Interface Number.426///427UINT8 InterfaceNumber;428} USB_DEVICE_PATH;429430///431/// USB Class Device Path SubType.432///433#define MSG_USB_CLASS_DP 0x0f434typedef struct {435EFI_DEVICE_PATH_PROTOCOL Header;436///437/// Vendor ID assigned by USB-IF. A value of 0xFFFF will438/// match any Vendor ID.439///440UINT16 VendorId;441///442/// Product ID assigned by USB-IF. A value of 0xFFFF will443/// match any Product ID.444///445UINT16 ProductId;446///447/// The class code assigned by the USB-IF. A value of 0xFF448/// will match any class code.449///450UINT8 DeviceClass;451///452/// The subclass code assigned by the USB-IF. A value of453/// 0xFF will match any subclass code.454///455UINT8 DeviceSubClass;456///457/// The protocol code assigned by the USB-IF. A value of458/// 0xFF will match any protocol code.459///460UINT8 DeviceProtocol;461} USB_CLASS_DEVICE_PATH;462463///464/// USB WWID Device Path SubType.465///466#define MSG_USB_WWID_DP 0x10467468///469/// This device path describes a USB device using its serial number.470///471typedef struct {472EFI_DEVICE_PATH_PROTOCOL Header;473///474/// USB interface number.475///476UINT16 InterfaceNumber;477///478/// USB vendor id of the device.479///480UINT16 VendorId;481///482/// USB product id of the device.483///484UINT16 ProductId;485///486/// Last 64-or-fewer UTF-16 characters of the USB487/// serial number. The length of the string is488/// determined by the Length field less the offset of the489/// Serial Number field (10)490///491/// CHAR16 SerialNumber[...];492} USB_WWID_DEVICE_PATH;493494///495/// Device Logical Unit SubType.496///497#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11498typedef struct {499EFI_DEVICE_PATH_PROTOCOL Header;500///501/// Logical Unit Number for the interface.502///503UINT8 Lun;504} DEVICE_LOGICAL_UNIT_DEVICE_PATH;505506///507/// SATA Device Path SubType.508///509#define MSG_SATA_DP 0x12510typedef struct {511EFI_DEVICE_PATH_PROTOCOL Header;512///513/// The HBA port number that facilitates the connection to the514/// device or a port multiplier. The value 0xFFFF is reserved.515///516UINT16 HBAPortNumber;517///518/// The Port multiplier port number that facilitates the connection519/// to the device. Must be set to 0xFFFF if the device is directly520/// connected to the HBA.521///522UINT16 PortMultiplierPortNumber;523///524/// Logical Unit Number.525///526UINT16 Lun;527} SATA_DEVICE_PATH;528529///530/// Flag for if the device is directly connected to the HBA.531///532#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000533534///535/// I2O Device Path SubType.536///537#define MSG_I2O_DP 0x06538typedef struct {539EFI_DEVICE_PATH_PROTOCOL Header;540///541/// Target ID (TID) for a device.542///543UINT32 Tid;544} I2O_DEVICE_PATH;545546///547/// MAC Address Device Path SubType.548///549#define MSG_MAC_ADDR_DP 0x0b550typedef struct {551EFI_DEVICE_PATH_PROTOCOL Header;552///553/// The MAC address for a network interface padded with 0s.554///555EFI_MAC_ADDRESS MacAddress;556///557/// Network interface type(i.e. 802.3, FDDI).558///559UINT8 IfType;560} MAC_ADDR_DEVICE_PATH;561562///563/// IPv4 Device Path SubType564///565#define MSG_IPv4_DP 0x0c566typedef struct {567EFI_DEVICE_PATH_PROTOCOL Header;568///569/// The local IPv4 address.570///571EFI_IPv4_ADDRESS LocalIpAddress;572///573/// The remote IPv4 address.574///575EFI_IPv4_ADDRESS RemoteIpAddress;576///577/// The local port number.578///579UINT16 LocalPort;580///581/// The remote port number.582///583UINT16 RemotePort;584///585/// The network protocol(i.e. UDP, TCP).586///587UINT16 Protocol;588///589/// 0x00 - The Source IP Address was assigned though DHCP.590/// 0x01 - The Source IP Address is statically bound.591///592BOOLEAN StaticIpAddress;593///594/// The gateway IP address595///596EFI_IPv4_ADDRESS GatewayIpAddress;597///598/// The subnet mask599///600EFI_IPv4_ADDRESS SubnetMask;601} IPv4_DEVICE_PATH;602603///604/// IPv6 Device Path SubType.605///606#define MSG_IPv6_DP 0x0d607typedef struct {608EFI_DEVICE_PATH_PROTOCOL Header;609///610/// The local IPv6 address.611///612EFI_IPv6_ADDRESS LocalIpAddress;613///614/// The remote IPv6 address.615///616EFI_IPv6_ADDRESS RemoteIpAddress;617///618/// The local port number.619///620UINT16 LocalPort;621///622/// The remote port number.623///624UINT16 RemotePort;625///626/// The network protocol(i.e. UDP, TCP).627///628UINT16 Protocol;629///630/// 0x00 - The Local IP Address was manually configured.631/// 0x01 - The Local IP Address is assigned through IPv6632/// stateless auto-configuration.633/// 0x02 - The Local IP Address is assigned through IPv6634/// stateful configuration.635///636UINT8 IpAddressOrigin;637///638/// The prefix length639///640UINT8 PrefixLength;641///642/// The gateway IP address643///644EFI_IPv6_ADDRESS GatewayIpAddress;645} IPv6_DEVICE_PATH;646647///648/// InfiniBand Device Path SubType.649///650#define MSG_INFINIBAND_DP 0x09651typedef struct {652EFI_DEVICE_PATH_PROTOCOL Header;653///654/// Flags to help identify/manage InfiniBand device path elements:655/// Bit 0 - IOC/Service (0b = IOC, 1b = Service).656/// Bit 1 - Extend Boot Environment.657/// Bit 2 - Console Protocol.658/// Bit 3 - Storage Protocol.659/// Bit 4 - Network Protocol.660/// All other bits are reserved.661///662UINT32 ResourceFlags;663///664/// 128-bit Global Identifier for remote fabric port.665///666UINT8 PortGid[16];667///668/// 64-bit unique identifier to remote IOC or server process.669/// Interpretation of field specified by Resource Flags (bit 0).670///671UINT64 ServiceId;672///673/// 64-bit persistent ID of remote IOC port.674///675UINT64 TargetPortId;676///677/// 64-bit persistent ID of remote device.678///679UINT64 DeviceId;680} INFINIBAND_DEVICE_PATH;681682#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01683#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02684#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04685#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08686#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10687688///689/// UART Device Path SubType.690///691#define MSG_UART_DP 0x0e692typedef struct {693EFI_DEVICE_PATH_PROTOCOL Header;694///695/// Reserved.696///697UINT32 Reserved;698///699/// The baud rate setting for the UART style device. A value of 0700/// means that the device's default baud rate will be used.701///702UINT64 BaudRate;703///704/// The number of data bits for the UART style device. A value705/// of 0 means that the device's default number of data bits will be used.706///707UINT8 DataBits;708///709/// The parity setting for the UART style device.710/// Parity 0x00 - Default Parity.711/// Parity 0x01 - No Parity.712/// Parity 0x02 - Even Parity.713/// Parity 0x03 - Odd Parity.714/// Parity 0x04 - Mark Parity.715/// Parity 0x05 - Space Parity.716///717UINT8 Parity;718///719/// The number of stop bits for the UART style device.720/// Stop Bits 0x00 - Default Stop Bits.721/// Stop Bits 0x01 - 1 Stop Bit.722/// Stop Bits 0x02 - 1.5 Stop Bits.723/// Stop Bits 0x03 - 2 Stop Bits.724///725UINT8 StopBits;726} UART_DEVICE_PATH;727728///729/// NVDIMM Namespace Device Path SubType.730///731#define NVDIMM_NAMESPACE_DP 0x20732typedef struct {733EFI_DEVICE_PATH_PROTOCOL Header;734///735/// Namespace unique label identifier UUID.736///737EFI_GUID Uuid;738} NVDIMM_NAMESPACE_DEVICE_PATH;739740//741// Use VENDOR_DEVICE_PATH struct742//743#define MSG_VENDOR_DP 0x0a744typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;745746#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID747#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID748#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID749#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID750751///752/// A new device path node is defined to declare flow control characteristics.753/// UART Flow Control Messaging Device Path754///755typedef struct {756EFI_DEVICE_PATH_PROTOCOL Header;757///758/// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.759///760EFI_GUID Guid;761///762/// Bitmap of supported flow control types.763/// Bit 0 set indicates hardware flow control.764/// Bit 1 set indicates Xon/Xoff flow control.765/// All other bits are reserved and are clear.766///767UINT32 FlowControlMap;768} UART_FLOW_CONTROL_DEVICE_PATH;769770#define UART_FLOW_CONTROL_HARDWARE 0x00000001771#define UART_FLOW_CONTROL_XON_XOFF 0x00000010772773#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID774///775/// Serial Attached SCSI (SAS) Device Path.776///777typedef struct {778EFI_DEVICE_PATH_PROTOCOL Header;779///780/// DEVICE_PATH_MESSAGING_SAS GUID.781///782EFI_GUID Guid;783///784/// Reserved for future use.785///786UINT32 Reserved;787///788/// SAS Address for Serial Attached SCSI Target.789///790UINT64 SasAddress;791///792/// SAS Logical Unit Number.793///794UINT64 Lun;795///796/// More Information about the device and its interconnect.797///798UINT16 DeviceTopology;799///800/// Relative Target Port (RTP).801///802UINT16 RelativeTargetPort;803} SAS_DEVICE_PATH;804805///806/// Serial Attached SCSI (SAS) Ex Device Path SubType807///808#define MSG_SASEX_DP 0x16809typedef struct {810EFI_DEVICE_PATH_PROTOCOL Header;811///812/// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.813///814UINT8 SasAddress[8];815///816/// 8-byte array of the SAS Logical Unit Number.817///818UINT8 Lun[8];819///820/// More Information about the device and its interconnect.821///822UINT16 DeviceTopology;823///824/// Relative Target Port (RTP).825///826UINT16 RelativeTargetPort;827} SASEX_DEVICE_PATH;828829///830/// NvmExpress Namespace Device Path SubType.831///832#define MSG_NVME_NAMESPACE_DP 0x17833typedef struct {834EFI_DEVICE_PATH_PROTOCOL Header;835UINT32 NamespaceId;836UINT64 NamespaceUuid;837} NVME_NAMESPACE_DEVICE_PATH;838839///840/// NVMe over Fabric (NVMe-oF) Namespace Device Path SubType.841///842#define MSG_NVME_OF_NAMESPACE_DP 0x22843typedef struct {844EFI_DEVICE_PATH_PROTOCOL Header;845///846/// Namespace Identifier Type (NIDT)847///848UINT8 NamespaceIdType;849///850/// Namespace Identifier (NID)851///852UINT8 NamespaceId[16];853///854/// Unique identifier of an NVM subsystem855///856CHAR8 SubsystemNqn[];857} NVME_OF_NAMESPACE_DEVICE_PATH;858859///860/// DNS Device Path SubType861///862#define MSG_DNS_DP 0x1F863typedef struct {864EFI_DEVICE_PATH_PROTOCOL Header;865///866/// Indicates the DNS server address is IPv4 or IPv6 address.867///868UINT8 IsIPv6;869///870/// Instance of the DNS server address.871///872EFI_IP_ADDRESS DnsServerIp[];873} DNS_DEVICE_PATH;874875///876/// Uniform Resource Identifiers (URI) Device Path SubType877///878#define MSG_URI_DP 0x18879typedef struct {880EFI_DEVICE_PATH_PROTOCOL Header;881///882/// Instance of the URI pursuant to RFC 3986.883///884CHAR8 Uri[];885} URI_DEVICE_PATH;886887///888/// Universal Flash Storage (UFS) Device Path SubType.889///890#define MSG_UFS_DP 0x19891typedef struct {892EFI_DEVICE_PATH_PROTOCOL Header;893///894/// Target ID on the UFS bus (PUN).895///896UINT8 Pun;897///898/// Logical Unit Number (LUN).899///900UINT8 Lun;901} UFS_DEVICE_PATH;902903///904/// SD (Secure Digital) Device Path SubType.905///906#define MSG_SD_DP 0x1A907typedef struct {908EFI_DEVICE_PATH_PROTOCOL Header;909UINT8 SlotNumber;910} SD_DEVICE_PATH;911912///913/// EMMC (Embedded MMC) Device Path SubType.914///915#define MSG_EMMC_DP 0x1D916typedef struct {917EFI_DEVICE_PATH_PROTOCOL Header;918UINT8 SlotNumber;919} EMMC_DEVICE_PATH;920921///922/// iSCSI Device Path SubType923///924#define MSG_ISCSI_DP 0x13925typedef struct {926EFI_DEVICE_PATH_PROTOCOL Header;927///928/// Network Protocol (0 = TCP, 1+ = reserved).929///930UINT16 NetworkProtocol;931///932/// iSCSI Login Options.933///934UINT16 LoginOption;935///936/// iSCSI Logical Unit Number.937///938UINT64 Lun;939///940/// iSCSI Target Portal group tag the initiator intends941/// to establish a session with.942///943UINT16 TargetPortalGroupTag;944///945/// iSCSI NodeTarget Name. The length of the name946/// is determined by subtracting the offset of this field from Length.947///948/// CHAR8 iSCSI Target Name.949} ISCSI_DEVICE_PATH;950951#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000952#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002953#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000954#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008955#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000956#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000957#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000958#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000959960///961/// VLAN Device Path SubType.962///963#define MSG_VLAN_DP 0x14964typedef struct {965EFI_DEVICE_PATH_PROTOCOL Header;966///967/// VLAN identifier (0-4094).968///969UINT16 VlanId;970} VLAN_DEVICE_PATH;971972///973/// Bluetooth Device Path SubType.974///975#define MSG_BLUETOOTH_DP 0x1b976typedef struct {977EFI_DEVICE_PATH_PROTOCOL Header;978///979/// 48bit Bluetooth device address.980///981BLUETOOTH_ADDRESS BD_ADDR;982} BLUETOOTH_DEVICE_PATH;983984///985/// Wi-Fi Device Path SubType.986///987#define MSG_WIFI_DP 0x1C988typedef struct {989EFI_DEVICE_PATH_PROTOCOL Header;990///991/// Service set identifier. A 32-byte octets string.992///993UINT8 SSId[32];994} WIFI_DEVICE_PATH;995996///997/// Bluetooth LE Device Path SubType.998///999#define MSG_BLUETOOTH_LE_DP 0x1E1000typedef struct {1001EFI_DEVICE_PATH_PROTOCOL Header;1002BLUETOOTH_LE_ADDRESS Address;1003} BLUETOOTH_LE_DEVICE_PATH;10041005//1006// Media Device Path1007//1008#define MEDIA_DEVICE_PATH 0x0410091010///1011/// Hard Drive Media Device Path SubType.1012///1013#define MEDIA_HARDDRIVE_DP 0x0110141015///1016/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.1017///1018typedef struct {1019EFI_DEVICE_PATH_PROTOCOL Header;1020///1021/// Describes the entry in a partition table, starting with entry 1.1022/// Partition number zero represents the entire device. Valid1023/// partition numbers for a MBR partition are [1, 4]. Valid1024/// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].1025///1026UINT32 PartitionNumber;1027///1028/// Starting LBA of the partition on the hard drive.1029///1030UINT64 PartitionStart;1031///1032/// Size of the partition in units of Logical Blocks.1033///1034UINT64 PartitionSize;1035///1036/// Signature unique to this partition:1037/// If SignatureType is 0, this field has to be initialized with 16 zeros.1038/// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.1039/// The other 12 bytes are initialized with zeros.1040/// If SignatureType is 2, this field contains a 16 byte signature.1041///1042UINT8 Signature[16];1043///1044/// Partition Format: (Unused values reserved).1045/// 0x01 - PC-AT compatible legacy MBR.1046/// 0x02 - GUID Partition Table.1047///1048UINT8 MBRType;1049///1050/// Type of Disk Signature: (Unused values reserved).1051/// 0x00 - No Disk Signature.1052/// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.1053/// 0x02 - GUID signature.1054///1055UINT8 SignatureType;1056} HARDDRIVE_DEVICE_PATH;10571058#define MBR_TYPE_PCAT 0x011059#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x0210601061#define NO_DISK_SIGNATURE 0x001062#define SIGNATURE_TYPE_MBR 0x011063#define SIGNATURE_TYPE_GUID 0x0210641065///1066/// CD-ROM Media Device Path SubType.1067///1068#define MEDIA_CDROM_DP 0x0210691070///1071/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.1072///1073typedef struct {1074EFI_DEVICE_PATH_PROTOCOL Header;1075///1076/// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.1077///1078UINT32 BootEntry;1079///1080/// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.1081///1082UINT64 PartitionStart;1083///1084/// Size of the partition in units of Blocks, also called Sectors.1085///1086UINT64 PartitionSize;1087} CDROM_DEVICE_PATH;10881089//1090// Use VENDOR_DEVICE_PATH struct1091//1092#define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype.10931094///1095/// File Path Media Device Path SubType1096///1097#define MEDIA_FILEPATH_DP 0x041098typedef struct {1099EFI_DEVICE_PATH_PROTOCOL Header;1100///1101/// A NULL-terminated Path string including directory and file names.1102///1103CHAR16 PathName[1];1104} FILEPATH_DEVICE_PATH;11051106#define SIZE_OF_FILEPATH_DEVICE_PATH OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)11071108///1109/// Media Protocol Device Path SubType.1110///1111#define MEDIA_PROTOCOL_DP 0x0511121113///1114/// The Media Protocol Device Path is used to denote the protocol that is being1115/// used in a device path at the location of the path specified.1116/// Many protocols are inherent to the style of device path.1117///1118typedef struct {1119EFI_DEVICE_PATH_PROTOCOL Header;1120///1121/// The ID of the protocol.1122///1123EFI_GUID Protocol;1124} MEDIA_PROTOCOL_DEVICE_PATH;11251126///1127/// PIWG Firmware File SubType.1128///1129#define MEDIA_PIWG_FW_FILE_DP 0x0611301131///1132/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.1133///1134typedef struct {1135EFI_DEVICE_PATH_PROTOCOL Header;1136///1137/// Firmware file name1138///1139EFI_GUID FvFileName;1140} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;11411142///1143/// PIWG Firmware Volume Device Path SubType.1144///1145#define MEDIA_PIWG_FW_VOL_DP 0x0711461147///1148/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.1149///1150typedef struct {1151EFI_DEVICE_PATH_PROTOCOL Header;1152///1153/// Firmware volume name.1154///1155EFI_GUID FvName;1156} MEDIA_FW_VOL_DEVICE_PATH;11571158///1159/// Media relative offset range device path.1160///1161#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x0811621163///1164/// Used to describe the offset range of media relative.1165///1166typedef struct {1167EFI_DEVICE_PATH_PROTOCOL Header;1168UINT32 Reserved;1169UINT64 StartingOffset;1170UINT64 EndingOffset;1171} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;11721173///1174/// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.1175///1176#define EFI_VIRTUAL_DISK_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE11771178extern EFI_GUID gEfiVirtualDiskGuid;11791180///1181/// This GUID defines a RAM Disk supporting an ISO image in volatile memory.1182///1183#define EFI_VIRTUAL_CD_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE11841185extern EFI_GUID gEfiVirtualCdGuid;11861187///1188/// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.1189///1190#define EFI_PERSISTENT_VIRTUAL_DISK_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT11911192extern EFI_GUID gEfiPersistentVirtualDiskGuid;11931194///1195/// This GUID defines a RAM Disk supporting an ISO image in persistent memory.1196///1197#define EFI_PERSISTENT_VIRTUAL_CD_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT11981199extern EFI_GUID gEfiPersistentVirtualCdGuid;12001201///1202/// Media ram disk device path.1203///1204#define MEDIA_RAM_DISK_DP 0x0912051206///1207/// Used to describe the ram disk device path.1208///1209typedef struct {1210EFI_DEVICE_PATH_PROTOCOL Header;1211///1212/// Starting Memory Address.1213///1214UINT32 StartingAddr[2];1215///1216/// Ending Memory Address.1217///1218UINT32 EndingAddr[2];1219///1220/// GUID that defines the type of the RAM Disk.1221///1222EFI_GUID TypeGuid;1223///1224/// RAM Diskinstance number, if supported. The default value is zero.1225///1226UINT16 Instance;1227} MEDIA_RAM_DISK_DEVICE_PATH;12281229///1230/// BIOS Boot Specification Device Path.1231///1232#define BBS_DEVICE_PATH 0x0512331234///1235/// BIOS Boot Specification Device Path SubType.1236///1237#define BBS_BBS_DP 0x0112381239///1240/// This Device Path is used to describe the booting of non-EFI-aware operating systems.1241///1242typedef struct {1243EFI_DEVICE_PATH_PROTOCOL Header;1244///1245/// Device Type as defined by the BIOS Boot Specification.1246///1247UINT16 DeviceType;1248///1249/// Status Flags as defined by the BIOS Boot Specification.1250///1251UINT16 StatusFlag;1252///1253/// Null-terminated ASCII string that describes the boot device to a user.1254///1255CHAR8 String[1];1256} BBS_BBS_DEVICE_PATH;12571258//1259// DeviceType definitions - from BBS specification1260//1261#define BBS_TYPE_FLOPPY 0x011262#define BBS_TYPE_HARDDRIVE 0x021263#define BBS_TYPE_CDROM 0x031264#define BBS_TYPE_PCMCIA 0x041265#define BBS_TYPE_USB 0x051266#define BBS_TYPE_EMBEDDED_NETWORK 0x061267#define BBS_TYPE_BEV 0x801268#define BBS_TYPE_UNKNOWN 0xFF12691270///1271/// Union of all possible Device Paths and pointers to Device Paths.1272///1273typedef union {1274EFI_DEVICE_PATH_PROTOCOL DevPath;1275PCI_DEVICE_PATH Pci;1276PCCARD_DEVICE_PATH PcCard;1277MEMMAP_DEVICE_PATH MemMap;1278VENDOR_DEVICE_PATH Vendor;12791280CONTROLLER_DEVICE_PATH Controller;1281BMC_DEVICE_PATH Bmc;1282ACPI_HID_DEVICE_PATH Acpi;1283ACPI_EXTENDED_HID_DEVICE_PATH ExtendedAcpi;1284ACPI_ADR_DEVICE_PATH AcpiAdr;12851286ATAPI_DEVICE_PATH Atapi;1287SCSI_DEVICE_PATH Scsi;1288ISCSI_DEVICE_PATH Iscsi;1289FIBRECHANNEL_DEVICE_PATH FibreChannel;1290FIBRECHANNELEX_DEVICE_PATH FibreChannelEx;12911292F1394_DEVICE_PATH F1394;1293USB_DEVICE_PATH Usb;1294SATA_DEVICE_PATH Sata;1295USB_CLASS_DEVICE_PATH UsbClass;1296USB_WWID_DEVICE_PATH UsbWwid;1297DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit;1298I2O_DEVICE_PATH I2O;1299MAC_ADDR_DEVICE_PATH MacAddr;1300IPv4_DEVICE_PATH Ipv4;1301IPv6_DEVICE_PATH Ipv6;1302VLAN_DEVICE_PATH Vlan;1303INFINIBAND_DEVICE_PATH InfiniBand;1304UART_DEVICE_PATH Uart;1305UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;1306SAS_DEVICE_PATH Sas;1307SASEX_DEVICE_PATH SasEx;1308NVME_NAMESPACE_DEVICE_PATH NvmeNamespace;1309NVME_OF_NAMESPACE_DEVICE_PATH NvmeOfNamespace;1310DNS_DEVICE_PATH Dns;1311URI_DEVICE_PATH Uri;1312BLUETOOTH_DEVICE_PATH Bluetooth;1313WIFI_DEVICE_PATH WiFi;1314UFS_DEVICE_PATH Ufs;1315SD_DEVICE_PATH Sd;1316EMMC_DEVICE_PATH Emmc;1317HARDDRIVE_DEVICE_PATH HardDrive;1318CDROM_DEVICE_PATH CD;13191320FILEPATH_DEVICE_PATH FilePath;1321MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;13221323MEDIA_FW_VOL_DEVICE_PATH FirmwareVolume;1324MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FirmwareFile;1325MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset;1326MEDIA_RAM_DISK_DEVICE_PATH RamDisk;1327BBS_BBS_DEVICE_PATH Bbs;1328} EFI_DEV_PATH;13291330typedef union {1331EFI_DEVICE_PATH_PROTOCOL *DevPath;1332PCI_DEVICE_PATH *Pci;1333PCCARD_DEVICE_PATH *PcCard;1334MEMMAP_DEVICE_PATH *MemMap;1335VENDOR_DEVICE_PATH *Vendor;13361337CONTROLLER_DEVICE_PATH *Controller;1338BMC_DEVICE_PATH *Bmc;1339ACPI_HID_DEVICE_PATH *Acpi;1340ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;1341ACPI_ADR_DEVICE_PATH *AcpiAdr;13421343ATAPI_DEVICE_PATH *Atapi;1344SCSI_DEVICE_PATH *Scsi;1345ISCSI_DEVICE_PATH *Iscsi;1346FIBRECHANNEL_DEVICE_PATH *FibreChannel;1347FIBRECHANNELEX_DEVICE_PATH *FibreChannelEx;13481349F1394_DEVICE_PATH *F1394;1350USB_DEVICE_PATH *Usb;1351SATA_DEVICE_PATH *Sata;1352USB_CLASS_DEVICE_PATH *UsbClass;1353USB_WWID_DEVICE_PATH *UsbWwid;1354DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicUnit;1355I2O_DEVICE_PATH *I2O;1356MAC_ADDR_DEVICE_PATH *MacAddr;1357IPv4_DEVICE_PATH *Ipv4;1358IPv6_DEVICE_PATH *Ipv6;1359VLAN_DEVICE_PATH *Vlan;1360INFINIBAND_DEVICE_PATH *InfiniBand;1361UART_DEVICE_PATH *Uart;1362UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;1363SAS_DEVICE_PATH *Sas;1364SASEX_DEVICE_PATH *SasEx;1365NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace;1366NVME_OF_NAMESPACE_DEVICE_PATH *NvmeOfNamespace;1367DNS_DEVICE_PATH *Dns;1368URI_DEVICE_PATH *Uri;1369BLUETOOTH_DEVICE_PATH *Bluetooth;1370WIFI_DEVICE_PATH *WiFi;1371UFS_DEVICE_PATH *Ufs;1372SD_DEVICE_PATH *Sd;1373EMMC_DEVICE_PATH *Emmc;1374HARDDRIVE_DEVICE_PATH *HardDrive;1375CDROM_DEVICE_PATH *CD;13761377FILEPATH_DEVICE_PATH *FilePath;1378MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;13791380MEDIA_FW_VOL_DEVICE_PATH *FirmwareVolume;1381MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FirmwareFile;1382MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;1383MEDIA_RAM_DISK_DEVICE_PATH *RamDisk;1384BBS_BBS_DEVICE_PATH *Bbs;1385UINT8 *Raw;1386} EFI_DEV_PATH_PTR;13871388#pragma pack()13891390#define END_DEVICE_PATH_TYPE 0x7f1391#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF1392#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x0113931394extern EFI_GUID gEfiDevicePathProtocolGuid;13951396#endif139713981399