1 /** @file
2   The device path protocol as defined in UEFI 2.0.
3 
4   The device path represents a programmatic path to a device,
5   from a software point of view. The path must persist from boot to boot, so
6   it can not contain things like PCI bus numbers that change from boot to boot.
7 
8 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
9 This program and the accompanying materials are licensed and made available under
10 the terms and conditions of the BSD License that accompanies this distribution.
11 The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php.
13 
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 
17 **/
18 
19 #ifndef __EFI_DEVICE_PATH_PROTOCOL_H__
20 #define __EFI_DEVICE_PATH_PROTOCOL_H__
21 
22 FILE_LICENCE ( BSD3 );
23 
24 #include <ipxe/efi/Guid/PcAnsi.h>
25 #include <ipxe/efi/IndustryStandard/Bluetooth.h>
26 #include <ipxe/efi/IndustryStandard/Acpi60.h>
27 
28 ///
29 /// Device Path protocol.
30 ///
31 #define EFI_DEVICE_PATH_PROTOCOL_GUID \
32   { \
33     0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
34   }
35 
36 ///
37 /// Device Path guid definition for backward-compatible with EFI1.1.
38 ///
39 #define DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH_PROTOCOL_GUID
40 
41 #pragma pack(1)
42 
43 /**
44   This protocol can be used on any device handle to obtain generic path/location
45   information concerning the physical device or logical device. If the handle does
46   not logically map to a physical device, the handle may not necessarily support
47   the device path protocol. The device path describes the location of the device
48   the handle is for. The size of the Device Path can be determined from the structures
49   that make up the Device Path.
50 **/
51 typedef struct {
52   UINT8 Type;       ///< 0x01 Hardware Device Path.
53                     ///< 0x02 ACPI Device Path.
54                     ///< 0x03 Messaging Device Path.
55                     ///< 0x04 Media Device Path.
56                     ///< 0x05 BIOS Boot Specification Device Path.
57                     ///< 0x7F End of Hardware Device Path.
58 
59   UINT8 SubType;    ///< Varies by Type
60                     ///< 0xFF End Entire Device Path, or
61                     ///< 0x01 End This Instance of a Device Path and start a new
62                     ///< Device Path.
63 
64   UINT8 Length[2];  ///< Specific Device Path data. Type and Sub-Type define
65                     ///< type of data. Size of data is included in Length.
66 
67 } EFI_DEVICE_PATH_PROTOCOL;
68 
69 ///
70 /// Device Path protocol definition for backward-compatible with EFI1.1.
71 ///
72 typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;
73 
74 ///
75 /// Hardware Device Paths.
76 ///
77 #define HARDWARE_DEVICE_PATH      0x01
78 
79 ///
80 /// PCI Device Path SubType.
81 ///
82 #define HW_PCI_DP                 0x01
83 
84 ///
85 /// PCI Device Path.
86 ///
87 typedef struct {
88   EFI_DEVICE_PATH_PROTOCOL        Header;
89   ///
90   /// PCI Function Number.
91   ///
92   UINT8                           Function;
93   ///
94   /// PCI Device Number.
95   ///
96   UINT8                           Device;
97 } PCI_DEVICE_PATH;
98 
99 ///
100 /// PCCARD Device Path SubType.
101 ///
102 #define HW_PCCARD_DP              0x02
103 
104 ///
105 /// PCCARD Device Path.
106 ///
107 typedef struct {
108   EFI_DEVICE_PATH_PROTOCOL        Header;
109   ///
110   /// Function Number (0 = First Function).
111   ///
112   UINT8                           FunctionNumber;
113 } PCCARD_DEVICE_PATH;
114 
115 ///
116 /// Memory Mapped Device Path SubType.
117 ///
118 #define HW_MEMMAP_DP              0x03
119 
120 ///
121 /// Memory Mapped Device Path.
122 ///
123 typedef struct {
124   EFI_DEVICE_PATH_PROTOCOL        Header;
125   ///
126   /// EFI_MEMORY_TYPE
127   ///
128   UINT32                          MemoryType;
129   ///
130   /// Starting Memory Address.
131   ///
132   EFI_PHYSICAL_ADDRESS            StartingAddress;
133   ///
134   /// Ending Memory Address.
135   ///
136   EFI_PHYSICAL_ADDRESS            EndingAddress;
137 } MEMMAP_DEVICE_PATH;
138 
139 ///
140 /// Hardware Vendor Device Path SubType.
141 ///
142 #define HW_VENDOR_DP              0x04
143 
144 ///
145 /// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
146 /// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the
147 /// contents on the n bytes that follow in the Vendor Device Path node.
148 ///
149 typedef struct {
150   EFI_DEVICE_PATH_PROTOCOL        Header;
151   ///
152   /// Vendor-assigned GUID that defines the data that follows.
153   ///
154   EFI_GUID                        Guid;
155   ///
156   /// Vendor-defined variable size data.
157   ///
158 } VENDOR_DEVICE_PATH;
159 
160 ///
161 /// Controller Device Path SubType.
162 ///
163 #define HW_CONTROLLER_DP          0x05
164 
165 ///
166 /// Controller Device Path.
167 ///
168 typedef struct {
169   EFI_DEVICE_PATH_PROTOCOL        Header;
170   ///
171   /// Controller number.
172   ///
173   UINT32                          ControllerNumber;
174 } CONTROLLER_DEVICE_PATH;
175 
176 ///
177 /// BMC Device Path SubType.
178 ///
179 #define HW_BMC_DP                 0x06
180 
181 ///
182 /// BMC Device Path.
183 ///
184 typedef struct {
185   EFI_DEVICE_PATH_PROTOCOL        Header;
186   ///
187   /// Interface Type.
188   ///
189   UINT8                           InterfaceType;
190   ///
191   /// Base Address.
192   ///
193   UINT8                           BaseAddress[8];
194 } BMC_DEVICE_PATH;
195 
196 ///
197 /// ACPI Device Paths.
198 ///
199 #define ACPI_DEVICE_PATH          0x02
200 
201 ///
202 /// ACPI Device Path SubType.
203 ///
204 #define ACPI_DP                   0x01
205 typedef struct {
206   EFI_DEVICE_PATH_PROTOCOL        Header;
207   ///
208   /// Device's PnP hardware ID stored in a numeric 32-bit
209   /// compressed EISA-type ID. This value must match the
210   /// corresponding _HID in the ACPI name space.
211   ///
212   UINT32                          HID;
213   ///
214   /// Unique ID that is required by ACPI if two devices have the
215   /// same _HID. This value must also match the corresponding
216   /// _UID/_HID pair in the ACPI name space. Only the 32-bit
217   /// numeric value type of _UID is supported. Thus, strings must
218   /// not be used for the _UID in the ACPI name space.
219   ///
220   UINT32                          UID;
221 } ACPI_HID_DEVICE_PATH;
222 
223 ///
224 /// Expanded ACPI Device Path SubType.
225 ///
226 #define ACPI_EXTENDED_DP          0x02
227 typedef struct {
228   EFI_DEVICE_PATH_PROTOCOL        Header;
229   ///
230   /// Device's PnP hardware ID stored in a numeric 32-bit
231   /// compressed EISA-type ID. This value must match the
232   /// corresponding _HID in the ACPI name space.
233   ///
234   UINT32                          HID;
235   ///
236   /// Unique ID that is required by ACPI if two devices have the
237   /// same _HID. This value must also match the corresponding
238   /// _UID/_HID pair in the ACPI name space.
239   ///
240   UINT32                          UID;
241   ///
242   /// Device's compatible PnP hardware ID stored in a numeric
243   /// 32-bit compressed EISA-type ID. This value must match at
244   /// least one of the compatible device IDs returned by the
245   /// corresponding _CID in the ACPI name space.
246   ///
247   UINT32                          CID;
248   ///
249   /// Optional variable length _HIDSTR.
250   /// Optional variable length _UIDSTR.
251   /// Optional variable length _CIDSTR.
252   ///
253 } ACPI_EXTENDED_HID_DEVICE_PATH;
254 
255 //
256 //  EISA ID Macro
257 //  EISA ID Definition 32-bits
258 //   bits[15:0] - three character compressed ASCII EISA ID.
259 //   bits[31:16] - binary number
260 //    Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
261 //
262 #define PNP_EISA_ID_CONST         0x41d0
263 #define EISA_ID(_Name, _Num)      ((UINT32)((_Name) | (_Num) << 16))
264 #define EISA_PNP_ID(_PNPId)       (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
265 #define EFI_PNP_ID(_PNPId)        (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
266 
267 #define PNP_EISA_ID_MASK          0xffff
268 #define EISA_ID_TO_NUM(_Id)       ((_Id) >> 16)
269 
270 ///
271 /// ACPI _ADR Device Path SubType.
272 ///
273 #define ACPI_ADR_DP               0x03
274 
275 ///
276 /// The _ADR device path is used to contain video output device attributes to support the Graphics
277 /// Output Protocol. The device path can contain multiple _ADR entries if multiple video output
278 /// devices are displaying the same output.
279 ///
280 typedef struct {
281   EFI_DEVICE_PATH_PROTOCOL        Header;
282   ///
283   /// _ADR value. For video output devices the value of this
284   /// field comes from Table B-2 of the ACPI 3.0 specification. At
285   /// least one _ADR value is required.
286   ///
287   UINT32                          ADR;
288   //
289   // This device path may optionally contain more than one _ADR entry.
290   //
291 } ACPI_ADR_DEVICE_PATH;
292 
293 #define ACPI_ADR_DISPLAY_TYPE_OTHER             0
294 #define ACPI_ADR_DISPLAY_TYPE_VGA               1
295 #define ACPI_ADR_DISPLAY_TYPE_TV                2
296 #define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL  3
297 #define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL  4
298 
299 #define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
300           ((UINT32)(  ((UINT32)((_DeviceIdScheme) & 0x1) << 31) |  \
301                       (((_HeadId)                 & 0x7) << 18) |  \
302                       (((_NonVgaOutput)           & 0x1) << 17) |  \
303                       (((_BiosCanDetect)          & 0x1) << 16) |  \
304                       (((_VendorInfo)             & 0xf) << 12) |  \
305                       (((_Type)                   & 0xf) << 8)  |  \
306                       (((_Port)                   & 0xf) << 4)  |  \
307                        ((_Index)                  & 0xf) ))
308 
309 ///
310 /// Messaging Device Paths.
311 /// This Device Path is used to describe the connection of devices outside the resource domain of the
312 /// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
313 /// information like networking protocol IP addresses.
314 ///
315 #define MESSAGING_DEVICE_PATH     0x03
316 
317 ///
318 /// ATAPI Device Path SubType
319 ///
320 #define MSG_ATAPI_DP              0x01
321 typedef struct {
322   EFI_DEVICE_PATH_PROTOCOL        Header;
323   ///
324   /// Set to zero for primary, or one for secondary.
325   ///
326   UINT8                           PrimarySecondary;
327   ///
328   /// Set to zero for master, or one for slave mode.
329   ///
330   UINT8                           SlaveMaster;
331   ///
332   /// Logical Unit Number.
333   ///
334   UINT16                          Lun;
335 } ATAPI_DEVICE_PATH;
336 
337 ///
338 /// SCSI Device Path SubType.
339 ///
340 #define MSG_SCSI_DP               0x02
341 typedef struct {
342   EFI_DEVICE_PATH_PROTOCOL        Header;
343   ///
344   /// Target ID on the SCSI bus (PUN).
345   ///
346   UINT16                          Pun;
347   ///
348   /// Logical Unit Number (LUN).
349   ///
350   UINT16                          Lun;
351 } SCSI_DEVICE_PATH;
352 
353 ///
354 /// Fibre Channel SubType.
355 ///
356 #define MSG_FIBRECHANNEL_DP       0x03
357 typedef struct {
358   EFI_DEVICE_PATH_PROTOCOL        Header;
359   ///
360   /// Reserved for the future.
361   ///
362   UINT32                          Reserved;
363   ///
364   /// Fibre Channel World Wide Number.
365   ///
366   UINT64                          WWN;
367   ///
368   /// Fibre Channel Logical Unit Number.
369   ///
370   UINT64                          Lun;
371 } FIBRECHANNEL_DEVICE_PATH;
372 
373 ///
374 /// Fibre Channel Ex SubType.
375 ///
376 #define MSG_FIBRECHANNELEX_DP     0x15
377 typedef struct {
378   EFI_DEVICE_PATH_PROTOCOL        Header;
379   ///
380   /// Reserved for the future.
381   ///
382   UINT32                          Reserved;
383   ///
384   /// 8 byte array containing Fibre Channel End Device Port Name.
385   ///
386   UINT8                           WWN[8];
387   ///
388   /// 8 byte array containing Fibre Channel Logical Unit Number.
389   ///
390   UINT8                           Lun[8];
391 } FIBRECHANNELEX_DEVICE_PATH;
392 
393 ///
394 /// 1394 Device Path SubType
395 ///
396 #define MSG_1394_DP               0x04
397 typedef struct {
398   EFI_DEVICE_PATH_PROTOCOL        Header;
399   ///
400   /// Reserved for the future.
401   ///
402   UINT32                          Reserved;
403   ///
404   /// 1394 Global Unique ID (GUID).
405   ///
406   UINT64                          Guid;
407 } F1394_DEVICE_PATH;
408 
409 ///
410 /// USB Device Path SubType.
411 ///
412 #define MSG_USB_DP                0x05
413 typedef struct {
414   EFI_DEVICE_PATH_PROTOCOL      Header;
415   ///
416   /// USB Parent Port Number.
417   ///
418   UINT8                         ParentPortNumber;
419   ///
420   /// USB Interface Number.
421   ///
422   UINT8                         InterfaceNumber;
423 } USB_DEVICE_PATH;
424 
425 ///
426 /// USB Class Device Path SubType.
427 ///
428 #define MSG_USB_CLASS_DP          0x0f
429 typedef struct {
430   EFI_DEVICE_PATH_PROTOCOL      Header;
431   ///
432   /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
433   /// match any Vendor ID.
434   ///
435   UINT16                        VendorId;
436   ///
437   /// Product ID assigned by USB-IF. A value of 0xFFFF will
438   /// match any Product ID.
439   ///
440   UINT16                        ProductId;
441   ///
442   /// The class code assigned by the USB-IF. A value of 0xFF
443   /// will match any class code.
444   ///
445   UINT8                         DeviceClass;
446   ///
447   /// The subclass code assigned by the USB-IF. A value of
448   /// 0xFF will match any subclass code.
449   ///
450   UINT8                         DeviceSubClass;
451   ///
452   /// The protocol code assigned by the USB-IF. A value of
453   /// 0xFF will match any protocol code.
454   ///
455   UINT8                         DeviceProtocol;
456 } USB_CLASS_DEVICE_PATH;
457 
458 ///
459 /// USB WWID Device Path SubType.
460 ///
461 #define MSG_USB_WWID_DP           0x10
462 
463 ///
464 /// This device path describes a USB device using its serial number.
465 ///
466 typedef struct {
467   EFI_DEVICE_PATH_PROTOCOL      Header;
468   ///
469   /// USB interface number.
470   ///
471   UINT16                        InterfaceNumber;
472   ///
473   /// USB vendor id of the device.
474   ///
475   UINT16                        VendorId;
476   ///
477   /// USB product id of the device.
478   ///
479   UINT16                        ProductId;
480   ///
481   /// Last 64-or-fewer UTF-16 characters of the USB
482   /// serial number. The length of the string is
483   /// determined by the Length field less the offset of the
484   /// Serial Number field (10)
485   ///
486   /// CHAR16                     SerialNumber[...];
487 } USB_WWID_DEVICE_PATH;
488 
489 ///
490 /// Device Logical Unit SubType.
491 ///
492 #define MSG_DEVICE_LOGICAL_UNIT_DP  0x11
493 typedef struct {
494   EFI_DEVICE_PATH_PROTOCOL      Header;
495   ///
496   /// Logical Unit Number for the interface.
497   ///
498   UINT8                         Lun;
499 } DEVICE_LOGICAL_UNIT_DEVICE_PATH;
500 
501 ///
502 /// SATA Device Path SubType.
503 ///
504 #define MSG_SATA_DP               0x12
505 typedef struct {
506   EFI_DEVICE_PATH_PROTOCOL        Header;
507   ///
508   /// The HBA port number that facilitates the connection to the
509   /// device or a port multiplier. The value 0xFFFF is reserved.
510   ///
511   UINT16                          HBAPortNumber;
512   ///
513   /// The Port multiplier port number that facilitates the connection
514   /// to the device. Must be set to 0xFFFF if the device is directly
515   /// connected to the HBA.
516   ///
517   UINT16                          PortMultiplierPortNumber;
518   ///
519   /// Logical Unit Number.
520   ///
521   UINT16                          Lun;
522 } SATA_DEVICE_PATH;
523 
524 ///
525 /// Flag for if the device is directly connected to the HBA.
526 ///
527 #define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
528 
529 ///
530 /// I2O Device Path SubType.
531 ///
532 #define MSG_I2O_DP                0x06
533 typedef struct {
534   EFI_DEVICE_PATH_PROTOCOL        Header;
535   ///
536   /// Target ID (TID) for a device.
537   ///
538   UINT32                          Tid;
539 } I2O_DEVICE_PATH;
540 
541 ///
542 /// MAC Address Device Path SubType.
543 ///
544 #define MSG_MAC_ADDR_DP           0x0b
545 typedef struct {
546   EFI_DEVICE_PATH_PROTOCOL        Header;
547   ///
548   /// The MAC address for a network interface padded with 0s.
549   ///
550   EFI_MAC_ADDRESS                 MacAddress;
551   ///
552   /// Network interface type(i.e. 802.3, FDDI).
553   ///
554   UINT8                           IfType;
555 } MAC_ADDR_DEVICE_PATH;
556 
557 ///
558 /// IPv4 Device Path SubType
559 ///
560 #define MSG_IPv4_DP               0x0c
561 typedef struct {
562   EFI_DEVICE_PATH_PROTOCOL        Header;
563   ///
564   /// The local IPv4 address.
565   ///
566   EFI_IPv4_ADDRESS                LocalIpAddress;
567   ///
568   /// The remote IPv4 address.
569   ///
570   EFI_IPv4_ADDRESS                RemoteIpAddress;
571   ///
572   /// The local port number.
573   ///
574   UINT16                          LocalPort;
575   ///
576   /// The remote port number.
577   ///
578   UINT16                          RemotePort;
579   ///
580   /// The network protocol(i.e. UDP, TCP).
581   ///
582   UINT16                          Protocol;
583   ///
584   /// 0x00 - The Source IP Address was assigned though DHCP.
585   /// 0x01 - The Source IP Address is statically bound.
586   ///
587   BOOLEAN                         StaticIpAddress;
588   ///
589   /// The gateway IP address
590   ///
591   EFI_IPv4_ADDRESS                GatewayIpAddress;
592   ///
593   /// The subnet mask
594   ///
595   EFI_IPv4_ADDRESS                SubnetMask;
596 } IPv4_DEVICE_PATH;
597 
598 ///
599 /// IPv6 Device Path SubType.
600 ///
601 #define MSG_IPv6_DP               0x0d
602 typedef struct {
603   EFI_DEVICE_PATH_PROTOCOL        Header;
604   ///
605   /// The local IPv6 address.
606   ///
607   EFI_IPv6_ADDRESS                LocalIpAddress;
608   ///
609   /// The remote IPv6 address.
610   ///
611   EFI_IPv6_ADDRESS                RemoteIpAddress;
612   ///
613   /// The local port number.
614   ///
615   UINT16                          LocalPort;
616   ///
617   /// The remote port number.
618   ///
619   UINT16                          RemotePort;
620   ///
621   /// The network protocol(i.e. UDP, TCP).
622   ///
623   UINT16                          Protocol;
624   ///
625   /// 0x00 - The Local IP Address was manually configured.
626   /// 0x01 - The Local IP Address is assigned through IPv6
627   /// stateless auto-configuration.
628   /// 0x02 - The Local IP Address is assigned through IPv6
629   /// stateful configuration.
630   ///
631   UINT8                           IpAddressOrigin;
632   ///
633   /// The prefix length
634   ///
635   UINT8                           PrefixLength;
636   ///
637   /// The gateway IP address
638   ///
639   EFI_IPv6_ADDRESS                GatewayIpAddress;
640 } IPv6_DEVICE_PATH;
641 
642 ///
643 /// InfiniBand Device Path SubType.
644 ///
645 #define MSG_INFINIBAND_DP         0x09
646 typedef struct {
647   EFI_DEVICE_PATH_PROTOCOL        Header;
648   ///
649   /// Flags to help identify/manage InfiniBand device path elements:
650   /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).
651   /// Bit 1 - Extend Boot Environment.
652   /// Bit 2 - Console Protocol.
653   /// Bit 3 - Storage Protocol.
654   /// Bit 4 - Network Protocol.
655   /// All other bits are reserved.
656   ///
657   UINT32                          ResourceFlags;
658   ///
659   /// 128-bit Global Identifier for remote fabric port.
660   ///
661   UINT8                           PortGid[16];
662   ///
663   /// 64-bit unique identifier to remote IOC or server process.
664   /// Interpretation of field specified by Resource Flags (bit 0).
665   ///
666   UINT64                          ServiceId;
667   ///
668   /// 64-bit persistent ID of remote IOC port.
669   ///
670   UINT64                          TargetPortId;
671   ///
672   /// 64-bit persistent ID of remote device.
673   ///
674   UINT64                          DeviceId;
675 } INFINIBAND_DEVICE_PATH;
676 
677 #define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE                0x01
678 #define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT  0x02
679 #define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL           0x04
680 #define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL           0x08
681 #define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL           0x10
682 
683 ///
684 /// UART Device Path SubType.
685 ///
686 #define MSG_UART_DP               0x0e
687 typedef struct {
688   EFI_DEVICE_PATH_PROTOCOL        Header;
689   ///
690   /// Reserved.
691   ///
692   UINT32                          Reserved;
693   ///
694   /// The baud rate setting for the UART style device. A value of 0
695   /// means that the device's default baud rate will be used.
696   ///
697   UINT64                          BaudRate;
698   ///
699   /// The number of data bits for the UART style device. A value
700   /// of 0 means that the device's default number of data bits will be used.
701   ///
702   UINT8                           DataBits;
703   ///
704   /// The parity setting for the UART style device.
705   /// Parity 0x00 - Default Parity.
706   /// Parity 0x01 - No Parity.
707   /// Parity 0x02 - Even Parity.
708   /// Parity 0x03 - Odd Parity.
709   /// Parity 0x04 - Mark Parity.
710   /// Parity 0x05 - Space Parity.
711   ///
712   UINT8                           Parity;
713   ///
714   /// The number of stop bits for the UART style device.
715   /// Stop Bits 0x00 - Default Stop Bits.
716   /// Stop Bits 0x01 - 1 Stop Bit.
717   /// Stop Bits 0x02 - 1.5 Stop Bits.
718   /// Stop Bits 0x03 - 2 Stop Bits.
719   ///
720   UINT8                           StopBits;
721 } UART_DEVICE_PATH;
722 
723 //
724 // Use VENDOR_DEVICE_PATH struct
725 //
726 #define MSG_VENDOR_DP             0x0a
727 typedef VENDOR_DEVICE_PATH        VENDOR_DEFINED_DEVICE_PATH;
728 
729 #define DEVICE_PATH_MESSAGING_PC_ANSI     EFI_PC_ANSI_GUID
730 #define DEVICE_PATH_MESSAGING_VT_100      EFI_VT_100_GUID
731 #define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
732 #define DEVICE_PATH_MESSAGING_VT_UTF8     EFI_VT_UTF8_GUID
733 
734 ///
735 /// A new device path node is defined to declare flow control characteristics.
736 /// UART Flow Control Messaging Device Path
737 ///
738 typedef struct {
739   EFI_DEVICE_PATH_PROTOCOL        Header;
740   ///
741   /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
742   ///
743   EFI_GUID                        Guid;
744   ///
745   /// Bitmap of supported flow control types.
746   /// Bit 0 set indicates hardware flow control.
747   /// Bit 1 set indicates Xon/Xoff flow control.
748   /// All other bits are reserved and are clear.
749   ///
750   UINT32                          FlowControlMap;
751 } UART_FLOW_CONTROL_DEVICE_PATH;
752 
753 #define UART_FLOW_CONTROL_HARDWARE         0x00000001
754 #define UART_FLOW_CONTROL_XON_XOFF         0x00000010
755 
756 #define DEVICE_PATH_MESSAGING_SAS          EFI_SAS_DEVICE_PATH_GUID
757 ///
758 /// Serial Attached SCSI (SAS) Device Path.
759 ///
760 typedef struct {
761   EFI_DEVICE_PATH_PROTOCOL        Header;
762   ///
763   /// DEVICE_PATH_MESSAGING_SAS GUID.
764   ///
765   EFI_GUID                        Guid;
766   ///
767   /// Reserved for future use.
768   ///
769   UINT32                          Reserved;
770   ///
771   /// SAS Address for Serial Attached SCSI Target.
772   ///
773   UINT64                          SasAddress;
774   ///
775   /// SAS Logical Unit Number.
776   ///
777   UINT64                          Lun;
778   ///
779   /// More Information about the device and its interconnect.
780   ///
781   UINT16                          DeviceTopology;
782   ///
783   /// Relative Target Port (RTP).
784   ///
785   UINT16                          RelativeTargetPort;
786 } SAS_DEVICE_PATH;
787 
788 ///
789 /// Serial Attached SCSI (SAS) Ex Device Path SubType
790 ///
791 #define MSG_SASEX_DP              0x16
792 typedef struct {
793   EFI_DEVICE_PATH_PROTOCOL        Header;
794   ///
795   /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.
796   ///
797   UINT8                           SasAddress[8];
798   ///
799   /// 8-byte array of the SAS Logical Unit Number.
800   ///
801   UINT8                           Lun[8];
802   ///
803   /// More Information about the device and its interconnect.
804   ///
805   UINT16                          DeviceTopology;
806   ///
807   /// Relative Target Port (RTP).
808   ///
809   UINT16                          RelativeTargetPort;
810 } SASEX_DEVICE_PATH;
811 
812 ///
813 /// NvmExpress Namespace Device Path SubType.
814 ///
815 #define MSG_NVME_NAMESPACE_DP     0x17
816 typedef struct {
817   EFI_DEVICE_PATH_PROTOCOL        Header;
818   UINT32                          NamespaceId;
819   UINT64                          NamespaceUuid;
820 } NVME_NAMESPACE_DEVICE_PATH;
821 
822 ///
823 /// Uniform Resource Identifiers (URI) Device Path SubType
824 ///
825 #define MSG_URI_DP                0x18
826 typedef struct {
827   EFI_DEVICE_PATH_PROTOCOL        Header;
828   ///
829   /// Instance of the URI pursuant to RFC 3986.
830   ///
831   CHAR8                           Uri[];
832 } URI_DEVICE_PATH;
833 
834 ///
835 /// Universal Flash Storage (UFS) Device Path SubType.
836 ///
837 #define MSG_UFS_DP                0x19
838 typedef struct {
839   EFI_DEVICE_PATH_PROTOCOL        Header;
840   ///
841   /// Target ID on the UFS bus (PUN).
842   ///
843   UINT8                           Pun;
844   ///
845   /// Logical Unit Number (LUN).
846   ///
847   UINT8                           Lun;
848 } UFS_DEVICE_PATH;
849 
850 ///
851 /// SD (Secure Digital) Device Path SubType.
852 ///
853 #define MSG_SD_DP                 0x1A
854 typedef struct {
855   EFI_DEVICE_PATH_PROTOCOL        Header;
856   UINT8                           SlotNumber;
857 } SD_DEVICE_PATH;
858 
859 ///
860 /// EMMC (Embedded MMC) Device Path SubType.
861 ///
862 #define MSG_EMMC_DP                 0x1D
863 typedef struct {
864   EFI_DEVICE_PATH_PROTOCOL        Header;
865   UINT8                           SlotNumber;
866 } EMMC_DEVICE_PATH;
867 
868 ///
869 /// iSCSI Device Path SubType
870 ///
871 #define MSG_ISCSI_DP              0x13
872 typedef struct {
873   EFI_DEVICE_PATH_PROTOCOL        Header;
874   ///
875   /// Network Protocol (0 = TCP, 1+ = reserved).
876   ///
877   UINT16                          NetworkProtocol;
878   ///
879   /// iSCSI Login Options.
880   ///
881   UINT16                          LoginOption;
882   ///
883   /// iSCSI Logical Unit Number.
884   ///
885   UINT64                          Lun;
886   ///
887   /// iSCSI Target Portal group tag the initiator intends
888   /// to establish a session with.
889   ///
890   UINT16                          TargetPortalGroupTag;
891   ///
892   /// iSCSI NodeTarget Name. The length of the name
893   /// is determined by subtracting the offset of this field from Length.
894   ///
895   /// CHAR8                        iSCSI Target Name.
896 } ISCSI_DEVICE_PATH;
897 
898 #define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST             0x0000
899 #define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C   0x0002
900 #define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST               0x0000
901 #define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C     0x0008
902 #define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP              0x0000
903 #define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON               0x1000
904 #define ISCSI_LOGIN_OPTION_CHAP_BI                      0x0000
905 #define ISCSI_LOGIN_OPTION_CHAP_UNI                     0x2000
906 
907 ///
908 /// VLAN Device Path SubType.
909 ///
910 #define MSG_VLAN_DP               0x14
911 typedef struct {
912   EFI_DEVICE_PATH_PROTOCOL        Header;
913   ///
914   /// VLAN identifier (0-4094).
915   ///
916   UINT16                          VlanId;
917 } VLAN_DEVICE_PATH;
918 
919 ///
920 /// Bluetooth Device Path SubType.
921 ///
922 #define MSG_BLUETOOTH_DP     0x1b
923 typedef struct {
924   EFI_DEVICE_PATH_PROTOCOL        Header;
925   ///
926   /// 48bit Bluetooth device address.
927   ///
928   BLUETOOTH_ADDRESS               BD_ADDR;
929 } BLUETOOTH_DEVICE_PATH;
930 
931 ///
932 /// Wi-Fi Device Path SubType.
933 ///
934 #define MSG_WIFI_DP               0x1C
935 typedef struct {
936   EFI_DEVICE_PATH_PROTOCOL        Header;
937   ///
938   /// Service set identifier. A 32-byte octets string.
939   ///
940   UINT8                           SSId[32];
941 } WIFI_DEVICE_PATH;
942 
943 //
944 // Media Device Path
945 //
946 #define MEDIA_DEVICE_PATH         0x04
947 
948 ///
949 /// Hard Drive Media Device Path SubType.
950 ///
951 #define MEDIA_HARDDRIVE_DP        0x01
952 
953 ///
954 /// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
955 ///
956 typedef struct {
957   EFI_DEVICE_PATH_PROTOCOL        Header;
958   ///
959   /// Describes the entry in a partition table, starting with entry 1.
960   /// Partition number zero represents the entire device. Valid
961   /// partition numbers for a MBR partition are [1, 4]. Valid
962   /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
963   ///
964   UINT32                          PartitionNumber;
965   ///
966   /// Starting LBA of the partition on the hard drive.
967   ///
968   UINT64                          PartitionStart;
969   ///
970   /// Size of the partition in units of Logical Blocks.
971   ///
972   UINT64                          PartitionSize;
973   ///
974   /// Signature unique to this partition:
975   /// If SignatureType is 0, this field has to be initialized with 16 zeros.
976   /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.
977   /// The other 12 bytes are initialized with zeros.
978   /// If SignatureType is 2, this field contains a 16 byte signature.
979   ///
980   UINT8                           Signature[16];
981   ///
982   /// Partition Format: (Unused values reserved).
983   /// 0x01 - PC-AT compatible legacy MBR.
984   /// 0x02 - GUID Partition Table.
985   ///
986   UINT8                           MBRType;
987   ///
988   /// Type of Disk Signature: (Unused values reserved).
989   /// 0x00 - No Disk Signature.
990   /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
991   /// 0x02 - GUID signature.
992   ///
993   UINT8                           SignatureType;
994 } HARDDRIVE_DEVICE_PATH;
995 
996 #define MBR_TYPE_PCAT             0x01
997 #define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
998 
999 #define NO_DISK_SIGNATURE         0x00
1000 #define SIGNATURE_TYPE_MBR        0x01
1001 #define SIGNATURE_TYPE_GUID       0x02
1002 
1003 ///
1004 /// CD-ROM Media Device Path SubType.
1005 ///
1006 #define MEDIA_CDROM_DP            0x02
1007 
1008 ///
1009 /// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
1010 ///
1011 typedef struct {
1012   EFI_DEVICE_PATH_PROTOCOL        Header;
1013   ///
1014   /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
1015   ///
1016   UINT32                          BootEntry;
1017   ///
1018   /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
1019   ///
1020   UINT64                          PartitionStart;
1021   ///
1022   /// Size of the partition in units of Blocks, also called Sectors.
1023   ///
1024   UINT64                          PartitionSize;
1025 } CDROM_DEVICE_PATH;
1026 
1027 //
1028 // Use VENDOR_DEVICE_PATH struct
1029 //
1030 #define MEDIA_VENDOR_DP           0x03  ///< Media vendor device path subtype.
1031 
1032 ///
1033 /// File Path Media Device Path SubType
1034 ///
1035 #define MEDIA_FILEPATH_DP         0x04
1036 typedef struct {
1037   EFI_DEVICE_PATH_PROTOCOL        Header;
1038   ///
1039   /// A NULL-terminated Path string including directory and file names.
1040   ///
1041   CHAR16                          PathName[1];
1042 } FILEPATH_DEVICE_PATH;
1043 
1044 #define SIZE_OF_FILEPATH_DEVICE_PATH  OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)
1045 
1046 ///
1047 /// Media Protocol Device Path SubType.
1048 ///
1049 #define MEDIA_PROTOCOL_DP         0x05
1050 
1051 ///
1052 /// The Media Protocol Device Path is used to denote the protocol that is being
1053 /// used in a device path at the location of the path specified.
1054 /// Many protocols are inherent to the style of device path.
1055 ///
1056 typedef struct {
1057   EFI_DEVICE_PATH_PROTOCOL        Header;
1058   ///
1059   /// The ID of the protocol.
1060   ///
1061   EFI_GUID                        Protocol;
1062 } MEDIA_PROTOCOL_DEVICE_PATH;
1063 
1064 ///
1065 /// PIWG Firmware File SubType.
1066 ///
1067 #define MEDIA_PIWG_FW_FILE_DP     0x06
1068 
1069 ///
1070 /// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
1071 ///
1072 typedef struct {
1073   EFI_DEVICE_PATH_PROTOCOL        Header;
1074   ///
1075   /// Firmware file name
1076   ///
1077   EFI_GUID                        FvFileName;
1078 } MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
1079 
1080 ///
1081 /// PIWG Firmware Volume Device Path SubType.
1082 ///
1083 #define MEDIA_PIWG_FW_VOL_DP      0x07
1084 
1085 ///
1086 /// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
1087 ///
1088 typedef struct {
1089   EFI_DEVICE_PATH_PROTOCOL        Header;
1090   ///
1091   /// Firmware volume name.
1092   ///
1093   EFI_GUID                        FvName;
1094 } MEDIA_FW_VOL_DEVICE_PATH;
1095 
1096 ///
1097 /// Media relative offset range device path.
1098 ///
1099 #define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
1100 
1101 ///
1102 /// Used to describe the offset range of media relative.
1103 ///
1104 typedef struct {
1105   EFI_DEVICE_PATH_PROTOCOL  Header;
1106   UINT32                    Reserved;
1107   UINT64                    StartingOffset;
1108   UINT64                    EndingOffset;
1109 } MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
1110 
1111 ///
1112 /// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.
1113 ///
1114 #define EFI_VIRTUAL_DISK_GUID               EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE
1115 
1116 extern  EFI_GUID                            gEfiVirtualDiskGuid;
1117 
1118 ///
1119 /// This GUID defines a RAM Disk supporting an ISO image in volatile memory.
1120 ///
1121 #define EFI_VIRTUAL_CD_GUID                 EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE
1122 
1123 extern  EFI_GUID                            gEfiVirtualCdGuid;
1124 
1125 ///
1126 /// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.
1127 ///
1128 #define EFI_PERSISTENT_VIRTUAL_DISK_GUID    EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT
1129 
1130 extern  EFI_GUID                            gEfiPersistentVirtualDiskGuid;
1131 
1132 ///
1133 /// This GUID defines a RAM Disk supporting an ISO image in persistent memory.
1134 ///
1135 #define EFI_PERSISTENT_VIRTUAL_CD_GUID      EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT
1136 
1137 extern  EFI_GUID                            gEfiPersistentVirtualCdGuid;
1138 
1139 ///
1140 /// Media ram disk device path.
1141 ///
1142 #define MEDIA_RAM_DISK_DP         0x09
1143 
1144 ///
1145 /// Used to describe the ram disk device path.
1146 ///
1147 typedef struct {
1148   EFI_DEVICE_PATH_PROTOCOL        Header;
1149   ///
1150   /// Starting Memory Address.
1151   ///
1152   UINT32                          StartingAddr[2];
1153   ///
1154   /// Ending Memory Address.
1155   ///
1156   UINT32                          EndingAddr[2];
1157   ///
1158   /// GUID that defines the type of the RAM Disk.
1159   ///
1160   EFI_GUID                        TypeGuid;
1161   ///
1162   /// RAM Diskinstance number, if supported. The default value is zero.
1163   ///
1164   UINT16                          Instance;
1165 } MEDIA_RAM_DISK_DEVICE_PATH;
1166 
1167 ///
1168 /// BIOS Boot Specification Device Path.
1169 ///
1170 #define BBS_DEVICE_PATH           0x05
1171 
1172 ///
1173 /// BIOS Boot Specification Device Path SubType.
1174 ///
1175 #define BBS_BBS_DP                0x01
1176 
1177 ///
1178 /// This Device Path is used to describe the booting of non-EFI-aware operating systems.
1179 ///
1180 typedef struct {
1181   EFI_DEVICE_PATH_PROTOCOL        Header;
1182   ///
1183   /// Device Type as defined by the BIOS Boot Specification.
1184   ///
1185   UINT16                          DeviceType;
1186   ///
1187   /// Status Flags as defined by the BIOS Boot Specification.
1188   ///
1189   UINT16                          StatusFlag;
1190   ///
1191   /// Null-terminated ASCII string that describes the boot device to a user.
1192   ///
1193   CHAR8                           String[1];
1194 } BBS_BBS_DEVICE_PATH;
1195 
1196 //
1197 // DeviceType definitions - from BBS specification
1198 //
1199 #define BBS_TYPE_FLOPPY           0x01
1200 #define BBS_TYPE_HARDDRIVE        0x02
1201 #define BBS_TYPE_CDROM            0x03
1202 #define BBS_TYPE_PCMCIA           0x04
1203 #define BBS_TYPE_USB              0x05
1204 #define BBS_TYPE_EMBEDDED_NETWORK 0x06
1205 #define BBS_TYPE_BEV              0x80
1206 #define BBS_TYPE_UNKNOWN          0xFF
1207 
1208 
1209 ///
1210 /// Union of all possible Device Paths and pointers to Device Paths.
1211 ///
1212 typedef union {
1213   EFI_DEVICE_PATH_PROTOCOL                   DevPath;
1214   PCI_DEVICE_PATH                            Pci;
1215   PCCARD_DEVICE_PATH                         PcCard;
1216   MEMMAP_DEVICE_PATH                         MemMap;
1217   VENDOR_DEVICE_PATH                         Vendor;
1218 
1219   CONTROLLER_DEVICE_PATH                     Controller;
1220   BMC_DEVICE_PATH                            Bmc;
1221   ACPI_HID_DEVICE_PATH                       Acpi;
1222   ACPI_EXTENDED_HID_DEVICE_PATH              ExtendedAcpi;
1223   ACPI_ADR_DEVICE_PATH                       AcpiAdr;
1224 
1225   ATAPI_DEVICE_PATH                          Atapi;
1226   SCSI_DEVICE_PATH                           Scsi;
1227   ISCSI_DEVICE_PATH                          Iscsi;
1228   FIBRECHANNEL_DEVICE_PATH                   FibreChannel;
1229   FIBRECHANNELEX_DEVICE_PATH                 FibreChannelEx;
1230 
1231   F1394_DEVICE_PATH                          F1394;
1232   USB_DEVICE_PATH                            Usb;
1233   SATA_DEVICE_PATH                           Sata;
1234   USB_CLASS_DEVICE_PATH                      UsbClass;
1235   USB_WWID_DEVICE_PATH                       UsbWwid;
1236   DEVICE_LOGICAL_UNIT_DEVICE_PATH            LogicUnit;
1237   I2O_DEVICE_PATH                            I2O;
1238   MAC_ADDR_DEVICE_PATH                       MacAddr;
1239   IPv4_DEVICE_PATH                           Ipv4;
1240   IPv6_DEVICE_PATH                           Ipv6;
1241   VLAN_DEVICE_PATH                           Vlan;
1242   INFINIBAND_DEVICE_PATH                     InfiniBand;
1243   UART_DEVICE_PATH                           Uart;
1244   UART_FLOW_CONTROL_DEVICE_PATH              UartFlowControl;
1245   SAS_DEVICE_PATH                            Sas;
1246   SASEX_DEVICE_PATH                          SasEx;
1247   NVME_NAMESPACE_DEVICE_PATH                 NvmeNamespace;
1248   URI_DEVICE_PATH                            Uri;
1249   BLUETOOTH_DEVICE_PATH                      Bluetooth;
1250   WIFI_DEVICE_PATH                           WiFi;
1251   UFS_DEVICE_PATH                            Ufs;
1252   SD_DEVICE_PATH                             Sd;
1253   EMMC_DEVICE_PATH                           Emmc;
1254   HARDDRIVE_DEVICE_PATH                      HardDrive;
1255   CDROM_DEVICE_PATH                          CD;
1256 
1257   FILEPATH_DEVICE_PATH                       FilePath;
1258   MEDIA_PROTOCOL_DEVICE_PATH                 MediaProtocol;
1259 
1260   MEDIA_FW_VOL_DEVICE_PATH                   FirmwareVolume;
1261   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH          FirmwareFile;
1262   MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH    Offset;
1263   MEDIA_RAM_DISK_DEVICE_PATH                 RamDisk;
1264   BBS_BBS_DEVICE_PATH                        Bbs;
1265 } EFI_DEV_PATH;
1266 
1267 
1268 
1269 typedef union {
1270   EFI_DEVICE_PATH_PROTOCOL                   *DevPath;
1271   PCI_DEVICE_PATH                            *Pci;
1272   PCCARD_DEVICE_PATH                         *PcCard;
1273   MEMMAP_DEVICE_PATH                         *MemMap;
1274   VENDOR_DEVICE_PATH                         *Vendor;
1275 
1276   CONTROLLER_DEVICE_PATH                     *Controller;
1277   BMC_DEVICE_PATH                            *Bmc;
1278   ACPI_HID_DEVICE_PATH                       *Acpi;
1279   ACPI_EXTENDED_HID_DEVICE_PATH              *ExtendedAcpi;
1280   ACPI_ADR_DEVICE_PATH                       *AcpiAdr;
1281 
1282   ATAPI_DEVICE_PATH                          *Atapi;
1283   SCSI_DEVICE_PATH                           *Scsi;
1284   ISCSI_DEVICE_PATH                          *Iscsi;
1285   FIBRECHANNEL_DEVICE_PATH                   *FibreChannel;
1286   FIBRECHANNELEX_DEVICE_PATH                 *FibreChannelEx;
1287 
1288   F1394_DEVICE_PATH                          *F1394;
1289   USB_DEVICE_PATH                            *Usb;
1290   SATA_DEVICE_PATH                           *Sata;
1291   USB_CLASS_DEVICE_PATH                      *UsbClass;
1292   USB_WWID_DEVICE_PATH                       *UsbWwid;
1293   DEVICE_LOGICAL_UNIT_DEVICE_PATH            *LogicUnit;
1294   I2O_DEVICE_PATH                            *I2O;
1295   MAC_ADDR_DEVICE_PATH                       *MacAddr;
1296   IPv4_DEVICE_PATH                           *Ipv4;
1297   IPv6_DEVICE_PATH                           *Ipv6;
1298   VLAN_DEVICE_PATH                           *Vlan;
1299   INFINIBAND_DEVICE_PATH                     *InfiniBand;
1300   UART_DEVICE_PATH                           *Uart;
1301   UART_FLOW_CONTROL_DEVICE_PATH              *UartFlowControl;
1302   SAS_DEVICE_PATH                            *Sas;
1303   SASEX_DEVICE_PATH                          *SasEx;
1304   NVME_NAMESPACE_DEVICE_PATH                 *NvmeNamespace;
1305   URI_DEVICE_PATH                            *Uri;
1306   BLUETOOTH_DEVICE_PATH                      *Bluetooth;
1307   WIFI_DEVICE_PATH                           *WiFi;
1308   UFS_DEVICE_PATH                            *Ufs;
1309   SD_DEVICE_PATH                             *Sd;
1310   EMMC_DEVICE_PATH                           *Emmc;
1311   HARDDRIVE_DEVICE_PATH                      *HardDrive;
1312   CDROM_DEVICE_PATH                          *CD;
1313 
1314   FILEPATH_DEVICE_PATH                       *FilePath;
1315   MEDIA_PROTOCOL_DEVICE_PATH                 *MediaProtocol;
1316 
1317   MEDIA_FW_VOL_DEVICE_PATH                   *FirmwareVolume;
1318   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH          *FirmwareFile;
1319   MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH    *Offset;
1320   MEDIA_RAM_DISK_DEVICE_PATH                 *RamDisk;
1321   BBS_BBS_DEVICE_PATH                        *Bbs;
1322   UINT8                                      *Raw;
1323 } EFI_DEV_PATH_PTR;
1324 
1325 #pragma pack()
1326 
1327 #define END_DEVICE_PATH_TYPE                 0x7f
1328 #define END_ENTIRE_DEVICE_PATH_SUBTYPE       0xFF
1329 #define END_INSTANCE_DEVICE_PATH_SUBTYPE     0x01
1330 
1331 extern EFI_GUID gEfiDevicePathProtocolGuid;
1332 
1333 #endif
1334