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