]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/DevicePath.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / DevicePath.h
index 47518961f886517dcafb2ea38cfcdeb534525724..aaec0a6848725bbc715a7c9617f875317e4ee258 100644 (file)
@@ -2,17 +2,11 @@
   The device path protocol as defined in UEFI 2.0.\r
 \r
   The device path represents a programmatic path to a device,\r
-  from a software point of view. The path must persist from boot to boot, so \r
+  from a software point of view. The path must persist from boot to boot, so\r
   it can not contain things like PCI bus numbers that change from boot to boot.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution.  \r
-The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php.                                          \r
-    \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.              \r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -20,6 +14,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define __EFI_DEVICE_PATH_PROTOCOL_H__\r
 \r
 #include <Guid/PcAnsi.h>\r
+#include <IndustryStandard/Bluetooth.h>\r
+#include <IndustryStandard/Acpi60.h>\r
 \r
 ///\r
 /// Device Path protocol.\r
@@ -37,11 +33,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #pragma pack(1)\r
 \r
 /**\r
-  This protocol can be used on any device handle to obtain generic path/location \r
-  information concerning the physical device or logical device. If the handle does \r
-  not logically map to a physical device, the handle may not necessarily support \r
-  the device path protocol. The device path describes the location of the device \r
-  the handle is for. The size of the Device Path can be determined from the structures \r
+  This protocol can be used on any device handle to obtain generic path/location\r
+  information concerning the physical device or logical device. If the handle does\r
+  not logically map to a physical device, the handle may not necessarily support\r
+  the device path protocol. The device path describes the location of the device\r
+  the handle is for. The size of the Device Path can be determined from the structures\r
   that make up the Device Path.\r
 **/\r
 typedef struct {\r
@@ -51,20 +47,20 @@ typedef struct {
                     ///< 0x04 Media Device Path.\r
                     ///< 0x05 BIOS Boot Specification Device Path.\r
                     ///< 0x7F End of Hardware Device Path.\r
-                    \r
+\r
   UINT8 SubType;    ///< Varies by Type\r
                     ///< 0xFF End Entire Device Path, or\r
                     ///< 0x01 End This Instance of a Device Path and start a new\r
                     ///< Device Path.\r
-                    \r
+\r
   UINT8 Length[2];  ///< Specific Device Path data. Type and Sub-Type define\r
                     ///< type of data. Size of data is included in Length.\r
-                    \r
+\r
 } EFI_DEVICE_PATH_PROTOCOL;\r
 \r
 ///\r
 /// Device Path protocol definition for backward-compatible with EFI1.1.\r
-/// \r
+///\r
 typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;\r
 \r
 ///\r
@@ -169,6 +165,26 @@ typedef struct {
   UINT32                          ControllerNumber;\r
 } CONTROLLER_DEVICE_PATH;\r
 \r
+///\r
+/// BMC Device Path SubType.\r
+///\r
+#define HW_BMC_DP                 0x06\r
+\r
+///\r
+/// BMC Device Path.\r
+///\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// Interface Type.\r
+  ///\r
+  UINT8                           InterfaceType;\r
+  ///\r
+  /// Base Address.\r
+  ///\r
+  UINT8                           BaseAddress[8];\r
+} BMC_DEVICE_PATH;\r
+\r
 ///\r
 /// ACPI Device Paths.\r
 ///\r
