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