]> 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 1286372f03a6aea8592081fb8887185806ede742..23042057546bf2d6795e82a93a86866ee185e54d 100644 (file)
 \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
@@ -506,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