3 Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #ifndef _DEVICE_PATH_UTILITIES_PROTOCOL_H_
21 #define _DEVICE_PATH_UTILITIES_PROTOCOL_H_
24 // Device Path Utilities protocol
26 #define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
28 0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4} \
33 (EFIAPI
*EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE
) (
34 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
39 Returns the size of the device path, in bytes.
42 DevicePath - Points to the start of the EFI device path.
45 Size - Size of the specified device path, in bytes, including the end-of-path tag.
51 EFI_DEVICE_PATH_PROTOCOL
*
52 (EFIAPI
*EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH
) (
53 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
58 Create a duplicate of the specified path.
61 DevicePath - Points to the source EFI device path.
64 Pointer - A pointer to the duplicate device path.
65 NULL - Insufficient memory.
71 EFI_DEVICE_PATH_PROTOCOL
*
72 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_PATH
) (
73 IN CONST EFI_DEVICE_PATH_PROTOCOL
*Src1
,
74 IN CONST EFI_DEVICE_PATH_PROTOCOL
*Src2
79 Create a new path by appending the second device path to the first.
82 Src1 - Points to the first device path. If NULL, then it is ignored.
83 Src2 - Points to the second device path. If NULL, then it is ignored.
86 Pointer - A pointer to the newly created device path.
87 NULL - Memory could not be allocated
88 or either DevicePath or DeviceNode is NULL.
94 EFI_DEVICE_PATH_PROTOCOL
*
95 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_NODE
) (
96 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
97 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DeviceNode
102 Creates a new path by appending the device node to the device path.
105 DevicePath - Points to the device path.
106 DeviceNode - Points to the device node.
109 Pointer - A pointer to the allocated device node.
110 NULL - Memory could not be allocated
111 or either DevicePath or DeviceNode is NULL.
117 EFI_DEVICE_PATH_PROTOCOL
*
118 (EFIAPI
*EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE
) (
119 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
120 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePathInstance
125 Creates a new path by appending the specified device path instance to the specified device path.
128 DevicePath - Points to the device path. If NULL, then ignored.
129 DevicePathInstance - Points to the device path instance.
132 Pointer - A pointer to the newly created device path
133 NULL - Memory could not be allocated or DevicePathInstance is NULL.
139 EFI_DEVICE_PATH_PROTOCOL
*
140 (EFIAPI
*EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE
) (
141 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePathInstance
,
142 OUT UINTN
*DevicePathInstanceSize
147 Creates a copy of the current device path instance and returns a pointer to the next device path instance.
150 DevicePathInstance - On input, this holds the pointer to the current device path
151 instance. On output, this holds the pointer to the next
152 device path instance or NULL if there are no more device
153 path instances in the device path.
154 DevicePathInstanceSize - On output, this holds the size of the device path instance,
155 in bytes or zero, if DevicePathInstance is zero.
158 Pointer - A pointer to the copy of the current device path instance.
159 NULL - DevicePathInstace was NULL on entry or there was insufficient memory.
166 (EFIAPI
*EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE
) (
167 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
172 Returns whether a device path is multi-instance.
175 DevicePath - Points to the device path. If NULL, then ignored.
178 TRUE - The device path has more than one instance
179 FALSE - The device path is empty or contains only a single instance.
185 EFI_DEVICE_PATH_PROTOCOL
*
186 (EFIAPI
*EFI_DEVICE_PATH_UTILS_CREATE_NODE
) (
188 IN UINT8 NodeSubType
,
194 Creates a device node
197 NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for
199 NodeSubType - NodeSubType is the device node sub-type
200 EFI_DEVICE_PATH.SubType) for the new device node.
201 NodeLength - NodeLength is the length of the device node
202 (EFI_DEVICE_PATH.Length) for the new device node.
205 Pointer - A pointer to the newly created device node.
206 NULL - NodeLength is less than
207 the size of the header or there was insufficient memory.
213 EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize
;
214 EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath
;
215 EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath
;
216 EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode
;
217 EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance
;
218 EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance
;
219 EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance
;
220 EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode
;
221 } EFI_DEVICE_PATH_UTILITIES_PROTOCOL
;
223 extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid
;