summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/efi/Protocol/DevicePath.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gpxe/efi/Protocol/DevicePath.h')
-rw-r--r--src/include/gpxe/efi/Protocol/DevicePath.h77
1 files changed, 26 insertions, 51 deletions
diff --git a/src/include/gpxe/efi/Protocol/DevicePath.h b/src/include/gpxe/efi/Protocol/DevicePath.h
index 5fb7bf66..e847668f 100644
--- a/src/include/gpxe/efi/Protocol/DevicePath.h
+++ b/src/include/gpxe/efi/Protocol/DevicePath.h
@@ -40,10 +40,30 @@
#pragma pack(1)
+/**
+ This protocol can be used on any device handle to obtain generic path/location
+ 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 {
- UINT8 Type;
- UINT8 SubType;
- UINT8 Length[2];
+ UINT8 Type; ///< 0x01 Hardware Device Path
+ ///< 0x02 ACPI Device Path
+ ///< 0x03 Messaging Device Path
+ ///< 0x04 Media Device Path
+ ///< 0x05 BIOS Boot Specification Device Path
+ ///< 0x7F End of Hardware Device Path
+
+ UINT8 SubType; ///< Varies by Type
+ ///< 0xFF End Entire Device Path, or
+ ///< 0x01 End This Instance of a Device Path and start a new
+ ///< Device Path
+
+ UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
+ ///< type of data. Size of data is included in Length.
+
} EFI_DEVICE_PATH_PROTOCOL;
///
@@ -110,6 +130,7 @@ typedef struct {
///
/// Optional variable length _HIDSTR
/// Optional variable length _UIDSTR
+ /// Optional variable length _CIDSTR
///
} ACPI_EXTENDED_HID_DEVICE_PATH;
@@ -505,55 +526,9 @@ typedef union {
#pragma pack()
-#define EFI_DP_TYPE_MASK 0x7F
-#define EFI_DP_TYPE_UNPACKED 0x80
#define END_DEVICE_PATH_TYPE 0x7f
-
-#define EFI_END_ENTIRE_DEVICE_PATH 0xff
-#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
-#define EFI_END_INSTANCE_DEVICE_PATH 0x01
-#define END_ENTIRE_DEVICE_PATH_SUBTYPE EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE
-#define END_INSTANCE_DEVICE_PATH_SUBTYPE EFI_END_INSTANCE_DEVICE_PATH
-
-#define EFI_END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL))
-#define END_DEVICE_PATH_LENGTH EFI_END_DEVICE_PATH_LENGTH
-
-#define DP_IS_END_TYPE(a)
-#define DP_IS_END_SUBTYPE(a) (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)
-#define DevicePathSubType(a) ((a)->SubType)
-#define IsDevicePathUnpacked(a) ((a)->Type & EFI_DP_TYPE_UNPACKED)
-
-#define EfiDevicePathNodeLength(a) (((a)->Length[0]) | ((a)->Length[1] << 8))
-#define DevicePathNodeLength(a) (EfiDevicePathNodeLength(a))
-#define EfiNextDevicePathNode(a) ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))
-#define NextDevicePathNode(a) (EfiNextDevicePathNode(a))
-
-#define EfiDevicePathType(a) (((a)->Type) & EFI_DP_TYPE_MASK)
-#define DevicePathType(a) (EfiDevicePathType(a))
-#define EfiIsDevicePathEndType(a) (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)
-#define IsDevicePathEndType(a) (EfiIsDevicePathEndType(a))
-
-
-#define EfiIsDevicePathEndSubType(a) ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)
-#define IsDevicePathEndSubType(a) (EfiIsDevicePathEndSubType(a))
-#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)
-
-#define EfiIsDevicePathEnd(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))
-#define IsDevicePathEnd(a) (EfiIsDevicePathEnd(a))
-#define EfiIsDevicePathEndInstance(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))
-
-
-#define SetDevicePathNodeLength(a,l) { \
- (a)->Length[0] = (UINT8) (l); \
- (a)->Length[1] = (UINT8) ((l) >> 8); \
- }
-
-#define SetDevicePathEndNode(a) { \
- (a)->Type = END_DEVICE_PATH_TYPE; \
- (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
- (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL); \
- (a)->Length[1] = 0; \
- }
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
extern EFI_GUID gEfiDevicePathProtocolGuid;