]>
Commit | Line | Data |
---|---|---|
20752cb8 HW |
1 | /** @file\r |
2 | The header file of RamDiskDxe driver.\r | |
3 | \r | |
4 | Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _RAM_DISK_IMPL_H_\r | |
16 | #define _RAM_DISK_IMPL_H_\r | |
17 | \r | |
18 | #include <Uefi.h>\r | |
19 | #include <Library/BaseLib.h>\r | |
20 | #include <Library/BaseMemoryLib.h>\r | |
21 | #include <Library/DebugLib.h>\r | |
22 | #include <Library/UefiLib.h>\r | |
23 | #include <Library/UefiDriverEntryPoint.h>\r | |
24 | #include <Library/UefiBootServicesTableLib.h>\r | |
25 | #include <Library/UefiHiiServicesLib.h>\r | |
26 | #include <Library/MemoryAllocationLib.h>\r | |
27 | #include <Library/HiiLib.h>\r | |
28 | #include <Library/FileExplorerLib.h>\r | |
29 | #include <Library/DevicePathLib.h>\r | |
30 | #include <Library/PrintLib.h>\r | |
31 | #include <Protocol/RamDisk.h>\r | |
32 | #include <Protocol/BlockIo.h>\r | |
216fefa3 | 33 | #include <Protocol/BlockIo2.h>\r |
20752cb8 HW |
34 | #include <Protocol/HiiConfigAccess.h>\r |
35 | #include <Protocol/SimpleFileSystem.h>\r | |
36 | #include <Guid/MdeModuleHii.h>\r | |
37 | #include <Guid/RamDiskHii.h>\r | |
38 | #include <Guid/FileInfo.h>\r | |
39 | \r | |
40 | #include "RamDiskNVData.h"\r | |
41 | \r | |
42 | ///\r | |
43 | /// RAM disk general definitions and declarations\r | |
44 | ///\r | |
45 | \r | |
46 | //\r | |
47 | // Block size for RAM disk\r | |
48 | //\r | |
49 | #define RAM_DISK_BLOCK_SIZE 512\r | |
50 | \r | |
51 | //\r | |
52 | // Iterate through the doule linked list. NOT delete safe\r | |
53 | //\r | |
54 | #define EFI_LIST_FOR_EACH(Entry, ListHead) \\r | |
55 | for(Entry = (ListHead)->ForwardLink; Entry != (ListHead); Entry = Entry->ForwardLink)\r | |
56 | \r | |
57 | //\r | |
58 | // Iterate through the doule linked list. This is delete-safe.\r | |
59 | // Do not touch NextEntry\r | |
60 | //\r | |
61 | #define EFI_LIST_FOR_EACH_SAFE(Entry, NextEntry, ListHead) \\r | |
62 | for(Entry = (ListHead)->ForwardLink, NextEntry = Entry->ForwardLink;\\r | |
63 | Entry != (ListHead); Entry = NextEntry, NextEntry = Entry->ForwardLink)\r | |
64 | \r | |
65 | //\r | |
66 | // RamDiskDxe driver maintains a list of registered RAM disks.\r | |
67 | //\r | |
68 | extern LIST_ENTRY RegisteredRamDisks;\r | |
69 | extern UINTN ListEntryNum;\r | |
70 | \r | |
71 | //\r | |
72 | // RAM Disk create method.\r | |
73 | //\r | |
74 | typedef enum _RAM_DISK_CREATE_METHOD {\r | |
75 | RamDiskCreateOthers = 0,\r | |
76 | RamDiskCreateHii\r | |
77 | } RAM_DISK_CREATE_METHOD;\r | |
78 | \r | |
79 | //\r | |
80 | // RamDiskDxe driver maintains a list of registered RAM disks.\r | |
81 | // The struct contains the list entry and the information of each RAM\r | |
82 | // disk\r | |
83 | //\r | |
84 | typedef struct {\r | |
85 | UINTN Signature;\r | |
86 | \r | |
87 | EFI_HANDLE Handle;\r | |
88 | \r | |
89 | EFI_BLOCK_IO_PROTOCOL BlockIo;\r | |
216fefa3 | 90 | EFI_BLOCK_IO2_PROTOCOL BlockIo2;\r |
20752cb8 HW |
91 | EFI_BLOCK_IO_MEDIA Media;\r |
92 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
93 | \r | |
94 | UINT64 StartingAddr;\r | |
95 | UINT64 Size;\r | |
96 | EFI_GUID TypeGuid;\r | |
97 | UINT16 InstanceNumber;\r | |
98 | RAM_DISK_CREATE_METHOD CreateMethod;\r | |
99 | \r | |
100 | LIST_ENTRY ThisInstance;\r | |
101 | } RAM_DISK_PRIVATE_DATA;\r | |
102 | \r | |
103 | #define RAM_DISK_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('R', 'D', 'S', 'K')\r | |
104 | #define RAM_DISK_PRIVATE_FROM_BLKIO(a) CR (a, RAM_DISK_PRIVATE_DATA, BlockIo, RAM_DISK_PRIVATE_DATA_SIGNATURE)\r | |
216fefa3 | 105 | #define RAM_DISK_PRIVATE_FROM_BLKIO2(a) CR (a, RAM_DISK_PRIVATE_DATA, BlockIo2, RAM_DISK_PRIVATE_DATA_SIGNATURE)\r |
20752cb8 HW |
106 | #define RAM_DISK_PRIVATE_FROM_THIS(a) CR (a, RAM_DISK_PRIVATE_DATA, ThisInstance, RAM_DISK_PRIVATE_DATA_SIGNATURE)\r |
107 | \r | |
108 | ///\r | |
109 | /// RAM disk HII-related definitions and declarations\r | |
110 | ///\r | |
111 | \r | |
112 | //\r | |
113 | // Tool generated IFR binary data and String package data\r | |
114 | //\r | |
115 | extern UINT8 RamDiskHiiBin[];\r | |
116 | extern UINT8 RamDiskDxeStrings[];\r | |
117 | \r | |
118 | typedef struct {\r | |
119 | VENDOR_DEVICE_PATH VendorDevicePath;\r | |
120 | EFI_DEVICE_PATH_PROTOCOL End;\r | |
121 | } HII_VENDOR_DEVICE_PATH;\r | |
122 | \r | |
123 | typedef struct {\r | |
124 | UINTN Signature;\r | |
125 | \r | |
126 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
127 | EFI_HANDLE DriverHandle;\r | |
128 | EFI_HII_HANDLE HiiHandle;\r | |
129 | } RAM_DISK_CONFIG_PRIVATE_DATA;\r | |
130 | \r | |
131 | extern RAM_DISK_CONFIG_PRIVATE_DATA mRamDiskConfigPrivateDataTemplate;\r | |
132 | \r | |
133 | #define RAM_DISK_CONFIG_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('R', 'C', 'F', 'G')\r | |
134 | #define RAM_DISK_CONFIG_PRIVATE_FROM_THIS(a) CR (a, RAM_DISK_CONFIG_PRIVATE_DATA, ConfigAccess, RAM_DISK_CONFIG_PRIVATE_DATA_SIGNATURE)\r | |
135 | \r | |
136 | #define RAM_DISK_LIST_VAR_OFFSET ((UINT16) OFFSET_OF (RAM_DISK_CONFIGURATION, RamDiskList))\r | |
137 | \r | |
138 | /**\r | |
139 | Register a RAM disk with specified address, size and type.\r | |
140 | \r | |
141 | @param[in] RamDiskBase The base address of registered RAM disk.\r | |
142 | @param[in] RamDiskSize The size of registered RAM disk.\r | |
143 | @param[in] RamDiskType The type of registered RAM disk. The GUID can be\r | |
144 | any of the values defined in section 9.3.6.9, or a\r | |
145 | vendor defined GUID.\r | |
146 | @param[in] ParentDevicePath\r | |
147 | Pointer to the parent device path. If there is no\r | |
148 | parent device path then ParentDevicePath is NULL.\r | |
149 | @param[out] DevicePath On return, points to a pointer to the device path\r | |
150 | of the RAM disk device.\r | |
151 | If ParentDevicePath is not NULL, the returned\r | |
152 | DevicePath is created by appending a RAM disk node\r | |
153 | to the parent device path. If ParentDevicePath is\r | |
154 | NULL, the returned DevicePath is a RAM disk device\r | |
155 | path without appending. This function is\r | |
156 | responsible for allocating the buffer DevicePath\r | |
157 | with the boot service AllocatePool().\r | |
158 | \r | |
159 | @retval EFI_SUCCESS The RAM disk is registered successfully.\r | |
160 | @retval EFI_INVALID_PARAMETER DevicePath or RamDiskType is NULL.\r | |
161 | RamDiskSize is 0.\r | |
162 | @retval EFI_ALREADY_STARTED A Device Path Protocol instance to be created\r | |
163 | is already present in the handle database.\r | |
164 | @retval EFI_OUT_OF_RESOURCES The RAM disk register operation fails due to\r | |
165 | resource limitation.\r | |
166 | \r | |
167 | **/\r | |
168 | EFI_STATUS\r | |
169 | EFIAPI\r | |
170 | RamDiskRegister (\r | |
171 | IN UINT64 RamDiskBase,\r | |
172 | IN UINT64 RamDiskSize,\r | |
173 | IN EFI_GUID *RamDiskType,\r | |
174 | IN EFI_DEVICE_PATH *ParentDevicePath OPTIONAL,\r | |
175 | OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r | |
176 | );\r | |
177 | \r | |
178 | /**\r | |
179 | Unregister a RAM disk specified by DevicePath.\r | |
180 | \r | |
181 | @param[in] DevicePath A pointer to the device path that describes a RAM\r | |
182 | Disk device.\r | |
183 | \r | |
184 | @retval EFI_SUCCESS The RAM disk is unregistered successfully.\r | |
185 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
186 | @retval EFI_UNSUPPORTED The device specified by DevicePath is not a\r | |
187 | valid ramdisk device path and not supported\r | |
188 | by the driver.\r | |
189 | @retval EFI_NOT_FOUND The RAM disk pointed by DevicePath doesn't\r | |
190 | exist.\r | |
191 | \r | |
192 | **/\r | |
193 | EFI_STATUS\r | |
194 | EFIAPI\r | |
195 | RamDiskUnregister (\r | |
196 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
197 | );\r | |
198 | \r | |
199 | /**\r | |
200 | Initialize the BlockIO protocol of a RAM disk device.\r | |
201 | \r | |
202 | @param[in] PrivateData Points to RAM disk private data.\r | |
203 | \r | |
204 | **/\r | |
205 | VOID\r | |
206 | RamDiskInitBlockIo (\r | |
207 | IN RAM_DISK_PRIVATE_DATA *PrivateData\r | |
208 | );\r | |
209 | \r | |
210 | /**\r | |
211 | Reset the Block Device.\r | |
212 | \r | |
213 | @param[in] This Indicates a pointer to the calling context.\r | |
214 | @param[in] ExtendedVerification\r | |
215 | Driver may perform diagnostics on reset.\r | |
216 | \r | |
217 | @retval EFI_SUCCESS The device was reset.\r | |
218 | @retval EFI_DEVICE_ERROR The device is not functioning properly and\r | |
219 | could not be reset.\r | |
220 | \r | |
221 | **/\r | |
222 | EFI_STATUS\r | |
223 | EFIAPI\r | |
224 | RamDiskBlkIoReset (\r | |
225 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
226 | IN BOOLEAN ExtendedVerification\r | |
227 | );\r | |
228 | \r | |
229 | /**\r | |
230 | Read BufferSize bytes from Lba into Buffer.\r | |
231 | \r | |
232 | @param[in] This Indicates a pointer to the calling context.\r | |
233 | @param[in] MediaId Id of the media, changes every time the media is\r | |
234 | replaced.\r | |
235 | @param[in] Lba The starting Logical Block Address to read from.\r | |
236 | @param[in] BufferSize Size of Buffer, must be a multiple of device block\r | |
237 | size.\r | |
238 | @param[out] Buffer A pointer to the destination buffer for the data.\r | |
239 | The caller is responsible for either having\r | |
240 | implicit or explicit ownership of the buffer.\r | |
241 | \r | |
242 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
243 | @retval EFI_DEVICE_ERROR The device reported an error while performing\r | |
244 | the read.\r | |
245 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
246 | @retval EFI_MEDIA_CHANGED The MediaId does not matched the current\r | |
247 | device.\r | |
248 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block\r | |
249 | size of the device.\r | |
250 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not\r | |
251 | valid, or the buffer is not on proper alignment.\r | |
252 | \r | |
253 | **/\r | |
254 | EFI_STATUS\r | |
255 | EFIAPI\r | |
256 | RamDiskBlkIoReadBlocks (\r | |
257 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
258 | IN UINT32 MediaId,\r | |
259 | IN EFI_LBA Lba,\r | |
260 | IN UINTN BufferSize,\r | |
261 | OUT VOID *Buffer\r | |
262 | );\r | |
263 | \r | |
264 | /**\r | |
265 | Write BufferSize bytes from Lba into Buffer.\r | |
266 | \r | |
267 | @param[in] This Indicates a pointer to the calling context.\r | |
268 | @param[in] MediaId The media ID that the write request is for.\r | |
269 | @param[in] Lba The starting logical block address to be written.\r | |
270 | The caller is responsible for writing to only\r | |
271 | legitimate locations.\r | |
272 | @param[in] BufferSize Size of Buffer, must be a multiple of device block\r | |
273 | size.\r | |
274 | @param[in] Buffer A pointer to the source buffer for the data.\r | |
275 | \r | |
276 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
277 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
278 | @retval EFI_DEVICE_ERROR The device reported an error while performing\r | |
279 | the write.\r | |
280 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
281 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current\r | |
282 | device.\r | |
283 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block\r | |
284 | size of the device.\r | |
285 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not\r | |
286 | valid, or the buffer is not on proper alignment.\r | |
287 | \r | |
288 | **/\r | |
289 | EFI_STATUS\r | |
290 | EFIAPI\r | |
291 | RamDiskBlkIoWriteBlocks (\r | |
292 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
293 | IN UINT32 MediaId,\r | |
294 | IN EFI_LBA Lba,\r | |
295 | IN UINTN BufferSize,\r | |
296 | IN VOID *Buffer\r | |
297 | );\r | |
298 | \r | |
299 | /**\r | |
300 | Flush the Block Device.\r | |
301 | \r | |
302 | @param[in] This Indicates a pointer to the calling context.\r | |
303 | \r | |
304 | @retval EFI_SUCCESS All outstanding data was written to the device.\r | |
305 | @retval EFI_DEVICE_ERROR The device reported an error while writting\r | |
306 | back the data\r | |
307 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
308 | \r | |
309 | **/\r | |
310 | EFI_STATUS\r | |
311 | EFIAPI\r | |
312 | RamDiskBlkIoFlushBlocks (\r | |
313 | IN EFI_BLOCK_IO_PROTOCOL *This\r | |
314 | );\r | |
315 | \r | |
216fefa3 HW |
316 | /**\r |
317 | Resets the block device hardware.\r | |
318 | \r | |
319 | @param[in] This The pointer of EFI_BLOCK_IO2_PROTOCOL.\r | |
320 | @param[in] ExtendedVerification The flag about if extend verificate.\r | |
321 | \r | |
322 | @retval EFI_SUCCESS The device was reset.\r | |
323 | @retval EFI_DEVICE_ERROR The block device is not functioning correctly\r | |
324 | and could not be reset.\r | |
325 | \r | |
326 | **/\r | |
327 | EFI_STATUS\r | |
328 | EFIAPI\r | |
329 | RamDiskBlkIo2Reset (\r | |
330 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
331 | IN BOOLEAN ExtendedVerification\r | |
332 | );\r | |
333 | \r | |
334 | /**\r | |
335 | Reads the requested number of blocks from the device.\r | |
336 | \r | |
337 | @param[in] This Indicates a pointer to the calling context.\r | |
338 | @param[in] MediaId The media ID that the read request is for.\r | |
339 | @param[in] Lba The starting logical block address to read\r | |
340 | from on the device.\r | |
341 | @param[in, out] Token A pointer to the token associated with the\r | |
342 | transaction.\r | |
343 | @param[in] BufferSize The size of the Buffer in bytes. This must be\r | |
344 | a multiple of the intrinsic block size of the\r | |
345 | device.\r | |
346 | @param[out] Buffer A pointer to the destination buffer for the\r | |
347 | data. The caller is responsible for either\r | |
348 | having implicit or explicit ownership of the\r | |
349 | buffer.\r | |
350 | \r | |
351 | @retval EFI_SUCCESS The read request was queued if Token->Event\r | |
352 | is not NULL. The data was read correctly from\r | |
353 | the device if the Token->Event is NULL.\r | |
354 | @retval EFI_DEVICE_ERROR The device reported an error while attempting\r | |
355 | to perform the read operation.\r | |
356 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
357 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
358 | @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of\r | |
359 | the intrinsic block size of the device.\r | |
360 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not\r | |
361 | valid, or the buffer is not on proper\r | |
362 | alignment.\r | |
363 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r | |
364 | lack of resources.\r | |
365 | \r | |
366 | **/\r | |
367 | EFI_STATUS\r | |
368 | EFIAPI\r | |
369 | RamDiskBlkIo2ReadBlocksEx (\r | |
370 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
371 | IN UINT32 MediaId,\r | |
372 | IN EFI_LBA Lba,\r | |
373 | IN OUT EFI_BLOCK_IO2_TOKEN *Token,\r | |
374 | IN UINTN BufferSize,\r | |
375 | OUT VOID *Buffer\r | |
376 | );\r | |
377 | \r | |
378 | /**\r | |
379 | Writes a specified number of blocks to the device.\r | |
380 | \r | |
381 | @param[in] This Indicates a pointer to the calling context.\r | |
382 | @param[in] MediaId The media ID that the write request is for.\r | |
383 | @param[in] Lba The starting logical block address to be\r | |
384 | written. The caller is responsible for\r | |
385 | writing to only legitimate locations.\r | |
386 | @param[in, out] Token A pointer to the token associated with the\r | |
387 | transaction.\r | |
388 | @param[in] BufferSize The size in bytes of Buffer. This must be a\r | |
389 | multiple of the intrinsic block size of the\r | |
390 | device.\r | |
391 | @param[in] Buffer A pointer to the source buffer for the data.\r | |
392 | \r | |
393 | @retval EFI_SUCCESS The write request was queued if Event is not\r | |
394 | NULL. The data was written correctly to the\r | |
395 | device if the Event is NULL.\r | |
396 | @retval EFI_WRITE_PROTECTED The device cannot be written to.\r | |
397 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
398 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
399 | @retval EFI_DEVICE_ERROR The device reported an error while attempting\r | |
400 | to perform the write operation.\r | |
401 | @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of\r | |
402 | the intrinsic block size of the device.\r | |
403 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not\r | |
404 | valid, or the buffer is not on proper\r | |
405 | alignment.\r | |
406 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r | |
407 | lack of resources.\r | |
408 | \r | |
409 | **/\r | |
410 | EFI_STATUS\r | |
411 | EFIAPI\r | |
412 | RamDiskBlkIo2WriteBlocksEx (\r | |
413 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
414 | IN UINT32 MediaId,\r | |
415 | IN EFI_LBA Lba,\r | |
416 | IN OUT EFI_BLOCK_IO2_TOKEN *Token,\r | |
417 | IN UINTN BufferSize,\r | |
418 | IN VOID *Buffer\r | |
419 | );\r | |
420 | \r | |
421 | /**\r | |
422 | Flushes all modified data to a physical block device.\r | |
423 | \r | |
424 | @param[in] This Indicates a pointer to the calling context.\r | |
425 | @param[in, out] Token A pointer to the token associated with the\r | |
426 | transaction.\r | |
427 | \r | |
428 | @retval EFI_SUCCESS The flush request was queued if Event is not\r | |
429 | NULL. All outstanding data was written\r | |
430 | correctly to the device if the Event is NULL.\r | |
431 | @retval EFI_DEVICE_ERROR The device reported an error while attempting\r | |
432 | to write data.\r | |
433 | @retval EFI_WRITE_PROTECTED The device cannot be written to.\r | |
434 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
435 | @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r | |
436 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r | |
437 | lack of resources.\r | |
438 | \r | |
439 | **/\r | |
440 | EFI_STATUS\r | |
441 | EFIAPI\r | |
442 | RamDiskBlkIo2FlushBlocksEx (\r | |
443 | IN EFI_BLOCK_IO2_PROTOCOL *This,\r | |
444 | IN OUT EFI_BLOCK_IO2_TOKEN *Token\r | |
445 | );\r | |
446 | \r | |
20752cb8 HW |
447 | /**\r |
448 | This function publish the RAM disk configuration Form.\r | |
449 | \r | |
450 | @param[in, out] ConfigPrivateData\r | |
451 | Points to RAM disk configuration private data.\r | |
452 | \r | |
453 | @retval EFI_SUCCESS HII Form is installed successfully.\r | |
454 | @retval EFI_OUT_OF_RESOURCES Not enough resource for HII Form installation.\r | |
455 | @retval Others Other errors as indicated.\r | |
456 | \r | |
457 | **/\r | |
458 | EFI_STATUS\r | |
459 | InstallRamDiskConfigForm (\r | |
460 | IN OUT RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivateData\r | |
461 | );\r | |
462 | \r | |
463 | /**\r | |
464 | This function removes RAM disk configuration Form.\r | |
465 | \r | |
466 | @param[in, out] ConfigPrivateData\r | |
467 | Points to RAM disk configuration private data.\r | |
468 | \r | |
469 | **/\r | |
470 | VOID\r | |
471 | UninstallRamDiskConfigForm (\r | |
472 | IN OUT RAM_DISK_CONFIG_PRIVATE_DATA *ConfigPrivateData\r | |
473 | );\r | |
474 | \r | |
475 | /**\r | |
476 | Unregister all registered RAM disks.\r | |
477 | \r | |
478 | **/\r | |
479 | VOID\r | |
480 | UnregisterAllRamDisks (\r | |
481 | VOID\r | |
482 | );\r | |
483 | \r | |
484 | /**\r | |
485 | This function allows a caller to extract the current configuration for one\r | |
486 | or more named elements from the target driver.\r | |
487 | \r | |
488 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
489 | @param[in] Request A null-terminated Unicode string in\r | |
490 | <ConfigRequest> format.\r | |
491 | @param[out] Progress On return, points to a character in the Request\r | |
492 | string. Points to the string's null terminator if\r | |
493 | request was successful. Points to the most recent\r | |
494 | '&' before the first failing name/value pair (or\r | |
495 | the beginning of the string if the failure is in\r | |
496 | the first name/value pair) if the request was not\r | |
497 | successful.\r | |
498 | @param[out] Results A null-terminated Unicode string in\r | |
499 | <ConfigAltResp> format which has all values filled\r | |
500 | in for the names in the Request string. String to\r | |
501 | be allocated by the called function.\r | |
502 | \r | |
503 | @retval EFI_SUCCESS The Results is filled with the requested\r | |
504 | values.\r | |
505 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r | |
506 | @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.\r | |
507 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in\r | |
508 | this driver.\r | |
509 | \r | |
510 | **/\r | |
511 | EFI_STATUS\r | |
512 | EFIAPI\r | |
513 | RamDiskExtractConfig (\r | |
514 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
515 | IN CONST EFI_STRING Request,\r | |
516 | OUT EFI_STRING *Progress,\r | |
517 | OUT EFI_STRING *Results\r | |
518 | );\r | |
519 | \r | |
520 | /**\r | |
521 | This function processes the results of changes in configuration.\r | |
522 | \r | |
523 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
524 | @param[in] Configuration A null-terminated Unicode string in <ConfigResp>\r | |
525 | format.\r | |
526 | @param[out] Progress A pointer to a string filled in with the offset of\r | |
527 | the most recent '&' before the first failing\r | |
528 | name/value pair (or the beginning of the string if\r | |
529 | the failure is in the first name/value pair) or\r | |
530 | the terminating NULL if all was successful.\r | |
531 | \r | |
532 | @retval EFI_SUCCESS The Results is processed successfully.\r | |
533 | @retval EFI_INVALID_PARAMETER Configuration is NULL.\r | |
534 | @retval EFI_NOT_FOUND Routing data doesn't match any storage in\r | |
535 | this driver.\r | |
536 | \r | |
537 | **/\r | |
538 | EFI_STATUS\r | |
539 | EFIAPI\r | |
540 | RamDiskRouteConfig (\r | |
541 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
542 | IN CONST EFI_STRING Configuration,\r | |
543 | OUT EFI_STRING *Progress\r | |
544 | );\r | |
545 | \r | |
546 | /**\r | |
547 | This function processes the results of changes in configuration.\r | |
548 | \r | |
549 | @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r | |
550 | @param[in] Action Specifies the type of action taken by the browser.\r | |
551 | @param[in] QuestionId A unique value which is sent to the original\r | |
552 | exporting driver so that it can identify the type\r | |
553 | of data to expect.\r | |
554 | @param[in] Type The type of value for the question.\r | |
555 | @param[in] Value A pointer to the data being sent to the original\r | |
556 | exporting driver.\r | |
557 | @param[out] ActionRequest On return, points to the action requested by the\r | |
558 | callback function.\r | |
559 | \r | |
560 | @retval EFI_SUCCESS The callback successfully handled the action.\r | |
561 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the\r | |
562 | variable and its data.\r | |
563 | @retval EFI_DEVICE_ERROR The variable could not be saved.\r | |
564 | @retval EFI_UNSUPPORTED The specified Action is not supported by the\r | |
565 | callback.\r | |
566 | \r | |
567 | **/\r | |
568 | EFI_STATUS\r | |
569 | EFIAPI\r | |
570 | RamDiskCallback (\r | |
571 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r | |
572 | IN EFI_BROWSER_ACTION Action,\r | |
573 | IN EFI_QUESTION_ID QuestionId,\r | |
574 | IN UINT8 Type,\r | |
575 | IN EFI_IFR_TYPE_VALUE *Value,\r | |
576 | OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r | |
577 | );\r | |
578 | \r | |
579 | \r | |
580 | /**\r | |
581 | This function gets the file information from an open file descriptor,\r | |
582 | and stores it in a buffer allocated from pool.\r | |
583 | \r | |
584 | @param[in] FHand File Handle.\r | |
585 | \r | |
586 | @return A pointer to a buffer with file information or NULL is returned.\r | |
587 | \r | |
588 | **/\r | |
589 | EFI_FILE_INFO *\r | |
590 | FileInfo (\r | |
591 | IN EFI_FILE_HANDLE FHand\r | |
592 | );\r | |
593 | \r | |
594 | \r | |
595 | /**\r | |
596 | This function will open a file or directory referenced by DevicePath.\r | |
597 | \r | |
598 | This function opens a file with the open mode according to the file path. The\r | |
599 | Attributes is valid only for EFI_FILE_MODE_CREATE.\r | |
600 | \r | |
601 | @param[in, out] FilePath On input, the device path to the file.\r | |
602 | On output, the remaining device path.\r | |
603 | @param[out] FileHandle Pointer to the file handle.\r | |
604 | @param[in] OpenMode The mode to open the file with.\r | |
605 | @param[in] Attributes The file's file attributes.\r | |
606 | \r | |
607 | @retval EFI_SUCCESS The information was set.\r | |
608 | @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r | |
609 | @retval EFI_UNSUPPORTED Could not open the file path.\r | |
610 | @retval EFI_NOT_FOUND The specified file could not be found on the\r | |
611 | device or the file system could not be found\r | |
612 | on the device.\r | |
613 | @retval EFI_NO_MEDIA The device has no medium.\r | |
614 | @retval EFI_MEDIA_CHANGED The device has a different medium in it or\r | |
615 | the medium is no longer supported.\r | |
616 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
617 | @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r | |
618 | @retval EFI_WRITE_PROTECTED The file or medium is write protected.\r | |
619 | @retval EFI_ACCESS_DENIED The file was opened read only.\r | |
620 | @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open\r | |
621 | the file.\r | |
622 | @retval EFI_VOLUME_FULL The volume is full.\r | |
623 | **/\r | |
624 | EFI_STATUS\r | |
625 | EFIAPI\r | |
626 | OpenFileByDevicePath(\r | |
627 | IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r | |
628 | OUT EFI_FILE_HANDLE *FileHandle,\r | |
629 | IN UINT64 OpenMode,\r | |
630 | IN UINT64 Attributes\r | |
631 | );\r | |
632 | \r | |
633 | #endif\r |