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