@@ -273,14 +289,14 @@ typedef struct {
 #define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL  4\r
 \r
 #define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \\r
-          ((UINT32)( (((_DeviceIdScheme) & 0x1) << 31) |  \\r
-                      (((_HeadId)         & 0x7) << 18) |  \\r
-                      (((_NonVgaOutput)   & 0x1) << 17) |  \\r
-                      (((_BiosCanDetect)  & 0x1) << 16) |  \\r
-                      (((_VendorInfo)     & 0xf) << 12) |  \\r
-                      (((_Type)           & 0xf) << 8)  |  \\r
-                      (((_Port)           & 0xf) << 4)  |  \\r
-                       ((_Index)          & 0xf) ))\r
+          ((UINT32)(  ((UINT32)((_DeviceIdScheme) & 0x1) << 31) |  \\r
+                      (((_HeadId)                 & 0x7) << 18) |  \\r
+                      (((_NonVgaOutput)           & 0x1) << 17) |  \\r
+                      (((_BiosCanDetect)          & 0x1) << 16) |  \\r
+                      (((_VendorInfo)             & 0xf) << 12) |  \\r
+                      (((_Type)                   & 0xf) << 8)  |  \\r
+                      (((_Port)                   & 0xf) << 4)  |  \\r
+                       ((_Index)                  & 0xf) ))\r
 \r
 ///\r
 /// Messaging Device Paths.\r
@@ -346,6 +362,26 @@ typedef struct {
   UINT64                          Lun;\r
 } FIBRECHANNEL_DEVICE_PATH;\r
 \r
+///\r
+/// Fibre Channel Ex SubType.\r
+///\r
+#define MSG_FIBRECHANNELEX_DP     0x15\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// Reserved for the future.\r
+  ///\r
+  UINT32                          Reserved;\r
+  ///\r
+  /// 8 byte array containing Fibre Channel End Device Port Name.\r
+  ///\r
+  UINT8                           WWN[8];\r
+  ///\r
+  /// 8 byte array containing Fibre Channel Logical Unit Number.\r
+  ///\r
+  UINT8                           Lun[8];\r
+} FIBRECHANNELEX_DEVICE_PATH;\r
+\r
 ///\r
 /// 1394 Device Path SubType\r
 ///\r
