2 EFI_DEVICE_PATH_UTILITIES_PROTOCOL as defined in UEFI 2.0.
3 Use to create and manipulate device paths and device nodes.
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 Module Name: DevicePathUtilities.h
18 #ifndef __DEVICE_PATH_UTILITIES_PROTOCOL_H__
19 #define __DEVICE_PATH_UTILITIES_PROTOCOL_H__
22 #include <Protocol/DevicePath.h>
25 // Device Path Utilities protocol
27 #define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
29 0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \
33 Returns the size of the device path, in bytes.
35 @param DevicePath Points to the start of the EFI device path.
37 @revtal Size Size of the specified device path, in bytes, including the end-of-path tag.
42 (EFIAPI
*EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE
) (
43 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
49 Create a duplicate of the specified path.
51 @param DevicePath Points to the source EFI device path.
53 @retval Pointer A pointer to the duplicate device path.
54 @retval NULL insufficient memory
58 EFI_DEVICE_PATH_PROTOCOL
*
59 (EFIAPI
*EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH
) (
60 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
65 Create a new path by appending the second device path to the first.
67 @param Src1 Points to the first device path. If NULL, then it is ignored.
68 @param Src2 Points to the second device path. If NULL, then it is ignored.
70 @retval Pointer A pointer to the newly created device path.
71 @retval NULL Memory could not be allocated
72 or either DevicePath or DeviceNode is NULL.
76 EFI_DEVICE_PATH_PROTOCOL
*
77 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_PATH
) (
78 IN CONST EFI_DEVICE_PATH_PROTOCOL
*Src1
,
79 IN CONST EFI_DEVICE_PATH_PROTOCOL
*Src2
84 Creates a new path by appending the device node to the device path.
86 @param DevicePath Points to the device path.
87 @param DeviceNode Points to the device node.
89 @retval Pointer A pointer to the allocated device node.
90 @retval NULL Memory could not be allocated
91 or either DevicePath or DeviceNode is NULL.
95 EFI_DEVICE_PATH_PROTOCOL
*
96 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_NODE
) (
97 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
98 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DeviceNode
103 Creates a new path by appending the specified device path instance to the specified device path.
105 @param DevicePath Points to the device path. If NULL, then ignored.
106 @param DevicePathInstance Points to the device path instance.
108 @retval Pointer A pointer to the newly created device path
109 @retval NULL Memory could not be allocated or DevicePathInstance is NULL.
113 EFI_DEVICE_PATH_PROTOCOL
*
114 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE
) (
115 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
116 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePathInstance
121 Creates a copy of the current device path instance and returns a pointer to the next device path
124 @param DevicePathInstance On input, this holds the pointer to the current device path
125 instance. On output, this holds the pointer to the next
126 device path instance or NULL if there are no more device
127 path instances in the device path.
128 @param DevicePathInstanceSize On output, this holds the size of the device path instance,
129 in bytes or zero, if DevicePathInstance is zero.
131 @retval Pointer A pointer to the copy of the current device path instance.
132 @retval NULL DevicePathInstace was NULL on entry or there was insufficient memory.
136 EFI_DEVICE_PATH_PROTOCOL
*
137 (EFIAPI
*EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE
) (
138 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePathInstance
,
139 OUT UINTN
*DevicePathInstanceSize
144 Creates a device node
146 @param NodeType NodeType is the device node type (EFI_DEVICE_PATH.Type) for
148 @param NodeSubType NodeSubType is the device node sub-type
149 EFI_DEVICE_PATH.SubType) for the new device node.
150 @param NodeLength NodeLength is the length of the device node
151 (EFI_DEVICE_PATH.Length) for the new device node.
153 @retval Pointer A pointer to the newly created device node.
154 @retval NULL NodeLength is less than
155 the size of the header or there was insufficient memory.
159 EFI_DEVICE_PATH_PROTOCOL
*
160 (EFIAPI
*EFI_DEVICE_PATH_CREATE_NODE
) (
162 IN UINT8 NodeSubType
,
168 Returns whether a device path is multi-instance.
170 @param DevicePath Points to the device path. If NULL, then ignored.
172 @retval TRUE The device path has more than one instance
173 @retval FALSE The device path is empty or contains only a single instance.
178 (EFIAPI
*EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE
) (
179 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
185 EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize
;
186 EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath
;
187 EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath
;
188 EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode
;
189 EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance
;
190 EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance
;
191 EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance
;
192 EFI_DEVICE_PATH_CREATE_NODE CreateDeviceNode
;
193 } EFI_DEVICE_PATH_UTILITIES_PROTOCOL
;
195 extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid
;