]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Disk/UdfDxe/Udf.h
MdeModulePkg: Initial UDF/ECMA-167 file system support
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / UdfDxe / Udf.h
1 /** @file
2 UDF/ECMA-167 file system driver.
3
4 Copyright (C) 2014-2017 Paulo Alcantara <pcacjr@zytor.com>
5
6 This program and the accompanying materials are licensed and made available
7 under the terms and conditions of the BSD License which accompanies this
8 distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
12 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 **/
14
15 #ifndef _UDF_H_
16 #define _UDF_H_
17
18 #include <Uefi.h>
19 #include <Base.h>
20
21 #include <Protocol/BlockIo.h>
22 #include <Protocol/ComponentName.h>
23 #include <Protocol/DevicePath.h>
24 #include <Protocol/DriverBinding.h>
25 #include <Protocol/DiskIo.h>
26 #include <Protocol/SimpleFileSystem.h>
27
28 #include <Guid/FileInfo.h>
29 #include <Guid/FileSystemInfo.h>
30 #include <Guid/FileSystemVolumeLabelInfo.h>
31
32 #include <Library/DebugLib.h>
33 #include <Library/UefiDriverEntryPoint.h>
34 #include <Library/BaseLib.h>
35 #include <Library/UefiLib.h>
36 #include <Library/BaseMemoryLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/UefiBootServicesTableLib.h>
39 #include <Library/DevicePathLib.h>
40
41 #include <IndustryStandard/ElTorito.h>
42 #include <IndustryStandard/Udf.h>
43
44 //
45 // C5BD4D42-1A76-4996-8956-73CDA326CD0A
46 //
47 #define EFI_UDF_DEVICE_PATH_GUID \
48 { 0xC5BD4D42, 0x1A76, 0x4996, \
49 { 0x89, 0x56, 0x73, 0xCD, 0xA3, 0x26, 0xCD, 0x0A } \
50 }
51
52 #define UDF_DEFAULT_LV_NUM 0
53
54 #define IS_PVD(_Pointer) \
55 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 1))
56 #define IS_PD(_Pointer) \
57 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 5))
58 #define IS_LVD(_Pointer) \
59 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 6))
60 #define IS_TD(_Pointer) \
61 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 8))
62 #define IS_FSD(_Pointer) \
63 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 256))
64 #define IS_FE(_Pointer) \
65 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 261))
66 #define IS_EFE(_Pointer) \
67 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 266))
68 #define IS_FID(_Pointer) \
69 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 257))
70 #define IS_AED(_Pointer) \
71 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 258))
72 #define IS_LVID(_Pointer) \
73 ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 9))
74
75 #define _GET_FILETYPE(_Pointer) \
76 (IS_FE (_Pointer) ? \
77 (((UDF_FILE_ENTRY *)(_Pointer))->IcbTag.FileType) \
78 : \
79 (((UDF_EXTENDED_FILE_ENTRY *)(_Pointer))->IcbTag.FileType))
80
81 #define IS_FE_DIRECTORY(_Pointer) \
82 ((BOOLEAN)(_GET_FILETYPE (_Pointer) == 4))
83 #define IS_FE_STANDARD_FILE(_Pointer) \
84 ((BOOLEAN)(_GET_FILETYPE (_Pointer) == 5))
85 #define IS_FE_SYMLINK(_Pointer) \
86 ((BOOLEAN)(_GET_FILETYPE (_Pointer) == 12))
87
88 #define HIDDEN_FILE (1 << 0)
89 #define DIRECTORY_FILE (1 << 1)
90 #define DELETED_FILE (1 << 2)
91 #define PARENT_FILE (1 << 3)
92
93 #define _GET_FILE_CHARS(_Pointer) \
94 (((UDF_FILE_IDENTIFIER_DESCRIPTOR *)(_Pointer))->FileCharacteristics)
95
96 #define IS_FID_HIDDEN_FILE(_Pointer) \
97 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & HIDDEN_FILE))
98 #define IS_FID_DIRECTORY_FILE(_Pointer) \
99 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & DIRECTORY_FILE))
100 #define IS_FID_DELETED_FILE(_Pointer) \
101 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & DELETED_FILE))
102 #define IS_FID_PARENT_FILE(_Pointer) \
103 ((BOOLEAN)(_GET_FILE_CHARS (_Pointer) & PARENT_FILE))
104 #define IS_FID_NORMAL_FILE(_Pointer) \
105 ((BOOLEAN)(!IS_FID_DIRECTORY_FILE (_Pointer) && \
106 !IS_FID_PARENT_FILE (_Pointer)))
107
108 typedef enum {
109 SHORT_ADS_SEQUENCE,
110 LONG_ADS_SEQUENCE,
111 EXTENDED_ADS_SEQUENCE,
112 INLINE_DATA
113 } UDF_FE_RECORDING_FLAGS;
114
115 #define GET_FE_RECORDING_FLAGS(_Fe) \
116 ((UDF_FE_RECORDING_FLAGS)((UDF_ICB_TAG *)( \
117 (UINT8 *)(_Fe) + \
118 sizeof (UDF_DESCRIPTOR_TAG)))->Flags & 0x07)
119
120 typedef enum {
121 EXTENT_RECORDED_AND_ALLOCATED,
122 EXTENT_NOT_RECORDED_BUT_ALLOCATED,
123 EXTENT_NOT_RECORDED_NOT_ALLOCATED,
124 EXTENT_IS_NEXT_EXTENT,
125 } UDF_EXTENT_FLAGS;
126
127 #define AD_LENGTH(_RecFlags) \
128 ((_RecFlags) == SHORT_ADS_SEQUENCE ? \
129 ((UINT64)(sizeof (UDF_SHORT_ALLOCATION_DESCRIPTOR))) : \
130 ((UINT64)(sizeof (UDF_LONG_ALLOCATION_DESCRIPTOR))))
131
132 #define GET_EXTENT_FLAGS(_RecFlags, _Ad) \
133 ((_RecFlags) == SHORT_ADS_SEQUENCE ? \
134 ((UDF_EXTENT_FLAGS)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
135 30) & 0x3)) : \
136 ((UDF_EXTENT_FLAGS)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength >> \
137 30) & 0x3)))
138
139 #define GET_EXTENT_LENGTH(_RecFlags, _Ad) \
140 ((_RecFlags) == SHORT_ADS_SEQUENCE ? \
141 ((UINT32)((((UDF_SHORT_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
142 ~0xC0000000UL))) : \
143 ((UINT32)((((UDF_LONG_ALLOCATION_DESCRIPTOR *)(_Ad))->ExtentLength & \
144 ~0xC0000000UL))))
145
146 #define UDF_FILENAME_LENGTH 128
147 #define UDF_PATH_LENGTH 512
148
149 #define GET_FID_FROM_ADS(_Data, _Offs) \
150 ((UDF_FILE_IDENTIFIER_DESCRIPTOR *)((UINT8 *)(_Data) + (_Offs)))
151
152 #define IS_VALID_COMPRESSION_ID(_CompId) \
153 ((BOOLEAN)((_CompId) == 8 || (_CompId) == 16))
154
155 #define LV_BLOCK_SIZE(_Vol, _LvNum) \
156 (_Vol)->LogicalVolDescs[(_LvNum)]->LogicalBlockSize
157
158 #define UDF_STANDARD_IDENTIFIER_LENGTH 5
159
160 #define LV_UDF_REVISION(_Lv) \
161 *(UINT16 *)(UINTN)(_Lv)->DomainIdentifier.IdentifierSuffix
162
163 #pragma pack(1)
164
165 typedef struct {
166 UINT8 StandardIdentifier[UDF_STANDARD_IDENTIFIER_LENGTH];
167 } UDF_STANDARD_IDENTIFIER;
168
169 #pragma pack()
170
171 typedef enum {
172 READ_FILE_GET_FILESIZE,
173 READ_FILE_ALLOCATE_AND_READ,
174 READ_FILE_SEEK_AND_READ,
175 } UDF_READ_FILE_FLAGS;
176
177 typedef struct {
178 VOID *FileData;
179 UDF_READ_FILE_FLAGS Flags;
180 UINT64 FileDataSize;
181 UINT64 FilePosition;
182 UINT64 FileSize;
183 UINT64 ReadLength;
184 } UDF_READ_FILE_INFO;
185
186 #pragma pack(1)
187
188 typedef struct {
189 UINT8 CharacterSetType;
190 UINT8 CharacterSetInfo[63];
191 } UDF_CHAR_SPEC;
192
193 typedef struct {
194 UINT8 Flags;
195 UINT8 Identifier[23];
196 UINT8 IdentifierSuffix[8];
197 } UDF_ENTITY_ID;
198
199 typedef struct {
200 UINT16 TypeAndTimezone;
201 INT16 Year;
202 UINT8 Month;
203 UINT8 Day;
204 UINT8 Hour;
205 UINT8 Minute;
206 UINT8 Second;
207 UINT8 Centiseconds;
208 UINT8 HundredsOfMicroseconds;
209 UINT8 Microseconds;
210 } UDF_TIMESTAMP;
211
212 typedef struct {
213 UINT32 LogicalBlockNumber;
214 UINT16 PartitionReferenceNumber;
215 } UDF_LB_ADDR;
216
217 typedef struct {
218 UINT32 ExtentLength;
219 UDF_LB_ADDR ExtentLocation;
220 UINT8 ImplementationUse[6];
221 } UDF_LONG_ALLOCATION_DESCRIPTOR;
222
223 typedef struct {
224 UDF_DESCRIPTOR_TAG DescriptorTag;
225 UINT32 PrevAllocationExtentDescriptor;
226 UINT32 LengthOfAllocationDescriptors;
227 } UDF_ALLOCATION_EXTENT_DESCRIPTOR;
228
229 typedef struct {
230 UINT8 StructureType;
231 UINT8 StandardIdentifier[UDF_STANDARD_IDENTIFIER_LENGTH];
232 UINT8 StructureVersion;
233 UINT8 Reserved;
234 UINT8 StructureData[2040];
235 } UDF_VOLUME_DESCRIPTOR;
236
237 typedef struct {
238 UDF_DESCRIPTOR_TAG DescriptorTag;
239 UINT32 VolumeDescriptorSequenceNumber;
240 UINT16 PartitionFlags;
241 UINT16 PartitionNumber;
242 UDF_ENTITY_ID PartitionContents;
243 UINT8 PartitionContentsUse[128];
244 UINT32 AccessType;
245 UINT32 PartitionStartingLocation;
246 UINT32 PartitionLength;
247 UDF_ENTITY_ID ImplementationIdentifier;
248 UINT8 ImplementationUse[128];
249 UINT8 Reserved[156];
250 } UDF_PARTITION_DESCRIPTOR;
251
252 typedef struct {
253 UDF_DESCRIPTOR_TAG DescriptorTag;
254 UINT32 VolumeDescriptorSequenceNumber;
255 UDF_CHAR_SPEC DescriptorCharacterSet;
256 UINT8 LogicalVolumeIdentifier[128];
257 UINT32 LogicalBlockSize;
258 UDF_ENTITY_ID DomainIdentifier;
259 UDF_LONG_ALLOCATION_DESCRIPTOR LogicalVolumeContentsUse;
260 UINT32 MapTableLength;
261 UINT32 NumberOfPartitionMaps;
262 UDF_ENTITY_ID ImplementationIdentifier;
263 UINT8 ImplementationUse[128];
264 UDF_EXTENT_AD IntegritySequenceExtent;
265 UINT8 PartitionMaps[6];
266 } UDF_LOGICAL_VOLUME_DESCRIPTOR;
267
268 typedef struct {
269 UDF_DESCRIPTOR_TAG DescriptorTag;
270 UDF_TIMESTAMP RecordingDateTime;
271 UINT32 IntegrityType;
272 UDF_EXTENT_AD NextIntegrityExtent;
273 UINT8 LogicalVolumeContentsUse[32];
274 UINT32 NumberOfPartitions;
275 UINT32 LengthOfImplementationUse;
276 UINT8 Data[0];
277 } UDF_LOGICAL_VOLUME_INTEGRITY;
278
279 typedef struct {
280 UDF_DESCRIPTOR_TAG DescriptorTag;
281 UDF_TIMESTAMP RecordingDateAndTime;
282 UINT16 InterchangeLevel;
283 UINT16 MaximumInterchangeLevel;
284 UINT32 CharacterSetList;
285 UINT32 MaximumCharacterSetList;
286 UINT32 FileSetNumber;
287 UINT32 FileSetDescriptorNumber;
288 UDF_CHAR_SPEC LogicalVolumeIdentifierCharacterSet;
289 UINT8 LogicalVolumeIdentifier[128];
290 UDF_CHAR_SPEC FileSetCharacterSet;
291 UINT8 FileSetIdentifier[32];
292 UINT8 CopyrightFileIdentifier[32];
293 UINT8 AbstractFileIdentifier[32];
294 UDF_LONG_ALLOCATION_DESCRIPTOR RootDirectoryIcb;
295 UDF_ENTITY_ID DomainIdentifier;
296 UDF_LONG_ALLOCATION_DESCRIPTOR NextExtent;
297 UDF_LONG_ALLOCATION_DESCRIPTOR SystemStreamDirectoryIcb;
298 UINT8 Reserved[32];
299 } UDF_FILE_SET_DESCRIPTOR;
300
301 typedef struct {
302 UINT32 ExtentLength;
303 UINT32 ExtentPosition;
304 } UDF_SHORT_ALLOCATION_DESCRIPTOR;
305
306 typedef struct {
307 UDF_DESCRIPTOR_TAG DescriptorTag;
308 UINT16 FileVersionNumber;
309 UINT8 FileCharacteristics;
310 UINT8 LengthOfFileIdentifier;
311 UDF_LONG_ALLOCATION_DESCRIPTOR Icb;
312 UINT16 LengthOfImplementationUse;
313 UINT8 Data[0];
314 } UDF_FILE_IDENTIFIER_DESCRIPTOR;
315
316 typedef struct {
317 UINT32 PriorRecordNumberOfDirectEntries;
318 UINT16 StrategyType;
319 UINT16 StrategyParameter;
320 UINT16 MaximumNumberOfEntries;
321 UINT8 Reserved;
322 UINT8 FileType;
323 UDF_LB_ADDR ParentIcbLocation;
324 UINT16 Flags;
325 } UDF_ICB_TAG;
326
327 typedef struct {
328 UDF_DESCRIPTOR_TAG DescriptorTag;
329 UDF_ICB_TAG IcbTag;
330 UINT32 Uid;
331 UINT32 Gid;
332 UINT32 Permissions;
333 UINT16 FileLinkCount;
334 UINT8 RecordFormat;
335 UINT8 RecordDisplayAttributes;
336 UINT32 RecordLength;
337 UINT64 InformationLength;
338 UINT64 LogicalBlocksRecorded;
339 UDF_TIMESTAMP AccessTime;
340 UDF_TIMESTAMP ModificationTime;
341 UDF_TIMESTAMP AttributeTime;
342 UINT32 CheckPoint;
343 UDF_LONG_ALLOCATION_DESCRIPTOR ExtendedAttributeIcb;
344 UDF_ENTITY_ID ImplementationIdentifier;
345 UINT64 UniqueId;
346 UINT32 LengthOfExtendedAttributes;
347 UINT32 LengthOfAllocationDescriptors;
348 UINT8 Data[0]; // L_EA + L_AD
349 } UDF_FILE_ENTRY;
350
351 typedef struct {
352 UDF_DESCRIPTOR_TAG DescriptorTag;
353 UDF_ICB_TAG IcbTag;
354 UINT32 Uid;
355 UINT32 Gid;
356 UINT32 Permissions;
357 UINT16 FileLinkCount;
358 UINT8 RecordFormat;
359 UINT8 RecordDisplayAttributes;
360 UINT32 RecordLength;
361 UINT64 InformationLength;
362 UINT64 ObjectSize;
363 UINT64 LogicalBlocksRecorded;
364 UDF_TIMESTAMP AccessTime;
365 UDF_TIMESTAMP ModificationTime;
366 UDF_TIMESTAMP CreationTime;
367 UDF_TIMESTAMP AttributeTime;
368 UINT32 CheckPoint;
369 UINT32 Reserved;
370 UDF_LONG_ALLOCATION_DESCRIPTOR ExtendedAttributeIcb;
371 UDF_LONG_ALLOCATION_DESCRIPTOR StreamDirectoryIcb;
372 UDF_ENTITY_ID ImplementationIdentifier;
373 UINT64 UniqueId;
374 UINT32 LengthOfExtendedAttributes;
375 UINT32 LengthOfAllocationDescriptors;
376 UINT8 Data[0]; // L_EA + L_AD
377 } UDF_EXTENDED_FILE_ENTRY;
378
379 typedef struct {
380 UINT8 ComponentType;
381 UINT8 LengthOfComponentIdentifier;
382 UINT16 ComponentFileVersionNumber;
383 UINT8 ComponentIdentifier[0];
384 } UDF_PATH_COMPONENT;
385
386 #pragma pack()
387
388 //
389 // UDF filesystem driver's private data
390 //
391 typedef struct {
392 UDF_LOGICAL_VOLUME_DESCRIPTOR **LogicalVolDescs;
393 UINTN LogicalVolDescsNo;
394 UDF_PARTITION_DESCRIPTOR **PartitionDescs;
395 UINTN PartitionDescsNo;
396 UDF_FILE_SET_DESCRIPTOR **FileSetDescs;
397 UINTN FileSetDescsNo;
398 UINTN FileEntrySize;
399 } UDF_VOLUME_INFO;
400
401 typedef struct {
402 VOID *FileEntry;
403 UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc;
404 } UDF_FILE_INFO;
405
406 typedef struct {
407 VOID *DirectoryData;
408 UINT64 DirectoryLength;
409 UINT64 FidOffset;
410 } UDF_READ_DIRECTORY_INFO;
411
412 #define PRIVATE_UDF_FILE_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'f', 'f')
413
414 #define PRIVATE_UDF_FILE_DATA_FROM_THIS(a) \
415 CR ( \
416 a, \
417 PRIVATE_UDF_FILE_DATA, \
418 FileIo, \
419 PRIVATE_UDF_FILE_DATA_SIGNATURE \
420 )
421
422 typedef struct {
423 UINTN Signature;
424 BOOLEAN IsRootDirectory;
425 UDF_FILE_INFO *Root;
426 UDF_FILE_INFO File;
427 UDF_READ_DIRECTORY_INFO ReadDirInfo;
428 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFs;
429 EFI_FILE_PROTOCOL FileIo;
430 CHAR16 AbsoluteFileName[UDF_PATH_LENGTH];
431 CHAR16 FileName[UDF_FILENAME_LENGTH];
432 UINT64 FileSize;
433 UINT64 FilePosition;
434 } PRIVATE_UDF_FILE_DATA;
435
436 #define PRIVATE_UDF_SIMPLE_FS_DATA_SIGNATURE SIGNATURE_32 ('U', 'd', 'f', 's')
437
438 #define PRIVATE_UDF_SIMPLE_FS_DATA_FROM_THIS(a) \
439 CR ( \
440 a, \
441 PRIVATE_UDF_SIMPLE_FS_DATA, \
442 SimpleFs, \
443 PRIVATE_UDF_SIMPLE_FS_DATA_SIGNATURE \
444 )
445
446 typedef struct {
447 UINTN Signature;
448 EFI_BLOCK_IO_PROTOCOL *BlockIo;
449 EFI_DISK_IO_PROTOCOL *DiskIo;
450 EFI_SIMPLE_FILE_SYSTEM_PROTOCOL SimpleFs;
451 UDF_VOLUME_INFO Volume;
452 UDF_FILE_INFO Root;
453 UINTN OpenFiles;
454 EFI_HANDLE Handle;
455 } PRIVATE_UDF_SIMPLE_FS_DATA;
456
457 //
458 // Global Variables
459 //
460 extern EFI_DRIVER_BINDING_PROTOCOL gUdfDriverBinding;
461 extern EFI_COMPONENT_NAME_PROTOCOL gUdfComponentName;
462 extern EFI_COMPONENT_NAME2_PROTOCOL gUdfComponentName2;
463
464 //
465 // Function Prototypes
466 //
467
468 /**
469 Open the root directory on a volume.
470
471 @param This Protocol instance pointer.
472 @param Root Returns an Open file handle for the root directory
473
474 @retval EFI_SUCCESS The device was opened.
475 @retval EFI_UNSUPPORTED This volume does not support the file system.
476 @retval EFI_NO_MEDIA The device has no media.
477 @retval EFI_DEVICE_ERROR The device reported an error.
478 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
479 @retval EFI_ACCESS_DENIED The service denied access to the file.
480 @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
481
482 **/
483 EFI_STATUS
484 EFIAPI
485 UdfOpenVolume (
486 IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
487 OUT EFI_FILE_PROTOCOL **Root
488 );
489
490 /**
491 Opens a new file relative to the source file's location.
492
493 @param This The protocol instance pointer.
494 @param NewHandle Returns File Handle for FileName.
495 @param FileName Null terminated string. "\", ".", and ".." are supported.
496 @param OpenMode Open mode for file.
497 @param Attributes Only used for EFI_FILE_MODE_CREATE.
498
499 @retval EFI_SUCCESS The device was opened.
500 @retval EFI_NOT_FOUND The specified file could not be found on the device.
501 @retval EFI_NO_MEDIA The device has no media.
502 @retval EFI_MEDIA_CHANGED The media has changed.
503 @retval EFI_DEVICE_ERROR The device reported an error.
504 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
505 @retval EFI_ACCESS_DENIED The service denied access to the file.
506 @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources.
507 @retval EFI_VOLUME_FULL The volume is full.
508
509 **/
510 EFI_STATUS
511 EFIAPI
512 UdfOpen (
513 IN EFI_FILE_PROTOCOL *This,
514 OUT EFI_FILE_PROTOCOL **NewHandle,
515 IN CHAR16 *FileName,
516 IN UINT64 OpenMode,
517 IN UINT64 Attributes
518 );
519
520 /**
521 Read data from the file.
522
523 @param This Protocol instance pointer.
524 @param BufferSize On input size of buffer, on output amount of data in buffer.
525 @param Buffer The buffer in which data is read.
526
527 @retval EFI_SUCCESS Data was read.
528 @retval EFI_NO_MEDIA The device has no media.
529 @retval EFI_DEVICE_ERROR The device reported an error.
530 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
531 @retval EFI_BUFFER_TO_SMALL BufferSize is too small. BufferSize contains required size.
532
533 **/
534 EFI_STATUS
535 EFIAPI
536 UdfRead (
537 IN EFI_FILE_PROTOCOL *This,
538 IN OUT UINTN *BufferSize,
539 OUT VOID *Buffer
540 );
541
542 /**
543 Close the file handle.
544
545 @param This Protocol instance pointer.
546
547 @retval EFI_SUCCESS The file was closed.
548
549 **/
550 EFI_STATUS
551 EFIAPI
552 UdfClose (
553 IN EFI_FILE_PROTOCOL *This
554 );
555
556 /**
557 Close and delete the file handle.
558
559 @param This Protocol instance pointer.
560
561 @retval EFI_SUCCESS The file was closed and deleted.
562 @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not
563 deleted.
564
565 **/
566 EFI_STATUS
567 EFIAPI
568 UdfDelete (
569 IN EFI_FILE_PROTOCOL *This
570 );
571
572 /**
573 Write data to a file.
574
575 @param This Protocol instance pointer.
576 @param BufferSize On input size of buffer, on output amount of data in buffer.
577 @param Buffer The buffer in which data to write.
578
579 @retval EFI_SUCCESS Data was written.
580 @retval EFI_UNSUPPORTED Writes to Open directory are not supported.
581 @retval EFI_NO_MEDIA The device has no media.
582 @retval EFI_DEVICE_ERROR The device reported an error.
583 @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
584 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
585 @retval EFI_WRITE_PROTECTED The device is write protected.
586 @retval EFI_ACCESS_DENIED The file was open for read only.
587 @retval EFI_VOLUME_FULL The volume is full.
588
589 **/
590 EFI_STATUS
591 EFIAPI
592 UdfWrite (
593 IN EFI_FILE_PROTOCOL *This,
594 IN OUT UINTN *BufferSize,
595 IN VOID *Buffer
596 );
597
598 /**
599 Get file's current position.
600
601 @param This Protocol instance pointer.
602 @param Position Byte position from the start of the file.
603
604 @retval EFI_SUCCESS Position was updated.
605 @retval EFI_UNSUPPORTED Seek request for directories is not valid.
606
607 **/
608 EFI_STATUS
609 EFIAPI
610 UdfGetPosition (
611 IN EFI_FILE_PROTOCOL *This,
612 OUT UINT64 *Position
613 );
614
615 /**
616 Set file's current position.
617
618 @param This Protocol instance pointer.
619 @param Position Byte position from the start of the file.
620
621 @retval EFI_SUCCESS Position was updated.
622 @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.
623
624 **/
625 EFI_STATUS
626 EFIAPI
627 UdfSetPosition (
628 IN EFI_FILE_PROTOCOL *This,
629 IN UINT64 Position
630 );
631
632 /**
633 Get information about a file.
634
635 @param This Protocol instance pointer.
636 @param InformationType Type of information to return in Buffer.
637 @param BufferSize On input size of buffer, on output amount of data in buffer.
638 @param Buffer The buffer to return data.
639
640 @retval EFI_SUCCESS Data was returned.
641 @retval EFI_UNSUPPORTED InformationType is not supported.
642 @retval EFI_NO_MEDIA The device has no media.
643 @retval EFI_DEVICE_ERROR The device reported an error.
644 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
645 @retval EFI_WRITE_PROTECTED The device is write protected.
646 @retval EFI_ACCESS_DENIED The file was open for read only.
647 @retval EFI_BUFFER_TOO_SMALL Buffer was too small; required size returned in BufferSize.
648
649 **/
650 EFI_STATUS
651 EFIAPI
652 UdfGetInfo (
653 IN EFI_FILE_PROTOCOL *This,
654 IN EFI_GUID *InformationType,
655 IN OUT UINTN *BufferSize,
656 OUT VOID *Buffer
657 );
658
659 /**
660 Set information about a file.
661
662 @param File Protocol instance pointer.
663 @param InformationType Type of information in Buffer.
664 @param BufferSize Size of buffer.
665 @param Buffer The data to write.
666
667 @retval EFI_SUCCESS Data was set.
668 @retval EFI_UNSUPPORTED InformationType is not supported.
669 @retval EFI_NO_MEDIA The device has no media.
670 @retval EFI_DEVICE_ERROR The device reported an error.
671 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
672 @retval EFI_WRITE_PROTECTED The device is write protected.
673 @retval EFI_ACCESS_DENIED The file was open for read only.
674
675 **/
676 EFI_STATUS
677 EFIAPI
678 UdfSetInfo (
679 IN EFI_FILE_PROTOCOL *This,
680 IN EFI_GUID *InformationType,
681 IN UINTN BufferSize,
682 IN VOID *Buffer
683 );
684
685 /**
686 Flush data back for the file handle.
687
688 @param This Protocol instance pointer.
689
690 @retval EFI_SUCCESS Data was flushed.
691 @retval EFI_UNSUPPORTED Writes to Open directory are not supported.
692 @retval EFI_NO_MEDIA The device has no media.
693 @retval EFI_DEVICE_ERROR The device reported an error.
694 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
695 @retval EFI_WRITE_PROTECTED The device is write protected.
696 @retval EFI_ACCESS_DENIED The file was open for read only.
697 @retval EFI_VOLUME_FULL The volume is full.
698
699 **/
700 EFI_STATUS
701 EFIAPI
702 UdfFlush (
703 IN EFI_FILE_PROTOCOL *This
704 );
705
706 /**
707 Read volume information on a medium which contains a valid UDF file system.
708
709 @param[in] BlockIo BlockIo interface.
710 @param[in] DiskIo DiskIo interface.
711 @param[out] Volume UDF volume information structure.
712
713 @retval EFI_SUCCESS Volume information read.
714 @retval EFI_NO_MEDIA The device has no media.
715 @retval EFI_DEVICE_ERROR The device reported an error.
716 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
717 @retval EFI_OUT_OF_RESOURCES The volume was not read due to lack of resources.
718
719 **/
720 EFI_STATUS
721 ReadUdfVolumeInformation (
722 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
723 IN EFI_DISK_IO_PROTOCOL *DiskIo,
724 OUT UDF_VOLUME_INFO *Volume
725 );
726
727 /**
728 Find the root directory on an UDF volume.
729
730 @param[in] BlockIo BlockIo interface.
731 @param[in] DiskIo DiskIo interface.
732 @param[in] Volume UDF volume information structure.
733 @param[out] File Root directory file.
734
735 @retval EFI_SUCCESS Root directory found.
736 @retval EFI_NO_MEDIA The device has no media.
737 @retval EFI_DEVICE_ERROR The device reported an error.
738 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
739 @retval EFI_OUT_OF_RESOURCES The root directory was not found due to lack of
740 resources.
741
742 **/
743 EFI_STATUS
744 FindRootDirectory (
745 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
746 IN EFI_DISK_IO_PROTOCOL *DiskIo,
747 IN UDF_VOLUME_INFO *Volume,
748 OUT UDF_FILE_INFO *File
749 );
750
751 /**
752 Find either a File Entry or a Extended File Entry from a given ICB.
753
754 @param[in] BlockIo BlockIo interface.
755 @param[in] DiskIo DiskIo interface.
756 @param[in] Volume UDF volume information structure.
757 @param[in] Icb ICB of the FID.
758 @param[out] FileEntry File Entry or Extended File Entry.
759
760 @retval EFI_SUCCESS File Entry or Extended File Entry found.
761 @retval EFI_NO_MEDIA The device has no media.
762 @retval EFI_DEVICE_ERROR The device reported an error.
763 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
764 @retval EFI_OUT_OF_RESOURCES The FE/EFE entry was not found due to lack of
765 resources.
766
767 **/
768 EFI_STATUS
769 FindFileEntry (
770 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
771 IN EFI_DISK_IO_PROTOCOL *DiskIo,
772 IN UDF_VOLUME_INFO *Volume,
773 IN UDF_LONG_ALLOCATION_DESCRIPTOR *Icb,
774 OUT VOID **FileEntry
775 );
776
777 /**
778 Find a file given its absolute path on an UDF volume.
779
780 @param[in] BlockIo BlockIo interface.
781 @param[in] DiskIo DiskIo interface.
782 @param[in] Volume UDF volume information structure.
783 @param[in] FilePath File's absolute path.
784 @param[in] Root Root directory file.
785 @param[in] Parent Parent directory file.
786 @param[out] File Found file.
787
788 @retval EFI_SUCCESS @p FilePath was found.
789 @retval EFI_NO_MEDIA The device has no media.
790 @retval EFI_DEVICE_ERROR The device reported an error.
791 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
792 @retval EFI_OUT_OF_RESOURCES The @p FilePath file was not found due to lack of
793 resources.
794
795 **/
796 EFI_STATUS
797 FindFile (
798 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
799 IN EFI_DISK_IO_PROTOCOL *DiskIo,
800 IN UDF_VOLUME_INFO *Volume,
801 IN CHAR16 *FilePath,
802 IN UDF_FILE_INFO *Root,
803 IN UDF_FILE_INFO *Parent,
804 IN UDF_LONG_ALLOCATION_DESCRIPTOR *Icb,
805 OUT UDF_FILE_INFO *File
806 );
807
808 /**
809 Read a directory entry at a time on an UDF volume.
810
811 @param[in] BlockIo BlockIo interface.
812 @param[in] DiskIo DiskIo interface.
813 @param[in] Volume UDF volume information structure.
814 @param[in] ParentIcb ICB of the parent file.
815 @param[in] FileEntryData FE/EFE of the parent file.
816 @param[in out] ReadDirInfo Next read directory listing structure
817 information.
818 @param[out] FoundFid File Identifier Descriptor pointer.
819
820 @retval EFI_SUCCESS Directory entry read.
821 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
822 @retval EFI_NO_MEDIA The device has no media.
823 @retval EFI_DEVICE_ERROR The device reported an error.
824 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
825 @retval EFI_OUT_OF_RESOURCES The directory entry was not read due to lack of
826 resources.
827
828 **/
829 EFI_STATUS
830 ReadDirectoryEntry (
831 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
832 IN EFI_DISK_IO_PROTOCOL *DiskIo,
833 IN UDF_VOLUME_INFO *Volume,
834 IN UDF_LONG_ALLOCATION_DESCRIPTOR *ParentIcb,
835 IN VOID *FileEntryData,
836 IN OUT UDF_READ_DIRECTORY_INFO *ReadDirInfo,
837 OUT UDF_FILE_IDENTIFIER_DESCRIPTOR **FoundFid
838 );
839
840 /**
841 Get a filename (encoded in OSTA-compressed format) from a File Identifier
842 Descriptor on an UDF volume.
843
844 @param[in] FileIdentifierDesc File Identifier Descriptor pointer.
845 @param[out] FileName Decoded filename.
846
847 @retval EFI_SUCCESS Filename decoded and read.
848 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
849 **/
850 EFI_STATUS
851 GetFileNameFromFid (
852 IN UDF_FILE_IDENTIFIER_DESCRIPTOR *FileIdentifierDesc,
853 OUT CHAR16 *FileName
854 );
855
856 /**
857 Resolve a symlink file on an UDF volume.
858
859 @param[in] BlockIo BlockIo interface.
860 @param[in] DiskIo DiskIo interface.
861 @param[in] Volume UDF volume information structure.
862 @param[in] Parent Parent file.
863 @param[in] FileEntryData FE/EFE structure pointer.
864 @param[out] File Resolved file.
865
866 @retval EFI_SUCCESS Symlink file resolved.
867 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
868 @retval EFI_NO_MEDIA The device has no media.
869 @retval EFI_DEVICE_ERROR The device reported an error.
870 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
871 @retval EFI_OUT_OF_RESOURCES The symlink file was not resolved due to lack of
872 resources.
873
874 **/
875 EFI_STATUS
876 ResolveSymlink (
877 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
878 IN EFI_DISK_IO_PROTOCOL *DiskIo,
879 IN UDF_VOLUME_INFO *Volume,
880 IN UDF_FILE_INFO *Parent,
881 IN VOID *FileEntryData,
882 OUT UDF_FILE_INFO *File
883 );
884
885 /**
886 Clean up in-memory UDF volume information.
887
888 @param[in] Volume Volume information pointer.
889
890 **/
891 VOID
892 CleanupVolumeInformation (
893 IN UDF_VOLUME_INFO *Volume
894 );
895
896 /**
897 Clean up in-memory UDF file information.
898
899 @param[in] File File information pointer.
900
901 **/
902 VOID
903 CleanupFileInformation (
904 IN UDF_FILE_INFO *File
905 );
906
907 /**
908 Find a file from its absolute path on an UDF volume.
909
910 @param[in] BlockIo BlockIo interface.
911 @param[in] DiskIo DiskIo interface.
912 @param[in] Volume UDF volume information structure.
913 @param[in] File File information structure.
914 @param[out] Size Size of the file.
915
916 @retval EFI_SUCCESS File size calculated and set in @p Size.
917 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
918 @retval EFI_NO_MEDIA The device has no media.
919 @retval EFI_DEVICE_ERROR The device reported an error.
920 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
921 @retval EFI_OUT_OF_RESOURCES The file size was not calculated due to lack of
922 resources.
923
924 **/
925 EFI_STATUS
926 GetFileSize (
927 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
928 IN EFI_DISK_IO_PROTOCOL *DiskIo,
929 IN UDF_VOLUME_INFO *Volume,
930 IN UDF_FILE_INFO *File,
931 OUT UINT64 *Size
932 );
933
934 /**
935 Set information about a file on an UDF volume.
936
937 @param[in] File File pointer.
938 @param[in] FileSize Size of the file.
939 @param[in] FileName Filename of the file.
940 @param[in out] BufferSize Size of the returned file infomation.
941 @param[out] Buffer Data of the returned file information.
942
943 @retval EFI_SUCCESS File information set.
944 @retval EFI_NO_MEDIA The device has no media.
945 @retval EFI_DEVICE_ERROR The device reported an error.
946 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
947 @retval EFI_OUT_OF_RESOURCES The file information was not set due to lack of
948 resources.
949
950 **/
951 EFI_STATUS
952 SetFileInfo (
953 IN UDF_FILE_INFO *File,
954 IN UINT64 FileSize,
955 IN CHAR16 *FileName,
956 IN OUT UINTN *BufferSize,
957 OUT VOID *Buffer
958 );
959
960 /**
961 Get volume and free space size information of an UDF volume.
962
963 @param[in] BlockIo BlockIo interface.
964 @param[in] DiskIo DiskIo interface.
965 @param[in] Volume UDF volume information structure.
966 @param[out] VolumeSize Volume size.
967 @param[out] FreeSpaceSize Free space size.
968
969 @retval EFI_SUCCESS Volume and free space size calculated.
970 @retval EFI_NO_MEDIA The device has no media.
971 @retval EFI_DEVICE_ERROR The device reported an error.
972 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
973 @retval EFI_OUT_OF_RESOURCES The volume and free space size were not
974 calculated due to lack of resources.
975
976 **/
977 EFI_STATUS
978 GetVolumeSize (
979 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
980 IN EFI_DISK_IO_PROTOCOL *DiskIo,
981 IN UDF_VOLUME_INFO *Volume,
982 OUT UINT64 *VolumeSize,
983 OUT UINT64 *FreeSpaceSize
984 );
985
986 /**
987 Seek a file and read its data into memory on an UDF volume.
988
989 @param[in] BlockIo BlockIo interface.
990 @param[in] DiskIo DiskIo interface.
991 @param[in] Volume UDF volume information structure.
992 @param[in] File File information structure.
993 @param[in] FileSize Size of the file.
994 @param[in out] FilePosition File position.
995 @param[in out] Buffer File data.
996 @param[in out] BufferSize Read size.
997
998 @retval EFI_SUCCESS File seeked and read.
999 @retval EFI_UNSUPPORTED Extended Allocation Descriptors not supported.
1000 @retval EFI_NO_MEDIA The device has no media.
1001 @retval EFI_DEVICE_ERROR The device reported an error.
1002 @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
1003 @retval EFI_OUT_OF_RESOURCES The file's recorded data was not read due to lack
1004 of resources.
1005
1006 **/
1007 EFI_STATUS
1008 ReadFileData (
1009 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,
1010 IN EFI_DISK_IO_PROTOCOL *DiskIo,
1011 IN UDF_VOLUME_INFO *Volume,
1012 IN UDF_FILE_INFO *File,
1013 IN UINT64 FileSize,
1014 IN OUT UINT64 *FilePosition,
1015 IN OUT VOID *Buffer,
1016 IN OUT UINT64 *BufferSize
1017 );
1018
1019 /**
1020 Check if ControllerHandle supports an UDF file system.
1021
1022 @param[in] This Protocol instance pointer.
1023 @param[in] ControllerHandle Handle of device to test.
1024
1025 @retval EFI_SUCCESS UDF file system found.
1026 @retval EFI_UNSUPPORTED UDF file system not found.
1027
1028 **/
1029 EFI_STATUS
1030 SupportUdfFileSystem (
1031 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1032 IN EFI_HANDLE ControllerHandle
1033 );
1034
1035 /**
1036 Mangle a filename by cutting off trailing whitespaces, "\\", "." and "..".
1037
1038 @param[in] FileName Filename.
1039
1040 @retval @p FileName Filename mangled.
1041
1042 **/
1043 CHAR16 *
1044 MangleFileName (
1045 IN CHAR16 *FileName
1046 );
1047
1048 /**
1049 Test to see if this driver supports ControllerHandle. Any ControllerHandle
1050 than contains a BlockIo and DiskIo protocol can be supported.
1051
1052 @param This Protocol instance pointer.
1053 @param ControllerHandle Handle of device to test
1054 @param RemainingDevicePath Optional parameter use to pick a specific child
1055 device to start.
1056
1057 @retval EFI_SUCCESS This driver supports this device
1058 @retval EFI_ALREADY_STARTED This driver is already running on this device
1059 @retval other This driver does not support this device
1060
1061 **/
1062 EFI_STATUS
1063 EFIAPI
1064 UdfDriverBindingSupported (
1065 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1066 IN EFI_HANDLE ControllerHandle,
1067 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
1068 );
1069
1070 /**
1071 Start this driver on ControllerHandle by opening a Block IO and Disk IO
1072 protocol, reading Device Path, and creating a child handle with a
1073 Disk IO and device path protocol.
1074
1075 @param This Protocol instance pointer.
1076 @param ControllerHandle Handle of device to bind driver to
1077 @param RemainingDevicePath Optional parameter use to pick a specific child
1078 device to start.
1079
1080 @retval EFI_SUCCESS This driver is added to ControllerHandle
1081 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
1082 @retval other This driver does not support this device
1083
1084 **/
1085 EFI_STATUS
1086 EFIAPI
1087 UdfDriverBindingStart (
1088 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1089 IN EFI_HANDLE ControllerHandle,
1090 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
1091 );
1092
1093 /**
1094 Stop this driver on ControllerHandle. Support stopping any child handles
1095 created by this driver.
1096
1097 @param This Protocol instance pointer.
1098 @param ControllerHandle Handle of device to stop driver on
1099 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
1100 children is zero stop the entire bus driver.
1101 @param ChildHandleBuffer List of Child Handles to Stop.
1102
1103 @retval EFI_SUCCESS This driver is removed ControllerHandle
1104 @retval other This driver was not removed from this device
1105
1106 **/
1107 EFI_STATUS
1108 EFIAPI
1109 UdfDriverBindingStop (
1110 IN EFI_DRIVER_BINDING_PROTOCOL *This,
1111 IN EFI_HANDLE ControllerHandle,
1112 IN UINTN NumberOfChildren,
1113 IN EFI_HANDLE *ChildHandleBuffer
1114 );
1115
1116 //
1117 // EFI Component Name Functions
1118 //
1119 /**
1120 Retrieves a Unicode string that is the user readable name of the driver.
1121
1122 This function retrieves the user readable name of a driver in the form of a
1123 Unicode string. If the driver specified by This has a user readable name in
1124 the language specified by Language, then a pointer to the driver name is
1125 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
1126 by This does not support the language specified by Language,
1127 then EFI_UNSUPPORTED is returned.
1128
1129 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1130 EFI_COMPONENT_NAME_PROTOCOL instance.
1131
1132 @param Language[in] A pointer to a Null-terminated ASCII string
1133 array indicating the language. This is the
1134 language of the driver name that the caller is
1135 requesting, and it must match one of the
1136 languages specified in SupportedLanguages. The
1137 number of languages supported by a driver is up
1138 to the driver writer. Language is specified
1139 in RFC 4646 or ISO 639-2 language code format.
1140
1141 @param DriverName[out] A pointer to the Unicode string to return.
1142 This Unicode string is the name of the
1143 driver specified by This in the language
1144 specified by Language.
1145
1146 @retval EFI_SUCCESS The Unicode string for the Driver specified by
1147 This and the language specified by Language was
1148 returned in DriverName.
1149
1150 @retval EFI_INVALID_PARAMETER Language is NULL.
1151
1152 @retval EFI_INVALID_PARAMETER DriverName is NULL.
1153
1154 @retval EFI_UNSUPPORTED The driver specified by This does not support
1155 the language specified by Language.
1156
1157 **/
1158 EFI_STATUS
1159 EFIAPI
1160 UdfComponentNameGetDriverName (
1161 IN EFI_COMPONENT_NAME_PROTOCOL *This,
1162 IN CHAR8 *Language,
1163 OUT CHAR16 **DriverName
1164 );
1165
1166 /**
1167 Retrieves a Unicode string that is the user readable name of the controller
1168 that is being managed by a driver.
1169
1170 This function retrieves the user readable name of the controller specified by
1171 ControllerHandle and ChildHandle in the form of a Unicode string. If the
1172 driver specified by This has a user readable name in the language specified by
1173 Language, then a pointer to the controller name is returned in ControllerName,
1174 and EFI_SUCCESS is returned. If the driver specified by This is not currently
1175 managing the controller specified by ControllerHandle and ChildHandle,
1176 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
1177 support the language specified by Language, then EFI_UNSUPPORTED is returned.
1178
1179 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
1180 EFI_COMPONENT_NAME_PROTOCOL instance.
1181
1182 @param ControllerHandle[in] The handle of a controller that the driver
1183 specified by This is managing. This handle
1184 specifies the controller whose name is to be
1185 returned.
1186
1187 @param ChildHandle[in] The handle of the child controller to retrieve
1188 the name of. This is an optional parameter that
1189 may be NULL. It will be NULL for device
1190 drivers. It will also be NULL for a bus drivers
1191 that wish to retrieve the name of the bus
1192 controller. It will not be NULL for a bus
1193 driver that wishes to retrieve the name of a
1194 child controller.
1195
1196 @param Language[in] A pointer to a Null-terminated ASCII string
1197 array indicating the language. This is the
1198 language of the driver name that the caller is
1199 requesting, and it must match one of the
1200 languages specified in SupportedLanguages. The
1201 number of languages supported by a driver is up
1202 to the driver writer. Language is specified in
1203 RFC 4646 or ISO 639-2 language code format.
1204
1205 @param ControllerName[out] A pointer to the Unicode string to return.
1206 This Unicode string is the name of the
1207 controller specified by ControllerHandle and
1208 ChildHandle in the language specified by
1209 Language from the point of view of the driver
1210 specified by This.
1211
1212 @retval EFI_SUCCESS The Unicode string for the user readable name in
1213 the language specified by Language for the
1214 driver specified by This was returned in
1215 DriverName.
1216
1217 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
1218
1219 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1220 EFI_HANDLE.
1221
1222 @retval EFI_INVALID_PARAMETER Language is NULL.
1223
1224 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1225
1226 @retval EFI_UNSUPPORTED The driver specified by This is not currently
1227 managing the controller specified by
1228 ControllerHandle and ChildHandle.
1229
1230 @retval EFI_UNSUPPORTED The driver specified by This does not support
1231 the language specified by Language.
1232
1233 **/
1234 EFI_STATUS
1235 EFIAPI
1236 UdfComponentNameGetControllerName (
1237 IN EFI_COMPONENT_NAME_PROTOCOL *This,
1238 IN EFI_HANDLE ControllerHandle,
1239 IN EFI_HANDLE ChildHandle OPTIONAL,
1240 IN CHAR8 *Language,
1241 OUT CHAR16 **ControllerName
1242 );
1243
1244 #endif // _UDF_H_