@@ -467,7 +503,7 @@ typedef struct {
   UINT16                          HBAPortNumber;\r
   ///\r
   /// The Port multiplier port number that facilitates the connection\r
-  /// to the device. Bit 15 should be set if the device is directly\r
+  /// to the device. Must be set to 0xFFFF if the device is directly\r
   /// connected to the HBA.\r
   ///\r
   UINT16                          PortMultiplierPortNumber;\r
@@ -541,6 +577,14 @@ typedef struct {
   /// 0x01 - The Source IP Address is statically bound.\r
   ///\r
   BOOLEAN                         StaticIpAddress;\r
+  ///\r
+  /// The gateway IP address\r
+  ///\r
+  EFI_IPv4_ADDRESS                GatewayIpAddress;\r
+  ///\r
+  /// The subnet mask\r
+  ///\r
+  EFI_IPv4_ADDRESS                SubnetMask;\r
 } IPv4_DEVICE_PATH;\r
 \r
 ///\r
@@ -570,10 +614,21 @@ typedef struct {
   ///\r
   UINT16                          Protocol;\r
   ///\r
-  /// 0x00 - The Source IP Address was assigned though DHCP.\r
-  /// 0x01 - The Source IP Address is statically bound.\r
+  /// 0x00 - The Local IP Address was manually configured.\r
+  /// 0x01 - The Local IP Address is assigned through IPv6\r
+  /// stateless auto-configuration.\r
+  /// 0x02 - The Local IP Address is assigned through IPv6\r
+  /// stateful configuration.\r
   ///\r
-  BOOLEAN                         StaticIpAddress;\r
+  UINT8                           IpAddressOrigin;\r
+  ///\r
+  /// The prefix length\r
+  ///\r
+  UINT8                           PrefixLength;\r
+  ///\r
+  /// The gateway IP address\r
+  ///\r
+  EFI_IPv6_ADDRESS                GatewayIpAddress;\r
 } IPv6_DEVICE_PATH;\r
 \r
 ///\r
@@ -722,6 +777,102 @@ typedef struct {
   UINT16                          RelativeTargetPort;\r
 } SAS_DEVICE_PATH;\r
 \r
+///\r
+/// Serial Attached SCSI (SAS) Ex Device Path SubType\r
+///\r
+#define MSG_SASEX_DP              0x16\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.\r
+  ///\r
+  UINT8                           SasAddress[8];\r
+  ///\r
+  /// 8-byte array of the SAS Logical Unit Number.\r
+  ///\r
+  UINT8                           Lun[8];\r
+  ///\r
+  /// More Information about the device and its interconnect.\r
+  ///\r
+  UINT16                          DeviceTopology;\r
+  ///\r
+  /// Relative Target Port (RTP).\r
+  ///\r
+  UINT16                          RelativeTargetPort;\r
+} SASEX_DEVICE_PATH;\r
+\r
+///\r
+/// NvmExpress Namespace Device Path SubType.\r
+///\r
+#define MSG_NVME_NAMESPACE_DP     0x17\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          NamespaceId;\r
+  UINT64                          NamespaceUuid;\r
+} NVME_NAMESPACE_DEVICE_PATH;\r
+\r
+///\r
+/// DNS Device Path SubType\r
+///\r
+#define MSG_DNS_DP                0x1F\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// Indicates the DNS server address is IPv4 or IPv6 address.\r
+  ///\r
+  UINT8                           IsIPv6;\r
+  ///\r
+  /// Instance of the DNS server address.\r
+  ///\r
+  EFI_IP_ADDRESS                  DnsServerIp[];\r
+} DNS_DEVICE_PATH;\r
+\r
+///\r
+/// Uniform Resource Identifiers (URI) Device Path SubType\r
+///\r
+#define MSG_URI_DP                0x18\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// Instance of the URI pursuant to RFC 3986.\r
+  ///\r
+  CHAR8                           Uri[];\r
+} URI_DEVICE_PATH;\r
+\r
+///\r
+/// Universal Flash Storage (UFS) Device Path SubType.\r
+///\r
+#define MSG_UFS_DP                0x19\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// Target ID on the UFS bus (PUN).\r
+  ///\r
+  UINT8                           Pun;\r
+  ///\r
+  /// Logical Unit Number (LUN).\r
+  ///\r
+  UINT8                           Lun;\r
+} UFS_DEVICE_PATH;\r
+\r
+///\r
+/// SD (Secure Digital) Device Path SubType.\r
+///\r
+#define MSG_SD_DP                 0x1A\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           SlotNumber;\r
+} SD_DEVICE_PATH;\r
+\r
+///\r
+/// EMMC (Embedded MMC) Device Path SubType.\r
+///\r
+#define MSG_EMMC_DP                 0x1D\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           SlotNumber;\r
+} EMMC_DEVICE_PATH;\r
+\r
 ///\r
 /// iSCSI Device Path SubType\r
 ///\r
@@ -773,6 +924,39 @@ typedef struct {
   UINT16                          VlanId;\r
 } VLAN_DEVICE_PATH;\r
 \r
+///\r
+/// Bluetooth Device Path SubType.\r
+///\r
+#define MSG_BLUETOOTH_DP     0x1b\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// 48bit Bluetooth device address.\r
+  ///\r
+  BLUETOOTH_ADDRESS               BD_ADDR;\r
+} BLUETOOTH_DEVICE_PATH;\r
+\r
+///\r
+/// Wi-Fi Device Path SubType.\r
+///\r
+#define MSG_WIFI_DP               0x1C\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// Service set identifier. A 32-byte octets string.\r
+  ///\r
+  UINT8                           SSId[32];\r
+} WIFI_DEVICE_PATH;\r
+\r
+///\r
+/// Bluetooth LE Device Path SubType.\r
+///\r
+#define MSG_BLUETOOTH_LE_DP       0x1E\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  BLUETOOTH_LE_ADDRESS            Address;\r
+} BLUETOOTH_LE_DEVICE_PATH;\r
+\r
 //\r
 // Media Device Path\r
 //\r
