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