]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemInternal.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / FvSimpleFileSystemDxe / FvSimpleFileSystemInternal.h
CommitLineData
9da91aea
BJ
1/** @file\r
2 The internal header file of FvSimpleFileSystem driver.\r
3\r
4Copyright (c) 2014, ARM Limited. All rights reserved.\r
d1102dba 5Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
9da91aea 6\r
9d510e61 7SPDX-License-Identifier: BSD-2-Clause-Patent\r
9da91aea
BJ
8\r
9**/\r
10\r
11#ifndef __FVFS_INTERNAL_H__\r
12#define __FVFS_INTERNAL_H__\r
13\r
14#include <Uefi.h>\r
15#include <PiDxe.h>\r
16\r
17#include <Library/BaseLib.h>\r
18#include <Library/BaseMemoryLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/DevicePathLib.h>\r
21#include <Library/MemoryAllocationLib.h>\r
22#include <Library/PrintLib.h>\r
23#include <Library/UefiBootServicesTableLib.h>\r
24#include <Library/UefiLib.h>\r
25\r
26#include <Protocol/DriverBinding.h>\r
27#include <Protocol/FirmwareVolume2.h>\r
28#include <Protocol/SimpleFileSystem.h>\r
29#include <Protocol/UnicodeCollation.h>\r
30\r
31#include <Guid/FileSystemInfo.h>\r
32#include <Guid/FileInfo.h>\r
33#include <Guid/FileSystemVolumeLabelInfo.h>\r
34\r
35typedef struct _FV_FILESYSTEM_FILE FV_FILESYSTEM_FILE;\r
36typedef struct _FV_FILESYSTEM_FILE_INFO FV_FILESYSTEM_FILE_INFO;\r
37typedef struct _FV_FILESYSTEM_INSTANCE FV_FILESYSTEM_INSTANCE;\r
38\r
39//\r
40// Struct representing an instance of the "filesystem". There will be one of\r
41// these structs per FV.\r
42//\r
43struct _FV_FILESYSTEM_INSTANCE {\r
1436aea4
MK
44 UINT32 Signature;\r
45 LIST_ENTRY FileInfoHead;\r
46 LIST_ENTRY FileHead;\r
47 EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;\r
48 EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol;\r
49 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFs;\r
50 FV_FILESYSTEM_FILE *Root;\r
51 CHAR16 *VolumeLabel;\r
9da91aea
BJ
52};\r
53\r
54//\r
d1102dba 55// Struct representing a opening file. Each opening operation on file will\r
9da91aea
BJ
56// create such an instance except for the "root directory", which will only\r
57// be created once for each FV.\r
58//\r
59struct _FV_FILESYSTEM_FILE {\r
1436aea4
MK
60 UINT32 Signature;\r
61 LIST_ENTRY Link;\r
62 FV_FILESYSTEM_FILE_INFO *DirReadNext;\r
63 FV_FILESYSTEM_INSTANCE *Instance;\r
64 EFI_FILE_PROTOCOL FileProtocol;\r
65 FV_FILESYSTEM_FILE_INFO *FvFileInfo;\r
66 UINT64 Position;\r
9da91aea
BJ
67};\r
68\r
69//\r
70// Struct representing the info of a file.\r
71//\r
72struct _FV_FILESYSTEM_FILE_INFO {\r
1436aea4
MK
73 UINT32 Signature;\r
74 LIST_ENTRY Link;\r
75 EFI_GUID NameGuid;\r
76 EFI_FV_FILETYPE Type;\r
77 EFI_FILE_INFO FileInfo;\r
9da91aea
BJ
78};\r
79\r
1436aea4
MK
80#define FVFS_FILE_SIGNATURE SIGNATURE_32 ('f', 'v', 'f', 'i')\r
81#define FVFS_FILE_INFO_SIGNATURE SIGNATURE_32 ('f', 'v', 'i', 'n')\r
82#define FVFS_INSTANCE_SIGNATURE SIGNATURE_32 ('f', 'v', 'f', 's')\r
9da91aea 83\r
1436aea4 84#define FVFS_INSTANCE_FROM_SIMPLE_FS_THIS(This) CR ( \\r
9da91aea
BJ
85 This, \\r
86 FV_FILESYSTEM_INSTANCE, \\r
87 SimpleFs, \\r
88 FVFS_INSTANCE_SIGNATURE \\r
89 )\r
90\r
1436aea4 91#define FVFS_FILE_FROM_FILE_THIS(This) CR ( \\r
9da91aea
BJ
92 This, \\r
93 FV_FILESYSTEM_FILE, \\r
94 FileProtocol, \\r
95 FVFS_FILE_SIGNATURE \\r
96 )\r
97\r
1436aea4 98#define FVFS_FILE_INFO_FROM_LINK(This) CR ( \\r
9da91aea
BJ
99 This, \\r
100 FV_FILESYSTEM_FILE_INFO, \\r
101 Link, \\r
102 FVFS_FILE_INFO_SIGNATURE \\r
103 )\r
104\r
1436aea4 105#define FVFS_FILE_FROM_LINK(FileLink) CR (FileLink, FV_FILESYSTEM_FILE, Link, FVFS_FILE_SIGNATURE)\r
9da91aea 106\r
1436aea4 107#define FVFS_GET_FIRST_FILE(Instance) FVFS_FILE_FROM_LINK (GetFirstNode (&Instance->FileHead))\r
9da91aea 108\r
1436aea4 109#define FVFS_GET_FIRST_FILE_INFO(Instance) FVFS_FILE_INFO_FROM_LINK (GetFirstNode (&Instance->FileInfoHead))\r
9da91aea 110\r
1436aea4 111#define FV_FILETYPE_IS_EXECUTABLE(Type) ((Type) == EFI_FV_FILETYPE_PEIM ||\\r
9da91aea
BJ
112 (Type) == EFI_FV_FILETYPE_DRIVER || \\r
113 (Type) == EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER || \\r
114 (Type) == EFI_FV_FILETYPE_APPLICATION)\r
115\r
116/**\r
117 Open the root directory on a volume.\r
118\r
119 @param This A pointer to the volume to open the root directory.\r
120 @param RootFile A pointer to the location to return the opened file handle for the\r
121 root directory.\r
122\r
123 @retval EFI_SUCCESS The device was opened.\r
124 @retval EFI_UNSUPPORTED This volume does not support the requested file system type.\r
125 @retval EFI_NO_MEDIA The device has no medium.\r
126 @retval EFI_DEVICE_ERROR The device reported an error.\r
127 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
128 @retval EFI_ACCESS_DENIED The service denied access to the file.\r
129 @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.\r
130 @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no\r
131 longer supported. Any existing file handles for this volume are\r
132 no longer valid. To access the files on the new medium, the\r
133 volume must be reopened with OpenVolume().\r
134\r
135**/\r
136EFI_STATUS\r
137EFIAPI\r
138FvSimpleFileSystemOpenVolume (\r
1436aea4
MK
139 IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,\r
140 OUT EFI_FILE_PROTOCOL **RootFile\r
9da91aea
BJ
141 );\r
142\r
143/**\r
144 Test to see if this driver supports ControllerHandle.\r
145\r
146 @param DriverBinding Protocol instance pointer.\r
147 @param ControllerHandle Handle of device to test\r
148 @param RemainingDevicePath Optional parameter use to pick a specific child\r
149 device to start.\r
150\r
151 @retval EFI_SUCCESS This driver supports this device\r
152 @retval EFI_ALREADY_STARTED This driver is already running on this device\r
153 @retval other This driver does not support this device\r
154\r
155**/\r
156EFI_STATUS\r
157EFIAPI\r
158FvSimpleFileSystemDriverSupported (\r
159 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
160 IN EFI_HANDLE ControllerHandle,\r
161 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
162 );\r
163\r
164/**\r
165 Start this driver on ControllerHandle by opening a FV protocol and\r
166 installing a SimpleFileSystem protocol on ControllerHandle.\r
167\r
168 @param DriverBinding Protocol instance pointer.\r
169 @param ControllerHandle Handle of device to bind driver to\r
170 @param RemainingDevicePath Optional parameter use to pick a specific child\r
171 device to start.\r
172\r
173 @retval EFI_SUCCESS This driver is added to ControllerHandle\r
174 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r
175 @retval other This driver does not support this device\r
176\r
177**/\r
178EFI_STATUS\r
179EFIAPI\r
180FvSimpleFileSystemDriverStart (\r
181 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
182 IN EFI_HANDLE ControllerHandle,\r
183 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
184 );\r
185\r
186/**\r
187 Stop this driver on ControllerHandle by removing SimpleFileSystem protocol and closing\r
188 the FV protocol on ControllerHandle.\r
189\r
190 @param DriverBinding Protocol instance pointer.\r
191 @param ControllerHandle Handle of device to stop driver on\r
192 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r
193 children is zero stop the entire bus driver.\r
194 @param ChildHandleBuffer List of Child Handles to Stop.\r
195\r
196 @retval EFI_SUCCESS This driver is removed ControllerHandle\r
197 @retval other This driver was not removed from this device\r
198\r
199**/\r
200EFI_STATUS\r
201EFIAPI\r
202FvSimpleFileSystemDriverStop (\r
1436aea4
MK
203 IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
204 IN EFI_HANDLE ControllerHandle,\r
205 IN UINTN NumberOfChildren,\r
206 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
9da91aea
BJ
207 );\r
208\r
209/**\r
210 Opens a new file relative to the source file's location.\r
211\r
212 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
213 handle to the source location. This would typically be an open\r
214 handle to a directory.\r
215 @param NewHandle A pointer to the location to return the opened handle for the new\r
216 file.\r
217 @param FileName The Null-terminated string of the name of the file to be opened.\r
218 The file name may contain the following path modifiers: "\", ".",\r
219 and "..".\r
220 @param OpenMode The mode to open the file. The only valid combinations that the\r
221 file may be opened with are: Read, Read/Write, or Create/Read/Write.\r
222 @param Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the\r
223 attribute bits for the newly created file.\r
224\r
225 @retval EFI_SUCCESS The file was opened.\r
226 @retval EFI_NOT_FOUND The specified file could not be found on the device.\r
227 @retval EFI_NO_MEDIA The device has no medium.\r
228 @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no\r
229 longer supported.\r
230 @retval EFI_DEVICE_ERROR The device reported an error.\r
231 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
232 @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write\r
233 when the media is write-protected.\r
234 @retval EFI_ACCESS_DENIED The service denied access to the file.\r
235 @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.\r
236 @retval EFI_VOLUME_FULL The volume is full.\r
237\r
238**/\r
239EFI_STATUS\r
240EFIAPI\r
241FvSimpleFileSystemOpen (\r
1436aea4
MK
242 IN EFI_FILE_PROTOCOL *This,\r
243 OUT EFI_FILE_PROTOCOL **NewHandle,\r
244 IN CHAR16 *FileName,\r
245 IN UINT64 OpenMode,\r
246 IN UINT64 Attributes\r
9da91aea
BJ
247 );\r
248\r
249/**\r
250 Closes a specified file handle.\r
251\r
252 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
253 handle to close.\r
254\r
255 @retval EFI_SUCCESS The file was closed.\r
256\r
257**/\r
258EFI_STATUS\r
259EFIAPI\r
260FvSimpleFileSystemClose (\r
261 IN EFI_FILE_PROTOCOL *This\r
262 );\r
263\r
264/**\r
265 Reads data from a file.\r
266\r
267 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
268 handle to read data from.\r
269 @param BufferSize On input, the size of the Buffer. On output, the amount of data\r
270 returned in Buffer. In both cases, the size is measured in bytes.\r
271 @param Buffer The buffer into which the data is read.\r
272\r
273 @retval EFI_SUCCESS Data was read.\r
274 @retval EFI_NO_MEDIA The device has no medium.\r
275 @retval EFI_DEVICE_ERROR The device reported an error.\r
276 @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file.\r
277 @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file.\r
278 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
279 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory\r
280 entry. BufferSize has been updated with the size\r
281 needed to complete the request.\r
282\r
283**/\r
284EFI_STATUS\r
285EFIAPI\r
286FvSimpleFileSystemRead (\r
1436aea4
MK
287 IN EFI_FILE_PROTOCOL *This,\r
288 IN OUT UINTN *BufferSize,\r
289 OUT VOID *Buffer\r
9da91aea
BJ
290 );\r
291\r
292/**\r
293 Writes data to a file.\r
294\r
295 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
296 handle to write data to.\r
297 @param BufferSize On input, the size of the Buffer. On output, the amount of data\r
298 actually written. In both cases, the size is measured in bytes.\r
299 @param Buffer The buffer of data to write.\r
300\r
301 @retval EFI_SUCCESS Data was written.\r
302 @retval EFI_UNSUPPORTED Writes to open directory files are not supported.\r
303 @retval EFI_NO_MEDIA The device has no medium.\r
304 @retval EFI_DEVICE_ERROR The device reported an error.\r
305 @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.\r
306 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
307 @retval EFI_WRITE_PROTECTED The file or medium is write-protected.\r
308 @retval EFI_ACCESS_DENIED The file was opened read only.\r
309 @retval EFI_VOLUME_FULL The volume is full.\r
310\r
311**/\r
312EFI_STATUS\r
313EFIAPI\r
314FvSimpleFileSystemWrite (\r
1436aea4
MK
315 IN EFI_FILE_PROTOCOL *This,\r
316 IN OUT UINTN *BufferSize,\r
317 IN VOID *Buffer\r
9da91aea
BJ
318 );\r
319\r
320/**\r
321 Returns a file's current position.\r
322\r
323 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
324 handle to get the current position on.\r
325 @param Position The address to return the file's current position value.\r
326\r
327 @retval EFI_SUCCESS The position was returned.\r
328 @retval EFI_UNSUPPORTED The request is not valid on open directories.\r
329 @retval EFI_DEVICE_ERROR An attempt was made to get the position from a deleted file.\r
330\r
331**/\r
332EFI_STATUS\r
333EFIAPI\r
334FvSimpleFileSystemGetPosition (\r
1436aea4
MK
335 IN EFI_FILE_PROTOCOL *This,\r
336 OUT UINT64 *Position\r
9da91aea
BJ
337 );\r
338\r
339/**\r
340 Sets a file's current position.\r
341\r
342 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the\r
343 file handle to set the requested position on.\r
344 @param Position The byte position from the start of the file to set.\r
345\r
346 @retval EFI_SUCCESS The position was set.\r
347 @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open\r
348 directories.\r
349 @retval EFI_DEVICE_ERROR An attempt was made to set the position of a deleted file.\r
350\r
351**/\r
352EFI_STATUS\r
353EFIAPI\r
354FvSimpleFileSystemSetPosition (\r
1436aea4
MK
355 IN EFI_FILE_PROTOCOL *This,\r
356 IN UINT64 Position\r
9da91aea
BJ
357 );\r
358\r
359/**\r
360 Flushes all modified data associated with a file to a device.\r
361\r
362 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
363 handle to flush.\r
364\r
365 @retval EFI_SUCCESS The data was flushed.\r
366 @retval EFI_NO_MEDIA The device has no medium.\r
367 @retval EFI_DEVICE_ERROR The device reported an error.\r
368 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
369 @retval EFI_WRITE_PROTECTED The file or medium is write-protected.\r
370 @retval EFI_ACCESS_DENIED The file was opened read-only.\r
371 @retval EFI_VOLUME_FULL The volume is full.\r
372\r
373**/\r
374EFI_STATUS\r
375EFIAPI\r
376FvSimpleFileSystemFlush (\r
377 IN EFI_FILE_PROTOCOL *This\r
378 );\r
379\r
380/**\r
381 Close and delete the file handle.\r
382\r
383 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the\r
384 handle to the file to delete.\r
385\r
386 @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed.\r
387 @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not deleted.\r
388\r
389**/\r
390EFI_STATUS\r
391EFIAPI\r
392FvSimpleFileSystemDelete (\r
1436aea4 393 IN EFI_FILE_PROTOCOL *This\r
9da91aea
BJ
394 );\r
395\r
396/**\r
397 Returns information about a file.\r
398\r
399 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
400 handle the requested information is for.\r
401 @param InformationType The type identifier for the information being requested.\r
402 @param BufferSize On input, the size of Buffer. On output, the amount of data\r
403 returned in Buffer. In both cases, the size is measured in bytes.\r
404 @param Buffer A pointer to the data buffer to return. The buffer's type is\r
405 indicated by InformationType.\r
406\r
407 @retval EFI_SUCCESS The information was returned.\r
408 @retval EFI_UNSUPPORTED The InformationType is not known.\r
409 @retval EFI_NO_MEDIA The device has no medium.\r
410 @retval EFI_DEVICE_ERROR The device reported an error.\r
411 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
412 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.\r
413 BufferSize has been updated with the size needed to complete\r
414 the request.\r
415**/\r
416EFI_STATUS\r
417EFIAPI\r
418FvSimpleFileSystemGetInfo (\r
1436aea4
MK
419 IN EFI_FILE_PROTOCOL *This,\r
420 IN EFI_GUID *InformationType,\r
421 IN OUT UINTN *BufferSize,\r
422 OUT VOID *Buffer\r
9da91aea
BJ
423 );\r
424\r
425/**\r
426 Sets information about a file.\r
427\r
428 @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file\r
429 handle the information is for.\r
430 @param InformationType The type identifier for the information being set.\r
431 @param BufferSize The size, in bytes, of Buffer.\r
432 @param Buffer A pointer to the data buffer to write. The buffer's type is\r
433 indicated by InformationType.\r
434\r
435 @retval EFI_SUCCESS The information was set.\r
436 @retval EFI_UNSUPPORTED The InformationType is not known.\r
437 @retval EFI_NO_MEDIA The device has no medium.\r
438 @retval EFI_DEVICE_ERROR The device reported an error.\r
439 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.\r
440 @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_INFO_ID and the media is\r
441 read-only.\r
442 @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_PROTOCOL_SYSTEM_INFO_ID\r
443 and the media is read only.\r
444 @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_SYSTEM_VOLUME_LABEL_ID\r
445 and the media is read-only.\r
446 @retval EFI_ACCESS_DENIED An attempt is made to change the name of a file to a\r
447 file that is already present.\r
448 @retval EFI_ACCESS_DENIED An attempt is being made to change the EFI_FILE_DIRECTORY\r
449 Attribute.\r
450 @retval EFI_ACCESS_DENIED An attempt is being made to change the size of a directory.\r
451 @retval EFI_ACCESS_DENIED InformationType is EFI_FILE_INFO_ID and the file was opened\r
452 read-only and an attempt is being made to modify a field\r
453 other than Attribute.\r
454 @retval EFI_VOLUME_FULL The volume is full.\r
455 @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of the type indicated\r
456 by InformationType.\r
457\r
458**/\r
459EFI_STATUS\r
460EFIAPI\r
461FvSimpleFileSystemSetInfo (\r
1436aea4
MK
462 IN EFI_FILE_PROTOCOL *This,\r
463 IN EFI_GUID *InformationType,\r
464 IN UINTN BufferSize,\r
465 IN VOID *Buffer\r
9da91aea
BJ
466 );\r
467\r
468/**\r
469 Get the size of the buffer that will be returned by FvFsReadFile.\r
470\r
471 @param FvProtocol A pointer to the EFI_FIRMWARE_VOLUME2_PROTOCOL instance.\r
472 @param FvFileInfo A pointer to the FV_FILESYSTEM_FILE_INFO instance that is a struct\r
473 representing a file's info.\r
474\r
475 @retval EFI_SUCCESS The file size was gotten correctly.\r
476 @retval Others The file size wasn't gotten correctly.\r
477\r
478**/\r
479EFI_STATUS\r
480FvFsGetFileSize (\r
1436aea4
MK
481 IN EFI_FIRMWARE_VOLUME2_PROTOCOL *FvProtocol,\r
482 IN OUT FV_FILESYSTEM_FILE_INFO *FvFileInfo\r
9da91aea
BJ
483 );\r
484\r
485/**\r
486 Retrieves a Unicode string that is the user readable name of the driver.\r
487\r
488 This function retrieves the user readable name of a driver in the form of a\r
489 Unicode string. If the driver specified by This has a user readable name in\r
490 the language specified by Language, then a pointer to the driver name is\r
491 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
492 by This does not support the language specified by Language,\r
493 then EFI_UNSUPPORTED is returned.\r
494\r
495 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
496 EFI_COMPONENT_NAME_PROTOCOL instance.\r
497\r
498 @param Language[in] A pointer to a Null-terminated ASCII string\r
499 array indicating the language. This is the\r
500 language of the driver name that the caller is\r
501 requesting, and it must match one of the\r
502 languages specified in SupportedLanguages. The\r
503 number of languages supported by a driver is up\r
504 to the driver writer. Language is specified\r
505 in RFC 4646 or ISO 639-2 language code format.\r
506\r
507 @param DriverName[out] A pointer to the Unicode string to return.\r
508 This Unicode string is the name of the\r
509 driver specified by This in the language\r
510 specified by Language.\r
511\r
512 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
513 This and the language specified by Language was\r
514 returned in DriverName.\r
515\r
516 @retval EFI_INVALID_PARAMETER Language is NULL.\r
517\r
518 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
519\r
520 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
521 the language specified by Language.\r
522\r
523**/\r
524EFI_STATUS\r
525EFIAPI\r
526FvSimpleFileSystemComponentNameGetDriverName (\r
527 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
528 IN CHAR8 *Language,\r
529 OUT CHAR16 **DriverName\r
530 );\r
531\r
532/**\r
533 Retrieves a Unicode string that is the user readable name of the controller\r
534 that is being managed by a driver.\r
535\r
536 This function retrieves the user readable name of the controller specified by\r
537 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
538 driver specified by This has a user readable name in the language specified by\r
539 Language, then a pointer to the controller name is returned in ControllerName,\r
540 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
541 managing the controller specified by ControllerHandle and ChildHandle,\r
542 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
543 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
544\r
545 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
546 EFI_COMPONENT_NAME_PROTOCOL instance.\r
547\r
548 @param ControllerHandle[in] The handle of a controller that the driver\r
549 specified by This is managing. This handle\r
550 specifies the controller whose name is to be\r
551 returned.\r
552\r
553 @param ChildHandle[in] The handle of the child controller to retrieve\r
554 the name of. This is an optional parameter that\r
555 may be NULL. It will be NULL for device\r
556 drivers. It will also be NULL for a bus drivers\r
557 that wish to retrieve the name of the bus\r
558 controller. It will not be NULL for a bus\r
559 driver that wishes to retrieve the name of a\r
560 child controller.\r
561\r
562 @param Language[in] A pointer to a Null-terminated ASCII string\r
563 array indicating the language. This is the\r
564 language of the driver name that the caller is\r
565 requesting, and it must match one of the\r
566 languages specified in SupportedLanguages. The\r
567 number of languages supported by a driver is up\r
568 to the driver writer. Language is specified in\r
569 RFC 4646 or ISO 639-2 language code format.\r
570\r
571 @param ControllerName[out] A pointer to the Unicode string to return.\r
572 This Unicode string is the name of the\r
573 controller specified by ControllerHandle and\r
574 ChildHandle in the language specified by\r
575 Language from the point of view of the driver\r
576 specified by This.\r
577\r
578 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
579 the language specified by Language for the\r
580 driver specified by This was returned in\r
581 DriverName.\r
582\r
583 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
584\r
585 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
586 EFI_HANDLE.\r
587\r
588 @retval EFI_INVALID_PARAMETER Language is NULL.\r
589\r
590 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
591\r
592 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
593 managing the controller specified by\r
594 ControllerHandle and ChildHandle.\r
595\r
596 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
597 the language specified by Language.\r
598\r
599**/\r
600EFI_STATUS\r
601EFIAPI\r
602FvSimpleFileSystemComponentNameGetControllerName (\r
1436aea4
MK
603 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
604 IN EFI_HANDLE ControllerHandle,\r
605 IN EFI_HANDLE ChildHandle OPTIONAL,\r
606 IN CHAR8 *Language,\r
607 OUT CHAR16 **ControllerName\r
9da91aea
BJ
608 );\r
609\r
610extern EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollation;\r
611extern EFI_FILE_PROTOCOL mFileSystemTemplate;\r
612extern EFI_COMPONENT_NAME_PROTOCOL gFvSimpleFileSystemComponentName;\r
613extern EFI_COMPONENT_NAME2_PROTOCOL gFvSimpleFileSystemComponentName2;\r
614\r
92141e17 615#endif\r