@@ -882,8 +1066,8 @@ typedef struct {
 #define MEDIA_PROTOCOL_DP         0x05\r
 \r
 ///\r
-/// The Media Protocol Device Path is used to denote the protocol that is being \r
-/// used in a device path at the location of the path specified. \r
+/// The Media Protocol Device Path is used to denote the protocol that is being\r
+/// used in a device path at the location of the path specified.\r
 /// Many protocols are inherent to the style of device path.\r
 ///\r
 typedef struct {\r
@@ -941,6 +1125,62 @@ typedef struct {
   UINT64                    EndingOffset;\r
 } MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;\r
 \r
+///\r
+/// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.\r
+///\r
+#define EFI_VIRTUAL_DISK_GUID               EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE\r
+\r
+extern  EFI_GUID                            gEfiVirtualDiskGuid;\r
+\r
+///\r
+/// This GUID defines a RAM Disk supporting an ISO image in volatile memory.\r
+///\r
+#define EFI_VIRTUAL_CD_GUID                 EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE\r
+\r
+extern  EFI_GUID                            gEfiVirtualCdGuid;\r
+\r
+///\r
+/// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.\r
+///\r
+#define EFI_PERSISTENT_VIRTUAL_DISK_GUID    EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT\r
+\r
+extern  EFI_GUID                            gEfiPersistentVirtualDiskGuid;\r
+\r
+///\r
+/// This GUID defines a RAM Disk supporting an ISO image in persistent memory.\r
+///\r
+#define EFI_PERSISTENT_VIRTUAL_CD_GUID      EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT\r
+\r
+extern  EFI_GUID                            gEfiPersistentVirtualCdGuid;\r
+\r
+///\r
+/// Media ram disk device path.\r
+///\r
+#define MEDIA_RAM_DISK_DP         0x09\r
+\r
+///\r
+/// Used to describe the ram disk device path.\r
+///\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  ///\r
+  /// Starting Memory Address.\r
+  ///\r
+  UINT32                          StartingAddr[2];\r
+  ///\r
+  /// Ending Memory Address.\r
+  ///\r
+  UINT32                          EndingAddr[2];\r
+  ///\r
+  /// GUID that defines the type of the RAM Disk.\r
+  ///\r
+  EFI_GUID                        TypeGuid;\r
+  ///\r
+  /// RAM Diskinstance number, if supported. The default value is zero.\r
+  ///\r
+  UINT16                          Instance;\r
+} MEDIA_RAM_DISK_DEVICE_PATH;\r
+\r
 ///\r
 /// BIOS Boot Specification Device Path.\r
 ///\r
@@ -965,7 +1205,7 @@ typedef struct {
   ///\r
   UINT16                          StatusFlag;\r
   ///\r
-  /// ASCIIZ string that describes the boot device to a user. \r
+  /// Null-terminated ASCII string that describes the boot device to a user.\r
   ///\r
   CHAR8                           String[1];\r
 } BBS_BBS_DEVICE_PATH;\r
@@ -994,6 +1234,7 @@ typedef union {
   VENDOR_DEVICE_PATH                         Vendor;\r
 \r
   CONTROLLER_DEVICE_PATH                     Controller;\r
+  BMC_DEVICE_PATH                            Bmc;\r
   ACPI_HID_DEVICE_PATH                       Acpi;\r
   ACPI_EXTENDED_HID_DEVICE_PATH              ExtendedAcpi;\r
   ACPI_ADR_DEVICE_PATH                       AcpiAdr;\r
@@ -1002,6 +1243,7 @@ typedef union {
   SCSI_DEVICE_PATH                           Scsi;\r
   ISCSI_DEVICE_PATH                          Iscsi;\r
   FIBRECHANNEL_DEVICE_PATH                   FibreChannel;\r
+  FIBRECHANNELEX_DEVICE_PATH                 FibreChannelEx;\r
 \r
   F1394_DEVICE_PATH                          F1394;\r
   USB_DEVICE_PATH                            Usb;\r
@@ -1018,6 +1260,15 @@ typedef union {
   UART_DEVICE_PATH                           Uart;\r
   UART_FLOW_CONTROL_DEVICE_PATH              UartFlowControl;\r
   SAS_DEVICE_PATH                            Sas;\r
+  SASEX_DEVICE_PATH                          SasEx;\r
+  NVME_NAMESPACE_DEVICE_PATH                 NvmeNamespace;\r
+  DNS_DEVICE_PATH                            Dns;\r
+  URI_DEVICE_PATH                            Uri;\r
+  BLUETOOTH_DEVICE_PATH                      Bluetooth;\r
+  WIFI_DEVICE_PATH                           WiFi;\r
+  UFS_DEVICE_PATH                            Ufs;\r
+  SD_DEVICE_PATH                             Sd;\r
+  EMMC_DEVICE_PATH                           Emmc;\r
   HARDDRIVE_DEVICE_PATH                      HardDrive;\r
   CDROM_DEVICE_PATH                          CD;\r
 \r
@@ -1027,7 +1278,7 @@ typedef union {
   MEDIA_FW_VOL_DEVICE_PATH                   FirmwareVolume;\r
   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH          FirmwareFile;\r
   MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH    Offset;\r
-\r
+  MEDIA_RAM_DISK_DEVICE_PATH                 RamDisk;\r
   BBS_BBS_DEVICE_PATH                        Bbs;\r
 } EFI_DEV_PATH;\r
 \r
@@ -1041,6 +1292,7 @@ typedef union {
   VENDOR_DEVICE_PATH                         *Vendor;\r
 \r
   CONTROLLER_DEVICE_PATH                     *Controller;\r
+  BMC_DEVICE_PATH                            *Bmc;\r
   ACPI_HID_DEVICE_PATH                       *Acpi;\r
   ACPI_EXTENDED_HID_DEVICE_PATH              *ExtendedAcpi;\r
   ACPI_ADR_DEVICE_PATH                       *AcpiAdr;\r
@@ -1049,6 +1301,7 @@ typedef union {
   SCSI_DEVICE_PATH                           *Scsi;\r
   ISCSI_DEVICE_PATH                          *Iscsi;\r
   FIBRECHANNEL_DEVICE_PATH                   *FibreChannel;\r
+  FIBRECHANNELEX_DEVICE_PATH                 *FibreChannelEx;\r
 \r
   F1394_DEVICE_PATH                          *F1394;\r
   USB_DEVICE_PATH                            *Usb;\r
@@ -1065,6 +1318,15 @@ typedef union {
   UART_DEVICE_PATH                           *Uart;\r
   UART_FLOW_CONTROL_DEVICE_PATH              *UartFlowControl;\r
   SAS_DEVICE_PATH                            *Sas;\r
+  SASEX_DEVICE_PATH                          *SasEx;\r
+  NVME_NAMESPACE_DEVICE_PATH                 *NvmeNamespace;\r
+  DNS_DEVICE_PATH                            *Dns;\r
+  URI_DEVICE_PATH                            *Uri;\r
+  BLUETOOTH_DEVICE_PATH                      *Bluetooth;\r
+  WIFI_DEVICE_PATH                           *WiFi;\r
+  UFS_DEVICE_PATH                            *Ufs;\r
+  SD_DEVICE_PATH                             *Sd;\r
+  EMMC_DEVICE_PATH                           *Emmc;\r
   HARDDRIVE_DEVICE_PATH                      *HardDrive;\r
   CDROM_DEVICE_PATH                          *CD;\r
 \r
@@ -1074,13 +1336,13 @@ typedef union {
   MEDIA_FW_VOL_DEVICE_PATH                   *FirmwareVolume;\r
   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH          *FirmwareFile;\r
   MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH    *Offset;\r
-\r
+  MEDIA_RAM_DISK_DEVICE_PATH                 *RamDisk;\r
   BBS_BBS_DEVICE_PATH                        *Bbs;\r
   UINT8                                      *Raw;\r
 } EFI_DEV_PATH_PTR;\r
 \r
 #pragma pack()\r
-                                             \r
+\r
 #define END_DEVICE_PATH_TYPE                 0x7f\r
 #define END_ENTIRE_DEVICE_PATH_SUBTYPE       0xFF\r
 #define END_INSTANCE_DEVICE_PATH_SUBTYPE     0x01\r