]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DevicePathUtilities.h
clean up the un-suitable ';' location when declaring the functions.
[mirror_edk2.git] / MdePkg / Include / Protocol / DevicePathUtilities.h
CommitLineData
d1f95000 1/** @file\r
2 EFI_DEVICE_PATH_UTILITIES_PROTOCOL as defined in UEFI 2.0. \r
3 Use to create and manipulate device paths and device nodes.\r
4\r
4ca9b6c4 5 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 6 All rights reserved. This program and the accompanying materials \r
7 are licensed and made available under the terms and conditions of the BSD License \r
8 which accompanies this distribution. The full text of the license may be found at \r
9 http://opensource.org/licenses/bsd-license.php \r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
d1f95000 14**/\r
15\r
16#ifndef __DEVICE_PATH_UTILITIES_PROTOCOL_H__\r
17#define __DEVICE_PATH_UTILITIES_PROTOCOL_H__\r
18\r
19\r
20#include <Protocol/DevicePath.h>\r
21\r
99e8ed21 22///\r
23/// Device Path Utilities protocol\r
24///\r
d1f95000 25#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \\r
26 { \\r
27 0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \\r
28 }\r
29\r
30/**\r
31 Returns the size of the device path, in bytes.\r
32\r
33 @param DevicePath Points to the start of the EFI device path.\r
34\r
19bee90c 35 @retval Size Size of the specified device path, in bytes, including the end-of-path tag.\r
d1f95000 36\r
37**/\r
38typedef\r
39UINTN\r
8b13229b 40(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE)(\r
d1f95000 41 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
ed66e1bc 42 ); \r
d1f95000 43 \r
44\r
45/**\r
46 Create a duplicate of the specified path.\r
47\r
48 @param DevicePath Points to the source EFI device path.\r
49\r
50 @retval Pointer A pointer to the duplicate device path.\r
51 @retval NULL insufficient memory\r
52\r
53**/\r
54typedef\r
55EFI_DEVICE_PATH_PROTOCOL*\r
8b13229b 56(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH)(\r
d1f95000 57 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
ed66e1bc 58 ); \r
d1f95000 59\r
60/**\r
61 Create a new path by appending the second device path to the first.\r
62\r
63 @param Src1 Points to the first device path. If NULL, then it is ignored.\r
64 @param Src2 Points to the second device path. If NULL, then it is ignored.\r
65\r
66 @retval Pointer A pointer to the newly created device path.\r
67 @retval NULL Memory could not be allocated\r
68 or either DevicePath or DeviceNode is NULL.\r
69\r
70**/\r
71typedef\r
72EFI_DEVICE_PATH_PROTOCOL*\r
8b13229b 73(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH)(\r
d1f95000 74 IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,\r
75 IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2\r
ed66e1bc 76 ); \r
d1f95000 77 \r
78/**\r
79 Creates a new path by appending the device node to the device path.\r
80\r
81 @param DevicePath Points to the device path.\r
82 @param DeviceNode Points to the device node.\r
83\r
84 @retval Pointer A pointer to the allocated device node.\r
85 @retval NULL Memory could not be allocated\r
86 or either DevicePath or DeviceNode is NULL.\r
87\r
88**/\r
89typedef\r
90EFI_DEVICE_PATH_PROTOCOL*\r
8b13229b 91(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE)(\r
d1f95000 92 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
93 IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode\r
ed66e1bc 94 );\r
d1f95000 95\r
96/**\r
97 Creates a new path by appending the specified device path instance to the specified device path.\r
98\r
99 @param DevicePath Points to the device path. If NULL, then ignored.\r
100 @param DevicePathInstance Points to the device path instance.\r
101\r
102 @retval Pointer A pointer to the newly created device path\r
103 @retval NULL Memory could not be allocated or DevicePathInstance is NULL.\r
104\r
105**/\r
106typedef\r
107EFI_DEVICE_PATH_PROTOCOL*\r
8b13229b 108(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE)(\r
d1f95000 109 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
110 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance\r
ed66e1bc 111 ); \r
d1f95000 112\r
113/**\r
114 Creates a copy of the current device path instance and returns a pointer to the next device path\r
115 instance.\r
116\r
117 @param DevicePathInstance On input, this holds the pointer to the current device path\r
118 instance. On output, this holds the pointer to the next\r
119 device path instance or NULL if there are no more device\r
120 path instances in the device path. \r
121 @param DevicePathInstanceSize On output, this holds the size of the device path instance,\r
122 in bytes or zero, if DevicePathInstance is zero.\r
123\r
124 @retval Pointer A pointer to the copy of the current device path instance.\r
125 @retval NULL DevicePathInstace was NULL on entry or there was insufficient memory.\r
126\r
127**/\r
128typedef\r
129EFI_DEVICE_PATH_PROTOCOL*\r
8b13229b 130(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE)(\r
d1f95000 131 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,\r
132 OUT UINTN *DevicePathInstanceSize\r
ed66e1bc 133 ); \r
d1f95000 134\r
135/**\r
136 Creates a device node\r
137\r
138 @param NodeType NodeType is the device node type (EFI_DEVICE_PATH.Type) for\r
139 the new device node.\r
140 @param NodeSubType NodeSubType is the device node sub-type\r
141 EFI_DEVICE_PATH.SubType) for the new device node.\r
142 @param NodeLength NodeLength is the length of the device node\r
143 (EFI_DEVICE_PATH.Length) for the new device node.\r
144\r
145 @retval Pointer A pointer to the newly created device node.\r
146 @retval NULL NodeLength is less than\r
147 the size of the header or there was insufficient memory.\r
148\r
149**/\r
150typedef\r
151EFI_DEVICE_PATH_PROTOCOL*\r
8b13229b 152(EFIAPI *EFI_DEVICE_PATH_CREATE_NODE)(\r
d1f95000 153 IN UINT8 NodeType,\r
154 IN UINT8 NodeSubType,\r
155 IN UINT16 NodeLength\r
ed66e1bc 156); \r
d1f95000 157\r
158/**\r
159 Returns whether a device path is multi-instance.\r
160\r
161 @param DevicePath Points to the device path. If NULL, then ignored.\r
162\r
163 @retval TRUE The device path has more than one instance\r
164 @retval FALSE The device path is empty or contains only a single instance.\r
165\r
166**/\r
167typedef\r
168BOOLEAN\r
8b13229b 169(EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE)(\r
d1f95000 170 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
ed66e1bc 171 ); \r
d1f95000 172 \r
4ca9b6c4
LG
173/**\r
174 @par Protocol Description:\r
175 This protocol is used to creates and manipulates device paths and device nodes.\r
176\r
177 @param GetDevicePathSize \r
178 Returns the size of the specified device path, in bytes.\r
179\r
180 @param DuplicateDevicePath\r
181 Duplicates a device path structure.\r
182 \r
183 @param AppendDeviceNode \r
184 Appends the device node to the specified device path.\r
185\r
186 @param AppendDevicePath \r
187 Appends the device path to the specified device path.\r
188\r
189 @param AppendDevicePathInstance\r
190 Appends a device path instance to another device path.\r
191\r
192 @param GetNextDevicePathInstance\r
193 Retrieves the next device path instance from a device path data structure.\r
194\r
195 @param IsDevicePathMultiInstance\r
196 Returns TRUE if this is a multi-instance device path.\r
d1f95000 197\r
4ca9b6c4
LG
198 @param CreateDeviceNode \r
199 Allocates memory for a device node with the specified type and sub-type.\r
200**/ \r
d1f95000 201typedef struct {\r
202 EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;\r
203 EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath;\r
204 EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath;\r
205 EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode;\r
206 EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance;\r
207 EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance;\r
208 EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance;\r
209 EFI_DEVICE_PATH_CREATE_NODE CreateDeviceNode;\r
210} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;\r
211\r
212extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid; \r
213\r
214#endif\r