Sync EDKII BaseTools to BaseTools project r1928
[mirror_edk2.git] / MdePkg / Include / Protocol / DevicePath.h
CommitLineData
d1f95000 1/** @file\r
8a7d75b0 2 The device path protocol as defined in UEFI 2.0.\r
959ccb23 3\r
630b4187 4 The device path represents a programmatic path to a device,\r
5 from a software point of view. The path must persist from boot to boot, so \r
d1f95000 6 it can not contain things like PCI bus numbers that change from boot to boot.\r
959ccb23 7\r
33b30a1e 8 Copyright (c) 2006 - 2009, Intel Corporation \r
d1f95000 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
959ccb23 13\r
d1f95000 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
959ccb23 16\r
959ccb23 17**/\r
18\r
d1f95000 19#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__\r
20#define __EFI_DEVICE_PATH_PROTOCOL_H__\r
21\r
b25e8149 22#include <Guid/PcAnsi.h>\r
23\r
99e8ed21 24///\r
25/// Device Path protocol\r
26///\r
d1f95000 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
959ccb23 31\r
99e8ed21 32///\r
9319d2c2 33/// Device Path guid definition for backward-compatible with EFI1.1.\r
99e8ed21 34///\r
a6508c05 35#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID\r
959ccb23 36\r
37#pragma pack(1)\r
38\r
2d824143 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
d1f95000 47typedef struct {\r
842a119d 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
2d824143 54 \r
55 UINT8 SubType; ///< Varies by Type\r
842a119d 56 ///< 0xFF End Entire Device Path, or\r
57 ///< 0x01 End This Instance of a Device Path and start a new\r
2d824143 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
d1f95000 63} EFI_DEVICE_PATH_PROTOCOL;\r
64\r
99e8ed21 65///\r
9319d2c2 66/// Device Path protocol definition for backward-compatible with EFI1.1.\r
99e8ed21 67/// \r
a6508c05 68typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;\r
69\r
99e8ed21 70///\r
71/// Hardware Device Paths\r
72///\r
959ccb23 73#define HARDWARE_DEVICE_PATH 0x01\r
74\r
f1004231 75///\r
f1409bb2 76/// PCI Device Path SubType\r
f1004231 77///\r
959ccb23 78#define HW_PCI_DP 0x01\r
f1409bb2 79\r
80///\r
81/// PCI Device Path\r
82///\r
959ccb23 83typedef struct {\r
84 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
85 ///\r
86 /// PCI Function Number\r
87 ///\r
959ccb23 88 UINT8 Function;\r
f1004231
LG
89 ///\r
90 /// PCI Device Number\r
91 ///\r
959ccb23 92 UINT8 Device;\r
93} PCI_DEVICE_PATH;\r
94\r
f1004231 95///\r
f1409bb2 96/// PCCARD Device Path SubType\r
f1004231 97///\r
959ccb23 98#define HW_PCCARD_DP 0x02\r
f1409bb2 99\r
100///\r
101/// PCCARD Device Path\r
102///\r
959ccb23 103typedef struct {\r
104 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
105 ///\r
106 /// Function Number (0 = First Function)\r
107 ///\r
959ccb23 108 UINT8 FunctionNumber;\r
109} PCCARD_DEVICE_PATH;\r
110\r
f1004231 111///\r
9319d2c2 112/// Memory Mapped Device Path SubType\r
f1004231 113///\r
959ccb23 114#define HW_MEMMAP_DP 0x03\r
9319d2c2
LG
115\r
116///\r
117/// Memory Mapped Device Path\r
118///\r
959ccb23 119typedef struct {\r
120 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
121 ///\r
122 /// EFI_MEMORY_TYPE\r
123 ///\r
959ccb23 124 UINT32 MemoryType;\r
f1004231
LG
125 ///\r
126 /// Starting Memory Address.\r
127 ///\r
959ccb23 128 EFI_PHYSICAL_ADDRESS StartingAddress;\r
f1004231
LG
129 ///\r
130 /// Ending Memory Address\r
131 ///\r
959ccb23 132 EFI_PHYSICAL_ADDRESS EndingAddress;\r
133} MEMMAP_DEVICE_PATH;\r
134\r
9319d2c2
LG
135///\r
136/// Hardware Vendor Device Path SubType\r
137///\r
138#define HW_VENDOR_DP 0x04\r
139\r
f1004231
LG
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
959ccb23 145typedef struct {\r
146 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
147 ///\r
148 /// Vendor-assigned GUID that defines the data that follows.\r
149 ///\r
959ccb23 150 EFI_GUID Guid;\r
f1004231
LG
151 ///\r
152 /// Vendor-defined variable size data.\r
153 ///\r
959ccb23 154} VENDOR_DEVICE_PATH;\r
155\r
f1004231 156///\r
9319d2c2 157/// Controller Device Path SubType\r
f1004231 158///\r
959ccb23 159#define HW_CONTROLLER_DP 0x05\r
9319d2c2
LG
160\r
161///\r
162/// Controller Device Path\r
163///\r
959ccb23 164typedef struct {\r
165 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
166 ///\r
167 /// Controller number.\r
168 ///\r
959ccb23 169 UINT32 ControllerNumber;\r
170} CONTROLLER_DEVICE_PATH;\r
171\r
99e8ed21 172///\r
9319d2c2 173/// ACPI Device Paths \r
99e8ed21 174///\r
959ccb23 175#define ACPI_DEVICE_PATH 0x02\r
176\r
f1004231 177///\r
9319d2c2 178/// ACPI Device Path SubType\r
f1004231 179///\r
959ccb23 180#define ACPI_DP 0x01\r
181typedef struct {\r
182 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
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
959ccb23 188 UINT32 HID;\r
f1004231
LG
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
959ccb23 196 UINT32 UID;\r
197} ACPI_HID_DEVICE_PATH;\r
198\r
f1004231 199///\r
9319d2c2 200/// Expanded ACPI Device Path SubType\r
f1004231 201///\r
959ccb23 202#define ACPI_EXTENDED_DP 0x02\r
203typedef struct {\r
204 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
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
959ccb23 210 UINT32 HID;\r
f1004231
LG
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
959ccb23 216 UINT32 UID;\r
f1004231 217 ///\r
cd2ed84a 218 /// Device's compatible PnP hardware ID stored in a numeric\r
f1004231
LG
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
959ccb23 223 UINT32 CID;\r
99e8ed21 224 ///\r
225 /// Optional variable length _HIDSTR\r
226 /// Optional variable length _UIDSTR\r
39099938 227 /// Optional variable length _CIDSTR\r
99e8ed21 228 ///\r
959ccb23 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
8b13229b 239#define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16))\r
959ccb23 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
9319d2c2
LG
246///\r
247/// ACPI _ADR Device Path SubType\r
248///\r
249#define ACPI_ADR_DP 0x03\r
959ccb23 250\r
f1004231
LG
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
959ccb23 256typedef struct {\r
257 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
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
959ccb23 263 UINT32 ADR;\r
9319d2c2
LG
264 //\r
265 // This device path may optionally contain more than one _ADR entry.\r
266 //\r
959ccb23 267} ACPI_ADR_DEVICE_PATH;\r
268\r
fbbe00ad 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
8b13229b 276 ((UINT32)( (((_DeviceIdScheme) & 0x1) << 31) | \\r
fbbe00ad 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
959ccb23 284\r
99e8ed21 285///\r
286/// Messaging Device Paths\r
f1004231
LG
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
99e8ed21 290///\r
959ccb23 291#define MESSAGING_DEVICE_PATH 0x03\r
292\r
f1004231 293///\r
9319d2c2 294/// ATAPI Device Path SubType\r
f1004231 295///\r
959ccb23 296#define MSG_ATAPI_DP 0x01\r
297typedef struct {\r
298 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
299 ///\r
300 /// Set to zero for primary or one for secondary\r
301 ///\r
959ccb23 302 UINT8 PrimarySecondary;\r
f1004231
LG
303 ///\r
304 /// Set to zero for master or one for slave mode\r
305 ///\r
959ccb23 306 UINT8 SlaveMaster;\r
f1004231
LG
307 ///\r
308 /// Logical Unit Number\r
309 ///\r
959ccb23 310 UINT16 Lun;\r
311} ATAPI_DEVICE_PATH;\r
312\r
f1004231 313///\r
9319d2c2 314/// SCSI Device Path SubType\r
f1004231 315///\r
959ccb23 316#define MSG_SCSI_DP 0x02\r
317typedef struct {\r
318 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
319 ///\r
320 /// Target ID on the SCSI bus (PUN)\r
321 ///\r
959ccb23 322 UINT16 Pun;\r
f1004231
LG
323 ///\r
324 /// Logical Unit Number (LUN)\r
325 ///\r
959ccb23 326 UINT16 Lun;\r
327} SCSI_DEVICE_PATH;\r
328\r
f1004231 329///\r
9319d2c2 330/// Fibre Channel SubType\r
f1004231 331///\r
959ccb23 332#define MSG_FIBRECHANNEL_DP 0x03\r
333typedef struct {\r
334 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
335 ///\r
336 /// Reserved for the future.\r
337 ///\r
959ccb23 338 UINT32 Reserved;\r
f1004231
LG
339 ///\r
340 /// Fibre Channel World Wide Number.\r
341 ///\r
959ccb23 342 UINT64 WWN;\r
f1004231
LG
343 ///\r
344 /// Fibre Channel Logical Unit Number.\r
345 ///\r
959ccb23 346 UINT64 Lun;\r
347} FIBRECHANNEL_DEVICE_PATH;\r
348\r
f1004231 349///\r
9319d2c2 350/// 1394 Device Path SubType\r
f1004231 351///\r
959ccb23 352#define MSG_1394_DP 0x04\r
353typedef struct {\r
354 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
355 ///\r
356 /// Reserved for the future.\r
357 ///\r
959ccb23 358 UINT32 Reserved;\r
f1004231
LG
359 ///\r
360 /// 1394 Global Unique ID (GUID).\r
361 ///\r
959ccb23 362 UINT64 Guid;\r
363} F1394_DEVICE_PATH;\r
364\r
f1004231 365///\r
9319d2c2 366/// USB Device Path SubType\r
f1004231 367///\r
959ccb23 368#define MSG_USB_DP 0x05\r
369typedef struct {\r
f1004231
LG
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
959ccb23 379} USB_DEVICE_PATH;\r
380\r
f1004231 381///\r
9319d2c2 382/// USB Class Device Path SubType\r
f1004231 383///\r
959ccb23 384#define MSG_USB_CLASS_DP 0x0f\r
385typedef struct {\r
f1004231
LG
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
959ccb23 412} USB_CLASS_DEVICE_PATH;\r
413\r
f1004231 414///\r
9319d2c2 415/// USB WWID Device Path SubType\r
f1004231 416///\r
959ccb23 417#define MSG_USB_WWID_DP 0x10\r
9319d2c2
LG
418\r
419///\r
420/// This device path describes a USB device using its serial number.\r
421///\r
959ccb23 422typedef struct {\r
f1004231
LG
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
959ccb23 443} USB_WWID_DEVICE_PATH;\r
444\r
f1004231 445///\r
9319d2c2 446/// Device Logical Unit SubType\r
f1004231 447///\r
959ccb23 448#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11\r
449typedef struct {\r
f1004231
LG
450 EFI_DEVICE_PATH_PROTOCOL Header;\r
451 ///\r
452 /// Logical Unit Number for the interface\r
453 ///\r
454 UINT8 Lun;\r
959ccb23 455} DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
456\r
f1004231 457///\r
9319d2c2 458/// SATA Device Path SubType\r
f1004231 459///\r
00edb218 460#define MSG_SATA_DP 0x12\r
959ccb23 461typedef struct {\r
00edb218 462 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
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
7d582d6b 467 UINT16 HBAPortNumber;\r
f1004231
LG
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
7d582d6b 473 UINT16 PortMultiplierPortNumber;\r
f1004231
LG
474 ///\r
475 /// Logical Unit Number.\r
476 ///\r
7d582d6b 477 UINT16 Lun;\r
959ccb23 478} SATA_DEVICE_PATH;\r
479\r
efb86b3a 480///\r
481/// Flag for if the device is directly connected to the HBA.\r
482///\r
483#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000\r
484\r
f1004231 485///\r
9319d2c2 486/// I2O Device Path SubType\r
f1004231 487///\r
959ccb23 488#define MSG_I2O_DP 0x06\r
489typedef struct {\r
490 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
491 ///\r
492 /// Target ID (TID) for a device\r
493 ///\r
959ccb23 494 UINT32 Tid;\r
495} I2O_DEVICE_PATH;\r
496\r
f1004231 497///\r
9319d2c2 498/// MAC Address Device Path SubType\r
f1004231 499///\r
959ccb23 500#define MSG_MAC_ADDR_DP 0x0b\r
501typedef struct {\r
502 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
503 ///\r
504 /// The MAC address for a network interface padded with 0s\r
505 ///\r
959ccb23 506 EFI_MAC_ADDRESS MacAddress;\r
f1004231
LG
507 ///\r
508 /// Network interface type(i.e. 802.3, FDDI).\r
509 ///\r
959ccb23 510 UINT8 IfType;\r
511} MAC_ADDR_DEVICE_PATH;\r
512\r
f1004231 513///\r
9319d2c2 514/// IPv4 Device Path SubType\r
f1004231 515///\r
959ccb23 516#define MSG_IPv4_DP 0x0c\r
517typedef struct {\r
518 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
519 ///\r
520 /// The local IPv4 address\r
521 ///\r
959ccb23 522 EFI_IPv4_ADDRESS LocalIpAddress;\r
f1004231
LG
523 ///\r
524 /// The remote IPv4 address\r
525 ///\r
959ccb23 526 EFI_IPv4_ADDRESS RemoteIpAddress;\r
f1004231
LG
527 ///\r
528 /// The local port number\r
529 ///\r
959ccb23 530 UINT16 LocalPort;\r
f1004231
LG
531 ///\r
532 /// The remote port number\r
533 ///\r
959ccb23 534 UINT16 RemotePort;\r
f1004231
LG
535 ///\r
536 /// The network protocol(i.e. UDP, TCP).\r
537 ///\r
959ccb23 538 UINT16 Protocol;\r
f1004231
LG
539 ///\r
540 /// 0x00 - The Source IP Address was assigned though DHCP\r
541 /// 0x01 - The Source IP Address is statically bound\r
542 ///\r
959ccb23 543 BOOLEAN StaticIpAddress;\r
544} IPv4_DEVICE_PATH;\r
545\r
f1004231 546///\r
9319d2c2 547/// IPv6 Device Path SubType\r
f1004231 548///\r
959ccb23 549#define MSG_IPv6_DP 0x0d\r
550typedef struct {\r
551 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
552 ///\r
553 /// The local IPv6 address\r
554 ///\r
959ccb23 555 EFI_IPv6_ADDRESS LocalIpAddress;\r
f1004231
LG
556 ///\r
557 /// The remote IPv6 address\r
558 ///\r
959ccb23 559 EFI_IPv6_ADDRESS RemoteIpAddress;\r
f1004231
LG
560 ///\r
561 /// The local port number\r
562 ///\r
959ccb23 563 UINT16 LocalPort;\r
f1004231
LG
564 ///\r
565 /// The remote port number\r
566 ///\r
959ccb23 567 UINT16 RemotePort;\r
f1004231
LG
568 ///\r
569 /// The network protocol(i.e. UDP, TCP).\r
570 ///\r
959ccb23 571 UINT16 Protocol;\r
f1004231
LG
572 ///\r
573 /// 0x00 - The Source IP Address was assigned though DHCP\r
574 /// 0x01 - The Source IP Address is statically bound\r
575 ///\r
959ccb23 576 BOOLEAN StaticIpAddress;\r
577} IPv6_DEVICE_PATH;\r
578\r
f1004231 579///\r
9319d2c2 580/// InfiniBand Device Path SubType\r
f1004231 581///\r
959ccb23 582#define MSG_INFINIBAND_DP 0x09\r
583typedef struct {\r
584 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
585 ///\r
586 /// Flags to help identify/manage InfiniBand device path elements:\r
cd2ed84a 587 /// Bit 0 - IOC/Service (0b = IOC, 1b = Service)\r
588 /// Bit 1 - Extend Boot Environment\r
589 /// Bit 2 - Console Protocol\r
590 /// Bit 3 - Storage Protocol\r
591 /// Bit 4 - Network Protocol\r
f1004231
LG
592 /// All other bits are reserved.\r
593 ///\r
959ccb23 594 UINT32 ResourceFlags;\r
f1004231
LG
595 ///\r
596 /// 128-bit Global Identifier for remote fabric port\r
597 ///\r
959ccb23 598 UINT8 PortGid[16];\r
f1004231
LG
599 ///\r
600 /// 64-bit unique identifier to remote IOC or server process.\r
601 /// Interpretation of field specified by Resource Flags (bit 0)\r
602 ///\r
959ccb23 603 UINT64 ServiceId;\r
f1004231
LG
604 ///\r
605 /// 64-bit persistent ID of remote IOC port\r
606 ///\r
959ccb23 607 UINT64 TargetPortId;\r
f1004231
LG
608 ///\r
609 /// 64-bit persistent ID of remote device\r
610 ///\r
959ccb23 611 UINT64 DeviceId;\r
612} INFINIBAND_DEVICE_PATH;\r
613\r
614#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01\r
615#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02\r
616#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04\r
617#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08\r
618#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10\r
619\r
f1004231 620///\r
9319d2c2 621/// UART Device Path SubType\r
f1004231 622///\r
959ccb23 623#define MSG_UART_DP 0x0e\r
624typedef struct {\r
625 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
626 ///\r
627 /// Reserved\r
628 ///\r
959ccb23 629 UINT32 Reserved;\r
f1004231
LG
630 ///\r
631 /// The baud rate setting for the UART style device. A value of 0\r
632 /// means that the device's default baud rate will be used.\r
633 ///\r
959ccb23 634 UINT64 BaudRate;\r
f1004231
LG
635 ///\r
636 /// The number of data bits for the UART style device. A value\r
637 /// of 0 means that the device's default number of data bits will be used.\r
638 ///\r
959ccb23 639 UINT8 DataBits;\r
f1004231
LG
640 ///\r
641 /// The parity setting for the UART style device.\r
642 /// Parity 0x00 - Default Parity\r
643 /// Parity 0x01 - No Parity\r
644 /// Parity 0x02 - Even Parity\r
645 /// Parity 0x03 - Odd Parity\r
646 /// Parity 0x04 - Mark Parity\r
647 /// Parity 0x05 - Space Parity\r
648 ///\r
959ccb23 649 UINT8 Parity;\r
f1004231
LG
650 ///\r
651 /// The number of stop bits for the UART style device.\r
652 /// Stop Bits 0x00 - Default Stop Bits\r
653 /// Stop Bits 0x01 - 1 Stop Bit\r
654 /// Stop Bits 0x02 - 1.5 Stop Bits\r
655 /// Stop Bits 0x03 - 2 Stop Bits\r
656 ///\r
959ccb23 657 UINT8 StopBits;\r
658} UART_DEVICE_PATH;\r
659\r
660//\r
661// Use VENDOR_DEVICE_PATH struct\r
662//\r
663#define MSG_VENDOR_DP 0x0a\r
00edb218 664typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;\r
959ccb23 665\r
666#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID\r
667#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID\r
668#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID\r
669#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID\r
670\r
f1004231
LG
671///\r
672/// A new device path node is defined to declare flow control characteristics.\r
673/// UART Flow Control Messaging Device Path\r
674///\r
959ccb23 675typedef struct {\r
676 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 677 ///\r
9319d2c2 678 /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID\r
f1004231 679 ///\r
959ccb23 680 EFI_GUID Guid;\r
f1004231
LG
681 ///\r
682 /// Bitmap of supported flow control types.\r
683 /// Bit 0 set indicates hardware flow control.\r
684 /// Bit 1 set indicates Xon/Xoff flow control.\r
685 /// All other bits are reserved and are clear.\r
686 ///\r
959ccb23 687 UINT32 FlowControlMap;\r
688} UART_FLOW_CONTROL_DEVICE_PATH;\r
689\r
9319d2c2 690#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID\r
f1004231
LG
691///\r
692/// Serial Attached SCSI (SAS) devices.\r
693///\r
959ccb23 694typedef struct {\r
695 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 696 ///\r
9319d2c2 697 /// DEVICE_PATH_MESSAGING_SAS GUID\r
f1004231 698 ///\r
959ccb23 699 EFI_GUID Guid;\r
f1004231
LG
700 ///\r
701 /// Reserved for future use.\r
702 ///\r
959ccb23 703 UINT32 Reserved;\r
f1004231
LG
704 ///\r
705 /// SAS Address for Serial Attached SCSI Target.\r
706 ///\r
959ccb23 707 UINT64 SasAddress;\r
f1004231
LG
708 ///\r
709 /// SAS Logical Unit Number.\r
710 ///\r
959ccb23 711 UINT64 Lun;\r
f1004231
LG
712 ///\r
713 /// More Information about the device and its interconnect\r
714 ///\r
959ccb23 715 UINT16 DeviceTopology;\r
f1004231
LG
716 ///\r
717 /// Relative Target Port (RTP)\r
718 ///\r
959ccb23 719 UINT16 RelativeTargetPort;\r
720} SAS_DEVICE_PATH;\r
721\r
f1004231 722///\r
9319d2c2 723/// iSCSI Device Path SubType\r
f1004231 724///\r
959ccb23 725#define MSG_ISCSI_DP 0x13\r
726typedef struct {\r
727 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
728 ///\r
729 /// Network Protocol (0 = TCP, 1+ = reserved)\r
730 ///\r
959ccb23 731 UINT16 NetworkProtocol;\r
f1004231
LG
732 ///\r
733 /// iSCSI Login Options\r
734 ///\r
959ccb23 735 UINT16 LoginOption;\r
f1004231
LG
736 ///\r
737 /// iSCSI Logical Unit Number\r
738 ///\r
ab2abe4c 739 UINT64 Lun;\r
f1004231
LG
740 ///\r
741 /// iSCSI Target Portal group tag the initiator intends\r
742 /// to establish a session with.\r
743 ///\r
959ccb23 744 UINT16 TargetPortalGroupTag;\r
f1004231
LG
745 ///\r
746 /// iSCSI NodeTarget Name. The length of the name\r
747 /// is determined by subtracting the offset of this field from Length.\r
748 ///\r
749 /// CHAR8 iSCSI Target Name\r
959ccb23 750} ISCSI_DEVICE_PATH;\r
751\r
752#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000\r
753#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002\r
754#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000\r
755#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008\r
756#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000\r
757#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000\r
758#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000\r
759#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000\r
760\r
8f97f911 761///\r
762/// VLAN Device Path SubType\r
763///\r
764#define MSG_VLAN_DP 0x14\r
765typedef struct {\r
766 EFI_DEVICE_PATH_PROTOCOL Header;\r
767 ///\r
768 /// VLAN identifier (0-4094)\r
769 ///\r
770 UINT16 VlanId;\r
771} VLAN_DEVICE_PATH;\r
772\r
959ccb23 773//\r
774// Media Device Path\r
775//\r
776#define MEDIA_DEVICE_PATH 0x04\r
777\r
f1004231 778///\r
9319d2c2 779/// Hard Drive Media Device Path SubType\r
f1004231 780///\r
959ccb23 781#define MEDIA_HARDDRIVE_DP 0x01\r
9319d2c2
LG
782\r
783///\r
784/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.\r
785///\r
959ccb23 786typedef struct {\r
787 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
788 ///\r
789 /// Describes the entry in a partition table, starting with entry 1.\r
790 /// Partition number zero represents the entire device. Valid\r
791 /// partition numbers for a MBR partition are [1, 4]. Valid\r
8e7b8fb4 792 /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].\r
f1004231 793 ///\r
959ccb23 794 UINT32 PartitionNumber;\r
f1004231
LG
795 ///\r
796 /// Starting LBA of the partition on the hard drive\r
797 ///\r
959ccb23 798 UINT64 PartitionStart;\r
f1004231
LG
799 ///\r
800 /// Size of the partition in units of Logical Blocks\r
801 ///\r
959ccb23 802 UINT64 PartitionSize;\r
f1004231 803 ///\r
8e7b8fb4 804 /// Signature unique to this partition:\r
805 /// If SignatureType is 0, this field has to be initialized with 16 zeros.\r
806 /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.\r
807 /// The other 12 bytes are initialized with zeros.\r
808 /// If SignatureType is 2, this field contains a 16 byte signature.\r
f1004231 809 ///\r
959ccb23 810 UINT8 Signature[16];\r
f1004231
LG
811 ///\r
812 /// Partition Format: (Unused values reserved)\r
cd2ed84a 813 /// 0x01 - PC-AT compatible legacy MBR\r
814 /// 0x02 - GUID Partition Table\r
f1004231 815 ///\r
959ccb23 816 UINT8 MBRType;\r
f1004231
LG
817 ///\r
818 /// Type of Disk Signature: (Unused values reserved)\r
cd2ed84a 819 /// 0x00 - No Disk Signature.\r
820 /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.\r
821 /// 0x02 - GUID signature.\r
f1004231 822 ///\r
959ccb23 823 UINT8 SignatureType;\r
824} HARDDRIVE_DEVICE_PATH;\r
825\r
826#define MBR_TYPE_PCAT 0x01\r
827#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02\r
828\r
f1004231 829#define NO_DISK_SIGNATURE 0x00\r
959ccb23 830#define SIGNATURE_TYPE_MBR 0x01\r
831#define SIGNATURE_TYPE_GUID 0x02\r
832\r
f1004231 833///\r
9319d2c2 834/// CD-ROM Media Device Path SubType\r
f1004231 835///\r
959ccb23 836#define MEDIA_CDROM_DP 0x02\r
9319d2c2
LG
837\r
838///\r
839/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.\r
840///\r
959ccb23 841typedef struct {\r
842 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
843 ///\r
844 /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.\r
845 ///\r
959ccb23 846 UINT32 BootEntry;\r
f1004231
LG
847 ///\r
848 /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.\r
849 ///\r
959ccb23 850 UINT64 PartitionStart;\r
f1004231
LG
851 ///\r
852 /// Size of the partition in units of Blocks, also called Sectors.\r
853 ///\r
959ccb23 854 UINT64 PartitionSize;\r
855} CDROM_DEVICE_PATH;\r
856\r
9319d2c2
LG
857//\r
858// Use VENDOR_DEVICE_PATH struct\r
859//\r
992f22b9 860#define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype\r
959ccb23 861\r
f1004231 862///\r
9319d2c2 863/// File Path Media Device Path SubType\r
f1004231 864///\r
959ccb23 865#define MEDIA_FILEPATH_DP 0x04\r
866typedef struct {\r
867 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 868 ///\r
fbf926ad 869 /// A NULL-terminated Path string including directory and file names.\r
f1004231 870 ///\r
959ccb23 871 CHAR16 PathName[1];\r
872} FILEPATH_DEVICE_PATH;\r
873\r
07636730 874#define SIZE_OF_FILEPATH_DEVICE_PATH OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)\r
959ccb23 875\r
9319d2c2
LG
876///\r
877/// Media Protocol Device Path SubType\r
878///\r
879#define MEDIA_PROTOCOL_DP 0x05\r
880\r
f1004231
LG
881///\r
882/// The Media Protocol Device Path is used to denote the protocol that is being \r
883/// used in a device path at the location of the path specified. \r
884/// Many protocols are inherent to the style of device path.\r
885///\r
959ccb23 886typedef struct {\r
887 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
888 ///\r
889 /// The ID of the protocol.\r
890 ///\r
959ccb23 891 EFI_GUID Protocol;\r
892} MEDIA_PROTOCOL_DEVICE_PATH;\r
893\r
f1004231 894///\r
9319d2c2 895/// PIWG Firmware Volume Device Path SubType\r
f1004231 896///\r
56bed2f4 897#define MEDIA_PIWG_FW_FILE_DP 0x06\r
9319d2c2
LG
898\r
899///\r
56bed2f4 900/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.\r
9319d2c2 901///\r
146332ae 902typedef struct {\r
903 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 904 ///\r
56bed2f4 905 /// Firmware file name\r
f1004231 906 ///\r
56bed2f4 907 EFI_GUID FvFileName;\r
908} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
959ccb23 909\r
f1004231 910///\r
9319d2c2 911/// PIWG Firmware Volume Device Path SubType\r
f1004231 912///\r
56bed2f4 913#define MEDIA_PIWG_FW_VOL_DP 0x07\r
9319d2c2
LG
914\r
915///\r
56bed2f4 916/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.\r
9319d2c2 917///\r
146332ae 918typedef struct {\r
919 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 920 ///\r
56bed2f4 921 /// Firmware volume name.\r
f1004231 922 ///\r
56bed2f4 923 EFI_GUID FvName;\r
924} MEDIA_FW_VOL_DEVICE_PATH;\r
959ccb23 925\r
deb7f094 926///\r
927/// Media relative offset range device path\r
928///\r
929#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08\r
930\r
931///\r
932/// Used to describe the offset range of media relative.\r
933///\r
934typedef struct {\r
935 EFI_DEVICE_PATH_PROTOCOL Header;\r
56bed2f4 936 UINT32 Reserved;\r
deb7f094 937 UINT64 StartingOffset;\r
938 UINT64 EndingOffset;\r
939} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;\r
940\r
f1004231 941///\r
f1004231
LG
942/// BIOS Boot Specification Device Path\r
943///\r
959ccb23 944#define BBS_DEVICE_PATH 0x05\r
9319d2c2
LG
945\r
946///\r
947/// BIOS Boot Specification Device Path SubType\r
948///\r
959ccb23 949#define BBS_BBS_DP 0x01\r
9319d2c2
LG
950\r
951///\r
952/// This Device Path is used to describe the booting of non-EFI-aware operating systems.\r
953///\r
959ccb23 954typedef struct {\r
955 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
956 ///\r
957 /// Device Type as defined by the BIOS Boot Specification.\r
958 ///\r
959ccb23 959 UINT16 DeviceType;\r
f1004231
LG
960 ///\r
961 /// Status Flags as defined by the BIOS Boot Specification\r
962 ///\r
959ccb23 963 UINT16 StatusFlag;\r
f1004231
LG
964 ///\r
965 /// ASCIIZ string that describes the boot device to a user. \r
966 ///\r
959ccb23 967 CHAR8 String[1];\r
968} BBS_BBS_DEVICE_PATH;\r
969\r
970//\r
971// DeviceType definitions - from BBS specification\r
972//\r
973#define BBS_TYPE_FLOPPY 0x01\r
974#define BBS_TYPE_HARDDRIVE 0x02\r
975#define BBS_TYPE_CDROM 0x03\r
976#define BBS_TYPE_PCMCIA 0x04\r
977#define BBS_TYPE_USB 0x05\r
978#define BBS_TYPE_EMBEDDED_NETWORK 0x06\r
979#define BBS_TYPE_BEV 0x80\r
980#define BBS_TYPE_UNKNOWN 0xFF\r
981\r
982\r
99e8ed21 983///\r
984/// Union of all possible Device Paths and pointers to Device Paths\r
985///\r
959ccb23 986typedef union {\r
987 EFI_DEVICE_PATH_PROTOCOL DevPath;\r
988 PCI_DEVICE_PATH Pci;\r
989 PCCARD_DEVICE_PATH PcCard;\r
990 MEMMAP_DEVICE_PATH MemMap;\r
991 VENDOR_DEVICE_PATH Vendor;\r
992\r
993 CONTROLLER_DEVICE_PATH Controller;\r
994 ACPI_HID_DEVICE_PATH Acpi;\r
995\r
996 ATAPI_DEVICE_PATH Atapi;\r
997 SCSI_DEVICE_PATH Scsi;\r
e3b1115e 998 ISCSI_DEVICE_PATH Iscsi;\r
959ccb23 999 FIBRECHANNEL_DEVICE_PATH FibreChannel;\r
1000\r
1001 F1394_DEVICE_PATH F1394;\r
1002 USB_DEVICE_PATH Usb;\r
1003 SATA_DEVICE_PATH Sata;\r
1004 USB_CLASS_DEVICE_PATH UsbClass;\r
1005 I2O_DEVICE_PATH I2O;\r
1006 MAC_ADDR_DEVICE_PATH MacAddr;\r
1007 IPv4_DEVICE_PATH Ipv4;\r
1008 IPv6_DEVICE_PATH Ipv6;\r
1009 INFINIBAND_DEVICE_PATH InfiniBand;\r
1010 UART_DEVICE_PATH Uart;\r
1011\r
1012 HARDDRIVE_DEVICE_PATH HardDrive;\r
1013 CDROM_DEVICE_PATH CD;\r
1014\r
1015 FILEPATH_DEVICE_PATH FilePath;\r
1016 MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;\r
deb7f094 1017 MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset;\r
959ccb23 1018\r
1019 BBS_BBS_DEVICE_PATH Bbs;\r
1020} EFI_DEV_PATH;\r
1021\r
1022\r
1023\r
1024typedef union {\r
1025 EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
1026 PCI_DEVICE_PATH *Pci;\r
1027 PCCARD_DEVICE_PATH *PcCard;\r
1028 MEMMAP_DEVICE_PATH *MemMap;\r
1029 VENDOR_DEVICE_PATH *Vendor;\r
1030\r
1031 CONTROLLER_DEVICE_PATH *Controller;\r
1032 ACPI_HID_DEVICE_PATH *Acpi;\r
1033 ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;\r
1034\r
1035 ATAPI_DEVICE_PATH *Atapi;\r
1036 SCSI_DEVICE_PATH *Scsi;\r
1037 FIBRECHANNEL_DEVICE_PATH *FibreChannel;\r
1038\r
1039 F1394_DEVICE_PATH *F1394;\r
1040 USB_DEVICE_PATH *Usb;\r
1041 SATA_DEVICE_PATH *Sata;\r
1042 USB_CLASS_DEVICE_PATH *UsbClass;\r
1043 I2O_DEVICE_PATH *I2O;\r
1044 MAC_ADDR_DEVICE_PATH *MacAddr;\r
1045 IPv4_DEVICE_PATH *Ipv4;\r
1046 IPv6_DEVICE_PATH *Ipv6;\r
1047 INFINIBAND_DEVICE_PATH *InfiniBand;\r
1048 UART_DEVICE_PATH *Uart;\r
1049\r
1050 HARDDRIVE_DEVICE_PATH *HardDrive;\r
1051 CDROM_DEVICE_PATH *CD;\r
1052\r
1053 FILEPATH_DEVICE_PATH *FilePath;\r
1054 MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;\r
deb7f094 1055 MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;\r
959ccb23 1056\r
1057 BBS_BBS_DEVICE_PATH *Bbs;\r
1058 UINT8 *Raw;\r
1059} EFI_DEV_PATH_PTR;\r
1060\r
1061#pragma pack()\r
d1f95000 1062 \r
d1f95000 1063#define END_DEVICE_PATH_TYPE 0x7f\r
e5dab016 1064#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF\r
1065#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01\r
d1f95000 1066\r
1067extern EFI_GUID gEfiDevicePathProtocolGuid;\r
959ccb23 1068\r
1069#endif\r