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