TianoCore EDK2 master
Loading...
Searching...
No Matches
DevicePathFromText.c
Go to the documentation of this file.
1
9#include "UefiDevicePathLib.h"
10
20CHAR16 *
22 IN CONST CHAR16 *Src
23 )
24{
25 return AllocateCopyPool (StrSize (Src), Src);
26}
27
39CHAR16 *
41 IN CHAR16 *Str,
42 IN CHAR16 *NodeName
43 )
44{
45 CHAR16 *ParamStr;
46 CHAR16 *StrPointer;
47 UINTN NodeNameLength;
48 UINTN ParameterLength;
49
50 //
51 // Check whether the node name matchs
52 //
53 NodeNameLength = StrLen (NodeName);
54 if (StrnCmp (Str, NodeName, NodeNameLength) != 0) {
55 return NULL;
56 }
57
58 ParamStr = Str + NodeNameLength;
59 if (!IS_LEFT_PARENTH (*ParamStr)) {
60 return NULL;
61 }
62
63 //
64 // Skip the found '(' and find first occurrence of ')'
65 //
66 ParamStr++;
67 ParameterLength = 0;
68 StrPointer = ParamStr;
69 while (!IS_NULL (*StrPointer)) {
70 if (IS_RIGHT_PARENTH (*StrPointer)) {
71 break;
72 }
73
74 StrPointer++;
75 ParameterLength++;
76 }
77
78 if (IS_NULL (*StrPointer)) {
79 //
80 // ')' not found
81 //
82 return NULL;
83 }
84
85 ParamStr = AllocateCopyPool ((ParameterLength + 1) * sizeof (CHAR16), ParamStr);
86 if (ParamStr == NULL) {
87 return NULL;
88 }
89
90 //
91 // Terminate the parameter string
92 //
93 ParamStr[ParameterLength] = L'\0';
94
95 return ParamStr;
96}
97
110CHAR16 *
112 IN OUT CHAR16 **List,
113 IN CHAR16 Separator
114 )
115{
116 CHAR16 *Str;
117 CHAR16 *ReturnStr;
118
119 Str = *List;
120 ReturnStr = Str;
121
122 if (IS_NULL (*Str)) {
123 return ReturnStr;
124 }
125
126 //
127 // Find first occurrence of the separator
128 //
129 while (!IS_NULL (*Str)) {
130 if (*Str == Separator) {
131 break;
132 }
133
134 Str++;
135 }
136
137 if (*Str == Separator) {
138 //
139 // Find a sub-string, terminate it
140 //
141 *Str = L'\0';
142 Str++;
143 }
144
145 //
146 // Move to next sub-string
147 //
148 *List = Str;
149
150 return ReturnStr;
151}
152
161CHAR16 *
163 IN OUT CHAR16 **List
164 )
165{
166 //
167 // The separator is comma
168 //
169 return SplitStr (List, L',');
170}
171
181CHAR16 *
183 IN OUT CHAR16 **DevicePath,
184 OUT BOOLEAN *IsInstanceEnd
185 )
186{
187 CHAR16 *Str;
188 CHAR16 *ReturnStr;
189 UINTN ParenthesesStack;
190
191 Str = *DevicePath;
192 if (IS_NULL (*Str)) {
193 return NULL;
194 }
195
196 //
197 // Skip the leading '/', '(', ')' and ','
198 //
199 while (!IS_NULL (*Str)) {
200 if (!IS_SLASH (*Str) &&
201 !IS_COMMA (*Str) &&
202 !IS_LEFT_PARENTH (*Str) &&
203 !IS_RIGHT_PARENTH (*Str))
204 {
205 break;
206 }
207
208 Str++;
209 }
210
211 ReturnStr = Str;
212
213 //
214 // Scan for the separator of this device node, '/' or ','
215 //
216 ParenthesesStack = 0;
217 while (!IS_NULL (*Str)) {
218 if ((IS_COMMA (*Str) || IS_SLASH (*Str)) && (ParenthesesStack == 0)) {
219 break;
220 }
221
222 if (IS_LEFT_PARENTH (*Str)) {
223 ParenthesesStack++;
224 } else if (IS_RIGHT_PARENTH (*Str)) {
225 ParenthesesStack--;
226 }
227
228 Str++;
229 }
230
231 if (ParenthesesStack != 0) {
232 //
233 // The '(' doesn't pair with ')', invalid device path text
234 //
235 return NULL;
236 }
237
238 if (IS_COMMA (*Str)) {
239 *IsInstanceEnd = TRUE;
240 *Str = L'\0';
241 Str++;
242 } else {
243 *IsInstanceEnd = FALSE;
244 if (!IS_NULL (*Str)) {
245 *Str = L'\0';
246 Str++;
247 }
248 }
249
250 *DevicePath = Str;
251
252 return ReturnStr;
253}
254
264BOOLEAN
266 IN CHAR16 *Str
267 )
268{
269 //
270 // skip preceeding white space
271 //
272 while (*Str == L' ') {
273 Str++;
274 }
275
276 //
277 // skip preceeding zeros
278 //
279 while (*Str == L'0') {
280 Str++;
281 }
282
283 return (BOOLEAN)(*Str == L'x' || *Str == L'X');
284}
285
295UINTN
297 IN CHAR16 *Str
298 )
299{
300 if (IsHexStr (Str)) {
301 return StrHexToUintn (Str);
302 } else {
303 return StrDecimalToUintn (Str);
304 }
305}
306
315VOID
317 IN CHAR16 *Str,
318 OUT UINT64 *Data
319 )
320{
321 if (IsHexStr (Str)) {
322 *Data = StrHexToUint64 (Str);
323 } else {
324 *Data = StrDecimalToUint64 (Str);
325 }
326}
327
336VOID
338 IN CHAR16 *Str,
339 IN OUT CHAR8 **AsciiStr
340 )
341{
342 CHAR8 *Dest;
343
344 Dest = *AsciiStr;
345 while (!IS_NULL (*Str)) {
346 *(Dest++) = (CHAR8)*(Str++);
347 }
348
349 *Dest = 0;
350
351 //
352 // Return the string next to it
353 //
354 *AsciiStr = Dest + 1;
355}
356
367 IN UINT8 Type,
368 IN CHAR16 *TextDeviceNode
369 )
370{
372 CHAR16 *SubtypeStr;
373 CHAR16 *DataStr;
374 UINTN DataLength;
375
376 SubtypeStr = GetNextParamStr (&TextDeviceNode);
377 DataStr = GetNextParamStr (&TextDeviceNode);
378
379 if (DataStr == NULL) {
380 DataLength = 0;
381 } else {
382 DataLength = StrLen (DataStr) / 2;
383 }
384
385 Node = CreateDeviceNode (
386 Type,
387 (UINT8)Strtoi (SubtypeStr),
388 (UINT16)(sizeof (EFI_DEVICE_PATH_PROTOCOL) + DataLength)
389 );
390
391 if (Node != NULL) {
392 StrHexToBytes (DataStr, DataLength * 2, (UINT8 *)(Node + 1), DataLength);
393 }
394
395 return Node;
396}
397
408 IN CHAR16 *TextDeviceNode
409 )
410{
411 CHAR16 *TypeStr;
412
413 TypeStr = GetNextParamStr (&TextDeviceNode);
414
415 return DevPathFromTextGenericPath ((UINT8)Strtoi (TypeStr), TextDeviceNode);
416}
417
428 IN CHAR16 *TextDeviceNode
429 )
430{
431 return DevPathFromTextGenericPath (HARDWARE_DEVICE_PATH, TextDeviceNode);
432}
433
444 IN CHAR16 *TextDeviceNode
445 )
446{
447 CHAR16 *FunctionStr;
448 CHAR16 *DeviceStr;
449 PCI_DEVICE_PATH *Pci;
450
451 DeviceStr = GetNextParamStr (&TextDeviceNode);
452 FunctionStr = GetNextParamStr (&TextDeviceNode);
455 HW_PCI_DP,
456 (UINT16)sizeof (PCI_DEVICE_PATH)
457 );
458
459 if (Pci != NULL) {
460 Pci->Function = (UINT8)Strtoi (FunctionStr);
461 Pci->Device = (UINT8)Strtoi (DeviceStr);
462 }
463
464 return (EFI_DEVICE_PATH_PROTOCOL *)Pci;
465}
466
477 IN CHAR16 *TextDeviceNode
478 )
479{
480 CHAR16 *FunctionNumberStr;
481 PCCARD_DEVICE_PATH *Pccard;
482
483 FunctionNumberStr = GetNextParamStr (&TextDeviceNode);
487 (UINT16)sizeof (PCCARD_DEVICE_PATH)
488 );
489
490 if (Pccard != NULL) {
491 Pccard->FunctionNumber = (UINT8)Strtoi (FunctionNumberStr);
492 }
493
494 return (EFI_DEVICE_PATH_PROTOCOL *)Pccard;
495}
496
507 IN CHAR16 *TextDeviceNode
508 )
509{
510 CHAR16 *MemoryTypeStr;
511 CHAR16 *StartingAddressStr;
512 CHAR16 *EndingAddressStr;
513 MEMMAP_DEVICE_PATH *MemMap;
514
515 MemoryTypeStr = GetNextParamStr (&TextDeviceNode);
516 StartingAddressStr = GetNextParamStr (&TextDeviceNode);
517 EndingAddressStr = GetNextParamStr (&TextDeviceNode);
521 (UINT16)sizeof (MEMMAP_DEVICE_PATH)
522 );
523
524 if (MemMap != NULL) {
525 MemMap->MemoryType = (UINT32)Strtoi (MemoryTypeStr);
526 Strtoi64 (StartingAddressStr, &MemMap->StartingAddress);
527 Strtoi64 (EndingAddressStr, &MemMap->EndingAddress);
528 }
529
530 return (EFI_DEVICE_PATH_PROTOCOL *)MemMap;
531}
532
546 IN CHAR16 *TextDeviceNode,
547 IN UINT8 Type,
548 IN UINT8 SubType
549 )
550{
551 CHAR16 *GuidStr;
552 CHAR16 *DataStr;
553 UINTN Length;
554 VENDOR_DEVICE_PATH *Vendor;
555
556 GuidStr = GetNextParamStr (&TextDeviceNode);
557
558 DataStr = GetNextParamStr (&TextDeviceNode);
559 Length = StrLen (DataStr);
560 //
561 // Two hex characters make up 1 buffer byte
562 //
563 Length = (Length + 1) / 2;
564
566 Type,
567 SubType,
568 (UINT16)(sizeof (VENDOR_DEVICE_PATH) + Length)
569 );
570
571 if (Vendor != NULL) {
572 StrToGuid (GuidStr, &Vendor->Guid);
573 StrHexToBytes (DataStr, Length * 2, (UINT8 *)(Vendor + 1), Length);
574 }
575
576 return (EFI_DEVICE_PATH_PROTOCOL *)Vendor;
577}
578
589 IN CHAR16 *TextDeviceNode
590 )
591{
592 return ConvertFromTextVendor (
593 TextDeviceNode,
596 );
597}
598
609 IN CHAR16 *TextDeviceNode
610 )
611{
612 CHAR16 *ControllerStr;
613 CONTROLLER_DEVICE_PATH *Controller;
614
615 ControllerStr = GetNextParamStr (&TextDeviceNode);
619 (UINT16)sizeof (CONTROLLER_DEVICE_PATH)
620 );
621
622 if (Controller != NULL) {
623 Controller->ControllerNumber = (UINT32)Strtoi (ControllerStr);
624 }
625
626 return (EFI_DEVICE_PATH_PROTOCOL *)Controller;
627}
628
639 IN CHAR16 *TextDeviceNode
640 )
641{
642 CHAR16 *InterfaceTypeStr;
643 CHAR16 *BaseAddressStr;
644 BMC_DEVICE_PATH *BmcDp;
645
646 InterfaceTypeStr = GetNextParamStr (&TextDeviceNode);
647 BaseAddressStr = GetNextParamStr (&TextDeviceNode);
650 HW_BMC_DP,
651 (UINT16)sizeof (BMC_DEVICE_PATH)
652 );
653
654 if (BmcDp != NULL) {
655 BmcDp->InterfaceType = (UINT8)Strtoi (InterfaceTypeStr);
657 (UINT64 *)(&BmcDp->BaseAddress),
658 StrHexToUint64 (BaseAddressStr)
659 );
660 }
661
662 return (EFI_DEVICE_PATH_PROTOCOL *)BmcDp;
663}
664
675 IN CHAR16 *TextDeviceNode
676 )
677{
678 return DevPathFromTextGenericPath (ACPI_DEVICE_PATH, TextDeviceNode);
679}
680
688UINT32
690 IN CHAR16 *Text
691 )
692{
693 return (((Text[0] - 'A' + 1) & 0x1f) << 10)
694 + (((Text[1] - 'A' + 1) & 0x1f) << 5)
695 + (((Text[2] - 'A' + 1) & 0x1f) << 0)
696 + (UINT32)(StrHexToUintn (&Text[3]) << 16)
697 ;
698}
699
710 IN CHAR16 *TextDeviceNode
711 )
712{
713 CHAR16 *HIDStr;
714 CHAR16 *UIDStr;
716
717 HIDStr = GetNextParamStr (&TextDeviceNode);
718 UIDStr = GetNextParamStr (&TextDeviceNode);
721 ACPI_DP,
722 (UINT16)sizeof (ACPI_HID_DEVICE_PATH)
723 );
724
725 if (Acpi != NULL) {
726 Acpi->HID = EisaIdFromText (HIDStr);
727 Acpi->UID = (UINT32)Strtoi (UIDStr);
728 }
729
730 return (EFI_DEVICE_PATH_PROTOCOL *)Acpi;
731}
732
744 IN CHAR16 *TextDeviceNode,
745 IN UINT32 PnPId
746 )
747{
748 CHAR16 *UIDStr;
750
751 UIDStr = GetNextParamStr (&TextDeviceNode);
754 ACPI_DP,
755 (UINT16)sizeof (ACPI_HID_DEVICE_PATH)
756 );
757
758 if (Acpi != NULL) {
759 Acpi->HID = EFI_PNP_ID (PnPId);
760 Acpi->UID = (UINT32)Strtoi (UIDStr);
761 }
762
763 return (EFI_DEVICE_PATH_PROTOCOL *)Acpi;
764}
765
776 IN CHAR16 *TextDeviceNode
777 )
778{
779 return ConvertFromTextAcpi (TextDeviceNode, 0x0a03);
780}
781
792 IN CHAR16 *TextDeviceNode
793 )
794{
795 return ConvertFromTextAcpi (TextDeviceNode, 0x0a08);
796}
797
808 IN CHAR16 *TextDeviceNode
809 )
810{
811 return ConvertFromTextAcpi (TextDeviceNode, 0x0604);
812}
813
824 IN CHAR16 *TextDeviceNode
825 )
826{
827 return ConvertFromTextAcpi (TextDeviceNode, 0x0301);
828}
829
840 IN CHAR16 *TextDeviceNode
841 )
842{
843 return ConvertFromTextAcpi (TextDeviceNode, 0x0501);
844}
845
856 IN CHAR16 *TextDeviceNode
857 )
858{
859 return ConvertFromTextAcpi (TextDeviceNode, 0x0401);
860}
861
872 IN CHAR16 *TextDeviceNode
873 )
874{
875 CHAR16 *HIDStr;
876 CHAR16 *CIDStr;
877 CHAR16 *UIDStr;
878 CHAR16 *HIDSTRStr;
879 CHAR16 *CIDSTRStr;
880 CHAR16 *UIDSTRStr;
881 CHAR8 *AsciiStr;
882 UINT16 Length;
884
885 HIDStr = GetNextParamStr (&TextDeviceNode);
886 CIDStr = GetNextParamStr (&TextDeviceNode);
887 UIDStr = GetNextParamStr (&TextDeviceNode);
888 HIDSTRStr = GetNextParamStr (&TextDeviceNode);
889 CIDSTRStr = GetNextParamStr (&TextDeviceNode);
890 UIDSTRStr = GetNextParamStr (&TextDeviceNode);
891
892 Length = (UINT16)(sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) + StrLen (HIDSTRStr) + 1);
893 Length = (UINT16)(Length + StrLen (UIDSTRStr) + 1);
894 Length = (UINT16)(Length + StrLen (CIDSTRStr) + 1);
898 Length
899 );
900
901 if (AcpiEx != NULL) {
902 AcpiEx->HID = EisaIdFromText (HIDStr);
903 AcpiEx->CID = EisaIdFromText (CIDStr);
904 AcpiEx->UID = (UINT32)Strtoi (UIDStr);
905
906 AsciiStr = (CHAR8 *)((UINT8 *)AcpiEx + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH));
907 StrToAscii (HIDSTRStr, &AsciiStr);
908 StrToAscii (UIDSTRStr, &AsciiStr);
909 StrToAscii (CIDSTRStr, &AsciiStr);
910 }
911
912 return (EFI_DEVICE_PATH_PROTOCOL *)AcpiEx;
913}
914
925 IN CHAR16 *TextDeviceNode
926 )
927{
928 CHAR16 *HIDStr;
929 CHAR16 *CIDStr;
930 CHAR16 *UIDSTRStr;
931 CHAR8 *AsciiStr;
932 UINT16 Length;
934
935 HIDStr = GetNextParamStr (&TextDeviceNode);
936 CIDStr = GetNextParamStr (&TextDeviceNode);
937 UIDSTRStr = GetNextParamStr (&TextDeviceNode);
938 Length = (UINT16)(sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) + StrLen (UIDSTRStr) + 3);
942 Length
943 );
944
945 if (AcpiEx == NULL) {
946 return (EFI_DEVICE_PATH_PROTOCOL *)AcpiEx;
947 }
948
949 AcpiEx->HID = EisaIdFromText (HIDStr);
950 //
951 // According to UEFI spec, the CID parameter is optional and has a default value of 0.
952 // So when the CID parameter is not specified or specified as 0 in the text device node.
953 // Set the CID to 0 in the ACPI extension device path structure.
954 //
955 if ((*CIDStr == L'\0') || (*CIDStr == L'0')) {
956 AcpiEx->CID = 0;
957 } else {
958 AcpiEx->CID = EisaIdFromText (CIDStr);
959 }
960
961 AcpiEx->UID = 0;
962
963 AsciiStr = (CHAR8 *)((UINT8 *)AcpiEx + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH));
964 //
965 // HID string is NULL
966 //
967 *AsciiStr = '\0';
968 //
969 // Convert UID string
970 //
971 AsciiStr++;
972 StrToAscii (UIDSTRStr, &AsciiStr);
973 //
974 // CID string is NULL
975 //
976 *AsciiStr = '\0';
977
978 return (EFI_DEVICE_PATH_PROTOCOL *)AcpiEx;
979}
980
991 IN CHAR16 *TextDeviceNode
992 )
993{
994 CHAR16 *DisplayDeviceStr;
995 ACPI_ADR_DEVICE_PATH *AcpiAdr;
996 UINTN Index;
997 UINTN Length;
998
1002 (UINT16)sizeof (ACPI_ADR_DEVICE_PATH)
1003 );
1004 if (AcpiAdr == NULL) {
1005 ASSERT (AcpiAdr != NULL);
1006 return (EFI_DEVICE_PATH_PROTOCOL *)AcpiAdr;
1007 }
1008
1009 for (Index = 0; ; Index++) {
1010 DisplayDeviceStr = GetNextParamStr (&TextDeviceNode);
1011 if (IS_NULL (*DisplayDeviceStr)) {
1012 break;
1013 }
1014
1015 if (Index > 0) {
1016 Length = DevicePathNodeLength (AcpiAdr);
1017 AcpiAdr = ReallocatePool (
1018 Length,
1019 Length + sizeof (UINT32),
1020 AcpiAdr
1021 );
1022
1023 if (AcpiAdr == NULL) {
1024 ASSERT (AcpiAdr != NULL);
1025 return (EFI_DEVICE_PATH_PROTOCOL *)AcpiAdr;
1026 }
1027
1028 SetDevicePathNodeLength (AcpiAdr, Length + sizeof (UINT32));
1029 }
1030
1031 (&AcpiAdr->ADR)[Index] = (UINT32)Strtoi (DisplayDeviceStr);
1032 }
1033
1034 return (EFI_DEVICE_PATH_PROTOCOL *)AcpiAdr;
1035}
1036
1047 IN CHAR16 *TextDeviceNode
1048 )
1049{
1050 return DevPathFromTextGenericPath (MESSAGING_DEVICE_PATH, TextDeviceNode);
1051}
1052
1063 IN CHAR16 *TextDeviceNode
1064 )
1065{
1066 CHAR16 *PrimarySecondaryStr;
1067 CHAR16 *SlaveMasterStr;
1068 CHAR16 *LunStr;
1069 ATAPI_DEVICE_PATH *Atapi;
1070
1074 (UINT16)sizeof (ATAPI_DEVICE_PATH)
1075 );
1076
1077 if (Atapi == NULL) {
1078 return (EFI_DEVICE_PATH_PROTOCOL *)Atapi;
1079 }
1080
1081 PrimarySecondaryStr = GetNextParamStr (&TextDeviceNode);
1082 SlaveMasterStr = GetNextParamStr (&TextDeviceNode);
1083 LunStr = GetNextParamStr (&TextDeviceNode);
1084
1085 if (StrCmp (PrimarySecondaryStr, L"Primary") == 0) {
1086 Atapi->PrimarySecondary = 0;
1087 } else if (StrCmp (PrimarySecondaryStr, L"Secondary") == 0) {
1088 Atapi->PrimarySecondary = 1;
1089 } else {
1090 Atapi->PrimarySecondary = (UINT8)Strtoi (PrimarySecondaryStr);
1091 }
1092
1093 if (StrCmp (SlaveMasterStr, L"Master") == 0) {
1094 Atapi->SlaveMaster = 0;
1095 } else if (StrCmp (SlaveMasterStr, L"Slave") == 0) {
1096 Atapi->SlaveMaster = 1;
1097 } else {
1098 Atapi->SlaveMaster = (UINT8)Strtoi (SlaveMasterStr);
1099 }
1100
1101 Atapi->Lun = (UINT16)Strtoi (LunStr);
1102
1103 return (EFI_DEVICE_PATH_PROTOCOL *)Atapi;
1104}
1105
1116 IN CHAR16 *TextDeviceNode
1117 )
1118{
1119 CHAR16 *PunStr;
1120 CHAR16 *LunStr;
1121 SCSI_DEVICE_PATH *Scsi;
1122
1123 PunStr = GetNextParamStr (&TextDeviceNode);
1124 LunStr = GetNextParamStr (&TextDeviceNode);
1128 (UINT16)sizeof (SCSI_DEVICE_PATH)
1129 );
1130
1131 if (Scsi != NULL) {
1132 Scsi->Pun = (UINT16)Strtoi (PunStr);
1133 Scsi->Lun = (UINT16)Strtoi (LunStr);
1134 }
1135
1136 return (EFI_DEVICE_PATH_PROTOCOL *)Scsi;
1137}
1138
1149 IN CHAR16 *TextDeviceNode
1150 )
1151{
1152 CHAR16 *WWNStr;
1153 CHAR16 *LunStr;
1155
1156 WWNStr = GetNextParamStr (&TextDeviceNode);
1157 LunStr = GetNextParamStr (&TextDeviceNode);
1161 (UINT16)sizeof (FIBRECHANNEL_DEVICE_PATH)
1162 );
1163
1164 if (Fibre != NULL) {
1165 Fibre->Reserved = 0;
1166 Strtoi64 (WWNStr, &Fibre->WWN);
1167 Strtoi64 (LunStr, &Fibre->Lun);
1168 }
1169
1170 return (EFI_DEVICE_PATH_PROTOCOL *)Fibre;
1171}
1172
1183 IN CHAR16 *TextDeviceNode
1184 )
1185{
1186 CHAR16 *WWNStr;
1187 CHAR16 *LunStr;
1189
1190 WWNStr = GetNextParamStr (&TextDeviceNode);
1191 LunStr = GetNextParamStr (&TextDeviceNode);
1195 (UINT16)sizeof (FIBRECHANNELEX_DEVICE_PATH)
1196 );
1197
1198 if (FibreEx != NULL) {
1199 FibreEx->Reserved = 0;
1200 Strtoi64 (WWNStr, (UINT64 *)(&FibreEx->WWN));
1201 Strtoi64 (LunStr, (UINT64 *)(&FibreEx->Lun));
1202
1203 *(UINT64 *)(&FibreEx->WWN) = SwapBytes64 (*(UINT64 *)(&FibreEx->WWN));
1204 *(UINT64 *)(&FibreEx->Lun) = SwapBytes64 (*(UINT64 *)(&FibreEx->Lun));
1205 }
1206
1207 return (EFI_DEVICE_PATH_PROTOCOL *)FibreEx;
1208}
1209
1220 IN CHAR16 *TextDeviceNode
1221 )
1222{
1223 CHAR16 *GuidStr;
1224 F1394_DEVICE_PATH *F1394DevPath;
1225
1226 GuidStr = GetNextParamStr (&TextDeviceNode);
1227 F1394DevPath = (F1394_DEVICE_PATH *)CreateDeviceNode (
1230 (UINT16)sizeof (F1394_DEVICE_PATH)
1231 );
1232
1233 if (F1394DevPath != NULL) {
1234 F1394DevPath->Reserved = 0;
1235 F1394DevPath->Guid = StrHexToUint64 (GuidStr);
1236 }
1237
1238 return (EFI_DEVICE_PATH_PROTOCOL *)F1394DevPath;
1239}
1240
1251 IN CHAR16 *TextDeviceNode
1252 )
1253{
1254 CHAR16 *PortStr;
1255 CHAR16 *InterfaceStr;
1256 USB_DEVICE_PATH *Usb;
1257
1258 PortStr = GetNextParamStr (&TextDeviceNode);
1259 InterfaceStr = GetNextParamStr (&TextDeviceNode);
1262 MSG_USB_DP,
1263 (UINT16)sizeof (USB_DEVICE_PATH)
1264 );
1265
1266 if (Usb != NULL) {
1267 Usb->ParentPortNumber = (UINT8)Strtoi (PortStr);
1268 Usb->InterfaceNumber = (UINT8)Strtoi (InterfaceStr);
1269 }
1270
1271 return (EFI_DEVICE_PATH_PROTOCOL *)Usb;
1272}
1273
1284 IN CHAR16 *TextDeviceNode
1285 )
1286{
1287 CHAR16 *TIDStr;
1288 I2O_DEVICE_PATH *I2ODevPath;
1289
1290 TIDStr = GetNextParamStr (&TextDeviceNode);
1291 I2ODevPath = (I2O_DEVICE_PATH *)CreateDeviceNode (
1293 MSG_I2O_DP,
1294 (UINT16)sizeof (I2O_DEVICE_PATH)
1295 );
1296
1297 if (I2ODevPath != NULL) {
1298 I2ODevPath->Tid = (UINT32)Strtoi (TIDStr);
1299 }
1300
1301 return (EFI_DEVICE_PATH_PROTOCOL *)I2ODevPath;
1302}
1303
1314 IN CHAR16 *TextDeviceNode
1315 )
1316{
1317 CHAR16 *FlagsStr;
1318 CHAR16 *GuidStr;
1319 CHAR16 *SidStr;
1320 CHAR16 *TidStr;
1321 CHAR16 *DidStr;
1322 INFINIBAND_DEVICE_PATH *InfiniBand;
1323
1324 FlagsStr = GetNextParamStr (&TextDeviceNode);
1325 GuidStr = GetNextParamStr (&TextDeviceNode);
1326 SidStr = GetNextParamStr (&TextDeviceNode);
1327 TidStr = GetNextParamStr (&TextDeviceNode);
1328 DidStr = GetNextParamStr (&TextDeviceNode);
1332 (UINT16)sizeof (INFINIBAND_DEVICE_PATH)
1333 );
1334
1335 if (InfiniBand != NULL) {
1336 InfiniBand->ResourceFlags = (UINT32)Strtoi (FlagsStr);
1337 StrToGuid (GuidStr, (EFI_GUID *)InfiniBand->PortGid);
1338 Strtoi64 (SidStr, &InfiniBand->ServiceId);
1339 Strtoi64 (TidStr, &InfiniBand->TargetPortId);
1340 Strtoi64 (DidStr, &InfiniBand->DeviceId);
1341 }
1342
1343 return (EFI_DEVICE_PATH_PROTOCOL *)InfiniBand;
1344}
1345
1356 IN CHAR16 *TextDeviceNode
1357 )
1358{
1359 return ConvertFromTextVendor (
1360 TextDeviceNode,
1362 MSG_VENDOR_DP
1363 );
1364}
1365
1376 IN CHAR16 *TextDeviceNode
1377 )
1378{
1379 VENDOR_DEVICE_PATH *Vendor;
1380
1383 MSG_VENDOR_DP,
1384 (UINT16)sizeof (VENDOR_DEVICE_PATH)
1385 );
1386
1387 if (Vendor != NULL) {
1388 CopyGuid (&Vendor->Guid, &gEfiPcAnsiGuid);
1389 }
1390
1391 return (EFI_DEVICE_PATH_PROTOCOL *)Vendor;
1392}
1393
1404 IN CHAR16 *TextDeviceNode
1405 )
1406{
1407 VENDOR_DEVICE_PATH *Vendor;
1408
1411 MSG_VENDOR_DP,
1412 (UINT16)sizeof (VENDOR_DEVICE_PATH)
1413 );
1414
1415 if (Vendor != NULL) {
1416 CopyGuid (&Vendor->Guid, &gEfiVT100Guid);
1417 }
1418
1419 return (EFI_DEVICE_PATH_PROTOCOL *)Vendor;
1420}
1421
1432 IN CHAR16 *TextDeviceNode
1433 )
1434{
1435 VENDOR_DEVICE_PATH *Vendor;
1436
1439 MSG_VENDOR_DP,
1440 (UINT16)sizeof (VENDOR_DEVICE_PATH)
1441 );
1442
1443 if (Vendor != NULL) {
1444 CopyGuid (&Vendor->Guid, &gEfiVT100PlusGuid);
1445 }
1446
1447 return (EFI_DEVICE_PATH_PROTOCOL *)Vendor;
1448}
1449
1460 IN CHAR16 *TextDeviceNode
1461 )
1462{
1463 VENDOR_DEVICE_PATH *Vendor;
1464
1467 MSG_VENDOR_DP,
1468 (UINT16)sizeof (VENDOR_DEVICE_PATH)
1469 );
1470
1471 if (Vendor != NULL) {
1472 CopyGuid (&Vendor->Guid, &gEfiVTUTF8Guid);
1473 }
1474
1475 return (EFI_DEVICE_PATH_PROTOCOL *)Vendor;
1476}
1477
1488 IN CHAR16 *TextDeviceNode
1489 )
1490{
1491 CHAR16 *ValueStr;
1492 UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;
1493
1494 ValueStr = GetNextParamStr (&TextDeviceNode);
1495 UartFlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *)CreateDeviceNode (
1497 MSG_VENDOR_DP,
1498 (UINT16)sizeof (UART_FLOW_CONTROL_DEVICE_PATH)
1499 );
1500
1501 if (UartFlowControl != NULL) {
1502 CopyGuid (&UartFlowControl->Guid, &gEfiUartDevicePathGuid);
1503 if (StrCmp (ValueStr, L"XonXoff") == 0) {
1504 UartFlowControl->FlowControlMap = 2;
1505 } else if (StrCmp (ValueStr, L"Hardware") == 0) {
1506 UartFlowControl->FlowControlMap = 1;
1507 } else {
1508 UartFlowControl->FlowControlMap = 0;
1509 }
1510 }
1511
1512 return (EFI_DEVICE_PATH_PROTOCOL *)UartFlowControl;
1513}
1514
1525 IN CHAR16 *TextDeviceNode
1526 )
1527{
1528 CHAR16 *AddressStr;
1529 CHAR16 *LunStr;
1530 CHAR16 *RTPStr;
1531 CHAR16 *SASSATAStr;
1532 CHAR16 *LocationStr;
1533 CHAR16 *ConnectStr;
1534 CHAR16 *DriveBayStr;
1535 CHAR16 *ReservedStr;
1536 UINT16 Info;
1537 UINT16 Uint16;
1538 SAS_DEVICE_PATH *Sas;
1539
1540 AddressStr = GetNextParamStr (&TextDeviceNode);
1541 LunStr = GetNextParamStr (&TextDeviceNode);
1542 RTPStr = GetNextParamStr (&TextDeviceNode);
1543 SASSATAStr = GetNextParamStr (&TextDeviceNode);
1544 LocationStr = GetNextParamStr (&TextDeviceNode);
1545 ConnectStr = GetNextParamStr (&TextDeviceNode);
1546 DriveBayStr = GetNextParamStr (&TextDeviceNode);
1547 ReservedStr = GetNextParamStr (&TextDeviceNode);
1550 MSG_VENDOR_DP,
1551 (UINT16)sizeof (SAS_DEVICE_PATH)
1552 );
1553
1554 if (Sas == NULL) {
1555 return (EFI_DEVICE_PATH_PROTOCOL *)Sas;
1556 }
1557
1558 CopyGuid (&Sas->Guid, &gEfiSasDevicePathGuid);
1559 Strtoi64 (AddressStr, &Sas->SasAddress);
1560 Strtoi64 (LunStr, &Sas->Lun);
1561 Sas->RelativeTargetPort = (UINT16)Strtoi (RTPStr);
1562
1563 if (StrCmp (SASSATAStr, L"NoTopology") == 0) {
1564 Info = 0x0;
1565 } else if ((StrCmp (SASSATAStr, L"SATA") == 0) || (StrCmp (SASSATAStr, L"SAS") == 0)) {
1566 Uint16 = (UINT16)Strtoi (DriveBayStr);
1567 if (Uint16 == 0) {
1568 Info = 0x1;
1569 } else {
1570 Info = (UINT16)(0x2 | ((Uint16 - 1) << 8));
1571 }
1572
1573 if (StrCmp (SASSATAStr, L"SATA") == 0) {
1574 Info |= BIT4;
1575 }
1576
1577 //
1578 // Location is an integer between 0 and 1 or else
1579 // the keyword Internal (0) or External (1).
1580 //
1581 if (StrCmp (LocationStr, L"External") == 0) {
1582 Uint16 = 1;
1583 } else if (StrCmp (LocationStr, L"Internal") == 0) {
1584 Uint16 = 0;
1585 } else {
1586 Uint16 = ((UINT16)Strtoi (LocationStr) & BIT0);
1587 }
1588
1589 Info |= (Uint16 << 5);
1590
1591 //
1592 // Connect is an integer between 0 and 3 or else
1593 // the keyword Direct (0) or Expanded (1).
1594 //
1595 if (StrCmp (ConnectStr, L"Expanded") == 0) {
1596 Uint16 = 1;
1597 } else if (StrCmp (ConnectStr, L"Direct") == 0) {
1598 Uint16 = 0;
1599 } else {
1600 Uint16 = ((UINT16)Strtoi (ConnectStr) & (BIT0 | BIT1));
1601 }
1602
1603 Info |= (Uint16 << 6);
1604 } else {
1605 Info = (UINT16)Strtoi (SASSATAStr);
1606 }
1607
1608 Sas->DeviceTopology = Info;
1609 Sas->Reserved = (UINT32)Strtoi (ReservedStr);
1610
1611 return (EFI_DEVICE_PATH_PROTOCOL *)Sas;
1612}
1613
1624 IN CHAR16 *TextDeviceNode
1625 )
1626{
1627 CHAR16 *AddressStr;
1628 CHAR16 *LunStr;
1629 CHAR16 *RTPStr;
1630 CHAR16 *SASSATAStr;
1631 CHAR16 *LocationStr;
1632 CHAR16 *ConnectStr;
1633 CHAR16 *DriveBayStr;
1634 UINT16 Info;
1635 UINT16 Uint16;
1636 UINT64 SasAddress;
1637 UINT64 Lun;
1638 SASEX_DEVICE_PATH *SasEx;
1639
1640 AddressStr = GetNextParamStr (&TextDeviceNode);
1641 LunStr = GetNextParamStr (&TextDeviceNode);
1642 RTPStr = GetNextParamStr (&TextDeviceNode);
1643 SASSATAStr = GetNextParamStr (&TextDeviceNode);
1644 LocationStr = GetNextParamStr (&TextDeviceNode);
1645 ConnectStr = GetNextParamStr (&TextDeviceNode);
1646 DriveBayStr = GetNextParamStr (&TextDeviceNode);
1650 (UINT16)sizeof (SASEX_DEVICE_PATH)
1651 );
1652
1653 if (SasEx == NULL) {
1654 return (EFI_DEVICE_PATH_PROTOCOL *)SasEx;
1655 }
1656
1657 Strtoi64 (AddressStr, &SasAddress);
1658 Strtoi64 (LunStr, &Lun);
1659 WriteUnaligned64 ((UINT64 *)&SasEx->SasAddress, SwapBytes64 (SasAddress));
1660 WriteUnaligned64 ((UINT64 *)&SasEx->Lun, SwapBytes64 (Lun));
1661 SasEx->RelativeTargetPort = (UINT16)Strtoi (RTPStr);
1662
1663 if (StrCmp (SASSATAStr, L"NoTopology") == 0) {
1664 Info = 0x0;
1665 } else if ((StrCmp (SASSATAStr, L"SATA") == 0) || (StrCmp (SASSATAStr, L"SAS") == 0)) {
1666 Uint16 = (UINT16)Strtoi (DriveBayStr);
1667 if (Uint16 == 0) {
1668 Info = 0x1;
1669 } else {
1670 Info = (UINT16)(0x2 | ((Uint16 - 1) << 8));
1671 }
1672
1673 if (StrCmp (SASSATAStr, L"SATA") == 0) {
1674 Info |= BIT4;
1675 }
1676
1677 //
1678 // Location is an integer between 0 and 1 or else
1679 // the keyword Internal (0) or External (1).
1680 //
1681 if (StrCmp (LocationStr, L"External") == 0) {
1682 Uint16 = 1;
1683 } else if (StrCmp (LocationStr, L"Internal") == 0) {
1684 Uint16 = 0;
1685 } else {
1686 Uint16 = ((UINT16)Strtoi (LocationStr) & BIT0);
1687 }
1688
1689 Info |= (Uint16 << 5);
1690
1691 //
1692 // Connect is an integer between 0 and 3 or else
1693 // the keyword Direct (0) or Expanded (1).
1694 //
1695 if (StrCmp (ConnectStr, L"Expanded") == 0) {
1696 Uint16 = 1;
1697 } else if (StrCmp (ConnectStr, L"Direct") == 0) {
1698 Uint16 = 0;
1699 } else {
1700 Uint16 = ((UINT16)Strtoi (ConnectStr) & (BIT0 | BIT1));
1701 }
1702
1703 Info |= (Uint16 << 6);
1704 } else {
1705 Info = (UINT16)Strtoi (SASSATAStr);
1706 }
1707
1708 SasEx->DeviceTopology = Info;
1709
1710 return (EFI_DEVICE_PATH_PROTOCOL *)SasEx;
1711}
1712
1723 IN CHAR16 *TextDeviceNode
1724 )
1725{
1726 CHAR16 *NamespaceIdStr;
1727 CHAR16 *NamespaceUuidStr;
1729 UINT8 *Uuid;
1730 UINTN Index;
1731
1732 NamespaceIdStr = GetNextParamStr (&TextDeviceNode);
1733 NamespaceUuidStr = GetNextParamStr (&TextDeviceNode);
1737 (UINT16)sizeof (NVME_NAMESPACE_DEVICE_PATH)
1738 );
1739
1740 if (Nvme != NULL) {
1741 Nvme->NamespaceId = (UINT32)Strtoi (NamespaceIdStr);
1742 Uuid = (UINT8 *)&Nvme->NamespaceUuid;
1743
1744 Index = sizeof (Nvme->NamespaceUuid) / sizeof (UINT8);
1745 while (Index-- != 0) {
1746 Uuid[Index] = (UINT8)StrHexToUintn (SplitStr (&NamespaceUuidStr, L'-'));
1747 }
1748 }
1749
1750 return (EFI_DEVICE_PATH_PROTOCOL *)Nvme;
1751}
1752
1763 IN CHAR16 *TextDeviceNode
1764 )
1765{
1766 CHAR16 *PunStr;
1767 CHAR16 *LunStr;
1768 UFS_DEVICE_PATH *Ufs;
1769
1770 PunStr = GetNextParamStr (&TextDeviceNode);
1771 LunStr = GetNextParamStr (&TextDeviceNode);
1774 MSG_UFS_DP,
1775 (UINT16)sizeof (UFS_DEVICE_PATH)
1776 );
1777
1778 if (Ufs != NULL) {
1779 Ufs->Pun = (UINT8)Strtoi (PunStr);
1780 Ufs->Lun = (UINT8)Strtoi (LunStr);
1781 }
1782
1783 return (EFI_DEVICE_PATH_PROTOCOL *)Ufs;
1784}
1785
1796 IN CHAR16 *TextDeviceNode
1797 )
1798{
1799 CHAR16 *SlotNumberStr;
1800 SD_DEVICE_PATH *Sd;
1801
1802 SlotNumberStr = GetNextParamStr (&TextDeviceNode);
1805 MSG_SD_DP,
1806 (UINT16)sizeof (SD_DEVICE_PATH)
1807 );
1808
1809 if (Sd != NULL) {
1810 Sd->SlotNumber = (UINT8)Strtoi (SlotNumberStr);
1811 }
1812
1813 return (EFI_DEVICE_PATH_PROTOCOL *)Sd;
1814}
1815
1826 IN CHAR16 *TextDeviceNode
1827 )
1828{
1829 CHAR16 *SlotNumberStr;
1830 EMMC_DEVICE_PATH *Emmc;
1831
1832 SlotNumberStr = GetNextParamStr (&TextDeviceNode);
1836 (UINT16)sizeof (EMMC_DEVICE_PATH)
1837 );
1838
1839 if (Emmc != NULL) {
1840 Emmc->SlotNumber = (UINT8)Strtoi (SlotNumberStr);
1841 }
1842
1843 return (EFI_DEVICE_PATH_PROTOCOL *)Emmc;
1844}
1845
1856 IN CHAR16 *TextDeviceNode
1857 )
1858{
1859 VENDOR_DEVICE_PATH *Vend;
1860
1863 MSG_VENDOR_DP,
1864 (UINT16)sizeof (VENDOR_DEVICE_PATH)
1865 );
1866
1867 if (Vend != NULL) {
1868 CopyGuid (&Vend->Guid, &gEfiDebugPortProtocolGuid);
1869 }
1870
1871 return (EFI_DEVICE_PATH_PROTOCOL *)Vend;
1872}
1873
1884 IN CHAR16 *TextDeviceNode
1885 )
1886{
1887 CHAR16 *AddressStr;
1888 CHAR16 *IfTypeStr;
1889 UINTN Length;
1890 MAC_ADDR_DEVICE_PATH *MACDevPath;
1891
1892 AddressStr = GetNextParamStr (&TextDeviceNode);
1893 IfTypeStr = GetNextParamStr (&TextDeviceNode);
1894 MACDevPath = (MAC_ADDR_DEVICE_PATH *)CreateDeviceNode (
1897 (UINT16)sizeof (MAC_ADDR_DEVICE_PATH)
1898 );
1899
1900 if (MACDevPath != NULL) {
1901 MACDevPath->IfType = (UINT8)Strtoi (IfTypeStr);
1902
1903 Length = sizeof (EFI_MAC_ADDRESS);
1904 if ((MACDevPath->IfType == 0x01) || (MACDevPath->IfType == 0x00)) {
1905 Length = 6;
1906 }
1907
1908 StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Length);
1909 }
1910
1911 return (EFI_DEVICE_PATH_PROTOCOL *)MACDevPath;
1912}
1913
1922UINTN
1924 IN CHAR16 *Text
1925 )
1926{
1927 if (StrCmp (Text, L"UDP") == 0) {
1928 return RFC_1700_UDP_PROTOCOL;
1929 }
1930
1931 if (StrCmp (Text, L"TCP") == 0) {
1932 return RFC_1700_TCP_PROTOCOL;
1933 }
1934
1935 return Strtoi (Text);
1936}
1937
1948 IN CHAR16 *TextDeviceNode
1949 )
1950{
1951 CHAR16 *RemoteIPStr;
1952 CHAR16 *ProtocolStr;
1953 CHAR16 *TypeStr;
1954 CHAR16 *LocalIPStr;
1955 CHAR16 *GatewayIPStr;
1956 CHAR16 *SubnetMaskStr;
1957 IPv4_DEVICE_PATH *IPv4;
1958
1959 RemoteIPStr = GetNextParamStr (&TextDeviceNode);
1960 ProtocolStr = GetNextParamStr (&TextDeviceNode);
1961 TypeStr = GetNextParamStr (&TextDeviceNode);
1962 LocalIPStr = GetNextParamStr (&TextDeviceNode);
1963 GatewayIPStr = GetNextParamStr (&TextDeviceNode);
1964 SubnetMaskStr = GetNextParamStr (&TextDeviceNode);
1968 (UINT16)sizeof (IPv4_DEVICE_PATH)
1969 );
1970
1971 if (IPv4 == NULL) {
1972 return (EFI_DEVICE_PATH_PROTOCOL *)IPv4;
1973 }
1974
1975 StrToIpv4Address (RemoteIPStr, NULL, &IPv4->RemoteIpAddress, NULL);
1976 IPv4->Protocol = (UINT16)NetworkProtocolFromText (ProtocolStr);
1977 if (StrCmp (TypeStr, L"Static") == 0) {
1978 IPv4->StaticIpAddress = TRUE;
1979 } else {
1980 IPv4->StaticIpAddress = FALSE;
1981 }
1982
1983 StrToIpv4Address (LocalIPStr, NULL, &IPv4->LocalIpAddress, NULL);
1984 if (!IS_NULL (*GatewayIPStr) && !IS_NULL (*SubnetMaskStr)) {
1985 StrToIpv4Address (GatewayIPStr, NULL, &IPv4->GatewayIpAddress, NULL);
1986 StrToIpv4Address (SubnetMaskStr, NULL, &IPv4->SubnetMask, NULL);
1987 } else {
1988 ZeroMem (&IPv4->GatewayIpAddress, sizeof (IPv4->GatewayIpAddress));
1989 ZeroMem (&IPv4->SubnetMask, sizeof (IPv4->SubnetMask));
1990 }
1991
1992 IPv4->LocalPort = 0;
1993 IPv4->RemotePort = 0;
1994
1995 return (EFI_DEVICE_PATH_PROTOCOL *)IPv4;
1996}
1997
2008 IN CHAR16 *TextDeviceNode
2009 )
2010{
2011 CHAR16 *RemoteIPStr;
2012 CHAR16 *ProtocolStr;
2013 CHAR16 *TypeStr;
2014 CHAR16 *LocalIPStr;
2015 CHAR16 *GatewayIPStr;
2016 CHAR16 *PrefixLengthStr;
2017 IPv6_DEVICE_PATH *IPv6;
2018
2019 RemoteIPStr = GetNextParamStr (&TextDeviceNode);
2020 ProtocolStr = GetNextParamStr (&TextDeviceNode);
2021 TypeStr = GetNextParamStr (&TextDeviceNode);
2022 LocalIPStr = GetNextParamStr (&TextDeviceNode);
2023 PrefixLengthStr = GetNextParamStr (&TextDeviceNode);
2024 GatewayIPStr = GetNextParamStr (&TextDeviceNode);
2028 (UINT16)sizeof (IPv6_DEVICE_PATH)
2029 );
2030
2031 if (IPv6 == NULL) {
2032 return (EFI_DEVICE_PATH_PROTOCOL *)IPv6;
2033 }
2034
2035 StrToIpv6Address (RemoteIPStr, NULL, &IPv6->RemoteIpAddress, NULL);
2036 IPv6->Protocol = (UINT16)NetworkProtocolFromText (ProtocolStr);
2037 if (StrCmp (TypeStr, L"Static") == 0) {
2038 IPv6->IpAddressOrigin = 0;
2039 } else if (StrCmp (TypeStr, L"StatelessAutoConfigure") == 0) {
2040 IPv6->IpAddressOrigin = 1;
2041 } else {
2042 IPv6->IpAddressOrigin = 2;
2043 }
2044
2045 StrToIpv6Address (LocalIPStr, NULL, &IPv6->LocalIpAddress, NULL);
2046 if (!IS_NULL (*GatewayIPStr) && !IS_NULL (*PrefixLengthStr)) {
2047 StrToIpv6Address (GatewayIPStr, NULL, &IPv6->GatewayIpAddress, NULL);
2048 IPv6->PrefixLength = (UINT8)Strtoi (PrefixLengthStr);
2049 } else {
2050 ZeroMem (&IPv6->GatewayIpAddress, sizeof (IPv6->GatewayIpAddress));
2051 IPv6->PrefixLength = 0;
2052 }
2053
2054 IPv6->LocalPort = 0;
2055 IPv6->RemotePort = 0;
2056
2057 return (EFI_DEVICE_PATH_PROTOCOL *)IPv6;
2058}
2059
2070 IN CHAR16 *TextDeviceNode
2071 )
2072{
2073 CHAR16 *BaudStr;
2074 CHAR16 *DataBitsStr;
2075 CHAR16 *ParityStr;
2076 CHAR16 *StopBitsStr;
2077 UART_DEVICE_PATH *Uart;
2078
2079 BaudStr = GetNextParamStr (&TextDeviceNode);
2080 DataBitsStr = GetNextParamStr (&TextDeviceNode);
2081 ParityStr = GetNextParamStr (&TextDeviceNode);
2082 StopBitsStr = GetNextParamStr (&TextDeviceNode);
2086 (UINT16)sizeof (UART_DEVICE_PATH)
2087 );
2088
2089 if (Uart == NULL) {
2090 return (EFI_DEVICE_PATH_PROTOCOL *)Uart;
2091 }
2092
2093 if (StrCmp (BaudStr, L"DEFAULT") == 0) {
2094 Uart->BaudRate = 115200;
2095 } else {
2096 Strtoi64 (BaudStr, &Uart->BaudRate);
2097 }
2098
2099 Uart->DataBits = (UINT8)((StrCmp (DataBitsStr, L"DEFAULT") == 0) ? 8 : Strtoi (DataBitsStr));
2100 switch (*ParityStr) {
2101 case L'D':
2102 Uart->Parity = 0;
2103 break;
2104
2105 case L'N':
2106 Uart->Parity = 1;
2107 break;
2108
2109 case L'E':
2110 Uart->Parity = 2;
2111 break;
2112
2113 case L'O':
2114 Uart->Parity = 3;
2115 break;
2116
2117 case L'M':
2118 Uart->Parity = 4;
2119 break;
2120
2121 case L'S':
2122 Uart->Parity = 5;
2123 break;
2124
2125 default:
2126 Uart->Parity = (UINT8)Strtoi (ParityStr);
2127 break;
2128 }
2129
2130 if (StrCmp (StopBitsStr, L"D") == 0) {
2131 Uart->StopBits = (UINT8)0;
2132 } else if (StrCmp (StopBitsStr, L"1") == 0) {
2133 Uart->StopBits = (UINT8)1;
2134 } else if (StrCmp (StopBitsStr, L"1.5") == 0) {
2135 Uart->StopBits = (UINT8)2;
2136 } else if (StrCmp (StopBitsStr, L"2") == 0) {
2137 Uart->StopBits = (UINT8)3;
2138 } else {
2139 Uart->StopBits = (UINT8)Strtoi (StopBitsStr);
2140 }
2141
2142 return (EFI_DEVICE_PATH_PROTOCOL *)Uart;
2143}
2144
2156 IN CHAR16 *TextDeviceNode,
2157 IN USB_CLASS_TEXT *UsbClassText
2158 )
2159{
2160 CHAR16 *VIDStr;
2161 CHAR16 *PIDStr;
2162 CHAR16 *ClassStr;
2163 CHAR16 *SubClassStr;
2164 CHAR16 *ProtocolStr;
2165 USB_CLASS_DEVICE_PATH *UsbClass;
2166
2170 (UINT16)sizeof (USB_CLASS_DEVICE_PATH)
2171 );
2172
2173 if (UsbClass == NULL) {
2174 return (EFI_DEVICE_PATH_PROTOCOL *)UsbClass;
2175 }
2176
2177 VIDStr = GetNextParamStr (&TextDeviceNode);
2178 PIDStr = GetNextParamStr (&TextDeviceNode);
2179 if (UsbClassText->ClassExist) {
2180 ClassStr = GetNextParamStr (&TextDeviceNode);
2181 if (*ClassStr == L'\0') {
2182 UsbClass->DeviceClass = 0xFF;
2183 } else {
2184 UsbClass->DeviceClass = (UINT8)Strtoi (ClassStr);
2185 }
2186 } else {
2187 UsbClass->DeviceClass = UsbClassText->Class;
2188 }
2189
2190 if (UsbClassText->SubClassExist) {
2191 SubClassStr = GetNextParamStr (&TextDeviceNode);
2192 if (*SubClassStr == L'\0') {
2193 UsbClass->DeviceSubClass = 0xFF;
2194 } else {
2195 UsbClass->DeviceSubClass = (UINT8)Strtoi (SubClassStr);
2196 }
2197 } else {
2198 UsbClass->DeviceSubClass = UsbClassText->SubClass;
2199 }
2200
2201 ProtocolStr = GetNextParamStr (&TextDeviceNode);
2202
2203 if (*VIDStr == L'\0') {
2204 UsbClass->VendorId = 0xFFFF;
2205 } else {
2206 UsbClass->VendorId = (UINT16)Strtoi (VIDStr);
2207 }
2208
2209 if (*PIDStr == L'\0') {
2210 UsbClass->ProductId = 0xFFFF;
2211 } else {
2212 UsbClass->ProductId = (UINT16)Strtoi (PIDStr);
2213 }
2214
2215 if (*ProtocolStr == L'\0') {
2216 UsbClass->DeviceProtocol = 0xFF;
2217 } else {
2218 UsbClass->DeviceProtocol = (UINT8)Strtoi (ProtocolStr);
2219 }
2220
2221 return (EFI_DEVICE_PATH_PROTOCOL *)UsbClass;
2222}
2223
2234 IN CHAR16 *TextDeviceNode
2235 )
2236{
2237 USB_CLASS_TEXT UsbClassText;
2238
2239 UsbClassText.ClassExist = TRUE;
2240 UsbClassText.SubClassExist = TRUE;
2241
2242 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2243}
2244
2255 IN CHAR16 *TextDeviceNode
2256 )
2257{
2258 USB_CLASS_TEXT UsbClassText;
2259
2260 UsbClassText.ClassExist = FALSE;
2261 UsbClassText.Class = USB_CLASS_AUDIO;
2262 UsbClassText.SubClassExist = TRUE;
2263
2264 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2265}
2266
2277 IN CHAR16 *TextDeviceNode
2278 )
2279{
2280 USB_CLASS_TEXT UsbClassText;
2281
2282 UsbClassText.ClassExist = FALSE;
2283 UsbClassText.Class = USB_CLASS_CDCCONTROL;
2284 UsbClassText.SubClassExist = TRUE;
2285
2286 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2287}
2288
2299 IN CHAR16 *TextDeviceNode
2300 )
2301{
2302 USB_CLASS_TEXT UsbClassText;
2303
2304 UsbClassText.ClassExist = FALSE;
2305 UsbClassText.Class = USB_CLASS_HID;
2306 UsbClassText.SubClassExist = TRUE;
2307
2308 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2309}
2310
2321 IN CHAR16 *TextDeviceNode
2322 )
2323{
2324 USB_CLASS_TEXT UsbClassText;
2325
2326 UsbClassText.ClassExist = FALSE;
2327 UsbClassText.Class = USB_CLASS_IMAGE;
2328 UsbClassText.SubClassExist = TRUE;
2329
2330 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2331}
2332
2343 IN CHAR16 *TextDeviceNode
2344 )
2345{
2346 USB_CLASS_TEXT UsbClassText;
2347
2348 UsbClassText.ClassExist = FALSE;
2349 UsbClassText.Class = USB_CLASS_PRINTER;
2350 UsbClassText.SubClassExist = TRUE;
2351
2352 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2353}
2354
2365 IN CHAR16 *TextDeviceNode
2366 )
2367{
2368 USB_CLASS_TEXT UsbClassText;
2369
2370 UsbClassText.ClassExist = FALSE;
2371 UsbClassText.Class = USB_CLASS_MASS_STORAGE;
2372 UsbClassText.SubClassExist = TRUE;
2373
2374 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2375}
2376
2387 IN CHAR16 *TextDeviceNode
2388 )
2389{
2390 USB_CLASS_TEXT UsbClassText;
2391
2392 UsbClassText.ClassExist = FALSE;
2393 UsbClassText.Class = USB_CLASS_HUB;
2394 UsbClassText.SubClassExist = TRUE;
2395
2396 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2397}
2398
2409 IN CHAR16 *TextDeviceNode
2410 )
2411{
2412 USB_CLASS_TEXT UsbClassText;
2413
2414 UsbClassText.ClassExist = FALSE;
2415 UsbClassText.Class = USB_CLASS_CDCDATA;
2416 UsbClassText.SubClassExist = TRUE;
2417
2418 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2419}
2420
2431 IN CHAR16 *TextDeviceNode
2432 )
2433{
2434 USB_CLASS_TEXT UsbClassText;
2435
2436 UsbClassText.ClassExist = FALSE;
2437 UsbClassText.Class = USB_CLASS_SMART_CARD;
2438 UsbClassText.SubClassExist = TRUE;
2439
2440 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2441}
2442
2453 IN CHAR16 *TextDeviceNode
2454 )
2455{
2456 USB_CLASS_TEXT UsbClassText;
2457
2458 UsbClassText.ClassExist = FALSE;
2459 UsbClassText.Class = USB_CLASS_VIDEO;
2460 UsbClassText.SubClassExist = TRUE;
2461
2462 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2463}
2464
2475 IN CHAR16 *TextDeviceNode
2476 )
2477{
2478 USB_CLASS_TEXT UsbClassText;
2479
2480 UsbClassText.ClassExist = FALSE;
2481 UsbClassText.Class = USB_CLASS_DIAGNOSTIC;
2482 UsbClassText.SubClassExist = TRUE;
2483
2484 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2485}
2486
2497 IN CHAR16 *TextDeviceNode
2498 )
2499{
2500 USB_CLASS_TEXT UsbClassText;
2501
2502 UsbClassText.ClassExist = FALSE;
2503 UsbClassText.Class = USB_CLASS_WIRELESS;
2504 UsbClassText.SubClassExist = TRUE;
2505
2506 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2507}
2508
2519 IN CHAR16 *TextDeviceNode
2520 )
2521{
2522 USB_CLASS_TEXT UsbClassText;
2523
2524 UsbClassText.ClassExist = FALSE;
2525 UsbClassText.Class = USB_CLASS_RESERVE;
2526 UsbClassText.SubClassExist = FALSE;
2527 UsbClassText.SubClass = USB_SUBCLASS_FW_UPDATE;
2528
2529 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2530}
2531
2542 IN CHAR16 *TextDeviceNode
2543 )
2544{
2545 USB_CLASS_TEXT UsbClassText;
2546
2547 UsbClassText.ClassExist = FALSE;
2548 UsbClassText.Class = USB_CLASS_RESERVE;
2549 UsbClassText.SubClassExist = FALSE;
2550 UsbClassText.SubClass = USB_SUBCLASS_IRDA_BRIDGE;
2551
2552 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2553}
2554
2565 IN CHAR16 *TextDeviceNode
2566 )
2567{
2568 USB_CLASS_TEXT UsbClassText;
2569
2570 UsbClassText.ClassExist = FALSE;
2571 UsbClassText.Class = USB_CLASS_RESERVE;
2572 UsbClassText.SubClassExist = FALSE;
2573 UsbClassText.SubClass = USB_SUBCLASS_TEST;
2574
2575 return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText);
2576}
2577
2588 IN CHAR16 *TextDeviceNode
2589 )
2590{
2591 CHAR16 *VIDStr;
2592 CHAR16 *PIDStr;
2593 CHAR16 *InterfaceNumStr;
2594 CHAR16 *SerialNumberStr;
2595 USB_WWID_DEVICE_PATH *UsbWwid;
2596 UINTN SerialNumberStrLen;
2597
2598 VIDStr = GetNextParamStr (&TextDeviceNode);
2599 PIDStr = GetNextParamStr (&TextDeviceNode);
2600 InterfaceNumStr = GetNextParamStr (&TextDeviceNode);
2601 SerialNumberStr = GetNextParamStr (&TextDeviceNode);
2602 SerialNumberStrLen = StrLen (SerialNumberStr);
2603 if ((SerialNumberStrLen >= 2) &&
2604 (SerialNumberStr[0] == L'\"') &&
2605 (SerialNumberStr[SerialNumberStrLen - 1] == L'\"')
2606 )
2607 {
2608 SerialNumberStr[SerialNumberStrLen - 1] = L'\0';
2609 SerialNumberStr++;
2610 SerialNumberStrLen -= 2;
2611 }
2612
2616 (UINT16)(sizeof (USB_WWID_DEVICE_PATH) + SerialNumberStrLen * sizeof (CHAR16))
2617 );
2618
2619 if (UsbWwid != NULL) {
2620 UsbWwid->VendorId = (UINT16)Strtoi (VIDStr);
2621 UsbWwid->ProductId = (UINT16)Strtoi (PIDStr);
2622 UsbWwid->InterfaceNumber = (UINT16)Strtoi (InterfaceNumStr);
2623
2624 //
2625 // There is no memory allocated in UsbWwid for the '\0' in SerialNumberStr.
2626 // Therefore, the '\0' will not be copied.
2627 //
2628 CopyMem (
2629 (UINT8 *)UsbWwid + sizeof (USB_WWID_DEVICE_PATH),
2630 SerialNumberStr,
2631 SerialNumberStrLen * sizeof (CHAR16)
2632 );
2633 }
2634
2635 return (EFI_DEVICE_PATH_PROTOCOL *)UsbWwid;
2636}
2637
2648 IN CHAR16 *TextDeviceNode
2649 )
2650{
2651 CHAR16 *LunStr;
2653
2654 LunStr = GetNextParamStr (&TextDeviceNode);
2658 (UINT16)sizeof (DEVICE_LOGICAL_UNIT_DEVICE_PATH)
2659 );
2660
2661 if (LogicalUnit != NULL) {
2662 LogicalUnit->Lun = (UINT8)Strtoi (LunStr);
2663 }
2664
2665 return (EFI_DEVICE_PATH_PROTOCOL *)LogicalUnit;
2666}
2667
2678 IN CHAR16 *TextDeviceNode
2679 )
2680{
2681 UINT16 Options;
2682 CHAR16 *NameStr;
2683 CHAR16 *PortalGroupStr;
2684 CHAR16 *LunStr;
2685 CHAR16 *HeaderDigestStr;
2686 CHAR16 *DataDigestStr;
2687 CHAR16 *AuthenticationStr;
2688 CHAR16 *ProtocolStr;
2689 CHAR8 *AsciiStr;
2690 ISCSI_DEVICE_PATH_WITH_NAME *ISCSIDevPath;
2691 UINT64 Lun;
2692
2693 NameStr = GetNextParamStr (&TextDeviceNode);
2694 PortalGroupStr = GetNextParamStr (&TextDeviceNode);
2695 LunStr = GetNextParamStr (&TextDeviceNode);
2696 HeaderDigestStr = GetNextParamStr (&TextDeviceNode);
2697 DataDigestStr = GetNextParamStr (&TextDeviceNode);
2698 AuthenticationStr = GetNextParamStr (&TextDeviceNode);
2699 ProtocolStr = GetNextParamStr (&TextDeviceNode);
2703 (UINT16)(sizeof (ISCSI_DEVICE_PATH_WITH_NAME) + StrLen (NameStr))
2704 );
2705
2706 if (ISCSIDevPath == NULL) {
2707 return (EFI_DEVICE_PATH_PROTOCOL *)ISCSIDevPath;
2708 }
2709
2710 AsciiStr = ISCSIDevPath->TargetName;
2711 StrToAscii (NameStr, &AsciiStr);
2712
2713 ISCSIDevPath->TargetPortalGroupTag = (UINT16)Strtoi (PortalGroupStr);
2714 Strtoi64 (LunStr, &Lun);
2715 WriteUnaligned64 ((UINT64 *)&ISCSIDevPath->Lun, SwapBytes64 (Lun));
2716
2717 Options = 0x0000;
2718 if (StrCmp (HeaderDigestStr, L"CRC32C") == 0) {
2719 Options |= 0x0002;
2720 }
2721
2722 if (StrCmp (DataDigestStr, L"CRC32C") == 0) {
2723 Options |= 0x0008;
2724 }
2725
2726 if (StrCmp (AuthenticationStr, L"None") == 0) {
2727 Options |= 0x0800;
2728 }
2729
2730 if (StrCmp (AuthenticationStr, L"CHAP_UNI") == 0) {
2731 Options |= 0x1000;
2732 }
2733
2734 ISCSIDevPath->LoginOption = (UINT16)Options;
2735
2736 if (IS_NULL (*ProtocolStr) || (StrCmp (ProtocolStr, L"TCP") == 0)) {
2737 ISCSIDevPath->NetworkProtocol = 0;
2738 } else {
2739 //
2740 // Undefined and reserved.
2741 //
2742 ISCSIDevPath->NetworkProtocol = 1;
2743 }
2744
2745 return (EFI_DEVICE_PATH_PROTOCOL *)ISCSIDevPath;
2746}
2747
2758 IN CHAR16 *TextDeviceNode
2759 )
2760{
2761 CHAR16 *VlanStr;
2762 VLAN_DEVICE_PATH *Vlan;
2763
2764 VlanStr = GetNextParamStr (&TextDeviceNode);
2768 (UINT16)sizeof (VLAN_DEVICE_PATH)
2769 );
2770
2771 if (Vlan != NULL) {
2772 Vlan->VlanId = (UINT16)Strtoi (VlanStr);
2773 }
2774
2775 return (EFI_DEVICE_PATH_PROTOCOL *)Vlan;
2776}
2777
2788 IN CHAR16 *TextDeviceNode
2789 )
2790{
2791 CHAR16 *BluetoothStr;
2792 BLUETOOTH_DEVICE_PATH *BluetoothDp;
2793
2794 BluetoothStr = GetNextParamStr (&TextDeviceNode);
2795 BluetoothDp = (BLUETOOTH_DEVICE_PATH *)CreateDeviceNode (
2798 (UINT16)sizeof (BLUETOOTH_DEVICE_PATH)
2799 );
2800
2801 if (BluetoothDp != NULL) {
2803 BluetoothStr,
2804 sizeof (BLUETOOTH_ADDRESS) * 2,
2805 BluetoothDp->BD_ADDR.Address,
2806 sizeof (BLUETOOTH_ADDRESS)
2807 );
2808 }
2809
2810 return (EFI_DEVICE_PATH_PROTOCOL *)BluetoothDp;
2811}
2812
2823 IN CHAR16 *TextDeviceNode
2824 )
2825{
2826 CHAR16 *SSIdStr;
2827 CHAR8 AsciiStr[33];
2828 UINTN DataLen;
2829 WIFI_DEVICE_PATH *WiFiDp;
2830
2831 SSIdStr = GetNextParamStr (&TextDeviceNode);
2835 (UINT16)sizeof (WIFI_DEVICE_PATH)
2836 );
2837
2838 if ((NULL != SSIdStr) && (NULL != WiFiDp)) {
2839 DataLen = StrLen (SSIdStr);
2840 if (StrLen (SSIdStr) > 32) {
2841 SSIdStr[32] = L'\0';
2842 DataLen = 32;
2843 }
2844
2845 UnicodeStrToAsciiStrS (SSIdStr, AsciiStr, sizeof (AsciiStr));
2846 CopyMem (WiFiDp->SSId, AsciiStr, DataLen);
2847 }
2848
2849 return (EFI_DEVICE_PATH_PROTOCOL *)WiFiDp;
2850}
2851
2862 IN CHAR16 *TextDeviceNode
2863 )
2864{
2865 CHAR16 *BluetoothLeAddrStr;
2866 CHAR16 *BluetoothLeAddrTypeStr;
2867 BLUETOOTH_LE_DEVICE_PATH *BluetoothLeDp;
2868
2869 BluetoothLeAddrStr = GetNextParamStr (&TextDeviceNode);
2870 BluetoothLeAddrTypeStr = GetNextParamStr (&TextDeviceNode);
2871 BluetoothLeDp = (BLUETOOTH_LE_DEVICE_PATH *)CreateDeviceNode (
2874 (UINT16)sizeof (BLUETOOTH_LE_DEVICE_PATH)
2875 );
2876
2877 if (BluetoothLeDp != NULL) {
2878 BluetoothLeDp->Address.Type = (UINT8)Strtoi (BluetoothLeAddrTypeStr);
2880 BluetoothLeAddrStr,
2881 sizeof (BluetoothLeDp->Address.Address) * 2,
2882 BluetoothLeDp->Address.Address,
2883 sizeof (BluetoothLeDp->Address.Address)
2884 );
2885 }
2886
2887 return (EFI_DEVICE_PATH_PROTOCOL *)BluetoothLeDp;
2888}
2889
2900 IN CHAR16 *TextDeviceNode
2901 )
2902{
2903 CHAR16 *DeviceNodeStr;
2904 CHAR16 *DeviceNodeStrPtr;
2905 UINT32 DnsServerIpCount;
2906 UINT16 DnsDeviceNodeLength;
2907 DNS_DEVICE_PATH *DnsDeviceNode;
2908 UINT32 DnsServerIpIndex;
2909 CHAR16 *DnsServerIp;
2910
2911 //
2912 // Count the DNS server address number.
2913 //
2914 DeviceNodeStr = UefiDevicePathLibStrDuplicate (TextDeviceNode);
2915 if (DeviceNodeStr == NULL) {
2916 return NULL;
2917 }
2918
2919 DeviceNodeStrPtr = DeviceNodeStr;
2920
2921 DnsServerIpCount = 0;
2922 while (DeviceNodeStrPtr != NULL && *DeviceNodeStrPtr != L'\0') {
2923 GetNextParamStr (&DeviceNodeStrPtr);
2924 DnsServerIpCount++;
2925 }
2926
2927 FreePool (DeviceNodeStr);
2928 DeviceNodeStr = NULL;
2929
2930 //
2931 // One or more instances of the DNS server address in EFI_IP_ADDRESS,
2932 // otherwise, NULL will be returned.
2933 //
2934 if (DnsServerIpCount == 0) {
2935 return NULL;
2936 }
2937
2938 //
2939 // Create the DNS DeviceNode.
2940 //
2941 DnsDeviceNodeLength = (UINT16)(sizeof (EFI_DEVICE_PATH_PROTOCOL) + sizeof (UINT8) + DnsServerIpCount * sizeof (EFI_IP_ADDRESS));
2942 DnsDeviceNode = (DNS_DEVICE_PATH *)CreateDeviceNode (
2944 MSG_DNS_DP,
2945 DnsDeviceNodeLength
2946 );
2947 if (DnsDeviceNode == NULL) {
2948 return NULL;
2949 }
2950
2951 //
2952 // Confirm the DNS server address is IPv4 or IPv6 type.
2953 //
2954 DeviceNodeStrPtr = TextDeviceNode;
2955 while (!IS_NULL (*DeviceNodeStrPtr)) {
2956 if (*DeviceNodeStrPtr == L'.') {
2957 DnsDeviceNode->IsIPv6 = 0x00;
2958 break;
2959 }
2960
2961 if (*DeviceNodeStrPtr == L':') {
2962 DnsDeviceNode->IsIPv6 = 0x01;
2963 break;
2964 }
2965
2966 DeviceNodeStrPtr++;
2967 }
2968
2969 for (DnsServerIpIndex = 0; DnsServerIpIndex < DnsServerIpCount; DnsServerIpIndex++) {
2970 DnsServerIp = GetNextParamStr (&TextDeviceNode);
2971 if (DnsDeviceNode->IsIPv6 == 0x00) {
2972 StrToIpv4Address (DnsServerIp, NULL, &(DnsDeviceNode->DnsServerIp[DnsServerIpIndex].v4), NULL);
2973 } else {
2974 StrToIpv6Address (DnsServerIp, NULL, &(DnsDeviceNode->DnsServerIp[DnsServerIpIndex].v6), NULL);
2975 }
2976 }
2977
2978 return (EFI_DEVICE_PATH_PROTOCOL *)DnsDeviceNode;
2979}
2980
2991 IN CHAR16 *TextDeviceNode
2992 )
2993{
2994 CHAR16 *UriStr;
2995 UINTN UriLength;
2996 URI_DEVICE_PATH *Uri;
2997
2998 UriStr = GetNextParamStr (&TextDeviceNode);
2999 UriLength = StrnLenS (UriStr, MAX_UINT16 - sizeof (URI_DEVICE_PATH));
3002 MSG_URI_DP,
3003 (UINT16)(sizeof (URI_DEVICE_PATH) + UriLength)
3004 );
3005
3006 while (Uri != NULL && UriLength-- != 0) {
3007 Uri->Uri[UriLength] = (CHAR8)UriStr[UriLength];
3008 }
3009
3010 return (EFI_DEVICE_PATH_PROTOCOL *)Uri;
3011}
3012
3023 IN CHAR16 *TextDeviceNode
3024 )
3025{
3026 return DevPathFromTextGenericPath (MEDIA_DEVICE_PATH, TextDeviceNode);
3027}
3028
3039 IN CHAR16 *TextDeviceNode
3040 )
3041{
3042 CHAR16 *PartitionStr;
3043 CHAR16 *TypeStr;
3044 CHAR16 *SignatureStr;
3045 CHAR16 *StartStr;
3046 CHAR16 *SizeStr;
3047 UINT32 Signature32;
3049
3050 PartitionStr = GetNextParamStr (&TextDeviceNode);
3051 TypeStr = GetNextParamStr (&TextDeviceNode);
3052 SignatureStr = GetNextParamStr (&TextDeviceNode);
3053 StartStr = GetNextParamStr (&TextDeviceNode);
3054 SizeStr = GetNextParamStr (&TextDeviceNode);
3056 MEDIA_DEVICE_PATH,
3058 (UINT16)sizeof (HARDDRIVE_DEVICE_PATH)
3059 );
3060
3061 if (Hd == NULL) {
3062 return (EFI_DEVICE_PATH_PROTOCOL *)Hd;
3063 }
3064
3065 Hd->PartitionNumber = (UINT32)Strtoi (PartitionStr);
3066
3067 ZeroMem (Hd->Signature, 16);
3068 Hd->MBRType = (UINT8)0;
3069
3070 if (StrCmp (TypeStr, L"MBR") == 0) {
3071 Hd->SignatureType = SIGNATURE_TYPE_MBR;
3072 Hd->MBRType = 0x01;
3073
3074 Signature32 = (UINT32)Strtoi (SignatureStr);
3075 CopyMem (Hd->Signature, &Signature32, sizeof (UINT32));
3076 } else if (StrCmp (TypeStr, L"GPT") == 0) {
3077 Hd->SignatureType = SIGNATURE_TYPE_GUID;
3078 Hd->MBRType = 0x02;
3079
3080 StrToGuid (SignatureStr, (EFI_GUID *)Hd->Signature);
3081 } else {
3082 Hd->SignatureType = (UINT8)Strtoi (TypeStr);
3083 }
3084
3085 Strtoi64 (StartStr, &Hd->PartitionStart);
3086 Strtoi64 (SizeStr, &Hd->PartitionSize);
3087
3088 return (EFI_DEVICE_PATH_PROTOCOL *)Hd;
3089}
3090
3101 IN CHAR16 *TextDeviceNode
3102 )
3103{
3104 CHAR16 *EntryStr;
3105 CHAR16 *StartStr;
3106 CHAR16 *SizeStr;
3107 CDROM_DEVICE_PATH *CDROMDevPath;
3108
3109 EntryStr = GetNextParamStr (&TextDeviceNode);
3110 StartStr = GetNextParamStr (&TextDeviceNode);
3111 SizeStr = GetNextParamStr (&TextDeviceNode);
3112 CDROMDevPath = (CDROM_DEVICE_PATH *)CreateDeviceNode (
3113 MEDIA_DEVICE_PATH,
3115 (UINT16)sizeof (CDROM_DEVICE_PATH)
3116 );
3117
3118 if (CDROMDevPath != NULL) {
3119 CDROMDevPath->BootEntry = (UINT32)Strtoi (EntryStr);
3120 Strtoi64 (StartStr, &CDROMDevPath->PartitionStart);
3121 Strtoi64 (SizeStr, &CDROMDevPath->PartitionSize);
3122 }
3123
3124 return (EFI_DEVICE_PATH_PROTOCOL *)CDROMDevPath;
3125}
3126
3137 IN CHAR16 *TextDeviceNode
3138 )
3139{
3140 return ConvertFromTextVendor (
3141 TextDeviceNode,
3142 MEDIA_DEVICE_PATH,
3144 );
3145}
3146
3157 IN CHAR16 *TextDeviceNode
3158 )
3159{
3161
3163 MEDIA_DEVICE_PATH,
3165 (UINT16)(sizeof (FILEPATH_DEVICE_PATH) + StrLen (TextDeviceNode) * 2)
3166 );
3167
3168 if (File != NULL) {
3169 StrCpyS (File->PathName, StrLen (TextDeviceNode) + 1, TextDeviceNode);
3170 }
3171
3172 return (EFI_DEVICE_PATH_PROTOCOL *)File;
3173}
3174
3185 IN CHAR16 *TextDeviceNode
3186 )
3187{
3188 CHAR16 *GuidStr;
3190
3191 GuidStr = GetNextParamStr (&TextDeviceNode);
3193 MEDIA_DEVICE_PATH,
3195 (UINT16)sizeof (MEDIA_PROTOCOL_DEVICE_PATH)
3196 );
3197
3198 if (Media != NULL) {
3199 StrToGuid (GuidStr, &Media->Protocol);
3200 }
3201
3202 return (EFI_DEVICE_PATH_PROTOCOL *)Media;
3203}
3204
3215 IN CHAR16 *TextDeviceNode
3216 )
3217{
3218 CHAR16 *GuidStr;
3220
3221 GuidStr = GetNextParamStr (&TextDeviceNode);
3223 MEDIA_DEVICE_PATH,
3225 (UINT16)sizeof (MEDIA_FW_VOL_DEVICE_PATH)
3226 );
3227
3228 if (Fv != NULL) {
3229 StrToGuid (GuidStr, &Fv->FvName);
3230 }
3231
3232 return (EFI_DEVICE_PATH_PROTOCOL *)Fv;
3233}
3234
3245 IN CHAR16 *TextDeviceNode
3246 )
3247{
3248 CHAR16 *GuidStr;
3250
3251 GuidStr = GetNextParamStr (&TextDeviceNode);
3253 MEDIA_DEVICE_PATH,
3255 (UINT16)sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH)
3256 );
3257
3258 if (FvFile != NULL) {
3259 StrToGuid (GuidStr, &FvFile->FvFileName);
3260 }
3261
3262 return (EFI_DEVICE_PATH_PROTOCOL *)FvFile;
3263}
3264
3275 IN CHAR16 *TextDeviceNode
3276 )
3277{
3278 CHAR16 *StartingOffsetStr;
3279 CHAR16 *EndingOffsetStr;
3281
3282 StartingOffsetStr = GetNextParamStr (&TextDeviceNode);
3283 EndingOffsetStr = GetNextParamStr (&TextDeviceNode);
3285 MEDIA_DEVICE_PATH,
3288 );
3289
3290 if (Offset != NULL) {
3291 Strtoi64 (StartingOffsetStr, &Offset->StartingOffset);
3292 Strtoi64 (EndingOffsetStr, &Offset->EndingOffset);
3293 }
3294
3295 return (EFI_DEVICE_PATH_PROTOCOL *)Offset;
3296}
3297
3308 IN CHAR16 *TextDeviceNode
3309 )
3310{
3311 CHAR16 *StartingAddrStr;
3312 CHAR16 *EndingAddrStr;
3313 CHAR16 *TypeGuidStr;
3314 CHAR16 *InstanceStr;
3316 UINT64 StartingAddr;
3317 UINT64 EndingAddr;
3318
3319 StartingAddrStr = GetNextParamStr (&TextDeviceNode);
3320 EndingAddrStr = GetNextParamStr (&TextDeviceNode);
3321 InstanceStr = GetNextParamStr (&TextDeviceNode);
3322 TypeGuidStr = GetNextParamStr (&TextDeviceNode);
3324 MEDIA_DEVICE_PATH,
3326 (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH)
3327 );
3328
3329 if (RamDisk != NULL) {
3330 Strtoi64 (StartingAddrStr, &StartingAddr);
3331 WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr);
3332 Strtoi64 (EndingAddrStr, &EndingAddr);
3333 WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr);
3334 RamDisk->Instance = (UINT16)Strtoi (InstanceStr);
3335 StrToGuid (TypeGuidStr, &RamDisk->TypeGuid);
3336 }
3337
3338 return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk;
3339}
3340
3351 IN CHAR16 *TextDeviceNode
3352 )
3353{
3354 CHAR16 *StartingAddrStr;
3355 CHAR16 *EndingAddrStr;
3356 CHAR16 *InstanceStr;
3358 UINT64 StartingAddr;
3359 UINT64 EndingAddr;
3360
3361 StartingAddrStr = GetNextParamStr (&TextDeviceNode);
3362 EndingAddrStr = GetNextParamStr (&TextDeviceNode);
3363 InstanceStr = GetNextParamStr (&TextDeviceNode);
3364
3366 MEDIA_DEVICE_PATH,
3368 (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH)
3369 );
3370
3371 if (RamDisk != NULL) {
3372 Strtoi64 (StartingAddrStr, &StartingAddr);
3373 WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr);
3374 Strtoi64 (EndingAddrStr, &EndingAddr);
3375 WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr);
3376 RamDisk->Instance = (UINT16)Strtoi (InstanceStr);
3377 CopyGuid (&RamDisk->TypeGuid, &gEfiVirtualDiskGuid);
3378 }
3379
3380 return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk;
3381}
3382
3393 IN CHAR16 *TextDeviceNode
3394 )
3395{
3396 CHAR16 *StartingAddrStr;
3397 CHAR16 *EndingAddrStr;
3398 CHAR16 *InstanceStr;
3400 UINT64 StartingAddr;
3401 UINT64 EndingAddr;
3402
3403 StartingAddrStr = GetNextParamStr (&TextDeviceNode);
3404 EndingAddrStr = GetNextParamStr (&TextDeviceNode);
3405 InstanceStr = GetNextParamStr (&TextDeviceNode);
3406
3408 MEDIA_DEVICE_PATH,
3410 (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH)
3411 );
3412
3413 if (RamDisk != NULL) {
3414 Strtoi64 (StartingAddrStr, &StartingAddr);
3415 WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr);
3416 Strtoi64 (EndingAddrStr, &EndingAddr);
3417 WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr);
3418 RamDisk->Instance = (UINT16)Strtoi (InstanceStr);
3419 CopyGuid (&RamDisk->TypeGuid, &gEfiVirtualCdGuid);
3420 }
3421
3422 return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk;
3423}
3424
3435 IN CHAR16 *TextDeviceNode
3436 )
3437{
3438 CHAR16 *StartingAddrStr;
3439 CHAR16 *EndingAddrStr;
3440 CHAR16 *InstanceStr;
3442 UINT64 StartingAddr;
3443 UINT64 EndingAddr;
3444
3445 StartingAddrStr = GetNextParamStr (&TextDeviceNode);
3446 EndingAddrStr = GetNextParamStr (&TextDeviceNode);
3447 InstanceStr = GetNextParamStr (&TextDeviceNode);
3448
3450 MEDIA_DEVICE_PATH,
3452 (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH)
3453 );
3454
3455 if (RamDisk != NULL) {
3456 Strtoi64 (StartingAddrStr, &StartingAddr);
3457 WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr);
3458 Strtoi64 (EndingAddrStr, &EndingAddr);
3459 WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr);
3460 RamDisk->Instance = (UINT16)Strtoi (InstanceStr);
3461 CopyGuid (&RamDisk->TypeGuid, &gEfiPersistentVirtualDiskGuid);
3462 }
3463
3464 return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk;
3465}
3466
3477 IN CHAR16 *TextDeviceNode
3478 )
3479{
3480 CHAR16 *StartingAddrStr;
3481 CHAR16 *EndingAddrStr;
3482 CHAR16 *InstanceStr;
3484 UINT64 StartingAddr;
3485 UINT64 EndingAddr;
3486
3487 StartingAddrStr = GetNextParamStr (&TextDeviceNode);
3488 EndingAddrStr = GetNextParamStr (&TextDeviceNode);
3489 InstanceStr = GetNextParamStr (&TextDeviceNode);
3490
3492 MEDIA_DEVICE_PATH,
3494 (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH)
3495 );
3496
3497 if (RamDisk != NULL) {
3498 Strtoi64 (StartingAddrStr, &StartingAddr);
3499 WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr);
3500 Strtoi64 (EndingAddrStr, &EndingAddr);
3501 WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr);
3502 RamDisk->Instance = (UINT16)Strtoi (InstanceStr);
3503 CopyGuid (&RamDisk->TypeGuid, &gEfiPersistentVirtualCdGuid);
3504 }
3505
3506 return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk;
3507}
3508
3519 IN CHAR16 *TextDeviceNode
3520 )
3521{
3522 return DevPathFromTextGenericPath (BBS_DEVICE_PATH, TextDeviceNode);
3523}
3524
3535 IN CHAR16 *TextDeviceNode
3536 )
3537{
3538 CHAR16 *TypeStr;
3539 CHAR16 *IdStr;
3540 CHAR16 *FlagsStr;
3541 CHAR8 *AsciiStr;
3543
3544 TypeStr = GetNextParamStr (&TextDeviceNode);
3545 IdStr = GetNextParamStr (&TextDeviceNode);
3546 FlagsStr = GetNextParamStr (&TextDeviceNode);
3549 BBS_BBS_DP,
3550 (UINT16)(sizeof (BBS_BBS_DEVICE_PATH) + StrLen (IdStr))
3551 );
3552
3553 if (Bbs == NULL) {
3554 return (EFI_DEVICE_PATH_PROTOCOL *)Bbs;
3555 }
3556
3557 if (StrCmp (TypeStr, L"Floppy") == 0) {
3558 Bbs->DeviceType = BBS_TYPE_FLOPPY;
3559 } else if (StrCmp (TypeStr, L"HD") == 0) {
3560 Bbs->DeviceType = BBS_TYPE_HARDDRIVE;
3561 } else if (StrCmp (TypeStr, L"CDROM") == 0) {
3562 Bbs->DeviceType = BBS_TYPE_CDROM;
3563 } else if (StrCmp (TypeStr, L"PCMCIA") == 0) {
3564 Bbs->DeviceType = BBS_TYPE_PCMCIA;
3565 } else if (StrCmp (TypeStr, L"USB") == 0) {
3566 Bbs->DeviceType = BBS_TYPE_USB;
3567 } else if (StrCmp (TypeStr, L"Network") == 0) {
3568 Bbs->DeviceType = BBS_TYPE_EMBEDDED_NETWORK;
3569 } else {
3570 Bbs->DeviceType = (UINT16)Strtoi (TypeStr);
3571 }
3572
3573 AsciiStr = Bbs->String;
3574 StrToAscii (IdStr, &AsciiStr);
3575
3576 Bbs->StatusFlag = (UINT16)Strtoi (FlagsStr);
3577
3578 return (EFI_DEVICE_PATH_PROTOCOL *)Bbs;
3579}
3580
3591 IN CHAR16 *TextDeviceNode
3592 )
3593{
3594 SATA_DEVICE_PATH *Sata;
3595 CHAR16 *Param1;
3596 CHAR16 *Param2;
3597 CHAR16 *Param3;
3598
3599 Param1 = GetNextParamStr (&TextDeviceNode);
3600 Param2 = GetNextParamStr (&TextDeviceNode);
3601 Param3 = GetNextParamStr (&TextDeviceNode);
3602
3606 (UINT16)sizeof (SATA_DEVICE_PATH)
3607 );
3608
3609 if (Sata == NULL) {
3610 return (EFI_DEVICE_PATH_PROTOCOL *)Sata;
3611 }
3612
3613 Sata->HBAPortNumber = (UINT16)Strtoi (Param1);
3614
3615 //
3616 // According to UEFI spec, if PMPN is not provided, the default is 0xFFFF
3617 //
3618 if (*Param2 == L'\0' ) {
3619 Sata->PortMultiplierPortNumber = 0xFFFF;
3620 } else {
3621 Sata->PortMultiplierPortNumber = (UINT16)Strtoi (Param2);
3622 }
3623
3624 Sata->Lun = (UINT16)Strtoi (Param3);
3625
3626 return (EFI_DEVICE_PATH_PROTOCOL *)Sata;
3627}
3628
3629GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevPathFromTextTable[] = {
3630 { L"Path", DevPathFromTextPath },
3631
3632 { L"HardwarePath", DevPathFromTextHardwarePath },
3633 { L"Pci", DevPathFromTextPci },
3634 { L"PcCard", DevPathFromTextPcCard },
3635 { L"MemoryMapped", DevPathFromTextMemoryMapped },
3636 { L"VenHw", DevPathFromTextVenHw },
3637 { L"Ctrl", DevPathFromTextCtrl },
3638 { L"BMC", DevPathFromTextBmc },
3639
3640 { L"AcpiPath", DevPathFromTextAcpiPath },
3641 { L"Acpi", DevPathFromTextAcpi },
3642 { L"PciRoot", DevPathFromTextPciRoot },
3643 { L"PcieRoot", DevPathFromTextPcieRoot },
3644 { L"Floppy", DevPathFromTextFloppy },
3645 { L"Keyboard", DevPathFromTextKeyboard },
3646 { L"Serial", DevPathFromTextSerial },
3647 { L"ParallelPort", DevPathFromTextParallelPort },
3648 { L"AcpiEx", DevPathFromTextAcpiEx },
3649 { L"AcpiExp", DevPathFromTextAcpiExp },
3650 { L"AcpiAdr", DevPathFromTextAcpiAdr },
3651
3652 { L"Msg", DevPathFromTextMsg },
3653 { L"Ata", DevPathFromTextAta },
3654 { L"Scsi", DevPathFromTextScsi },
3655 { L"Fibre", DevPathFromTextFibre },
3656 { L"FibreEx", DevPathFromTextFibreEx },
3657 { L"I1394", DevPathFromText1394 },
3658 { L"USB", DevPathFromTextUsb },
3659 { L"I2O", DevPathFromTextI2O },
3660 { L"Infiniband", DevPathFromTextInfiniband },
3661 { L"VenMsg", DevPathFromTextVenMsg },
3662 { L"VenPcAnsi", DevPathFromTextVenPcAnsi },
3663 { L"VenVt100", DevPathFromTextVenVt100 },
3664 { L"VenVt100Plus", DevPathFromTextVenVt100Plus },
3665 { L"VenUtf8", DevPathFromTextVenUtf8 },
3666 { L"UartFlowCtrl", DevPathFromTextUartFlowCtrl },
3667 { L"SAS", DevPathFromTextSAS },
3668 { L"SasEx", DevPathFromTextSasEx },
3669 { L"NVMe", DevPathFromTextNVMe },
3670 { L"UFS", DevPathFromTextUfs },
3671 { L"SD", DevPathFromTextSd },
3672 { L"eMMC", DevPathFromTextEmmc },
3673 { L"DebugPort", DevPathFromTextDebugPort },
3674 { L"MAC", DevPathFromTextMAC },
3675 { L"IPv4", DevPathFromTextIPv4 },
3676 { L"IPv6", DevPathFromTextIPv6 },
3677 { L"Uart", DevPathFromTextUart },
3678 { L"UsbClass", DevPathFromTextUsbClass },
3679 { L"UsbAudio", DevPathFromTextUsbAudio },
3680 { L"UsbCDCControl", DevPathFromTextUsbCDCControl },
3681 { L"UsbHID", DevPathFromTextUsbHID },
3682 { L"UsbImage", DevPathFromTextUsbImage },
3683 { L"UsbPrinter", DevPathFromTextUsbPrinter },
3684 { L"UsbMassStorage", DevPathFromTextUsbMassStorage },
3685 { L"UsbHub", DevPathFromTextUsbHub },
3686 { L"UsbCDCData", DevPathFromTextUsbCDCData },
3687 { L"UsbSmartCard", DevPathFromTextUsbSmartCard },
3688 { L"UsbVideo", DevPathFromTextUsbVideo },
3689 { L"UsbDiagnostic", DevPathFromTextUsbDiagnostic },
3690 { L"UsbWireless", DevPathFromTextUsbWireless },
3691 { L"UsbDeviceFirmwareUpdate", DevPathFromTextUsbDeviceFirmwareUpdate },
3692 { L"UsbIrdaBridge", DevPathFromTextUsbIrdaBridge },
3693 { L"UsbTestAndMeasurement", DevPathFromTextUsbTestAndMeasurement },
3694 { L"UsbWwid", DevPathFromTextUsbWwid },
3695 { L"Unit", DevPathFromTextUnit },
3696 { L"iSCSI", DevPathFromTextiSCSI },
3697 { L"Vlan", DevPathFromTextVlan },
3698 { L"Dns", DevPathFromTextDns },
3699 { L"Uri", DevPathFromTextUri },
3700 { L"Bluetooth", DevPathFromTextBluetooth },
3701 { L"Wi-Fi", DevPathFromTextWiFi },
3702 { L"BluetoothLE", DevPathFromTextBluetoothLE },
3703 { L"MediaPath", DevPathFromTextMediaPath },
3704 { L"HD", DevPathFromTextHD },
3705 { L"CDROM", DevPathFromTextCDROM },
3706 { L"VenMedia", DevPathFromTextVenMedia },
3707 { L"Media", DevPathFromTextMedia },
3708 { L"Fv", DevPathFromTextFv },
3709 { L"FvFile", DevPathFromTextFvFile },
3711 { L"RamDisk", DevPathFromTextRamDisk },
3712 { L"VirtualDisk", DevPathFromTextVirtualDisk },
3713 { L"VirtualCD", DevPathFromTextVirtualCd },
3714 { L"PersistentVirtualDisk", DevPathFromTextPersistentVirtualDisk },
3715 { L"PersistentVirtualCD", DevPathFromTextPersistentVirtualCd },
3716
3717 { L"BbsPath", DevPathFromTextBbsPath },
3718 { L"BBS", DevPathFromTextBBS },
3719 { L"Sata", DevPathFromTextSata },
3720 { NULL, NULL }
3721};
3722
3735EFIAPI
3737 IN CONST CHAR16 *TextDeviceNode
3738 )
3739{
3740 DEVICE_PATH_FROM_TEXT FromText;
3741 CHAR16 *ParamStr;
3742 EFI_DEVICE_PATH_PROTOCOL *DeviceNode;
3743 CHAR16 *DeviceNodeStr;
3744 UINTN Index;
3745
3746 if ((TextDeviceNode == NULL) || (IS_NULL (*TextDeviceNode))) {
3747 return NULL;
3748 }
3749
3750 ParamStr = NULL;
3751 FromText = NULL;
3752 DeviceNodeStr = UefiDevicePathLibStrDuplicate (TextDeviceNode);
3753 ASSERT (DeviceNodeStr != NULL);
3754
3755 for (Index = 0; mUefiDevicePathLibDevPathFromTextTable[Index].Function != NULL; Index++) {
3756 ParamStr = GetParamByNodeName (DeviceNodeStr, mUefiDevicePathLibDevPathFromTextTable[Index].DevicePathNodeText);
3757 if (ParamStr != NULL) {
3758 FromText = mUefiDevicePathLibDevPathFromTextTable[Index].Function;
3759 break;
3760 }
3761 }
3762
3763 if (FromText == NULL) {
3764 //
3765 // A file path
3766 //
3767 FromText = DevPathFromTextFilePath;
3768 DeviceNode = FromText (DeviceNodeStr);
3769 } else {
3770 DeviceNode = FromText (ParamStr);
3771 FreePool (ParamStr);
3772 }
3773
3774 FreePool (DeviceNodeStr);
3775
3776 return DeviceNode;
3777}
3778
3792EFIAPI
3794 IN CONST CHAR16 *TextDevicePath
3795 )
3796{
3797 EFI_DEVICE_PATH_PROTOCOL *DeviceNode;
3798 EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
3799 CHAR16 *DevicePathStr;
3800 CHAR16 *Str;
3801 CHAR16 *DeviceNodeStr;
3802 BOOLEAN IsInstanceEnd;
3803 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
3804
3805 if ((TextDevicePath == NULL) || (IS_NULL (*TextDevicePath))) {
3806 return NULL;
3807 }
3808
3809 DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)AllocatePool (END_DEVICE_PATH_LENGTH);
3810
3811 if (DevicePath == NULL) {
3812 ASSERT (DevicePath != NULL);
3813 return NULL;
3814 }
3815
3816 SetDevicePathEndNode (DevicePath);
3817
3818 DevicePathStr = UefiDevicePathLibStrDuplicate (TextDevicePath);
3819
3820 if (DevicePathStr == NULL) {
3821 return NULL;
3822 }
3823
3824 Str = DevicePathStr;
3825 while ((DeviceNodeStr = GetNextDeviceNodeStr (&Str, &IsInstanceEnd)) != NULL) {
3826 DeviceNode = UefiDevicePathLibConvertTextToDeviceNode (DeviceNodeStr);
3827
3828 NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode);
3829 if (DevicePath != NULL) {
3830 FreePool (DevicePath);
3831 }
3832
3833 if (DeviceNode != NULL) {
3834 FreePool (DeviceNode);
3835 }
3836
3837 DevicePath = NewDevicePath;
3838
3839 if (IsInstanceEnd) {
3840 DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *)AllocatePool (END_DEVICE_PATH_LENGTH);
3841 if (DeviceNode == NULL) {
3842 ASSERT (DeviceNode != NULL);
3843 return NULL;
3844 }
3845
3846 SetDevicePathEndNode (DeviceNode);
3847 DeviceNode->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE;
3848
3849 NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode);
3850 if (DevicePath != NULL) {
3851 FreePool (DevicePath);
3852 }
3853
3854 if (DeviceNode != NULL) {
3855 FreePool (DeviceNode);
3856 }
3857
3858 DevicePath = NewDevicePath;
3859 }
3860 }
3861
3862 FreePool (DevicePathStr);
3863 return DevicePath;
3864}
UINT64 UINTN
UINT64 EFIAPI StrHexToUint64(IN CONST CHAR16 *String)
Definition: String.c:560
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
Definition: String.c:72
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
Definition: SafeString.c:226
UINTN EFIAPI StrDecimalToUintn(IN CONST CHAR16 *String)
Definition: String.c:405
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
Definition: String.c:109
UINT64 EFIAPI StrDecimalToUint64(IN CONST CHAR16 *String)
Definition: String.c:456
RETURN_STATUS EFIAPI UnicodeStrToAsciiStrS(IN CONST CHAR16 *Source, OUT CHAR8 *Destination, IN UINTN DestMax)
Definition: SafeString.c:2650
UINTN EFIAPI StrHexToUintn(IN CONST CHAR16 *String)
Definition: String.c:508
UINTN EFIAPI StrnLenS(IN CONST CHAR16 *String, IN UINTN MaxSize)
Definition: SafeString.c:119
RETURN_STATUS EFIAPI StrToIpv6Address(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT IPv6_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:1129
RETURN_STATUS EFIAPI StrToIpv4Address(IN CONST CHAR16 *String, OUT CHAR16 **EndPointer OPTIONAL, OUT IPv4_ADDRESS *Address, OUT UINT8 *PrefixLength OPTIONAL)
Definition: SafeString.c:1351
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
Definition: String.c:162
RETURN_STATUS EFIAPI StrToGuid(IN CONST CHAR16 *String, OUT GUID *Guid)
Definition: SafeString.c:1500
RETURN_STATUS EFIAPI StrHexToBytes(IN CONST CHAR16 *String, IN UINTN Length, OUT UINT8 *Buffer, IN UINTN MaxBufferSize)
Definition: SafeString.c:1615
UINT64 EFIAPI SwapBytes64(IN UINT64 Value)
Definition: SwapBytes64.c:25
UINT64 EFIAPI WriteUnaligned64(OUT UINT64 *Buffer, IN UINT64 Value)
Definition: Unaligned.c:236
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
Definition: MemLibGuid.c:39
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define BBS_BBS_DP
Definition: DevicePath.h:1238
#define MSG_IPv6_DP
Definition: DevicePath.h:607
#define MSG_IPv4_DP
Definition: DevicePath.h:566
#define MEDIA_FILEPATH_DP
Definition: DevicePath.h:1098
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define MSG_INFINIBAND_DP
Definition: DevicePath.h:651
#define MSG_SCSI_DP
Definition: DevicePath.h:346
#define HW_BMC_DP
Definition: DevicePath.h:170
#define HW_VENDOR_DP
Definition: DevicePath.h:133
#define MEDIA_RAM_DISK_DP
Definition: DevicePath.h:1205
#define MSG_DEVICE_LOGICAL_UNIT_DP
Definition: DevicePath.h:498
#define MSG_NVME_NAMESPACE_DP
Definition: DevicePath.h:833
#define MSG_SD_DP
Definition: DevicePath.h:907
#define MSG_URI_DP
Definition: DevicePath.h:879
#define MSG_SASEX_DP
Definition: DevicePath.h:809
#define MEDIA_CDROM_DP
Definition: DevicePath.h:1069
#define MSG_ATAPI_DP
Definition: DevicePath.h:326
#define HW_PCCARD_DP
Definition: DevicePath.h:93
#define BBS_DEVICE_PATH
Definition: DevicePath.h:1233
#define ACPI_DEVICE_PATH
Definition: DevicePath.h:190
#define MSG_I2O_DP
Definition: DevicePath.h:538
#define MEDIA_PIWG_FW_FILE_DP
Definition: DevicePath.h:1130
#define MSG_UFS_DP
Definition: DevicePath.h:891
#define MEDIA_HARDDRIVE_DP
Definition: DevicePath.h:1014
#define MEDIA_PROTOCOL_DP
Definition: DevicePath.h:1112
#define MSG_DNS_DP
Definition: DevicePath.h:863
#define MSG_BLUETOOTH_DP
Definition: DevicePath.h:976
#define MSG_EMMC_DP
Definition: DevicePath.h:916
#define MSG_USB_WWID_DP
Definition: DevicePath.h:467
#define MSG_USB_DP
Definition: DevicePath.h:418
#define MSG_ISCSI_DP
Definition: DevicePath.h:925
#define MEDIA_PIWG_FW_VOL_DP
Definition: DevicePath.h:1146
#define MSG_MAC_ADDR_DP
Definition: DevicePath.h:550
#define ACPI_DP
Definition: DevicePath.h:195
#define MSG_FIBRECHANNELEX_DP
Definition: DevicePath.h:382
#define ACPI_EXTENDED_DP
Definition: DevicePath.h:217
#define MSG_UART_DP
Definition: DevicePath.h:692
#define MSG_SATA_DP
Definition: DevicePath.h:510
#define MSG_VLAN_DP
Definition: DevicePath.h:964
#define MEDIA_RELATIVE_OFFSET_RANGE_DP
Definition: DevicePath.h:1162
#define MSG_USB_CLASS_DP
Definition: DevicePath.h:434
#define MSG_BLUETOOTH_LE_DP
Definition: DevicePath.h:1000
#define HW_PCI_DP
Definition: DevicePath.h:73
#define MSG_WIFI_DP
Definition: DevicePath.h:988
#define HW_MEMMAP_DP
Definition: DevicePath.h:109
#define MSG_1394_DP
Definition: DevicePath.h:402
#define MESSAGING_DEVICE_PATH
Definition: DevicePath.h:321
#define HW_CONTROLLER_DP
Definition: DevicePath.h:154
#define ACPI_ADR_DP
Definition: DevicePath.h:264
#define MEDIA_VENDOR_DP
Media vendor device path subtype.
Definition: DevicePath.h:1093
#define MSG_FIBRECHANNEL_DP
Definition: DevicePath.h:362
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextMediaPath(IN CHAR16 *TextDeviceNode)
CHAR16 * GetNextParamStr(IN OUT CHAR16 **List)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextFilePath(IN CHAR16 *TextDeviceNode)
UINTN Strtoi(IN CHAR16 *Str)
CHAR16 * GetParamByNodeName(IN CHAR16 *Str, IN CHAR16 *NodeName)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextSd(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromText1394(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * ConvertFromTextUsbClass(IN CHAR16 *TextDeviceNode, IN USB_CLASS_TEXT *UsbClassText)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextAcpiAdr(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVenVt100Plus(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbAudio(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbImage(IN CHAR16 *TextDeviceNode)
VOID StrToAscii(IN CHAR16 *Str, IN OUT CHAR8 **AsciiStr)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsb(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVirtualCd(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextGenericPath(IN UINT8 Type, IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextFv(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextPersistentVirtualCd(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbCDCControl(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextPcCard(IN CHAR16 *TextDeviceNode)
BOOLEAN IsHexStr(IN CHAR16 *Str)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextAcpiPath(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUfs(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVenVt100(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextPci(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibConvertTextToDeviceNode(IN CONST CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextMedia(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbMassStorage(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextPciRoot(IN CHAR16 *TextDeviceNode)
UINTN NetworkProtocolFromText(IN CHAR16 *Text)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUartFlowCtrl(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVenUtf8(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUri(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextHardwarePath(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextHD(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbPrinter(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextIPv4(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbHID(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextInfiniband(IN CHAR16 *TextDeviceNode)
CHAR16 * SplitStr(IN OUT CHAR16 **List, IN CHAR16 Separator)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextBBS(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVenMsg(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextScsi(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextNVMe(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextPersistentVirtualDisk(IN CHAR16 *TextDeviceNode)
VOID Strtoi64(IN CHAR16 *Str, OUT UINT64 *Data)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI UefiDevicePathLibConvertTextToDevicePath(IN CONST CHAR16 *TextDevicePath)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextI2O(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUart(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbDiagnostic(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextAta(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVenMedia(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextBluetoothLE(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVirtualDisk(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextRelativeOffsetRange(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextBmc(IN CHAR16 *TextDeviceNode)
UINT32 EisaIdFromText(IN CHAR16 *Text)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbWireless(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextSAS(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextBluetooth(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextDebugPort(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextAcpi(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextDns(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextMemoryMapped(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbSmartCard(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * ConvertFromTextAcpi(IN CHAR16 *TextDeviceNode, IN UINT32 PnPId)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextRamDisk(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * ConvertFromTextVendor(IN CHAR16 *TextDeviceNode, IN UINT8 Type, IN UINT8 SubType)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbVideo(IN CHAR16 *TextDeviceNode)
CHAR16 * GetNextDeviceNodeStr(IN OUT CHAR16 **DevicePath, OUT BOOLEAN *IsInstanceEnd)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVenHw(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextCtrl(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbClass(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextFibre(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextKeyboard(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextAcpiExp(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextCDROM(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbTestAndMeasurement(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextFloppy(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVenPcAnsi(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextBbsPath(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextiSCSI(IN CHAR16 *TextDeviceNode)
CHAR16 * UefiDevicePathLibStrDuplicate(IN CONST CHAR16 *Src)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextWiFi(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextEmmc(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbIrdaBridge(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextAcpiEx(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbCDCData(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextFibreEx(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextMAC(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextPath(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbDeviceFirmwareUpdate(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbWwid(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextIPv6(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUsbHub(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextParallelPort(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextUnit(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextFvFile(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextMsg(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextPcieRoot(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextSata(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextSasEx(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextVlan(IN CHAR16 *TextDeviceNode)
EFI_DEVICE_PATH_PROTOCOL * DevPathFromTextSerial(IN CHAR16 *TextDeviceNode)
UINT16 EFIAPI SetDevicePathNodeLength(IN OUT VOID *Node, IN UINTN Length)
UINTN EFIAPI DevicePathNodeLength(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathNode(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI CreateDeviceNode(IN UINT8 NodeType, IN UINT8 NodeSubType, IN UINT16 NodeLength)
VOID EFIAPI SetDevicePathEndNode(OUT VOID *Node)
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define GLOBAL_REMOVE_IF_UNREFERENCED
Definition: Base.h:48
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
UINT8 PrimarySecondary
Definition: DevicePath.h:332
UINT8 Address[6]
Definition: Bluetooth.h:22
BLUETOOTH_ADDRESS BD_ADDR
Definition: DevicePath.h:982
UINT8 BaseAddress[8]
Definition: DevicePath.h:184
UINT8 InterfaceType
Definition: DevicePath.h:180
EFI_IP_ADDRESS DnsServerIp[]
Definition: DevicePath.h:873
Definition: Base.h:213
EFI_IPv4_ADDRESS GatewayIpAddress
Definition: DevicePath.h:597
EFI_IPv4_ADDRESS SubnetMask
Definition: DevicePath.h:601
BOOLEAN StaticIpAddress
Definition: DevicePath.h:593
EFI_IPv4_ADDRESS LocalIpAddress
Definition: DevicePath.h:572
EFI_IPv4_ADDRESS RemoteIpAddress
Definition: DevicePath.h:576
EFI_IPv6_ADDRESS LocalIpAddress
Definition: DevicePath.h:613
UINT8 IpAddressOrigin
Definition: DevicePath.h:637
EFI_IPv6_ADDRESS RemoteIpAddress
Definition: DevicePath.h:617
EFI_IPv6_ADDRESS GatewayIpAddress
Definition: DevicePath.h:645
EFI_MAC_ADDRESS MacAddress
Definition: DevicePath.h:556
EFI_PHYSICAL_ADDRESS StartingAddress
Definition: DevicePath.h:123
EFI_PHYSICAL_ADDRESS EndingAddress
Definition: DevicePath.h:127
UINT16 RelativeTargetPort
Definition: DevicePath.h:803
EFI_GUID Guid
Definition: DevicePath.h:783
UINT64 SasAddress
Definition: DevicePath.h:791
UINT16 DeviceTopology
Definition: DevicePath.h:799
UINT16 DeviceTopology
Definition: DevicePath.h:823
UINT8 SasAddress[8]
Definition: DevicePath.h:815
UINT16 RelativeTargetPort
Definition: DevicePath.h:827
UINT16 PortMultiplierPortNumber
Definition: DevicePath.h:523
UINT16 HBAPortNumber
Definition: DevicePath.h:517
UINT8 InterfaceNumber
Definition: DevicePath.h:428
UINT8 ParentPortNumber
Definition: DevicePath.h:424
UINT8 SSId[32]
Definition: DevicePath.h:994