2 DevicePathToText protocol as defined in the UEFI 2.0 specification.
4 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
5 Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "UefiDevicePathLib.h"
19 Concatenates a formatted unicode string to allocated pool. The caller must
20 free the resulting buffer.
22 @param Str Tracks the allocated pool, size in use, and
23 amount of pool allocated.
24 @param Fmt The format string
25 @param ... Variable arguments based on the format string.
27 @return Allocated buffer with the formatted string printed in it.
28 The caller must free the allocated buffer. The buffer
29 allocation is not packed.
34 UefiDevicePathLibCatPrint (
35 IN OUT POOL_PRINT
*Str
,
44 Count
= SPrintLength (Fmt
, Args
);
47 if ((Str
->Count
+ (Count
+ 1)) * sizeof (CHAR16
) > Str
->Capacity
) {
48 Str
->Capacity
= (Str
->Count
+ (Count
+ 1) * 2) * sizeof (CHAR16
);
49 Str
->Str
= ReallocatePool (
50 Str
->Count
* sizeof (CHAR16
),
54 ASSERT (Str
->Str
!= NULL
);
57 UnicodeVSPrint (&Str
->Str
[Str
->Count
], Str
->Capacity
- Str
->Count
* sizeof (CHAR16
), Fmt
, Args
);
65 Converts a PCI device path structure to its string representative.
67 @param Str The string representative of input device.
68 @param DevPath The input device path structure.
69 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
70 of the display node is used, where applicable. If DisplayOnly
71 is FALSE, then the longer text representation of the display node
73 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
74 representation for a device node can be used, where applicable.
79 IN OUT POOL_PRINT
*Str
,
81 IN BOOLEAN DisplayOnly
,
82 IN BOOLEAN AllowShortcuts
88 UefiDevicePathLibCatPrint (Str
, L
"Pci(0x%x,0x%x)", Pci
->Device
, Pci
->Function
);
92 Converts a PC Card device path structure to its string representative.
94 @param Str The string representative of input device.
95 @param DevPath The input device path structure.
96 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
97 of the display node is used, where applicable. If DisplayOnly
98 is FALSE, then the longer text representation of the display node
100 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
101 representation for a device node can be used, where applicable.
105 DevPathToTextPccard (
106 IN OUT POOL_PRINT
*Str
,
108 IN BOOLEAN DisplayOnly
,
109 IN BOOLEAN AllowShortcuts
112 PCCARD_DEVICE_PATH
*Pccard
;
115 UefiDevicePathLibCatPrint (Str
, L
"PcCard(0x%x)", Pccard
->FunctionNumber
);
119 Converts a Memory Map device path structure to its string representative.
121 @param Str The string representative of input device.
122 @param DevPath The input device path structure.
123 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
124 of the display node is used, where applicable. If DisplayOnly
125 is FALSE, then the longer text representation of the display node
127 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
128 representation for a device node can be used, where applicable.
132 DevPathToTextMemMap (
133 IN OUT POOL_PRINT
*Str
,
135 IN BOOLEAN DisplayOnly
,
136 IN BOOLEAN AllowShortcuts
139 MEMMAP_DEVICE_PATH
*MemMap
;
142 UefiDevicePathLibCatPrint (
144 L
"MemoryMapped(0x%x,0x%lx,0x%lx)",
146 MemMap
->StartingAddress
,
147 MemMap
->EndingAddress
152 Converts a Vendor device path structure to its string representative.
154 @param Str The string representative of input device.
155 @param DevPath The input device path structure.
156 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
157 of the display node is used, where applicable. If DisplayOnly
158 is FALSE, then the longer text representation of the display node
160 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
161 representation for a device node can be used, where applicable.
165 DevPathToTextVendor (
166 IN OUT POOL_PRINT
*Str
,
168 IN BOOLEAN DisplayOnly
,
169 IN BOOLEAN AllowShortcuts
172 VENDOR_DEVICE_PATH
*Vendor
;
176 UINT32 FlowControlMap
;
179 Vendor
= (VENDOR_DEVICE_PATH
*) DevPath
;
180 switch (DevicePathType (&Vendor
->Header
)) {
181 case HARDWARE_DEVICE_PATH
:
185 case MESSAGING_DEVICE_PATH
:
187 if (AllowShortcuts
) {
188 if (CompareGuid (&Vendor
->Guid
, &gEfiPcAnsiGuid
)) {
189 UefiDevicePathLibCatPrint (Str
, L
"VenPcAnsi()");
191 } else if (CompareGuid (&Vendor
->Guid
, &gEfiVT100Guid
)) {
192 UefiDevicePathLibCatPrint (Str
, L
"VenVt100()");
194 } else if (CompareGuid (&Vendor
->Guid
, &gEfiVT100PlusGuid
)) {
195 UefiDevicePathLibCatPrint (Str
, L
"VenVt100Plus()");
197 } else if (CompareGuid (&Vendor
->Guid
, &gEfiVTUTF8Guid
)) {
198 UefiDevicePathLibCatPrint (Str
, L
"VenUft8()");
200 } else if (CompareGuid (&Vendor
->Guid
, &gEfiUartDevicePathGuid
)) {
201 FlowControlMap
= (((UART_FLOW_CONTROL_DEVICE_PATH
*) Vendor
)->FlowControlMap
);
202 switch (FlowControlMap
& 0x00000003) {
204 UefiDevicePathLibCatPrint (Str
, L
"UartFlowCtrl(%s)", L
"None");
208 UefiDevicePathLibCatPrint (Str
, L
"UartFlowCtrl(%s)", L
"Hardware");
212 UefiDevicePathLibCatPrint (Str
, L
"UartFlowCtrl(%s)", L
"XonXoff");
220 } else if (CompareGuid (&Vendor
->Guid
, &gEfiSasDevicePathGuid
)) {
221 UefiDevicePathLibCatPrint (
223 L
"SAS(0x%lx,0x%lx,0x%x,",
224 ((SAS_DEVICE_PATH
*) Vendor
)->SasAddress
,
225 ((SAS_DEVICE_PATH
*) Vendor
)->Lun
,
226 ((SAS_DEVICE_PATH
*) Vendor
)->RelativeTargetPort
228 Info
= (((SAS_DEVICE_PATH
*) Vendor
)->DeviceTopology
);
229 if (((Info
& 0x0f) == 0) && ((Info
& BIT7
) == 0)) {
230 UefiDevicePathLibCatPrint (Str
, L
"NoTopology,0,0,0,");
231 } else if (((Info
& 0x0f) <= 2) && ((Info
& BIT7
) == 0)) {
232 UefiDevicePathLibCatPrint (
235 ((Info
& BIT4
) != 0) ? L
"SATA" : L
"SAS",
236 ((Info
& BIT5
) != 0) ? L
"External" : L
"Internal",
237 ((Info
& BIT6
) != 0) ? L
"Expanded" : L
"Direct"
239 if ((Info
& 0x0f) == 1) {
240 UefiDevicePathLibCatPrint (Str
, L
"0,");
243 // Value 0x0 thru 0xFF -> Drive 1 thru Drive 256
245 UefiDevicePathLibCatPrint (Str
, L
"0x%x,", ((Info
>> 8) & 0xff) + 1);
248 UefiDevicePathLibCatPrint (Str
, L
"0x%x,0,0,0,", Info
);
251 UefiDevicePathLibCatPrint (Str
, L
"0x%x)", ((SAS_DEVICE_PATH
*) Vendor
)->Reserved
);
253 } else if (CompareGuid (&Vendor
->Guid
, &gEfiDebugPortProtocolGuid
)) {
254 UefiDevicePathLibCatPrint (Str
, L
"DebugPort()");
260 case MEDIA_DEVICE_PATH
:
269 DataLength
= DevicePathNodeLength (&Vendor
->Header
) - sizeof (VENDOR_DEVICE_PATH
);
270 UefiDevicePathLibCatPrint (Str
, L
"Ven%s(%g", Type
, &Vendor
->Guid
);
271 if (DataLength
!= 0) {
272 UefiDevicePathLibCatPrint (Str
, L
",");
273 for (Index
= 0; Index
< DataLength
; Index
++) {
274 UefiDevicePathLibCatPrint (Str
, L
"%02x", ((VENDOR_DEVICE_PATH_WITH_DATA
*) Vendor
)->VendorDefinedData
[Index
]);
278 UefiDevicePathLibCatPrint (Str
, L
")");
282 Converts a Controller device path structure to its string representative.
284 @param Str The string representative of input device.
285 @param DevPath The input device path structure.
286 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
287 of the display node is used, where applicable. If DisplayOnly
288 is FALSE, then the longer text representation of the display node
290 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
291 representation for a device node can be used, where applicable.
295 DevPathToTextController (
296 IN OUT POOL_PRINT
*Str
,
298 IN BOOLEAN DisplayOnly
,
299 IN BOOLEAN AllowShortcuts
302 CONTROLLER_DEVICE_PATH
*Controller
;
304 Controller
= DevPath
;
305 UefiDevicePathLibCatPrint (
308 Controller
->ControllerNumber
313 Converts a BMC device path structure to its string representative.
315 @param Str The string representative of input device.
316 @param DevPath The input device path structure.
317 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
318 of the display node is used, where applicable. If DisplayOnly
319 is FALSE, then the longer text representation of the display node
321 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
322 representation for a device node can be used, where applicable.
327 IN OUT POOL_PRINT
*Str
,
329 IN BOOLEAN DisplayOnly
,
330 IN BOOLEAN AllowShortcuts
333 BMC_DEVICE_PATH
*Bmc
;
336 UefiDevicePathLibCatPrint (
340 ReadUnaligned64 ((UINT64
*) (&Bmc
->BaseAddress
))
345 Converts a ACPI device path structure to its string representative.
347 @param Str The string representative of input device.
348 @param DevPath The input device path structure.
349 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
350 of the display node is used, where applicable. If DisplayOnly
351 is FALSE, then the longer text representation of the display node
353 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
354 representation for a device node can be used, where applicable.
359 IN OUT POOL_PRINT
*Str
,
361 IN BOOLEAN DisplayOnly
,
362 IN BOOLEAN AllowShortcuts
365 ACPI_HID_DEVICE_PATH
*Acpi
;
368 if ((Acpi
->HID
& PNP_EISA_ID_MASK
) == PNP_EISA_ID_CONST
) {
369 switch (EISA_ID_TO_NUM (Acpi
->HID
)) {
371 UefiDevicePathLibCatPrint (Str
, L
"PciRoot(0x%x)", Acpi
->UID
);
375 UefiDevicePathLibCatPrint (Str
, L
"PcieRoot(0x%x)", Acpi
->UID
);
379 UefiDevicePathLibCatPrint (Str
, L
"Floppy(0x%x)", Acpi
->UID
);
383 UefiDevicePathLibCatPrint (Str
, L
"Keyboard(0x%x)", Acpi
->UID
);
387 UefiDevicePathLibCatPrint (Str
, L
"Serial(0x%x)", Acpi
->UID
);
391 UefiDevicePathLibCatPrint (Str
, L
"ParallelPort(0x%x)", Acpi
->UID
);
395 UefiDevicePathLibCatPrint (Str
, L
"Acpi(PNP%04x,0x%x)", EISA_ID_TO_NUM (Acpi
->HID
), Acpi
->UID
);
399 UefiDevicePathLibCatPrint (Str
, L
"Acpi(0x%08x,0x%x)", Acpi
->HID
, Acpi
->UID
);
404 Converts a ACPI extended HID device path structure to its string representative.
406 @param Str The string representative of input device.
407 @param DevPath The input device path structure.
408 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
409 of the display node is used, where applicable. If DisplayOnly
410 is FALSE, then the longer text representation of the display node
412 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
413 representation for a device node can be used, where applicable.
417 DevPathToTextAcpiEx (
418 IN OUT POOL_PRINT
*Str
,
420 IN BOOLEAN DisplayOnly
,
421 IN BOOLEAN AllowShortcuts
424 ACPI_EXTENDED_HID_DEVICE_PATH
*AcpiEx
;
432 HIDStr
= (CHAR8
*) (((UINT8
*) AcpiEx
) + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH
));
433 UIDStr
= HIDStr
+ AsciiStrLen (HIDStr
) + 1;
434 CIDStr
= UIDStr
+ AsciiStrLen (UIDStr
) + 1;
437 // Converts EISA identification to string.
443 ((AcpiEx
->HID
>> 10) & 0x1f) + 'A' - 1,
444 ((AcpiEx
->HID
>> 5) & 0x1f) + 'A' - 1,
445 ((AcpiEx
->HID
>> 0) & 0x1f) + 'A' - 1,
446 (AcpiEx
->HID
>> 16) & 0xFFFF
452 ((AcpiEx
->CID
>> 10) & 0x1f) + 'A' - 1,
453 ((AcpiEx
->CID
>> 5) & 0x1f) + 'A' - 1,
454 ((AcpiEx
->CID
>> 0) & 0x1f) + 'A' - 1,
455 (AcpiEx
->CID
>> 16) & 0xFFFF
458 if ((*HIDStr
== '\0') && (*CIDStr
== '\0') && (AcpiEx
->UID
== 0)) {
462 UefiDevicePathLibCatPrint (
464 L
"AcpiExp(%s,%s,%a)",
470 if (AllowShortcuts
) {
474 if (AcpiEx
->HID
== 0) {
475 UefiDevicePathLibCatPrint (Str
, L
"AcpiEx(%a,", HIDStr
);
477 UefiDevicePathLibCatPrint (Str
, L
"AcpiEx(%s,", HIDText
);
480 if (AcpiEx
->UID
== 0) {
481 UefiDevicePathLibCatPrint (Str
, L
"%a,", UIDStr
);
483 UefiDevicePathLibCatPrint (Str
, L
"0x%x,", AcpiEx
->UID
);
486 if (AcpiEx
->CID
== 0) {
487 UefiDevicePathLibCatPrint (Str
, L
"%a)", CIDStr
);
489 UefiDevicePathLibCatPrint (Str
, L
"%s)", CIDText
);
492 UefiDevicePathLibCatPrint (
494 L
"AcpiEx(%s,%s,0x%x,%a,%a,%a)",
507 Converts a ACPI address device path structure to its string representative.
509 @param Str The string representative of input device.
510 @param DevPath The input device path structure.
511 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
512 of the display node is used, where applicable. If DisplayOnly
513 is FALSE, then the longer text representation of the display node
515 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
516 representation for a device node can be used, where applicable.
520 DevPathToTextAcpiAdr (
521 IN OUT POOL_PRINT
*Str
,
523 IN BOOLEAN DisplayOnly
,
524 IN BOOLEAN AllowShortcuts
527 ACPI_ADR_DEVICE_PATH
*AcpiAdr
;
530 UINT16 AdditionalAdrCount
;
533 Length
= (UINT16
) DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL
*) AcpiAdr
);
534 AdditionalAdrCount
= (UINT16
) ((Length
- 8) / 4);
536 UefiDevicePathLibCatPrint (Str
, L
"AcpiAdr(0x%x", AcpiAdr
->ADR
);
537 for (Index
= 0; Index
< AdditionalAdrCount
; Index
++) {
538 UefiDevicePathLibCatPrint (Str
, L
",0x%x", *(UINT32
*) ((UINT8
*) AcpiAdr
+ 8 + Index
* 4));
540 UefiDevicePathLibCatPrint (Str
, L
")");
544 Converts a ATAPI device path structure to its string representative.
546 @param Str The string representative of input device.
547 @param DevPath The input device path structure.
548 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
549 of the display node is used, where applicable. If DisplayOnly
550 is FALSE, then the longer text representation of the display node
552 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
553 representation for a device node can be used, where applicable.
558 IN OUT POOL_PRINT
*Str
,
560 IN BOOLEAN DisplayOnly
,
561 IN BOOLEAN AllowShortcuts
564 ATAPI_DEVICE_PATH
*Atapi
;
569 UefiDevicePathLibCatPrint (Str
, L
"Ata(0x%x)", Atapi
->Lun
);
571 UefiDevicePathLibCatPrint (
574 (Atapi
->PrimarySecondary
== 1) ? L
"Secondary" : L
"Primary",
575 (Atapi
->SlaveMaster
== 1) ? L
"Slave" : L
"Master",
582 Converts a SCSI device path structure to its string representative.
584 @param Str The string representative of input device.
585 @param DevPath The input device path structure.
586 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
587 of the display node is used, where applicable. If DisplayOnly
588 is FALSE, then the longer text representation of the display node
590 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
591 representation for a device node can be used, where applicable.
596 IN OUT POOL_PRINT
*Str
,
598 IN BOOLEAN DisplayOnly
,
599 IN BOOLEAN AllowShortcuts
602 SCSI_DEVICE_PATH
*Scsi
;
605 UefiDevicePathLibCatPrint (Str
, L
"Scsi(0x%x,0x%x)", Scsi
->Pun
, Scsi
->Lun
);
609 Converts a Fibre device path structure to its string representative.
611 @param Str The string representative of input device.
612 @param DevPath The input device path structure.
613 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
614 of the display node is used, where applicable. If DisplayOnly
615 is FALSE, then the longer text representation of the display node
617 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
618 representation for a device node can be used, where applicable.
623 IN OUT POOL_PRINT
*Str
,
625 IN BOOLEAN DisplayOnly
,
626 IN BOOLEAN AllowShortcuts
629 FIBRECHANNEL_DEVICE_PATH
*Fibre
;
632 UefiDevicePathLibCatPrint (Str
, L
"Fibre(0x%lx,0x%lx)", Fibre
->WWN
, Fibre
->Lun
);
636 Converts a FibreEx device path structure to its string representative.
638 @param Str The string representative of input device.
639 @param DevPath The input device path structure.
640 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
641 of the display node is used, where applicable. If DisplayOnly
642 is FALSE, then the longer text representation of the display node
644 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
645 representation for a device node can be used, where applicable.
649 DevPathToTextFibreEx (
650 IN OUT POOL_PRINT
*Str
,
652 IN BOOLEAN DisplayOnly
,
653 IN BOOLEAN AllowShortcuts
656 FIBRECHANNELEX_DEVICE_PATH
*FibreEx
;
660 UefiDevicePathLibCatPrint (Str
, L
"FibreEx(0x");
661 for (Index
= 0; Index
< sizeof (FibreEx
->WWN
) / sizeof (FibreEx
->WWN
[0]); Index
++) {
662 UefiDevicePathLibCatPrint (Str
, L
"%02x", FibreEx
->WWN
[Index
]);
664 UefiDevicePathLibCatPrint (Str
, L
",0x");
665 for (Index
= 0; Index
< sizeof (FibreEx
->Lun
) / sizeof (FibreEx
->Lun
[0]); Index
++) {
666 UefiDevicePathLibCatPrint (Str
, L
"%02x", FibreEx
->Lun
[Index
]);
668 UefiDevicePathLibCatPrint (Str
, L
")");
672 Converts a Sas Ex device path structure to its string representative.
674 @param Str The string representative of input device.
675 @param DevPath The input device path structure.
676 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
677 of the display node is used, where applicable. If DisplayOnly
678 is FALSE, then the longer text representation of the display node
680 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
681 representation for a device node can be used, where applicable.
686 IN OUT POOL_PRINT
*Str
,
688 IN BOOLEAN DisplayOnly
,
689 IN BOOLEAN AllowShortcuts
692 SASEX_DEVICE_PATH
*SasEx
;
696 UefiDevicePathLibCatPrint (Str
, L
"SasEx(0x");
698 for (Index
= 0; Index
< sizeof (SasEx
->SasAddress
) / sizeof (SasEx
->SasAddress
[0]); Index
++) {
699 UefiDevicePathLibCatPrint (Str
, L
"%02x", SasEx
->SasAddress
[Index
]);
701 UefiDevicePathLibCatPrint (Str
, L
",0x");
702 for (Index
= 0; Index
< sizeof (SasEx
->Lun
) / sizeof (SasEx
->Lun
[0]); Index
++) {
703 UefiDevicePathLibCatPrint (Str
, L
"%02x", SasEx
->Lun
[Index
]);
705 UefiDevicePathLibCatPrint (Str
, L
",0x%x,", SasEx
->RelativeTargetPort
);
707 if (((SasEx
->DeviceTopology
& 0x0f) == 0) && ((SasEx
->DeviceTopology
& BIT7
) == 0)) {
708 UefiDevicePathLibCatPrint (Str
, L
"NoTopology,0,0,0");
709 } else if (((SasEx
->DeviceTopology
& 0x0f) <= 2) && ((SasEx
->DeviceTopology
& BIT7
) == 0)) {
710 UefiDevicePathLibCatPrint (
713 ((SasEx
->DeviceTopology
& BIT4
) != 0) ? L
"SATA" : L
"SAS",
714 ((SasEx
->DeviceTopology
& BIT5
) != 0) ? L
"External" : L
"Internal",
715 ((SasEx
->DeviceTopology
& BIT6
) != 0) ? L
"Expanded" : L
"Direct"
717 if ((SasEx
->DeviceTopology
& 0x0f) == 1) {
718 UefiDevicePathLibCatPrint (Str
, L
"0");
721 // Value 0x0 thru 0xFF -> Drive 1 thru Drive 256
723 UefiDevicePathLibCatPrint (Str
, L
"0x%x", ((SasEx
->DeviceTopology
>> 8) & 0xff) + 1);
726 UefiDevicePathLibCatPrint (Str
, L
"0x%x,0,0,0", SasEx
->DeviceTopology
);
729 UefiDevicePathLibCatPrint (Str
, L
")");
735 Converts a NVM Express Namespace device path structure to its string representative.
737 @param Str The string representative of input device.
738 @param DevPath The input device path structure.
739 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
740 of the display node is used, where applicable. If DisplayOnly
741 is FALSE, then the longer text representation of the display node
743 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
744 representation for a device node can be used, where applicable.
749 IN OUT POOL_PRINT
*Str
,
751 IN BOOLEAN DisplayOnly
,
752 IN BOOLEAN AllowShortcuts
755 NVME_NAMESPACE_DEVICE_PATH
*Nvme
;
759 Uuid
= (UINT8
*) &Nvme
->NamespaceUuid
;
760 UefiDevicePathLibCatPrint (
762 L
"NVMe(0x%x,%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x)",
764 Uuid
[7], Uuid
[6], Uuid
[5], Uuid
[4],
765 Uuid
[3], Uuid
[2], Uuid
[1], Uuid
[0]
770 Converts a UFS device path structure to its string representative.
772 @param Str The string representative of input device.
773 @param DevPath The input device path structure.
774 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
775 of the display node is used, where applicable. If DisplayOnly
776 is FALSE, then the longer text representation of the display node
778 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
779 representation for a device node can be used, where applicable.
784 IN OUT POOL_PRINT
*Str
,
786 IN BOOLEAN DisplayOnly
,
787 IN BOOLEAN AllowShortcuts
790 UFS_DEVICE_PATH
*Ufs
;
793 UefiDevicePathLibCatPrint (Str
, L
"UFS(0x%x,0x%x)", Ufs
->Pun
, Ufs
->Lun
);
797 Converts a SD (Secure Digital) device path structure to its string representative.
799 @param Str The string representative of input device.
800 @param DevPath The input device path structure.
801 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
802 of the display node is used, where applicable. If DisplayOnly
803 is FALSE, then the longer text representation of the display node
805 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
806 representation for a device node can be used, where applicable.
811 IN OUT POOL_PRINT
*Str
,
813 IN BOOLEAN DisplayOnly
,
814 IN BOOLEAN AllowShortcuts
820 UefiDevicePathLibCatPrint (
828 Converts a EMMC (Embedded MMC) device path structure to its string representative.
830 @param Str The string representative of input device.
831 @param DevPath The input device path structure.
832 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
833 of the display node is used, where applicable. If DisplayOnly
834 is FALSE, then the longer text representation of the display node
836 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
837 representation for a device node can be used, where applicable.
842 IN OUT POOL_PRINT
*Str
,
844 IN BOOLEAN DisplayOnly
,
845 IN BOOLEAN AllowShortcuts
848 EMMC_DEVICE_PATH
*Emmc
;
851 UefiDevicePathLibCatPrint (
859 Converts a 1394 device path structure to its string representative.
861 @param Str The string representative of input device.
862 @param DevPath The input device path structure.
863 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
864 of the display node is used, where applicable. If DisplayOnly
865 is FALSE, then the longer text representation of the display node
867 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
868 representation for a device node can be used, where applicable.
873 IN OUT POOL_PRINT
*Str
,
875 IN BOOLEAN DisplayOnly
,
876 IN BOOLEAN AllowShortcuts
879 F1394_DEVICE_PATH
*F1394DevPath
;
881 F1394DevPath
= DevPath
;
883 // Guid has format of IEEE-EUI64
885 UefiDevicePathLibCatPrint (Str
, L
"I1394(%016lx)", F1394DevPath
->Guid
);
889 Converts a USB device path structure to its string representative.
891 @param Str The string representative of input device.
892 @param DevPath The input device path structure.
893 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
894 of the display node is used, where applicable. If DisplayOnly
895 is FALSE, then the longer text representation of the display node
897 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
898 representation for a device node can be used, where applicable.
903 IN OUT POOL_PRINT
*Str
,
905 IN BOOLEAN DisplayOnly
,
906 IN BOOLEAN AllowShortcuts
909 USB_DEVICE_PATH
*Usb
;
912 UefiDevicePathLibCatPrint (Str
, L
"USB(0x%x,0x%x)", Usb
->ParentPortNumber
, Usb
->InterfaceNumber
);
916 Converts a USB WWID device path structure to its string representative.
918 @param Str The string representative of input device.
919 @param DevPath The input device path structure.
920 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
921 of the display node is used, where applicable. If DisplayOnly
922 is FALSE, then the longer text representation of the display node
924 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
925 representation for a device node can be used, where applicable.
929 DevPathToTextUsbWWID (
930 IN OUT POOL_PRINT
*Str
,
932 IN BOOLEAN DisplayOnly
,
933 IN BOOLEAN AllowShortcuts
936 USB_WWID_DEVICE_PATH
*UsbWWId
;
937 CHAR16
*SerialNumberStr
;
943 SerialNumberStr
= (CHAR16
*) ((UINT8
*) UsbWWId
+ sizeof (USB_WWID_DEVICE_PATH
));
944 Length
= (UINT16
) ((DevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL
*) UsbWWId
) - sizeof (USB_WWID_DEVICE_PATH
)) / sizeof (CHAR16
));
945 if (SerialNumberStr
[Length
- 1] != 0) {
947 // In case no NULL terminator in SerialNumber, create a new one with NULL terminator
949 NewStr
= AllocateCopyPool ((Length
+ 1) * sizeof (CHAR16
), SerialNumberStr
);
950 ASSERT (NewStr
!= NULL
);
952 SerialNumberStr
= NewStr
;
955 UefiDevicePathLibCatPrint (
957 L
"UsbWwid(0x%x,0x%x,0x%x,\"%s\")",
960 UsbWWId
->InterfaceNumber
,
966 Converts a Logic Unit device path structure to its string representative.
968 @param Str The string representative of input device.
969 @param DevPath The input device path structure.
970 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
971 of the display node is used, where applicable. If DisplayOnly
972 is FALSE, then the longer text representation of the display node
974 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
975 representation for a device node can be used, where applicable.
979 DevPathToTextLogicalUnit (
980 IN OUT POOL_PRINT
*Str
,
982 IN BOOLEAN DisplayOnly
,
983 IN BOOLEAN AllowShortcuts
986 DEVICE_LOGICAL_UNIT_DEVICE_PATH
*LogicalUnit
;
988 LogicalUnit
= DevPath
;
989 UefiDevicePathLibCatPrint (Str
, L
"Unit(0x%x)", LogicalUnit
->Lun
);
993 Converts a USB class device path structure to its string representative.
995 @param Str The string representative of input device.
996 @param DevPath The input device path structure.
997 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
998 of the display node is used, where applicable. If DisplayOnly
999 is FALSE, then the longer text representation of the display node
1001 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1002 representation for a device node can be used, where applicable.
1006 DevPathToTextUsbClass (
1007 IN OUT POOL_PRINT
*Str
,
1009 IN BOOLEAN DisplayOnly
,
1010 IN BOOLEAN AllowShortcuts
1013 USB_CLASS_DEVICE_PATH
*UsbClass
;
1014 BOOLEAN IsKnownSubClass
;
1019 IsKnownSubClass
= TRUE
;
1020 switch (UsbClass
->DeviceClass
) {
1021 case USB_CLASS_AUDIO
:
1022 UefiDevicePathLibCatPrint (Str
, L
"UsbAudio");
1025 case USB_CLASS_CDCCONTROL
:
1026 UefiDevicePathLibCatPrint (Str
, L
"UsbCDCControl");
1030 UefiDevicePathLibCatPrint (Str
, L
"UsbHID");
1033 case USB_CLASS_IMAGE
:
1034 UefiDevicePathLibCatPrint (Str
, L
"UsbImage");
1037 case USB_CLASS_PRINTER
:
1038 UefiDevicePathLibCatPrint (Str
, L
"UsbPrinter");
1041 case USB_CLASS_MASS_STORAGE
:
1042 UefiDevicePathLibCatPrint (Str
, L
"UsbMassStorage");
1046 UefiDevicePathLibCatPrint (Str
, L
"UsbHub");
1049 case USB_CLASS_CDCDATA
:
1050 UefiDevicePathLibCatPrint (Str
, L
"UsbCDCData");
1053 case USB_CLASS_SMART_CARD
:
1054 UefiDevicePathLibCatPrint (Str
, L
"UsbSmartCard");
1057 case USB_CLASS_VIDEO
:
1058 UefiDevicePathLibCatPrint (Str
, L
"UsbVideo");
1061 case USB_CLASS_DIAGNOSTIC
:
1062 UefiDevicePathLibCatPrint (Str
, L
"UsbDiagnostic");
1065 case USB_CLASS_WIRELESS
:
1066 UefiDevicePathLibCatPrint (Str
, L
"UsbWireless");
1070 IsKnownSubClass
= FALSE
;
1074 if (IsKnownSubClass
) {
1075 UefiDevicePathLibCatPrint (
1077 L
"(0x%x,0x%x,0x%x,0x%x)",
1079 UsbClass
->ProductId
,
1080 UsbClass
->DeviceSubClass
,
1081 UsbClass
->DeviceProtocol
1086 if (UsbClass
->DeviceClass
== USB_CLASS_RESERVE
) {
1087 if (UsbClass
->DeviceSubClass
== USB_SUBCLASS_FW_UPDATE
) {
1088 UefiDevicePathLibCatPrint (
1090 L
"UsbDeviceFirmwareUpdate(0x%x,0x%x,0x%x)",
1092 UsbClass
->ProductId
,
1093 UsbClass
->DeviceProtocol
1096 } else if (UsbClass
->DeviceSubClass
== USB_SUBCLASS_IRDA_BRIDGE
) {
1097 UefiDevicePathLibCatPrint (
1099 L
"UsbIrdaBridge(0x%x,0x%x,0x%x)",
1101 UsbClass
->ProductId
,
1102 UsbClass
->DeviceProtocol
1105 } else if (UsbClass
->DeviceSubClass
== USB_SUBCLASS_TEST
) {
1106 UefiDevicePathLibCatPrint (
1108 L
"UsbTestAndMeasurement(0x%x,0x%x,0x%x)",
1110 UsbClass
->ProductId
,
1111 UsbClass
->DeviceProtocol
1117 UefiDevicePathLibCatPrint (
1119 L
"UsbClass(0x%x,0x%x,0x%x,0x%x,0x%x)",
1121 UsbClass
->ProductId
,
1122 UsbClass
->DeviceClass
,
1123 UsbClass
->DeviceSubClass
,
1124 UsbClass
->DeviceProtocol
1129 Converts a SATA device path structure to its string representative.
1131 @param Str The string representative of input device.
1132 @param DevPath The input device path structure.
1133 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1134 of the display node is used, where applicable. If DisplayOnly
1135 is FALSE, then the longer text representation of the display node
1137 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1138 representation for a device node can be used, where applicable.
1143 IN OUT POOL_PRINT
*Str
,
1145 IN BOOLEAN DisplayOnly
,
1146 IN BOOLEAN AllowShortcuts
1149 SATA_DEVICE_PATH
*Sata
;
1152 UefiDevicePathLibCatPrint (
1154 L
"Sata(0x%x,0x%x,0x%x)",
1155 Sata
->HBAPortNumber
,
1156 Sata
->PortMultiplierPortNumber
,
1162 Converts a I20 device path structure to its string representative.
1164 @param Str The string representative of input device.
1165 @param DevPath The input device path structure.
1166 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1167 of the display node is used, where applicable. If DisplayOnly
1168 is FALSE, then the longer text representation of the display node
1170 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1171 representation for a device node can be used, where applicable.
1176 IN OUT POOL_PRINT
*Str
,
1178 IN BOOLEAN DisplayOnly
,
1179 IN BOOLEAN AllowShortcuts
1182 I2O_DEVICE_PATH
*I2ODevPath
;
1184 I2ODevPath
= DevPath
;
1185 UefiDevicePathLibCatPrint (Str
, L
"I2O(0x%x)", I2ODevPath
->Tid
);
1189 Converts a MAC address device path structure to its string representative.
1191 @param Str The string representative of input device.
1192 @param DevPath The input device path structure.
1193 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1194 of the display node is used, where applicable. If DisplayOnly
1195 is FALSE, then the longer text representation of the display node
1197 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1198 representation for a device node can be used, where applicable.
1202 DevPathToTextMacAddr (
1203 IN OUT POOL_PRINT
*Str
,
1205 IN BOOLEAN DisplayOnly
,
1206 IN BOOLEAN AllowShortcuts
1209 MAC_ADDR_DEVICE_PATH
*MacDevPath
;
1210 UINTN HwAddressSize
;
1213 MacDevPath
= DevPath
;
1215 HwAddressSize
= sizeof (EFI_MAC_ADDRESS
);
1216 if (MacDevPath
->IfType
== 0x01 || MacDevPath
->IfType
== 0x00) {
1220 UefiDevicePathLibCatPrint (Str
, L
"MAC(");
1222 for (Index
= 0; Index
< HwAddressSize
; Index
++) {
1223 UefiDevicePathLibCatPrint (Str
, L
"%02x", MacDevPath
->MacAddress
.Addr
[Index
]);
1226 UefiDevicePathLibCatPrint (Str
, L
",0x%x)", MacDevPath
->IfType
);
1230 Converts network protocol string to its text representation.
1232 @param Str The string representative of input device.
1233 @param Protocol The network protocol ID.
1237 CatNetworkProtocol (
1238 IN OUT POOL_PRINT
*Str
,
1242 if (Protocol
== RFC_1700_TCP_PROTOCOL
) {
1243 UefiDevicePathLibCatPrint (Str
, L
"TCP");
1244 } else if (Protocol
== RFC_1700_UDP_PROTOCOL
) {
1245 UefiDevicePathLibCatPrint (Str
, L
"UDP");
1247 UefiDevicePathLibCatPrint (Str
, L
"0x%x", Protocol
);
1252 Converts IP v4 address to its text representation.
1254 @param Str The string representative of input device.
1255 @param Address The IP v4 address.
1259 IN OUT POOL_PRINT
*Str
,
1260 IN EFI_IPv4_ADDRESS
*Address
1263 UefiDevicePathLibCatPrint (Str
, L
"%d.%d.%d.%d", Address
->Addr
[0], Address
->Addr
[1], Address
->Addr
[2], Address
->Addr
[3]);
1267 Converts IP v6 address to its text representation.
1269 @param Str The string representative of input device.
1270 @param Address The IP v6 address.
1274 IN OUT POOL_PRINT
*Str
,
1275 IN EFI_IPv6_ADDRESS
*Address
1278 UefiDevicePathLibCatPrint (
1279 Str
, L
"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
1280 Address
->Addr
[0], Address
->Addr
[1],
1281 Address
->Addr
[2], Address
->Addr
[3],
1282 Address
->Addr
[4], Address
->Addr
[5],
1283 Address
->Addr
[6], Address
->Addr
[7],
1284 Address
->Addr
[8], Address
->Addr
[9],
1285 Address
->Addr
[10], Address
->Addr
[11],
1286 Address
->Addr
[12], Address
->Addr
[13],
1287 Address
->Addr
[14], Address
->Addr
[15]
1292 Converts a IPv4 device path structure to its string representative.
1294 @param Str The string representative of input device.
1295 @param DevPath The input device path structure.
1296 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1297 of the display node is used, where applicable. If DisplayOnly
1298 is FALSE, then the longer text representation of the display node
1300 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1301 representation for a device node can be used, where applicable.
1306 IN OUT POOL_PRINT
*Str
,
1308 IN BOOLEAN DisplayOnly
,
1309 IN BOOLEAN AllowShortcuts
1312 IPv4_DEVICE_PATH
*IPDevPath
;
1314 IPDevPath
= DevPath
;
1315 UefiDevicePathLibCatPrint (Str
, L
"IPv4(");
1316 CatIPv4Address (Str
, &IPDevPath
->RemoteIpAddress
);
1319 UefiDevicePathLibCatPrint (Str
, L
")");
1323 UefiDevicePathLibCatPrint (Str
, L
",");
1324 CatNetworkProtocol (Str
, IPDevPath
->Protocol
);
1326 UefiDevicePathLibCatPrint (Str
, L
",%s,", IPDevPath
->StaticIpAddress
? L
"Static" : L
"DHCP");
1327 CatIPv4Address (Str
, &IPDevPath
->LocalIpAddress
);
1328 if (DevicePathNodeLength (IPDevPath
) == sizeof (IPv4_DEVICE_PATH
)) {
1329 UefiDevicePathLibCatPrint (Str
, L
",");
1330 CatIPv4Address (Str
, &IPDevPath
->GatewayIpAddress
);
1331 UefiDevicePathLibCatPrint (Str
, L
",");
1332 CatIPv4Address (Str
, &IPDevPath
->SubnetMask
);
1334 UefiDevicePathLibCatPrint (Str
, L
")");
1338 Converts a IPv6 device path structure to its string representative.
1340 @param Str The string representative of input device.
1341 @param DevPath The input device path structure.
1342 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1343 of the display node is used, where applicable. If DisplayOnly
1344 is FALSE, then the longer text representation of the display node
1346 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1347 representation for a device node can be used, where applicable.
1352 IN OUT POOL_PRINT
*Str
,
1354 IN BOOLEAN DisplayOnly
,
1355 IN BOOLEAN AllowShortcuts
1358 IPv6_DEVICE_PATH
*IPDevPath
;
1360 IPDevPath
= DevPath
;
1361 UefiDevicePathLibCatPrint (Str
, L
"IPv6(");
1362 CatIPv6Address (Str
, &IPDevPath
->RemoteIpAddress
);
1364 UefiDevicePathLibCatPrint (Str
, L
")");
1368 UefiDevicePathLibCatPrint (Str
, L
",");
1369 CatNetworkProtocol (Str
, IPDevPath
->Protocol
);
1371 switch (IPDevPath
->IpAddressOrigin
) {
1373 UefiDevicePathLibCatPrint (Str
, L
",Static,");
1376 UefiDevicePathLibCatPrint (Str
, L
",StatelessAutoConfigure,");
1379 UefiDevicePathLibCatPrint (Str
, L
",StatefulAutoConfigure,");
1383 CatIPv6Address (Str
, &IPDevPath
->LocalIpAddress
);
1385 if (DevicePathNodeLength (IPDevPath
) == sizeof (IPv6_DEVICE_PATH
)) {
1386 UefiDevicePathLibCatPrint (Str
, L
",0x%x,", IPDevPath
->PrefixLength
);
1387 CatIPv6Address (Str
, &IPDevPath
->GatewayIpAddress
);
1389 UefiDevicePathLibCatPrint (Str
, L
")");
1393 Converts an Infini Band device path structure to its string representative.
1395 @param Str The string representative of input device.
1396 @param DevPath The input device path structure.
1397 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1398 of the display node is used, where applicable. If DisplayOnly
1399 is FALSE, then the longer text representation of the display node
1401 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1402 representation for a device node can be used, where applicable.
1406 DevPathToTextInfiniBand (
1407 IN OUT POOL_PRINT
*Str
,
1409 IN BOOLEAN DisplayOnly
,
1410 IN BOOLEAN AllowShortcuts
1413 INFINIBAND_DEVICE_PATH
*InfiniBand
;
1415 InfiniBand
= DevPath
;
1416 UefiDevicePathLibCatPrint (
1418 L
"Infiniband(0x%x,%g,0x%lx,0x%lx,0x%lx)",
1419 InfiniBand
->ResourceFlags
,
1420 InfiniBand
->PortGid
,
1421 InfiniBand
->ServiceId
,
1422 InfiniBand
->TargetPortId
,
1423 InfiniBand
->DeviceId
1428 Converts a UART device path structure to its string representative.
1430 @param Str The string representative of input device.
1431 @param DevPath The input device path structure.
1432 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1433 of the display node is used, where applicable. If DisplayOnly
1434 is FALSE, then the longer text representation of the display node
1436 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1437 representation for a device node can be used, where applicable.
1442 IN OUT POOL_PRINT
*Str
,
1444 IN BOOLEAN DisplayOnly
,
1445 IN BOOLEAN AllowShortcuts
1448 UART_DEVICE_PATH
*Uart
;
1452 switch (Uart
->Parity
) {
1482 if (Uart
->BaudRate
== 0) {
1483 UefiDevicePathLibCatPrint (Str
, L
"Uart(DEFAULT,");
1485 UefiDevicePathLibCatPrint (Str
, L
"Uart(%ld,", Uart
->BaudRate
);
1488 if (Uart
->DataBits
== 0) {
1489 UefiDevicePathLibCatPrint (Str
, L
"DEFAULT,");
1491 UefiDevicePathLibCatPrint (Str
, L
"%d,", Uart
->DataBits
);
1494 UefiDevicePathLibCatPrint (Str
, L
"%c,", Parity
);
1496 switch (Uart
->StopBits
) {
1498 UefiDevicePathLibCatPrint (Str
, L
"D)");
1502 UefiDevicePathLibCatPrint (Str
, L
"1)");
1506 UefiDevicePathLibCatPrint (Str
, L
"1.5)");
1510 UefiDevicePathLibCatPrint (Str
, L
"2)");
1514 UefiDevicePathLibCatPrint (Str
, L
"x)");
1520 Converts an iSCSI device path structure to its string representative.
1522 @param Str The string representative of input device.
1523 @param DevPath The input device path structure.
1524 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1525 of the display node is used, where applicable. If DisplayOnly
1526 is FALSE, then the longer text representation of the display node
1528 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1529 representation for a device node can be used, where applicable.
1533 DevPathToTextiSCSI (
1534 IN OUT POOL_PRINT
*Str
,
1536 IN BOOLEAN DisplayOnly
,
1537 IN BOOLEAN AllowShortcuts
1540 ISCSI_DEVICE_PATH_WITH_NAME
*ISCSIDevPath
;
1543 ISCSIDevPath
= DevPath
;
1544 UefiDevicePathLibCatPrint (
1546 L
"iSCSI(%a,0x%x,0x%lx,",
1547 ISCSIDevPath
->TargetName
,
1548 ISCSIDevPath
->TargetPortalGroupTag
,
1552 Options
= ISCSIDevPath
->LoginOption
;
1553 UefiDevicePathLibCatPrint (Str
, L
"%s,", (((Options
>> 1) & 0x0001) != 0) ? L
"CRC32C" : L
"None");
1554 UefiDevicePathLibCatPrint (Str
, L
"%s,", (((Options
>> 3) & 0x0001) != 0) ? L
"CRC32C" : L
"None");
1555 if (((Options
>> 11) & 0x0001) != 0) {
1556 UefiDevicePathLibCatPrint (Str
, L
"%s,", L
"None");
1557 } else if (((Options
>> 12) & 0x0001) != 0) {
1558 UefiDevicePathLibCatPrint (Str
, L
"%s,", L
"CHAP_UNI");
1560 UefiDevicePathLibCatPrint (Str
, L
"%s,", L
"CHAP_BI");
1564 UefiDevicePathLibCatPrint (Str
, L
"%s)", (ISCSIDevPath
->NetworkProtocol
== 0) ? L
"TCP" : L
"reserved");
1568 Converts a VLAN device path structure to its string representative.
1570 @param Str The string representative of input device.
1571 @param DevPath The input device path structure.
1572 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1573 of the display node is used, where applicable. If DisplayOnly
1574 is FALSE, then the longer text representation of the display node
1576 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1577 representation for a device node can be used, where applicable.
1582 IN OUT POOL_PRINT
*Str
,
1584 IN BOOLEAN DisplayOnly
,
1585 IN BOOLEAN AllowShortcuts
1588 VLAN_DEVICE_PATH
*Vlan
;
1591 UefiDevicePathLibCatPrint (Str
, L
"Vlan(%d)", Vlan
->VlanId
);
1595 Converts a Bluetooth device path structure to its string representative.
1597 @param Str The string representative of input device.
1598 @param DevPath The input device path structure.
1599 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1600 of the display node is used, where applicable. If DisplayOnly
1601 is FALSE, then the longer text representation of the display node
1603 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1604 representation for a device node can be used, where applicable.
1608 DevPathToTextBluetooth (
1609 IN OUT POOL_PRINT
*Str
,
1611 IN BOOLEAN DisplayOnly
,
1612 IN BOOLEAN AllowShortcuts
1615 BLUETOOTH_DEVICE_PATH
*Bluetooth
;
1617 Bluetooth
= DevPath
;
1618 UefiDevicePathLibCatPrint (
1620 L
"Bluetooth(%02x%02x%02x%02x%02x%02x)",
1621 Bluetooth
->BD_ADDR
.Address
[0],
1622 Bluetooth
->BD_ADDR
.Address
[1],
1623 Bluetooth
->BD_ADDR
.Address
[2],
1624 Bluetooth
->BD_ADDR
.Address
[3],
1625 Bluetooth
->BD_ADDR
.Address
[4],
1626 Bluetooth
->BD_ADDR
.Address
[5]
1631 Converts a Wi-Fi device path structure to its string representative.
1633 @param Str The string representative of input device.
1634 @param DevPath The input device path structure.
1635 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1636 of the display node is used, where applicable. If DisplayOnly
1637 is FALSE, then the longer text representation of the display node
1639 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1640 representation for a device node can be used, where applicable.
1645 IN OUT POOL_PRINT
*Str
,
1647 IN BOOLEAN DisplayOnly
,
1648 IN BOOLEAN AllowShortcuts
1651 WIFI_DEVICE_PATH
*WiFi
;
1657 CopyMem (SSId
, WiFi
->SSId
, 32);
1659 UefiDevicePathLibCatPrint (Str
, L
"Wi-Fi(%a)", SSId
);
1663 Converts a Bluetooth device path structure to its string representative.
1665 @param Str The string representative of input device.
1666 @param DevPath The input device path structure.
1667 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1668 of the display node is used, where applicable. If DisplayOnly
1669 is FALSE, then the longer text representation of the display node
1671 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1672 representation for a device node can be used, where applicable.
1676 DevPathToTextBluetoothLE (
1677 IN OUT POOL_PRINT
*Str
,
1679 IN BOOLEAN DisplayOnly
,
1680 IN BOOLEAN AllowShortcuts
1683 BLUETOOTH_LE_DEVICE_PATH
*BluetoothLE
;
1685 BluetoothLE
= DevPath
;
1686 UefiDevicePathLibCatPrint (
1688 L
"BluetoothLE(%02x%02x%02x%02x%02x%02x,0x%02x)",
1689 BluetoothLE
->Address
.Address
[0],
1690 BluetoothLE
->Address
.Address
[1],
1691 BluetoothLE
->Address
.Address
[2],
1692 BluetoothLE
->Address
.Address
[3],
1693 BluetoothLE
->Address
.Address
[4],
1694 BluetoothLE
->Address
.Address
[5],
1695 BluetoothLE
->Address
.Type
1700 Converts a DNS device path structure to its string representative.
1702 @param Str The string representative of input device.
1703 @param DevPath The input device path structure.
1704 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1705 of the display node is used, where applicable. If DisplayOnly
1706 is FALSE, then the longer text representation of the display node
1708 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1709 representation for a device node can be used, where applicable.
1714 IN OUT POOL_PRINT
*Str
,
1716 IN BOOLEAN DisplayOnly
,
1717 IN BOOLEAN AllowShortcuts
1720 DNS_DEVICE_PATH
*DnsDevPath
;
1721 UINT32 DnsServerIpCount
;
1722 UINT32 DnsServerIpIndex
;
1724 DnsDevPath
= DevPath
;
1725 DnsServerIpCount
= (UINT32
) (DevicePathNodeLength(DnsDevPath
) - sizeof (EFI_DEVICE_PATH_PROTOCOL
) - sizeof (DnsDevPath
->IsIPv6
)) / sizeof (EFI_IP_ADDRESS
);
1727 UefiDevicePathLibCatPrint (Str
, L
"Dns(");
1729 for (DnsServerIpIndex
= 0; DnsServerIpIndex
< DnsServerIpCount
; DnsServerIpIndex
++) {
1730 if (DnsDevPath
->IsIPv6
== 0x00) {
1731 CatIPv4Address (Str
, &(DnsDevPath
->DnsServerIp
[DnsServerIpIndex
].v4
));
1733 CatIPv6Address (Str
, &(DnsDevPath
->DnsServerIp
[DnsServerIpIndex
].v6
));
1736 if (DnsServerIpIndex
< DnsServerIpCount
- 1) {
1737 UefiDevicePathLibCatPrint (Str
, L
",");
1741 UefiDevicePathLibCatPrint (Str
, L
")");
1745 Converts a URI device path structure to its string representative.
1747 @param Str The string representative of input device.
1748 @param DevPath The input device path structure.
1749 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1750 of the display node is used, where applicable. If DisplayOnly
1751 is FALSE, then the longer text representation of the display node
1753 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1754 representation for a device node can be used, where applicable.
1759 IN OUT POOL_PRINT
*Str
,
1761 IN BOOLEAN DisplayOnly
,
1762 IN BOOLEAN AllowShortcuts
1765 URI_DEVICE_PATH
*Uri
;
1770 // Uri in the device path may not be null terminated.
1773 UriLength
= DevicePathNodeLength (Uri
) - sizeof (URI_DEVICE_PATH
);
1774 UriStr
= AllocatePool (UriLength
+ 1);
1775 ASSERT (UriStr
!= NULL
);
1777 CopyMem (UriStr
, Uri
->Uri
, UriLength
);
1778 UriStr
[UriLength
] = '\0';
1779 UefiDevicePathLibCatPrint (Str
, L
"Uri(%a)", UriStr
);
1784 Converts a Hard drive device path structure to its string representative.
1786 @param Str The string representative of input device.
1787 @param DevPath The input device path structure.
1788 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1789 of the display node is used, where applicable. If DisplayOnly
1790 is FALSE, then the longer text representation of the display node
1792 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1793 representation for a device node can be used, where applicable.
1797 DevPathToTextHardDrive (
1798 IN OUT POOL_PRINT
*Str
,
1800 IN BOOLEAN DisplayOnly
,
1801 IN BOOLEAN AllowShortcuts
1804 HARDDRIVE_DEVICE_PATH
*Hd
;
1807 switch (Hd
->SignatureType
) {
1808 case SIGNATURE_TYPE_MBR
:
1809 UefiDevicePathLibCatPrint (
1811 L
"HD(%d,%s,0x%08x,",
1812 Hd
->PartitionNumber
,
1814 *((UINT32
*) (&(Hd
->Signature
[0])))
1818 case SIGNATURE_TYPE_GUID
:
1819 UefiDevicePathLibCatPrint (
1822 Hd
->PartitionNumber
,
1824 (EFI_GUID
*) &(Hd
->Signature
[0])
1829 UefiDevicePathLibCatPrint (
1832 Hd
->PartitionNumber
,
1838 UefiDevicePathLibCatPrint (Str
, L
"0x%lx,0x%lx)", Hd
->PartitionStart
, Hd
->PartitionSize
);
1842 Converts a CDROM device path structure to its string representative.
1844 @param Str The string representative of input device.
1845 @param DevPath The input device path structure.
1846 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1847 of the display node is used, where applicable. If DisplayOnly
1848 is FALSE, then the longer text representation of the display node
1850 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1851 representation for a device node can be used, where applicable.
1855 DevPathToTextCDROM (
1856 IN OUT POOL_PRINT
*Str
,
1858 IN BOOLEAN DisplayOnly
,
1859 IN BOOLEAN AllowShortcuts
1862 CDROM_DEVICE_PATH
*Cd
;
1866 UefiDevicePathLibCatPrint (Str
, L
"CDROM(0x%x)", Cd
->BootEntry
);
1870 UefiDevicePathLibCatPrint (Str
, L
"CDROM(0x%x,0x%lx,0x%lx)", Cd
->BootEntry
, Cd
->PartitionStart
, Cd
->PartitionSize
);
1874 Converts a File device path structure to its string representative.
1876 @param Str The string representative of input device.
1877 @param DevPath The input device path structure.
1878 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1879 of the display node is used, where applicable. If DisplayOnly
1880 is FALSE, then the longer text representation of the display node
1882 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1883 representation for a device node can be used, where applicable.
1887 DevPathToTextFilePath (
1888 IN OUT POOL_PRINT
*Str
,
1890 IN BOOLEAN DisplayOnly
,
1891 IN BOOLEAN AllowShortcuts
1894 FILEPATH_DEVICE_PATH
*Fp
;
1897 UefiDevicePathLibCatPrint (Str
, L
"%s", Fp
->PathName
);
1901 Converts a Media protocol device path structure to its string representative.
1903 @param Str The string representative of input device.
1904 @param DevPath The input device path structure.
1905 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1906 of the display node is used, where applicable. If DisplayOnly
1907 is FALSE, then the longer text representation of the display node
1909 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1910 representation for a device node can be used, where applicable.
1914 DevPathToTextMediaProtocol (
1915 IN OUT POOL_PRINT
*Str
,
1917 IN BOOLEAN DisplayOnly
,
1918 IN BOOLEAN AllowShortcuts
1921 MEDIA_PROTOCOL_DEVICE_PATH
*MediaProt
;
1923 MediaProt
= DevPath
;
1924 UefiDevicePathLibCatPrint (Str
, L
"Media(%g)", &MediaProt
->Protocol
);
1928 Converts a Firmware Volume device path structure to its string representative.
1930 @param Str The string representative of input device.
1931 @param DevPath The input device path structure.
1932 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1933 of the display node is used, where applicable. If DisplayOnly
1934 is FALSE, then the longer text representation of the display node
1936 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1937 representation for a device node can be used, where applicable.
1942 IN OUT POOL_PRINT
*Str
,
1944 IN BOOLEAN DisplayOnly
,
1945 IN BOOLEAN AllowShortcuts
1948 MEDIA_FW_VOL_DEVICE_PATH
*Fv
;
1951 UefiDevicePathLibCatPrint (Str
, L
"Fv(%g)", &Fv
->FvName
);
1955 Converts a Firmware Volume File device path structure to its string representative.
1957 @param Str The string representative of input device.
1958 @param DevPath The input device path structure.
1959 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1960 of the display node is used, where applicable. If DisplayOnly
1961 is FALSE, then the longer text representation of the display node
1963 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1964 representation for a device node can be used, where applicable.
1968 DevPathToTextFvFile (
1969 IN OUT POOL_PRINT
*Str
,
1971 IN BOOLEAN DisplayOnly
,
1972 IN BOOLEAN AllowShortcuts
1975 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH
*FvFile
;
1978 UefiDevicePathLibCatPrint (Str
, L
"FvFile(%g)", &FvFile
->FvFileName
);
1982 Converts a Relative Offset device path structure to its string representative.
1984 @param Str The string representative of input device.
1985 @param DevPath The input device path structure.
1986 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
1987 of the display node is used, where applicable. If DisplayOnly
1988 is FALSE, then the longer text representation of the display node
1990 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
1991 representation for a device node can be used, where applicable.
1995 DevPathRelativeOffsetRange (
1996 IN OUT POOL_PRINT
*Str
,
1998 IN BOOLEAN DisplayOnly
,
1999 IN BOOLEAN AllowShortcuts
2002 MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
*Offset
;
2005 UefiDevicePathLibCatPrint (
2007 L
"Offset(0x%lx,0x%lx)",
2008 Offset
->StartingOffset
,
2009 Offset
->EndingOffset
2014 Converts a Ram Disk device path structure to its string representative.
2016 @param Str The string representative of input device.
2017 @param DevPath The input device path structure.
2018 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
2019 of the display node is used, where applicable. If DisplayOnly
2020 is FALSE, then the longer text representation of the display node
2022 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
2023 representation for a device node can be used, where applicable.
2027 DevPathToTextRamDisk (
2028 IN OUT POOL_PRINT
*Str
,
2030 IN BOOLEAN DisplayOnly
,
2031 IN BOOLEAN AllowShortcuts
2034 MEDIA_RAM_DISK_DEVICE_PATH
*RamDisk
;
2038 if (CompareGuid (&RamDisk
->TypeGuid
, &gEfiVirtualDiskGuid
)) {
2039 UefiDevicePathLibCatPrint (
2041 L
"VirtualDisk(0x%lx,0x%lx,%d)",
2042 LShiftU64 ((UINT64
)RamDisk
->StartingAddr
[1], 32) | RamDisk
->StartingAddr
[0],
2043 LShiftU64 ((UINT64
)RamDisk
->EndingAddr
[1], 32) | RamDisk
->EndingAddr
[0],
2046 } else if (CompareGuid (&RamDisk
->TypeGuid
, &gEfiVirtualCdGuid
)) {
2047 UefiDevicePathLibCatPrint (
2049 L
"VirtualCD(0x%lx,0x%lx,%d)",
2050 LShiftU64 ((UINT64
)RamDisk
->StartingAddr
[1], 32) | RamDisk
->StartingAddr
[0],
2051 LShiftU64 ((UINT64
)RamDisk
->EndingAddr
[1], 32) | RamDisk
->EndingAddr
[0],
2054 } else if (CompareGuid (&RamDisk
->TypeGuid
, &gEfiPersistentVirtualDiskGuid
)) {
2055 UefiDevicePathLibCatPrint (
2057 L
"PersistentVirtualDisk(0x%lx,0x%lx,%d)",
2058 LShiftU64 ((UINT64
)RamDisk
->StartingAddr
[1], 32) | RamDisk
->StartingAddr
[0],
2059 LShiftU64 ((UINT64
)RamDisk
->EndingAddr
[1], 32) | RamDisk
->EndingAddr
[0],
2062 } else if (CompareGuid (&RamDisk
->TypeGuid
, &gEfiPersistentVirtualCdGuid
)) {
2063 UefiDevicePathLibCatPrint (
2065 L
"PersistentVirtualCD(0x%lx,0x%lx,%d)",
2066 LShiftU64 ((UINT64
)RamDisk
->StartingAddr
[1], 32) | RamDisk
->StartingAddr
[0],
2067 LShiftU64 ((UINT64
)RamDisk
->EndingAddr
[1], 32) | RamDisk
->EndingAddr
[0],
2071 UefiDevicePathLibCatPrint (
2073 L
"RamDisk(0x%lx,0x%lx,%d,%g)",
2074 LShiftU64 ((UINT64
)RamDisk
->StartingAddr
[1], 32) | RamDisk
->StartingAddr
[0],
2075 LShiftU64 ((UINT64
)RamDisk
->EndingAddr
[1], 32) | RamDisk
->EndingAddr
[0],
2083 Converts a BIOS Boot Specification device path structure to its string representative.
2085 @param Str The string representative of input device.
2086 @param DevPath The input device path structure.
2087 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
2088 of the display node is used, where applicable. If DisplayOnly
2089 is FALSE, then the longer text representation of the display node
2091 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
2092 representation for a device node can be used, where applicable.
2097 IN OUT POOL_PRINT
*Str
,
2099 IN BOOLEAN DisplayOnly
,
2100 IN BOOLEAN AllowShortcuts
2103 BBS_BBS_DEVICE_PATH
*Bbs
;
2107 switch (Bbs
->DeviceType
) {
2108 case BBS_TYPE_FLOPPY
:
2112 case BBS_TYPE_HARDDRIVE
:
2116 case BBS_TYPE_CDROM
:
2120 case BBS_TYPE_PCMCIA
:
2128 case BBS_TYPE_EMBEDDED_NETWORK
:
2138 UefiDevicePathLibCatPrint (Str
, L
"BBS(%s,%a", Type
, Bbs
->String
);
2140 UefiDevicePathLibCatPrint (Str
, L
"BBS(0x%x,%a", Bbs
->DeviceType
, Bbs
->String
);
2144 UefiDevicePathLibCatPrint (Str
, L
")");
2148 UefiDevicePathLibCatPrint (Str
, L
",0x%x)", Bbs
->StatusFlag
);
2152 Converts an End-of-Device-Path structure to its string representative.
2154 @param Str The string representative of input device.
2155 @param DevPath The input device path structure.
2156 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
2157 of the display node is used, where applicable. If DisplayOnly
2158 is FALSE, then the longer text representation of the display node
2160 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
2161 representation for a device node can be used, where applicable.
2165 DevPathToTextEndInstance (
2166 IN OUT POOL_PRINT
*Str
,
2168 IN BOOLEAN DisplayOnly
,
2169 IN BOOLEAN AllowShortcuts
2172 UefiDevicePathLibCatPrint (Str
, L
",");
2175 GLOBAL_REMOVE_IF_UNREFERENCED
const DEVICE_PATH_TO_TEXT_GENERIC_TABLE mUefiDevicePathLibToTextTableGeneric
[] = {
2176 {HARDWARE_DEVICE_PATH
, L
"HardwarePath" },
2177 {ACPI_DEVICE_PATH
, L
"AcpiPath" },
2178 {MESSAGING_DEVICE_PATH
, L
"Msg" },
2179 {MEDIA_DEVICE_PATH
, L
"MediaPath" },
2180 {BBS_DEVICE_PATH
, L
"BbsPath" },
2185 Converts an unknown device path structure to its string representative.
2187 @param Str The string representative of input device.
2188 @param DevPath The input device path structure.
2189 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
2190 of the display node is used, where applicable. If DisplayOnly
2191 is FALSE, then the longer text representation of the display node
2193 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
2194 representation for a device node can be used, where applicable.
2198 DevPathToTextNodeGeneric (
2199 IN OUT POOL_PRINT
*Str
,
2201 IN BOOLEAN DisplayOnly
,
2202 IN BOOLEAN AllowShortcuts
2205 EFI_DEVICE_PATH_PROTOCOL
*Node
;
2210 for (Index
= 0; mUefiDevicePathLibToTextTableGeneric
[Index
].Text
!= NULL
; Index
++) {
2211 if (DevicePathType (Node
) == mUefiDevicePathLibToTextTableGeneric
[Index
].Type
) {
2216 if (mUefiDevicePathLibToTextTableGeneric
[Index
].Text
== NULL
) {
2218 // It's a node whose type cannot be recognized
2220 UefiDevicePathLibCatPrint (Str
, L
"Path(%d,%d", DevicePathType (Node
), DevicePathSubType (Node
));
2223 // It's a node whose type can be recognized
2225 UefiDevicePathLibCatPrint (Str
, L
"%s(%d", mUefiDevicePathLibToTextTableGeneric
[Index
].Text
, DevicePathSubType (Node
));
2228 Index
= sizeof (EFI_DEVICE_PATH_PROTOCOL
);
2229 if (Index
< DevicePathNodeLength (Node
)) {
2230 UefiDevicePathLibCatPrint (Str
, L
",");
2231 for (; Index
< DevicePathNodeLength (Node
); Index
++) {
2232 UefiDevicePathLibCatPrint (Str
, L
"%02x", ((UINT8
*) Node
)[Index
]);
2236 UefiDevicePathLibCatPrint (Str
, L
")");
2239 GLOBAL_REMOVE_IF_UNREFERENCED
const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLibToTextTable
[] = {
2240 {HARDWARE_DEVICE_PATH
, HW_PCI_DP
, DevPathToTextPci
},
2241 {HARDWARE_DEVICE_PATH
, HW_PCCARD_DP
, DevPathToTextPccard
},
2242 {HARDWARE_DEVICE_PATH
, HW_MEMMAP_DP
, DevPathToTextMemMap
},
2243 {HARDWARE_DEVICE_PATH
, HW_VENDOR_DP
, DevPathToTextVendor
},
2244 {HARDWARE_DEVICE_PATH
, HW_CONTROLLER_DP
, DevPathToTextController
},
2245 {HARDWARE_DEVICE_PATH
, HW_BMC_DP
, DevPathToTextBmc
},
2246 {ACPI_DEVICE_PATH
, ACPI_DP
, DevPathToTextAcpi
},
2247 {ACPI_DEVICE_PATH
, ACPI_EXTENDED_DP
, DevPathToTextAcpiEx
},
2248 {ACPI_DEVICE_PATH
, ACPI_ADR_DP
, DevPathToTextAcpiAdr
},
2249 {MESSAGING_DEVICE_PATH
, MSG_ATAPI_DP
, DevPathToTextAtapi
},
2250 {MESSAGING_DEVICE_PATH
, MSG_SCSI_DP
, DevPathToTextScsi
},
2251 {MESSAGING_DEVICE_PATH
, MSG_FIBRECHANNEL_DP
, DevPathToTextFibre
},
2252 {MESSAGING_DEVICE_PATH
, MSG_FIBRECHANNELEX_DP
, DevPathToTextFibreEx
},
2253 {MESSAGING_DEVICE_PATH
, MSG_SASEX_DP
, DevPathToTextSasEx
},
2254 {MESSAGING_DEVICE_PATH
, MSG_NVME_NAMESPACE_DP
, DevPathToTextNVMe
},
2255 {MESSAGING_DEVICE_PATH
, MSG_UFS_DP
, DevPathToTextUfs
},
2256 {MESSAGING_DEVICE_PATH
, MSG_SD_DP
, DevPathToTextSd
},
2257 {MESSAGING_DEVICE_PATH
, MSG_EMMC_DP
, DevPathToTextEmmc
},
2258 {MESSAGING_DEVICE_PATH
, MSG_1394_DP
, DevPathToText1394
},
2259 {MESSAGING_DEVICE_PATH
, MSG_USB_DP
, DevPathToTextUsb
},
2260 {MESSAGING_DEVICE_PATH
, MSG_USB_WWID_DP
, DevPathToTextUsbWWID
},
2261 {MESSAGING_DEVICE_PATH
, MSG_DEVICE_LOGICAL_UNIT_DP
, DevPathToTextLogicalUnit
},
2262 {MESSAGING_DEVICE_PATH
, MSG_USB_CLASS_DP
, DevPathToTextUsbClass
},
2263 {MESSAGING_DEVICE_PATH
, MSG_SATA_DP
, DevPathToTextSata
},
2264 {MESSAGING_DEVICE_PATH
, MSG_I2O_DP
, DevPathToTextI2O
},
2265 {MESSAGING_DEVICE_PATH
, MSG_MAC_ADDR_DP
, DevPathToTextMacAddr
},
2266 {MESSAGING_DEVICE_PATH
, MSG_IPv4_DP
, DevPathToTextIPv4
},
2267 {MESSAGING_DEVICE_PATH
, MSG_IPv6_DP
, DevPathToTextIPv6
},
2268 {MESSAGING_DEVICE_PATH
, MSG_INFINIBAND_DP
, DevPathToTextInfiniBand
},
2269 {MESSAGING_DEVICE_PATH
, MSG_UART_DP
, DevPathToTextUart
},
2270 {MESSAGING_DEVICE_PATH
, MSG_VENDOR_DP
, DevPathToTextVendor
},
2271 {MESSAGING_DEVICE_PATH
, MSG_ISCSI_DP
, DevPathToTextiSCSI
},
2272 {MESSAGING_DEVICE_PATH
, MSG_VLAN_DP
, DevPathToTextVlan
},
2273 {MESSAGING_DEVICE_PATH
, MSG_DNS_DP
, DevPathToTextDns
},
2274 {MESSAGING_DEVICE_PATH
, MSG_URI_DP
, DevPathToTextUri
},
2275 {MESSAGING_DEVICE_PATH
, MSG_BLUETOOTH_DP
, DevPathToTextBluetooth
},
2276 {MESSAGING_DEVICE_PATH
, MSG_WIFI_DP
, DevPathToTextWiFi
},
2277 {MESSAGING_DEVICE_PATH
, MSG_BLUETOOTH_LE_DP
, DevPathToTextBluetoothLE
},
2278 {MEDIA_DEVICE_PATH
, MEDIA_HARDDRIVE_DP
, DevPathToTextHardDrive
},
2279 {MEDIA_DEVICE_PATH
, MEDIA_CDROM_DP
, DevPathToTextCDROM
},
2280 {MEDIA_DEVICE_PATH
, MEDIA_VENDOR_DP
, DevPathToTextVendor
},
2281 {MEDIA_DEVICE_PATH
, MEDIA_PROTOCOL_DP
, DevPathToTextMediaProtocol
},
2282 {MEDIA_DEVICE_PATH
, MEDIA_FILEPATH_DP
, DevPathToTextFilePath
},
2283 {MEDIA_DEVICE_PATH
, MEDIA_PIWG_FW_VOL_DP
, DevPathToTextFv
},
2284 {MEDIA_DEVICE_PATH
, MEDIA_PIWG_FW_FILE_DP
, DevPathToTextFvFile
},
2285 {MEDIA_DEVICE_PATH
, MEDIA_RELATIVE_OFFSET_RANGE_DP
, DevPathRelativeOffsetRange
},
2286 {MEDIA_DEVICE_PATH
, MEDIA_RAM_DISK_DP
, DevPathToTextRamDisk
},
2287 {BBS_DEVICE_PATH
, BBS_BBS_DP
, DevPathToTextBBS
},
2288 {END_DEVICE_PATH_TYPE
, END_INSTANCE_DEVICE_PATH_SUBTYPE
, DevPathToTextEndInstance
},
2293 Converts a device node to its string representation.
2295 @param DeviceNode A Pointer to the device node to be converted.
2296 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
2297 of the display node is used, where applicable. If DisplayOnly
2298 is FALSE, then the longer text representation of the display node
2300 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
2301 representation for a device node can be used, where applicable.
2303 @return A pointer to the allocated text representation of the device node or NULL if DeviceNode
2304 is NULL or there was insufficient memory.
2309 UefiDevicePathLibConvertDeviceNodeToText (
2310 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DeviceNode
,
2311 IN BOOLEAN DisplayOnly
,
2312 IN BOOLEAN AllowShortcuts
2317 DEVICE_PATH_TO_TEXT ToText
;
2319 if (DeviceNode
== NULL
) {
2323 ZeroMem (&Str
, sizeof (Str
));
2326 // Process the device path node
2327 // If not found, use a generic function
2329 ToText
= DevPathToTextNodeGeneric
;
2330 for (Index
= 0; mUefiDevicePathLibToTextTable
[Index
].Function
!= NULL
; Index
++) {
2331 if (DevicePathType (DeviceNode
) == mUefiDevicePathLibToTextTable
[Index
].Type
&&
2332 DevicePathSubType (DeviceNode
) == mUefiDevicePathLibToTextTable
[Index
].SubType
2334 ToText
= mUefiDevicePathLibToTextTable
[Index
].Function
;
2342 ToText (&Str
, (VOID
*) DeviceNode
, DisplayOnly
, AllowShortcuts
);
2344 ASSERT (Str
.Str
!= NULL
);
2349 Converts a device path to its text representation.
2351 @param DevicePath A Pointer to the device to be converted.
2352 @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
2353 of the display node is used, where applicable. If DisplayOnly
2354 is FALSE, then the longer text representation of the display node
2356 @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
2357 representation for a device node can be used, where applicable.
2359 @return A pointer to the allocated text representation of the device path or
2360 NULL if DeviceNode is NULL or there was insufficient memory.
2365 UefiDevicePathLibConvertDevicePathToText (
2366 IN CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
2367 IN BOOLEAN DisplayOnly
,
2368 IN BOOLEAN AllowShortcuts
2372 EFI_DEVICE_PATH_PROTOCOL
*Node
;
2373 EFI_DEVICE_PATH_PROTOCOL
*AlignedNode
;
2375 DEVICE_PATH_TO_TEXT ToText
;
2377 if (DevicePath
== NULL
) {
2381 ZeroMem (&Str
, sizeof (Str
));
2384 // Process each device path node
2386 Node
= (EFI_DEVICE_PATH_PROTOCOL
*) DevicePath
;
2387 while (!IsDevicePathEnd (Node
)) {
2389 // Find the handler to dump this device path node
2390 // If not found, use a generic function
2392 ToText
= DevPathToTextNodeGeneric
;
2393 for (Index
= 0; mUefiDevicePathLibToTextTable
[Index
].Function
!= NULL
; Index
+= 1) {
2395 if (DevicePathType (Node
) == mUefiDevicePathLibToTextTable
[Index
].Type
&&
2396 DevicePathSubType (Node
) == mUefiDevicePathLibToTextTable
[Index
].SubType
2398 ToText
= mUefiDevicePathLibToTextTable
[Index
].Function
;
2403 // Put a path separator in if needed
2405 if ((Str
.Count
!= 0) && (ToText
!= DevPathToTextEndInstance
)) {
2406 if (Str
.Str
[Str
.Count
] != L
',') {
2407 UefiDevicePathLibCatPrint (&Str
, L
"/");
2411 AlignedNode
= AllocateCopyPool (DevicePathNodeLength (Node
), Node
);
2413 // Print this node of the device path
2415 ToText (&Str
, AlignedNode
, DisplayOnly
, AllowShortcuts
);
2416 FreePool (AlignedNode
);
2419 // Next device path node
2421 Node
= NextDevicePathNode (Node
);
2424 if (Str
.Str
== NULL
) {
2425 return AllocateZeroPool (sizeof (CHAR16
));