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