]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/DevicePath.h
Add the detailed descriptions for the structure data member in these protocol.
[mirror_edk2.git] / MdePkg / Include / Protocol / DevicePath.h
1 /** @file
2 The device path protocol as defined in UEFI 2.0.
3
4 The device path represents a programatic path to a device. It's the view
5 from a software point of view. It also 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 - 2008, Intel Corporation
9 All rights reserved. This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. 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
24 ///
25 /// Device Path protocol
26 ///
27 #define EFI_DEVICE_PATH_PROTOCOL_GUID \
28 { \
29 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
30 }
31
32 ///
33 /// Device Path guid definition for backward-compatible with EFI1.1.
34 ///
35 #define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
36
37 #pragma pack(1)
38
39 /**
40 This protocol can be used on any device handle to obtain generic path/location
41 information concerning the physical device or logical device. If the handle does
42 not logically map to a physical device, the handle may not necessarily support
43 the device path protocol. The device path describes the location of the device
44 the handle is for. The size of the Device Path can be determined from the structures
45 that make up the Device Path.
46 **/
47 typedef struct {
48 UINT8 Type; ///< 0x01 Hardware Device Path
49 ///< 0x02 ACPI Device Path
50 ///< 0x03 Messaging Device Path
51 ///< 0x04 Media Device Path
52 ///< 0x05 BIOS Boot Specification Device Path
53 ///< 0x7F End of Hardware Device Path
54
55 UINT8 SubType; ///< Varies by Type
56 ///< 0xFF End Entire Device Path, or
57 ///< 0x01 End This Instance of a Device Path and start a new
58 ///< Device Path
59
60 UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
61 ///< type of data. Size of data is included in Length.
62
63 } EFI_DEVICE_PATH_PROTOCOL;
64
65 ///
66 /// Device Path protocol definition for backward-compatible with EFI1.1.
67 ///
68 typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;
69
70 ///
71 /// Hardware Device Paths
72 ///
73 #define HARDWARE_DEVICE_PATH 0x01
74
75 ///
76 /// PCI Device Path SubType
77 ///
78 #define HW_PCI_DP 0x01
79
80 ///
81 /// PCI Device Path
82 ///
83 typedef struct {
84 EFI_DEVICE_PATH_PROTOCOL Header;
85 ///
86 /// PCI Function Number
87 ///
88 UINT8 Function;
89 ///
90 /// PCI Device Number
91 ///
92 UINT8 Device;
93 } PCI_DEVICE_PATH;
94
95 ///
96 /// PCCARD Device Path SubType
97 ///
98 #define HW_PCCARD_DP 0x02
99
100 ///
101 /// PCCARD Device Path
102 ///
103 typedef struct {
104 EFI_DEVICE_PATH_PROTOCOL Header;
105 ///
106 /// Function Number (0 = First Function)
107 ///
108 UINT8 FunctionNumber;
109 } PCCARD_DEVICE_PATH;
110
111 ///
112 /// Memory Mapped Device Path SubType
113 ///
114 #define HW_MEMMAP_DP 0x03
115
116 ///
117 /// Memory Mapped Device Path
118 ///
119 typedef struct {
120 EFI_DEVICE_PATH_PROTOCOL Header;
121 ///
122 /// EFI_MEMORY_TYPE
123 ///
124 UINT32 MemoryType;
125 ///
126 /// Starting Memory Address.
127 ///
128 EFI_PHYSICAL_ADDRESS StartingAddress;
129 ///
130 /// Ending Memory Address
131 ///
132 EFI_PHYSICAL_ADDRESS EndingAddress;
133 } MEMMAP_DEVICE_PATH;
134
135 ///
136 /// Hardware Vendor Device Path SubType
137 ///
138 #define HW_VENDOR_DP 0x04
139
140 ///
141 /// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
142 /// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the
143 /// contents on the n bytes that follow in the Vendor Device Path node.
144 ///
145 typedef struct {
146 EFI_DEVICE_PATH_PROTOCOL Header;
147 ///
148 /// Vendor-assigned GUID that defines the data that follows.
149 ///
150 EFI_GUID Guid;
151 ///
152 /// Vendor-defined variable size data.
153 ///
154 } VENDOR_DEVICE_PATH;
155
156 ///
157 /// Controller Device Path SubType
158 ///
159 #define HW_CONTROLLER_DP 0x05
160
161 ///
162 /// Controller Device Path
163 ///
164 typedef struct {
165 EFI_DEVICE_PATH_PROTOCOL Header;
166 ///
167 /// Controller number.
168 ///
169 UINT32 ControllerNumber;
170 } CONTROLLER_DEVICE_PATH;
171
172 ///
173 /// ACPI Device Paths
174 ///
175 #define ACPI_DEVICE_PATH 0x02
176
177 ///
178 /// ACPI Device Path SubType
179 ///
180 #define ACPI_DP 0x01
181 typedef struct {
182 EFI_DEVICE_PATH_PROTOCOL Header;
183 ///
184 /// Device's PnP hardware ID stored in a numeric 32-bit
185 /// compressed EISA-type ID. This value must match the
186 /// corresponding _HID in the ACPI name space.
187 ///
188 UINT32 HID;
189 ///
190 /// Unique ID that is required by ACPI if two devices have the
191 /// same _HID. This value must also match the corresponding
192 /// _UID/_HID pair in the ACPI name space. Only the 32-bit
193 /// numeric value type of _UID is supported; thus strings must
194 /// not be used for the _UID in the ACPI name space.
195 ///
196 UINT32 UID;
197 } ACPI_HID_DEVICE_PATH;
198
199 ///
200 /// Expanded ACPI Device Path SubType
201 ///
202 #define ACPI_EXTENDED_DP 0x02
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.
215 ///
216 UINT32 UID;
217 ///
218 /// Device's compatible PnP hardware ID stored in a numeric
219 /// 32-bit compressed EISA-type ID. This value must match at
220 /// least one of the compatible device IDs returned by the
221 /// corresponding _CID in the ACPI name space.
222 ///
223 UINT32 CID;
224 ///
225 /// Optional variable length _HIDSTR
226 /// Optional variable length _UIDSTR
227 /// Optional variable length _CIDSTR
228 ///
229 } ACPI_EXTENDED_HID_DEVICE_PATH;
230
231 //
232 // EISA ID Macro
233 // EISA ID Definition 32-bits
234 // bits[15:0] - three character compressed ASCII EISA ID.
235 // bits[31:16] - binary number
236 // Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
237 //
238 #define PNP_EISA_ID_CONST 0x41d0
239 #define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16))
240 #define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
241 #define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
242
243 #define PNP_EISA_ID_MASK 0xffff
244 #define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
245
246 ///
247 /// ACPI _ADR Device Path SubType
248 ///
249 #define ACPI_ADR_DP 0x03
250
251 ///
252 /// The _ADR device path is used to contain video output device attributes to support the Graphics
253 /// Output Protocol. The device path can contain multiple _ADR entries if multiple video output
254 /// devices are displaying the same output.
255 ///
256 typedef struct {
257 EFI_DEVICE_PATH_PROTOCOL Header;
258 ///
259 /// _ADR value. For video output devices the value of this
260 /// field comes from Table B-2 ACPI 3.0 specification. At
261 /// least one _ADR value is required.
262 ///
263 UINT32 ADR;
264 //
265 // This device path may optionally contain more than one _ADR entry.
266 //
267 } ACPI_ADR_DEVICE_PATH;
268
269 #define ACPI_ADR_DISPLAY_TYPE_OTHER 0
270 #define ACPI_ADR_DISPLAY_TYPE_VGA 1
271 #define ACPI_ADR_DISPLAY_TYPE_TV 2
272 #define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3
273 #define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4
274
275 #define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
276 ((UINT32)( (((_DeviceIdScheme) & 0x1) << 31) | \
277 (((_HeadId) & 0x7) << 18) | \
278 (((_NonVgaOutput) & 0x1) << 17) | \
279 (((_BiosCanDetect) & 0x1) << 16) | \
280 (((_VendorInfo) & 0xf) << 12) | \
281 (((_Type) & 0xf) << 8) | \
282 (((_Port) & 0xf) << 4) | \
283 ((_Index) & 0xf) ))
284
285 ///
286 /// Messaging Device Paths
287 /// This Device Path is used to describe the connection of devices outside the resource domain of the
288 /// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
289 /// information like networking protocol IP addresses.
290 ///
291 #define MESSAGING_DEVICE_PATH 0x03
292
293 ///
294 /// ATAPI Device Path SubType
295 ///
296 #define MSG_ATAPI_DP 0x01
297 typedef struct {
298 EFI_DEVICE_PATH_PROTOCOL Header;
299 ///
300 /// Set to zero for primary or one for secondary
301 ///
302 UINT8 PrimarySecondary;
303 ///
304 /// Set to zero for master or one for slave mode
305 ///
306 UINT8 SlaveMaster;
307 ///
308 /// Logical Unit Number
309 ///
310 UINT16 Lun;
311 } ATAPI_DEVICE_PATH;
312
313 ///
314 /// SCSI Device Path SubType
315 ///
316 #define MSG_SCSI_DP 0x02
317 typedef struct {
318 EFI_DEVICE_PATH_PROTOCOL Header;
319 ///
320 /// Target ID on the SCSI bus (PUN)
321 ///
322 UINT16 Pun;
323 ///
324 /// Logical Unit Number (LUN)
325 ///
326 UINT16 Lun;
327 } SCSI_DEVICE_PATH;
328
329 ///
330 /// Fibre Channel SubType
331 ///
332 #define MSG_FIBRECHANNEL_DP 0x03
333 typedef struct {
334 EFI_DEVICE_PATH_PROTOCOL Header;
335 ///
336 /// Reserved for the future.
337 ///
338 UINT32 Reserved;
339 ///
340 /// Fibre Channel World Wide Number.
341 ///
342 UINT64 WWN;
343 ///
344 /// Fibre Channel Logical Unit Number.
345 ///
346 UINT64 Lun;
347 } FIBRECHANNEL_DEVICE_PATH;
348
349 ///
350 /// 1394 Device Path SubType
351 ///
352 #define MSG_1394_DP 0x04
353 typedef struct {
354 EFI_DEVICE_PATH_PROTOCOL Header;
355 ///
356 /// Reserved for the future.
357 ///
358 UINT32 Reserved;
359 ///
360 /// 1394 Global Unique ID (GUID).
361 ///
362 UINT64 Guid;
363 } F1394_DEVICE_PATH;
364
365 ///
366 /// USB Device Path SubType
367 ///
368 #define MSG_USB_DP 0x05
369 typedef struct {
370 EFI_DEVICE_PATH_PROTOCOL Header;
371 ///
372 /// USB Parent Port Number
373 ///
374 UINT8 ParentPortNumber;
375 ///
376 /// USB Interface Number
377 ///
378 UINT8 InterfaceNumber;
379 } USB_DEVICE_PATH;
380
381 ///
382 /// USB Class Device Path SubType
383 ///
384 #define MSG_USB_CLASS_DP 0x0f
385 typedef struct {
386 EFI_DEVICE_PATH_PROTOCOL Header;
387 ///
388 /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
389 /// match any Vendor ID.
390 ///
391 UINT16 VendorId;
392 ///
393 /// Product ID assigned by USB-IF. A value of 0xFFFF will
394 /// match any Product ID.
395 ///
396 UINT16 ProductId;
397 ///
398 /// The class code assigned by the USB-IF. A value of 0xFF
399 /// will match any class code.
400 ///
401 UINT8 DeviceClass;
402 ///
403 /// The subclass code assigned by the USB-IF. A value of
404 /// 0xFF will match any subclass code.
405 ///
406 UINT8 DeviceSubClass;
407 ///
408 /// The protocol code assigned by the USB-IF. A value of
409 /// 0xFF will match any protocol code.
410 ///
411 UINT8 DeviceProtocol;
412 } USB_CLASS_DEVICE_PATH;
413
414 ///
415 /// USB WWID Device Path SubType
416 ///
417 #define MSG_USB_WWID_DP 0x10
418
419 ///
420 /// This device path describes a USB device using its serial number.
421 ///
422 typedef struct {
423 EFI_DEVICE_PATH_PROTOCOL Header;
424 ///
425 /// USB interface number
426 ///
427 UINT16 InterfaceNumber;
428 ///
429 /// USB vendor id of the device
430 ///
431 UINT16 VendorId;
432 ///
433 /// USB product id of the device
434 ///
435 UINT16 ProductId;
436 ///
437 /// Last 64-or-fewer UTF-16 characters of the USB
438 /// serial number. The length of the string is
439 /// determined by the Length field less the offset of the
440 /// Serial Number field (10)
441 ///
442 /// CHAR16 SerialNumber[...];
443 } USB_WWID_DEVICE_PATH;
444
445 ///
446 /// Device Logical Unit SubType
447 ///
448 #define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
449 typedef struct {
450 EFI_DEVICE_PATH_PROTOCOL Header;
451 ///
452 /// Logical Unit Number for the interface
453 ///
454 UINT8 Lun;
455 } DEVICE_LOGICAL_UNIT_DEVICE_PATH;
456
457 ///
458 /// SATA Device Path SubType
459 ///
460 #define MSG_SATA_DP 0x12
461 typedef struct {
462 EFI_DEVICE_PATH_PROTOCOL Header;
463 ///
464 /// The HBA port number that facilitates the connection to the
465 /// device or a port multiplier. The value 0xFFFF is reserved.
466 ///
467 UINT16 HBAPortNumber;
468 ///
469 /// The Port multiplier port number that facilitates the connection
470 /// to the device. Bit 15 should be set if the device is directly
471 /// connected to the HBA.
472 ///
473 UINT16 PortMultiplierPortNumber;
474 ///
475 /// Logical Unit Number.
476 ///
477 UINT16 Lun;
478 } SATA_DEVICE_PATH;
479
480 ///
481 /// I2O Device Path SubType
482 ///
483 #define MSG_I2O_DP 0x06
484 typedef struct {
485 EFI_DEVICE_PATH_PROTOCOL Header;
486 ///
487 /// Target ID (TID) for a device
488 ///
489 UINT32 Tid;
490 } I2O_DEVICE_PATH;
491
492 ///
493 /// MAC Address Device Path SubType
494 ///
495 #define MSG_MAC_ADDR_DP 0x0b
496 typedef struct {
497 EFI_DEVICE_PATH_PROTOCOL Header;
498 ///
499 /// The MAC address for a network interface padded with 0s
500 ///
501 EFI_MAC_ADDRESS MacAddress;
502 ///
503 /// Network interface type(i.e. 802.3, FDDI).
504 ///
505 UINT8 IfType;
506 } MAC_ADDR_DEVICE_PATH;
507
508 ///
509 /// IPv4 Device Path SubType
510 ///
511 #define MSG_IPv4_DP 0x0c
512 typedef struct {
513 EFI_DEVICE_PATH_PROTOCOL Header;
514 ///
515 /// The local IPv4 address
516 ///
517 EFI_IPv4_ADDRESS LocalIpAddress;
518 ///
519 /// The remote IPv4 address
520 ///
521 EFI_IPv4_ADDRESS RemoteIpAddress;
522 ///
523 /// The local port number
524 ///
525 UINT16 LocalPort;
526 ///
527 /// The remote port number
528 ///
529 UINT16 RemotePort;
530 ///
531 /// The network protocol(i.e. UDP, TCP).
532 ///
533 UINT16 Protocol;
534 ///
535 /// 0x00 - The Source IP Address was assigned though DHCP
536 /// 0x01 - The Source IP Address is statically bound
537 ///
538 BOOLEAN StaticIpAddress;
539 } IPv4_DEVICE_PATH;
540
541 ///
542 /// IPv6 Device Path SubType
543 ///
544 #define MSG_IPv6_DP 0x0d
545 typedef struct {
546 EFI_DEVICE_PATH_PROTOCOL Header;
547 ///
548 /// The local IPv6 address
549 ///
550 EFI_IPv6_ADDRESS LocalIpAddress;
551 ///
552 /// The remote IPv6 address
553 ///
554 EFI_IPv6_ADDRESS RemoteIpAddress;
555 ///
556 /// The local port number
557 ///
558 UINT16 LocalPort;
559 ///
560 /// The remote port number
561 ///
562 UINT16 RemotePort;
563 ///
564 /// The network protocol(i.e. UDP, TCP).
565 ///
566 UINT16 Protocol;
567 ///
568 /// 0x00 - The Source IP Address was assigned though DHCP
569 /// 0x01 - The Source IP Address is statically bound
570 ///
571 BOOLEAN StaticIpAddress;
572 } IPv6_DEVICE_PATH;
573
574 ///
575 /// InfiniBand Device Path SubType
576 ///
577 #define MSG_INFINIBAND_DP 0x09
578 typedef struct {
579 EFI_DEVICE_PATH_PROTOCOL Header;
580 ///
581 /// Flags to help identify/manage InfiniBand device path elements:
582 /// Bit 0 - IOC/Service (0b = IOC, 1b = Service)
583 /// Bit 1 - Extend Boot Environment
584 /// Bit 2 - Console Protocol
585 /// Bit 3 - Storage Protocol
586 /// Bit 4 - Network Protocol
587 /// All other bits are reserved.
588 ///
589 UINT32 ResourceFlags;
590 ///
591 /// 128-bit Global Identifier for remote fabric port
592 ///
593 UINT8 PortGid[16];
594 ///
595 /// 64-bit unique identifier to remote IOC or server process.
596 /// Interpretation of field specified by Resource Flags (bit 0)
597 ///
598 UINT64 ServiceId;
599 ///
600 /// 64-bit persistent ID of remote IOC port
601 ///
602 UINT64 TargetPortId;
603 ///
604 /// 64-bit persistent ID of remote device
605 ///
606 UINT64 DeviceId;
607 } INFINIBAND_DEVICE_PATH;
608
609 #define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
610 #define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
611 #define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
612 #define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
613 #define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
614
615 ///
616 /// UART Device Path SubType
617 ///
618 #define MSG_UART_DP 0x0e
619 typedef struct {
620 EFI_DEVICE_PATH_PROTOCOL Header;
621 ///
622 /// Reserved
623 ///
624 UINT32 Reserved;
625 ///
626 /// The baud rate setting for the UART style device. A value of 0
627 /// means that the device's default baud rate will be used.
628 ///
629 UINT64 BaudRate;
630 ///
631 /// The number of data bits for the UART style device. A value
632 /// of 0 means that the device's default number of data bits will be used.
633 ///
634 UINT8 DataBits;
635 ///
636 /// The parity setting for the UART style device.
637 /// Parity 0x00 - Default Parity
638 /// Parity 0x01 - No Parity
639 /// Parity 0x02 - Even Parity
640 /// Parity 0x03 - Odd Parity
641 /// Parity 0x04 - Mark Parity
642 /// Parity 0x05 - Space Parity
643 ///
644 UINT8 Parity;
645 ///
646 /// The number of stop bits for the UART style device.
647 /// Stop Bits 0x00 - Default Stop Bits
648 /// Stop Bits 0x01 - 1 Stop Bit
649 /// Stop Bits 0x02 - 1.5 Stop Bits
650 /// Stop Bits 0x03 - 2 Stop Bits
651 ///
652 UINT8 StopBits;
653 } UART_DEVICE_PATH;
654
655 //
656 // Use VENDOR_DEVICE_PATH struct
657 //
658 #define MSG_VENDOR_DP 0x0a
659 typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;
660
661 #define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID
662 #define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID
663 #define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
664 #define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID
665
666 #define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL EFI_UART_DEVICE_PATH_GUID
667
668 ///
669 /// A new device path node is defined to declare flow control characteristics.
670 /// UART Flow Control Messaging Device Path
671 ///
672 typedef struct {
673 EFI_DEVICE_PATH_PROTOCOL Header;
674 ///
675 /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID
676 ///
677 EFI_GUID Guid;
678 ///
679 /// Bitmap of supported flow control types.
680 /// Bit 0 set indicates hardware flow control.
681 /// Bit 1 set indicates Xon/Xoff flow control.
682 /// All other bits are reserved and are clear.
683 ///
684 UINT32 FlowControlMap;
685 } UART_FLOW_CONTROL_DEVICE_PATH;
686
687 #define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID
688 ///
689 /// Serial Attached SCSI (SAS) devices.
690 ///
691 typedef struct {
692 EFI_DEVICE_PATH_PROTOCOL Header;
693 ///
694 /// DEVICE_PATH_MESSAGING_SAS GUID
695 ///
696 EFI_GUID Guid;
697 ///
698 /// Reserved for future use.
699 ///
700 UINT32 Reserved;
701 ///
702 /// SAS Address for Serial Attached SCSI Target.
703 ///
704 UINT64 SasAddress;
705 ///
706 /// SAS Logical Unit Number.
707 ///
708 UINT64 Lun;
709 ///
710 /// More Information about the device and its interconnect
711 ///
712 UINT16 DeviceTopology;
713 ///
714 /// Relative Target Port (RTP)
715 ///
716 UINT16 RelativeTargetPort;
717 } SAS_DEVICE_PATH;
718
719 ///
720 /// iSCSI Device Path SubType
721 ///
722 #define MSG_ISCSI_DP 0x13
723 typedef struct {
724 EFI_DEVICE_PATH_PROTOCOL Header;
725 ///
726 /// Network Protocol (0 = TCP, 1+ = reserved)
727 ///
728 UINT16 NetworkProtocol;
729 ///
730 /// iSCSI Login Options
731 ///
732 UINT16 LoginOption;
733 ///
734 /// iSCSI Logical Unit Number
735 ///
736 UINT64 Lun;
737 ///
738 /// iSCSI Target Portal group tag the initiator intends
739 /// to establish a session with.
740 ///
741 UINT16 TargetPortalGroupTag;
742 ///
743 /// iSCSI NodeTarget Name. The length of the name
744 /// is determined by subtracting the offset of this field from Length.
745 ///
746 /// CHAR8 iSCSI Target Name
747 } ISCSI_DEVICE_PATH;
748
749 #define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000
750 #define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002
751 #define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000
752 #define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008
753 #define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000
754 #define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000
755 #define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
756 #define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
757
758 //
759 // Media Device Path
760 //
761 #define MEDIA_DEVICE_PATH 0x04
762
763 ///
764 /// Hard Drive Media Device Path SubType
765 ///
766 #define MEDIA_HARDDRIVE_DP 0x01
767
768 ///
769 /// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
770 ///
771 typedef struct {
772 EFI_DEVICE_PATH_PROTOCOL Header;
773 ///
774 /// Describes the entry in a partition table, starting with entry 1.
775 /// Partition number zero represents the entire device. Valid
776 /// partition numbers for a MBR partition are [1, 4]. Valid
777 /// partition numbers for a GPT partition are [1,
778 /// NumberOfPartitionEntries].
779 ///
780 UINT32 PartitionNumber;
781 ///
782 /// Starting LBA of the partition on the hard drive
783 ///
784 UINT64 PartitionStart;
785 ///
786 /// Size of the partition in units of Logical Blocks
787 ///
788 UINT64 PartitionSize;
789 ///
790 /// Signature unique to this partition
791 ///
792 UINT8 Signature[16];
793 ///
794 /// Partition Format: (Unused values reserved)
795 /// 0x01 - PC-AT compatible legacy MBR
796 /// 0x02 - GUID Partition Table
797 ///
798 UINT8 MBRType;
799 ///
800 /// Type of Disk Signature: (Unused values reserved)
801 /// 0x00 - No Disk Signature.
802 /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
803 /// 0x02 - GUID signature.
804 ///
805 UINT8 SignatureType;
806 } HARDDRIVE_DEVICE_PATH;
807
808 #define MBR_TYPE_PCAT 0x01
809 #define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
810
811 #define NO_DISK_SIGNATURE 0x00
812 #define SIGNATURE_TYPE_MBR 0x01
813 #define SIGNATURE_TYPE_GUID 0x02
814
815 ///
816 /// CD-ROM Media Device Path SubType
817 ///
818 #define MEDIA_CDROM_DP 0x02
819
820 ///
821 /// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
822 ///
823 typedef struct {
824 EFI_DEVICE_PATH_PROTOCOL Header;
825 ///
826 /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
827 ///
828 UINT32 BootEntry;
829 ///
830 /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
831 ///
832 UINT64 PartitionStart;
833 ///
834 /// Size of the partition in units of Blocks, also called Sectors.
835 ///
836 UINT64 PartitionSize;
837 } CDROM_DEVICE_PATH;
838
839 //
840 // Use VENDOR_DEVICE_PATH struct
841 //
842 #define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype
843
844 ///
845 /// File Path Media Device Path SubType
846 ///
847 #define MEDIA_FILEPATH_DP 0x04
848 typedef struct {
849 EFI_DEVICE_PATH_PROTOCOL Header;
850 ///
851 /// A NULL-terminated Unicode Path string including directory and file names.
852 ///
853 CHAR16 PathName[1];
854 } FILEPATH_DEVICE_PATH;
855
856 #define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
857
858 ///
859 /// Media Protocol Device Path SubType
860 ///
861 #define MEDIA_PROTOCOL_DP 0x05
862
863 ///
864 /// The Media Protocol Device Path is used to denote the protocol that is being
865 /// used in a device path at the location of the path specified.
866 /// Many protocols are inherent to the style of device path.
867 ///
868 typedef struct {
869 EFI_DEVICE_PATH_PROTOCOL Header;
870 ///
871 /// The ID of the protocol.
872 ///
873 EFI_GUID Protocol;
874 } MEDIA_PROTOCOL_DEVICE_PATH;
875
876 ///
877 /// PIWG Firmware Volume Device Path SubType
878 ///
879 #define MEDIA_PIWG_FW_VOL_DP 0x7
880
881 ///
882 /// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
883 ///
884 typedef struct {
885 EFI_DEVICE_PATH_PROTOCOL Header;
886 ///
887 /// Firmware volume name.
888 ///
889 EFI_GUID FvName;
890 } MEDIA_FW_VOL_DEVICE_PATH;
891
892 ///
893 /// PIWG Firmware Volume Device Path SubType
894 ///
895 #define MEDIA_PIWG_FW_FILE_DP 0x6
896
897 ///
898 /// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
899 ///
900 typedef struct {
901 EFI_DEVICE_PATH_PROTOCOL Header;
902 ///
903 /// Firmware file name
904 ///
905 EFI_GUID FvFileName;
906 } MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
907
908 ///
909 /// BIOS Boot Specification Device Path
910 ///
911 #define BBS_DEVICE_PATH 0x05
912
913 ///
914 /// BIOS Boot Specification Device Path SubType
915 ///
916 #define BBS_BBS_DP 0x01
917
918 ///
919 /// This Device Path is used to describe the booting of non-EFI-aware operating systems.
920 ///
921 typedef struct {
922 EFI_DEVICE_PATH_PROTOCOL Header;
923 ///
924 /// Device Type as defined by the BIOS Boot Specification.
925 ///
926 UINT16 DeviceType;
927 ///
928 /// Status Flags as defined by the BIOS Boot Specification
929 ///
930 UINT16 StatusFlag;
931 ///
932 /// ASCIIZ string that describes the boot device to a user.
933 ///
934 CHAR8 String[1];
935 } BBS_BBS_DEVICE_PATH;
936
937 //
938 // DeviceType definitions - from BBS specification
939 //
940 #define BBS_TYPE_FLOPPY 0x01
941 #define BBS_TYPE_HARDDRIVE 0x02
942 #define BBS_TYPE_CDROM 0x03
943 #define BBS_TYPE_PCMCIA 0x04
944 #define BBS_TYPE_USB 0x05
945 #define BBS_TYPE_EMBEDDED_NETWORK 0x06
946 #define BBS_TYPE_BEV 0x80
947 #define BBS_TYPE_UNKNOWN 0xFF
948
949
950 ///
951 /// Union of all possible Device Paths and pointers to Device Paths
952 ///
953 typedef union {
954 EFI_DEVICE_PATH_PROTOCOL DevPath;
955 PCI_DEVICE_PATH Pci;
956 PCCARD_DEVICE_PATH PcCard;
957 MEMMAP_DEVICE_PATH MemMap;
958 VENDOR_DEVICE_PATH Vendor;
959
960 CONTROLLER_DEVICE_PATH Controller;
961 ACPI_HID_DEVICE_PATH Acpi;
962
963 ATAPI_DEVICE_PATH Atapi;
964 SCSI_DEVICE_PATH Scsi;
965 ISCSI_DEVICE_PATH Iscsi;
966 FIBRECHANNEL_DEVICE_PATH FibreChannel;
967
968 F1394_DEVICE_PATH F1394;
969 USB_DEVICE_PATH Usb;
970 SATA_DEVICE_PATH Sata;
971 USB_CLASS_DEVICE_PATH UsbClass;
972 I2O_DEVICE_PATH I2O;
973 MAC_ADDR_DEVICE_PATH MacAddr;
974 IPv4_DEVICE_PATH Ipv4;
975 IPv6_DEVICE_PATH Ipv6;
976 INFINIBAND_DEVICE_PATH InfiniBand;
977 UART_DEVICE_PATH Uart;
978
979 HARDDRIVE_DEVICE_PATH HardDrive;
980 CDROM_DEVICE_PATH CD;
981
982 FILEPATH_DEVICE_PATH FilePath;
983 MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
984
985 BBS_BBS_DEVICE_PATH Bbs;
986 } EFI_DEV_PATH;
987
988
989
990 typedef union {
991 EFI_DEVICE_PATH_PROTOCOL *DevPath;
992 PCI_DEVICE_PATH *Pci;
993 PCCARD_DEVICE_PATH *PcCard;
994 MEMMAP_DEVICE_PATH *MemMap;
995 VENDOR_DEVICE_PATH *Vendor;
996
997 CONTROLLER_DEVICE_PATH *Controller;
998 ACPI_HID_DEVICE_PATH *Acpi;
999 ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
1000
1001 ATAPI_DEVICE_PATH *Atapi;
1002 SCSI_DEVICE_PATH *Scsi;
1003 FIBRECHANNEL_DEVICE_PATH *FibreChannel;
1004
1005 F1394_DEVICE_PATH *F1394;
1006 USB_DEVICE_PATH *Usb;
1007 SATA_DEVICE_PATH *Sata;
1008 USB_CLASS_DEVICE_PATH *UsbClass;
1009 I2O_DEVICE_PATH *I2O;
1010 MAC_ADDR_DEVICE_PATH *MacAddr;
1011 IPv4_DEVICE_PATH *Ipv4;
1012 IPv6_DEVICE_PATH *Ipv6;
1013 INFINIBAND_DEVICE_PATH *InfiniBand;
1014 UART_DEVICE_PATH *Uart;
1015
1016 HARDDRIVE_DEVICE_PATH *HardDrive;
1017 CDROM_DEVICE_PATH *CD;
1018
1019 FILEPATH_DEVICE_PATH *FilePath;
1020 MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
1021
1022 BBS_BBS_DEVICE_PATH *Bbs;
1023 UINT8 *Raw;
1024 } EFI_DEV_PATH_PTR;
1025
1026 #pragma pack()
1027
1028 #define END_DEVICE_PATH_TYPE 0x7f
1029 #define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
1030 #define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
1031
1032 extern EFI_GUID gEfiDevicePathProtocolGuid;
1033
1034 #endif