]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/DevicePath.h
Update comments for Protocol definitions to match UEFI spec.
[mirror_edk2.git] / MdePkg / Include / Protocol / DevicePath.h
index c7653a4b99cde068a0d9a5b7b9e39c49389609b6..23042057546bf2d6795e82a93a86866ee185e54d 100644 (file)
@@ -5,7 +5,7 @@
   from a software point of view. It also 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, Intel Corporation                                                         \r
+  Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -21,9 +21,9 @@
 \r
 #include <Guid/PcAnsi.h>\r
 \r
-//\r
-// Device Path protocol\r
-//\r
+///\r
+/// Device Path protocol\r
+///\r
 #define EFI_DEVICE_PATH_PROTOCOL_GUID \\r
   { \\r
     0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
 // Protocol GUID defined in EFI1.1.\r
 // \r
 \r
-//\r
-// Device Path information\r
-//\r
+///\r
+/// Device Path information\r
+///\r
 #define DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH_PROTOCOL_GUID\r
 \r
 #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
+  that make up the Device Path.\r
+**/\r
 typedef struct {\r
-  UINT8 Type;\r
-  UINT8 SubType;\r
-  UINT8 Length[2];\r
+  UINT8 Type;       ///< 0x01 Hardware Device Path\r
+                    ///< 0x02 ACPI Device Path\r
+                    ///< 0x03 Messaging Device Path\r
+                    ///< 0x04 Media Device Path\r
+                    ///< 0x05 BIOS Boot Specification Device Path\r
+                    ///< 0x7F End of Hardware Device Path\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
+  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
 } EFI_DEVICE_PATH_PROTOCOL;\r
 \r
-//\r
-// For backward-compatible with EFI1.1.\r
-// \r
+///\r
+/// For backward-compatible with EFI1.1.\r
+/// \r
 typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;\r
 \r
-//\r
-// Hardware Device Paths\r
-//\r
+///\r
+/// Hardware Device Paths\r
+///\r
 #define HARDWARE_DEVICE_PATH      0x01\r
 \r
 #define HW_PCI_DP                 0x01\r
@@ -89,9 +109,9 @@ typedef struct {
   UINT32                          ControllerNumber;\r
 } CONTROLLER_DEVICE_PATH;\r
 \r
-//\r
-// ACPI Device Paths\r
-//\r
+///\r
+/// ACPI Device Paths\r
+///\r
 #define ACPI_DEVICE_PATH          0x02\r
 \r
 #define ACPI_DP                   0x01\r
@@ -107,10 +127,11 @@ typedef struct {
   UINT32                          HID;\r
   UINT32                          UID;\r
   UINT32                          CID;\r
-  //\r
-  // Optional variable length _HIDSTR\r
-  // Optional variable length _UIDSTR\r
-  //\r
+  ///\r
+  /// Optional variable length _HIDSTR\r
+  /// Optional variable length _UIDSTR\r
+  /// Optional variable length _CIDSTR\r
+  ///\r
 } ACPI_EXTENDED_HID_DEVICE_PATH;\r
 \r
 //\r
@@ -151,9 +172,9 @@ typedef struct {
                       (((_Port)           & 0xf) << 4)  |  \\r
                        ((_Index)          & 0xf) ))\r
 \r
-//\r
-// Messaging Device Paths\r
-//\r
+///\r
+/// Messaging Device Paths\r
+///\r
 #define MESSAGING_DEVICE_PATH     0x03\r
 \r
 #define MSG_ATAPI_DP              0x01\r
@@ -426,9 +447,9 @@ typedef struct {
 #define BBS_TYPE_UNKNOWN          0xFF\r
 \r
 \r
-//\r
-// Union of all possible Device Paths and pointers to Device Paths\r
-//\r
+///\r
+/// Union of all possible Device Paths and pointers to Device Paths\r
+///\r
 \r
 typedef union {\r
   EFI_DEVICE_PATH_PROTOCOL             DevPath;\r
@@ -505,55 +526,9 @@ typedef union {
 \r
 #pragma pack()\r
                                              \r
-#define EFI_DP_TYPE_MASK                     0x7F\r
-#define EFI_DP_TYPE_UNPACKED                 0x80\r
 #define END_DEVICE_PATH_TYPE                 0x7f\r
-                                             \r
-#define EFI_END_ENTIRE_DEVICE_PATH           0xff\r
-#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE   0xff\r
-#define EFI_END_INSTANCE_DEVICE_PATH         0x01\r
-#define END_ENTIRE_DEVICE_PATH_SUBTYPE       EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE\r
-#define END_INSTANCE_DEVICE_PATH_SUBTYPE     EFI_END_INSTANCE_DEVICE_PATH\r
-                                             \r
-#define EFI_END_DEVICE_PATH_LENGTH           (sizeof (EFI_DEVICE_PATH_PROTOCOL))\r
-#define END_DEVICE_PATH_LENGTH               EFI_END_DEVICE_PATH_LENGTH\r
-                                             \r
-#define DP_IS_END_TYPE(a)                    \r
-#define DP_IS_END_SUBTYPE(a)                 (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
-#define DevicePathSubType(a)                 ((a)->SubType)\r
-#define IsDevicePathUnpacked(a)              ((a)->Type & EFI_DP_TYPE_UNPACKED)\r
-                                             \r
-#define EfiDevicePathNodeLength(a)           (((a)->Length[0]) | ((a)->Length[1] << 8))\r
-#define DevicePathNodeLength(a)              (EfiDevicePathNodeLength(a))\r
-#define EfiNextDevicePathNode(a)             ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))\r
-#define NextDevicePathNode(a)                (EfiNextDevicePathNode(a)) \r
-                                             \r
-#define EfiDevicePathType(a)                 (((a)->Type) & EFI_DP_TYPE_MASK)\r
-#define DevicePathType(a)                    (EfiDevicePathType(a))\r
-#define EfiIsDevicePathEndType(a)            (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)\r
-#define IsDevicePathEndType(a)               (EfiIsDevicePathEndType(a)) \r
-                                             \r
-                                             \r
-#define EfiIsDevicePathEndSubType(a)         ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
-#define IsDevicePathEndSubType(a)            (EfiIsDevicePathEndSubType(a))\r
-#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)\r
-                                             \r
-#define EfiIsDevicePathEnd(a)                (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))\r
-#define IsDevicePathEnd(a)                   (EfiIsDevicePathEnd(a))\r
-#define EfiIsDevicePathEndInstance(a)        (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))\r
-\r
-\r
-#define SetDevicePathNodeLength(a,l) {                           \\r
-          (a)->Length[0] = (UINT8) (l);                          \\r
-          (a)->Length[1] = (UINT8) ((l) >> 8);                   \\r
-          }\r
-\r
-#define SetDevicePathEndNode(a)  {                               \\r
-          (a)->Type = END_DEVICE_PATH_TYPE;                      \\r
-          (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;         \\r
-          (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL);     \\r
-          (a)->Length[1] = 0;                                    \\r
-          }\r
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE       0xFF\r
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE     0x01\r
 \r
 extern EFI_GUID gEfiDevicePathProtocolGuid;\r
 \r