]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DevicePath.h
MdePkg: Clean up source files
[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
9095d37b 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
9095d37b
LG
8Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9This program and the accompanying materials are licensed and made available under\r
10the terms and conditions of the BSD License that accompanies this distribution.\r
af2dc6a7 11The full text of the license may be found at\r
9095d37b
LG
12http://opensource.org/licenses/bsd-license.php.\r
13\r
14THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15WITHOUT 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
362c355c 23#include <IndustryStandard/Bluetooth.h>\r
6a46c1a2
FT
24#include <IndustryStandard/Acpi60.h>\r
25\r
99e8ed21 26///\r
af2dc6a7 27/// Device Path protocol.\r
99e8ed21 28///\r
d1f95000 29#define EFI_DEVICE_PATH_PROTOCOL_GUID \\r
30 { \\r
31 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
32 }\r
959ccb23 33\r
99e8ed21 34///\r
9319d2c2 35/// Device Path guid definition for backward-compatible with EFI1.1.\r
99e8ed21 36///\r
a6508c05 37#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID\r
959ccb23 38\r
39#pragma pack(1)\r
40\r
2d824143 41/**\r
9095d37b
LG
42 This protocol can be used on any device handle to obtain generic path/location\r
43 information concerning the physical device or logical device. If the handle does\r
44 not logically map to a physical device, the handle may not necessarily support\r
45 the device path protocol. The device path describes the location of the device\r
46 the handle is for. The size of the Device Path can be determined from the structures\r
2d824143 47 that make up the Device Path.\r
48**/\r
d1f95000 49typedef struct {\r
af2dc6a7 50 UINT8 Type; ///< 0x01 Hardware Device Path.\r
51 ///< 0x02 ACPI Device Path.\r
52 ///< 0x03 Messaging Device Path.\r
53 ///< 0x04 Media Device Path.\r
54 ///< 0x05 BIOS Boot Specification Device Path.\r
55 ///< 0x7F End of Hardware Device Path.\r
9095d37b 56\r
2d824143 57 UINT8 SubType; ///< Varies by Type\r
842a119d 58 ///< 0xFF End Entire Device Path, or\r
59 ///< 0x01 End This Instance of a Device Path and start a new\r
af2dc6a7 60 ///< Device Path.\r
9095d37b 61\r
2d824143 62 UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define\r
63 ///< type of data. Size of data is included in Length.\r
9095d37b 64\r
d1f95000 65} EFI_DEVICE_PATH_PROTOCOL;\r
66\r
99e8ed21 67///\r
9319d2c2 68/// Device Path protocol definition for backward-compatible with EFI1.1.\r
9095d37b 69///\r
a6508c05 70typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;\r
71\r
99e8ed21 72///\r
af2dc6a7 73/// Hardware Device Paths.\r
99e8ed21 74///\r
959ccb23 75#define HARDWARE_DEVICE_PATH 0x01\r
76\r
f1004231 77///\r
af2dc6a7 78/// PCI Device Path SubType.\r
f1004231 79///\r
959ccb23 80#define HW_PCI_DP 0x01\r
f1409bb2 81\r
82///\r
af2dc6a7 83/// PCI Device Path.\r
f1409bb2 84///\r
959ccb23 85typedef struct {\r
86 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 87 ///\r
af2dc6a7 88 /// PCI Function Number.\r
f1004231 89 ///\r
959ccb23 90 UINT8 Function;\r
f1004231 91 ///\r
af2dc6a7 92 /// PCI Device Number.\r
f1004231 93 ///\r
959ccb23 94 UINT8 Device;\r
95} PCI_DEVICE_PATH;\r
96\r
f1004231 97///\r
af2dc6a7 98/// PCCARD Device Path SubType.\r
f1004231 99///\r
959ccb23 100#define HW_PCCARD_DP 0x02\r
f1409bb2 101\r
102///\r
af2dc6a7 103/// PCCARD Device Path.\r
f1409bb2 104///\r
959ccb23 105typedef struct {\r
106 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 107 ///\r
af2dc6a7 108 /// Function Number (0 = First Function).\r
f1004231 109 ///\r
959ccb23 110 UINT8 FunctionNumber;\r
111} PCCARD_DEVICE_PATH;\r
112\r
f1004231 113///\r
af2dc6a7 114/// Memory Mapped Device Path SubType.\r
f1004231 115///\r
959ccb23 116#define HW_MEMMAP_DP 0x03\r
9319d2c2
LG
117\r
118///\r
af2dc6a7 119/// Memory Mapped Device Path.\r
9319d2c2 120///\r
959ccb23 121typedef struct {\r
122 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
123 ///\r
124 /// EFI_MEMORY_TYPE\r
125 ///\r
959ccb23 126 UINT32 MemoryType;\r
f1004231
LG
127 ///\r
128 /// Starting Memory Address.\r
129 ///\r
959ccb23 130 EFI_PHYSICAL_ADDRESS StartingAddress;\r
f1004231 131 ///\r
af2dc6a7 132 /// Ending Memory Address.\r
f1004231 133 ///\r
959ccb23 134 EFI_PHYSICAL_ADDRESS EndingAddress;\r
135} MEMMAP_DEVICE_PATH;\r
136\r
9319d2c2 137///\r
af2dc6a7 138/// Hardware Vendor Device Path SubType.\r
9319d2c2
LG
139///\r
140#define HW_VENDOR_DP 0x04\r
141\r
f1004231
LG
142///\r
143/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must\r
144/// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the\r
145/// contents on the n bytes that follow in the Vendor Device Path node.\r
146///\r
959ccb23 147typedef struct {\r
148 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
149 ///\r
150 /// Vendor-assigned GUID that defines the data that follows.\r
151 ///\r
959ccb23 152 EFI_GUID Guid;\r
f1004231
LG
153 ///\r
154 /// Vendor-defined variable size data.\r
155 ///\r
959ccb23 156} VENDOR_DEVICE_PATH;\r
157\r
f1004231 158///\r
af2dc6a7 159/// Controller Device Path SubType.\r
f1004231 160///\r
959ccb23 161#define HW_CONTROLLER_DP 0x05\r
9319d2c2
LG
162\r
163///\r
af2dc6a7 164/// Controller Device Path.\r
9319d2c2 165///\r
959ccb23 166typedef struct {\r
167 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
168 ///\r
169 /// Controller number.\r
170 ///\r
959ccb23 171 UINT32 ControllerNumber;\r
172} CONTROLLER_DEVICE_PATH;\r
173\r
624f017e
HW
174///\r
175/// BMC Device Path SubType.\r
176///\r
177#define HW_BMC_DP 0x06\r
178\r
179///\r
180/// BMC Device Path.\r
181///\r
182typedef struct {\r
183 EFI_DEVICE_PATH_PROTOCOL Header;\r
184 ///\r
185 /// Interface Type.\r
186 ///\r
187 UINT8 InterfaceType;\r
188 ///\r
189 /// Base Address.\r
190 ///\r
191 UINT8 BaseAddress[8];\r
192} BMC_DEVICE_PATH;\r
193\r
99e8ed21 194///\r
af2dc6a7 195/// ACPI Device Paths.\r
99e8ed21 196///\r
959ccb23 197#define ACPI_DEVICE_PATH 0x02\r
198\r
f1004231 199///\r
af2dc6a7 200/// ACPI Device Path SubType.\r
f1004231 201///\r
959ccb23 202#define ACPI_DP 0x01\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. Only the 32-bit\r
af2dc6a7 215 /// numeric value type of _UID is supported. Thus, strings must\r
f1004231
LG
216 /// not be used for the _UID in the ACPI name space.\r
217 ///\r
959ccb23 218 UINT32 UID;\r
219} ACPI_HID_DEVICE_PATH;\r
220\r
f1004231 221///\r
af2dc6a7 222/// Expanded ACPI Device Path SubType.\r
f1004231 223///\r
959ccb23 224#define ACPI_EXTENDED_DP 0x02\r
225typedef struct {\r
226 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
227 ///\r
228 /// Device's PnP hardware ID stored in a numeric 32-bit\r
229 /// compressed EISA-type ID. This value must match the\r
230 /// corresponding _HID in the ACPI name space.\r
231 ///\r
959ccb23 232 UINT32 HID;\r
f1004231
LG
233 ///\r
234 /// Unique ID that is required by ACPI if two devices have the\r
235 /// same _HID. This value must also match the corresponding\r
236 /// _UID/_HID pair in the ACPI name space.\r
237 ///\r
959ccb23 238 UINT32 UID;\r
f1004231 239 ///\r
cd2ed84a 240 /// Device's compatible PnP hardware ID stored in a numeric\r
f1004231
LG
241 /// 32-bit compressed EISA-type ID. This value must match at\r
242 /// least one of the compatible device IDs returned by the\r
243 /// corresponding _CID in the ACPI name space.\r
244 ///\r
959ccb23 245 UINT32 CID;\r
99e8ed21 246 ///\r
af2dc6a7 247 /// Optional variable length _HIDSTR.\r
248 /// Optional variable length _UIDSTR.\r
249 /// Optional variable length _CIDSTR.\r
99e8ed21 250 ///\r
959ccb23 251} ACPI_EXTENDED_HID_DEVICE_PATH;\r
252\r
253//\r
254// EISA ID Macro\r
255// EISA ID Definition 32-bits\r
256// bits[15:0] - three character compressed ASCII EISA ID.\r
257// bits[31:16] - binary number\r
258// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'\r
259//\r
260#define PNP_EISA_ID_CONST 0x41d0\r
8b13229b 261#define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16))\r
959ccb23 262#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
263#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
264\r
265#define PNP_EISA_ID_MASK 0xffff\r
266#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)\r
267\r
9319d2c2 268///\r
af2dc6a7 269/// ACPI _ADR Device Path SubType.\r
9319d2c2
LG
270///\r
271#define ACPI_ADR_DP 0x03\r
959ccb23 272\r
f1004231
LG
273///\r
274/// The _ADR device path is used to contain video output device attributes to support the Graphics\r
275/// Output Protocol. The device path can contain multiple _ADR entries if multiple video output\r
276/// devices are displaying the same output.\r
277///\r
959ccb23 278typedef struct {\r
279 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
280 ///\r
281 /// _ADR value. For video output devices the value of this\r
af2dc6a7 282 /// field comes from Table B-2 of the ACPI 3.0 specification. At\r
f1004231
LG
283 /// least one _ADR value is required.\r
284 ///\r
959ccb23 285 UINT32 ADR;\r
9319d2c2
LG
286 //\r
287 // This device path may optionally contain more than one _ADR entry.\r
288 //\r
959ccb23 289} ACPI_ADR_DEVICE_PATH;\r
290\r
fbbe00ad 291#define ACPI_ADR_DISPLAY_TYPE_OTHER 0\r
292#define ACPI_ADR_DISPLAY_TYPE_VGA 1\r
293#define ACPI_ADR_DISPLAY_TYPE_TV 2\r
294#define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3\r
295#define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4\r
296\r
297#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \\r
d3938cc8
MK
298 ((UINT32)( ((UINT32)((_DeviceIdScheme) & 0x1) << 31) | \\r
299 (((_HeadId) & 0x7) << 18) | \\r
300 (((_NonVgaOutput) & 0x1) << 17) | \\r
301 (((_BiosCanDetect) & 0x1) << 16) | \\r
302 (((_VendorInfo) & 0xf) << 12) | \\r
303 (((_Type) & 0xf) << 8) | \\r
304 (((_Port) & 0xf) << 4) | \\r
305 ((_Index) & 0xf) ))\r
959ccb23 306\r
99e8ed21 307///\r
af2dc6a7 308/// Messaging Device Paths.\r
f1004231
LG
309/// This Device Path is used to describe the connection of devices outside the resource domain of the\r
310/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract\r
311/// information like networking protocol IP addresses.\r
99e8ed21 312///\r
959ccb23 313#define MESSAGING_DEVICE_PATH 0x03\r
314\r
f1004231 315///\r
9319d2c2 316/// ATAPI Device Path SubType\r
f1004231 317///\r
959ccb23 318#define MSG_ATAPI_DP 0x01\r
319typedef struct {\r
320 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 321 ///\r
af2dc6a7 322 /// Set to zero for primary, or one for secondary.\r
f1004231 323 ///\r
959ccb23 324 UINT8 PrimarySecondary;\r
f1004231 325 ///\r
af2dc6a7 326 /// Set to zero for master, or one for slave mode.\r
f1004231 327 ///\r
959ccb23 328 UINT8 SlaveMaster;\r
f1004231 329 ///\r
af2dc6a7 330 /// Logical Unit Number.\r
f1004231 331 ///\r
959ccb23 332 UINT16 Lun;\r
333} ATAPI_DEVICE_PATH;\r
334\r
f1004231 335///\r
af2dc6a7 336/// SCSI Device Path SubType.\r
f1004231 337///\r
959ccb23 338#define MSG_SCSI_DP 0x02\r
339typedef struct {\r
340 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 341 ///\r
af2dc6a7 342 /// Target ID on the SCSI bus (PUN).\r
f1004231 343 ///\r
959ccb23 344 UINT16 Pun;\r
f1004231 345 ///\r
af2dc6a7 346 /// Logical Unit Number (LUN).\r
f1004231 347 ///\r
959ccb23 348 UINT16 Lun;\r
349} SCSI_DEVICE_PATH;\r
350\r
f1004231 351///\r
af2dc6a7 352/// Fibre Channel SubType.\r
f1004231 353///\r
959ccb23 354#define MSG_FIBRECHANNEL_DP 0x03\r
355typedef struct {\r
356 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
357 ///\r
358 /// Reserved for the future.\r
359 ///\r
959ccb23 360 UINT32 Reserved;\r
f1004231
LG
361 ///\r
362 /// Fibre Channel World Wide Number.\r
363 ///\r
959ccb23 364 UINT64 WWN;\r
f1004231
LG
365 ///\r
366 /// Fibre Channel Logical Unit Number.\r
367 ///\r
959ccb23 368 UINT64 Lun;\r
369} FIBRECHANNEL_DEVICE_PATH;\r
370\r
09e19629
RN
371///\r
372/// Fibre Channel Ex SubType.\r
373///\r
374#define MSG_FIBRECHANNELEX_DP 0x15\r
375typedef struct {\r
376 EFI_DEVICE_PATH_PROTOCOL Header;\r
377 ///\r
378 /// Reserved for the future.\r
379 ///\r
380 UINT32 Reserved;\r
381 ///\r
382 /// 8 byte array containing Fibre Channel End Device Port Name.\r
383 ///\r
384 UINT8 WWN[8];\r
385 ///\r
386 /// 8 byte array containing Fibre Channel Logical Unit Number.\r
387 ///\r
388 UINT8 Lun[8];\r
389} FIBRECHANNELEX_DEVICE_PATH;\r
390\r
f1004231 391///\r
9319d2c2 392/// 1394 Device Path SubType\r
f1004231 393///\r
959ccb23 394#define MSG_1394_DP 0x04\r
395typedef struct {\r
396 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
397 ///\r
398 /// Reserved for the future.\r
399 ///\r
959ccb23 400 UINT32 Reserved;\r
f1004231
LG
401 ///\r
402 /// 1394 Global Unique ID (GUID).\r
403 ///\r
959ccb23 404 UINT64 Guid;\r
405} F1394_DEVICE_PATH;\r
406\r
f1004231 407///\r
af2dc6a7 408/// USB Device Path SubType.\r
f1004231 409///\r
959ccb23 410#define MSG_USB_DP 0x05\r
411typedef struct {\r
f1004231
LG
412 EFI_DEVICE_PATH_PROTOCOL Header;\r
413 ///\r
af2dc6a7 414 /// USB Parent Port Number.\r
f1004231
LG
415 ///\r
416 UINT8 ParentPortNumber;\r
417 ///\r
af2dc6a7 418 /// USB Interface Number.\r
f1004231
LG
419 ///\r
420 UINT8 InterfaceNumber;\r
959ccb23 421} USB_DEVICE_PATH;\r
422\r
f1004231 423///\r
af2dc6a7 424/// USB Class Device Path SubType.\r
f1004231 425///\r
959ccb23 426#define MSG_USB_CLASS_DP 0x0f\r
427typedef struct {\r
f1004231
LG
428 EFI_DEVICE_PATH_PROTOCOL Header;\r
429 ///\r
430 /// Vendor ID assigned by USB-IF. A value of 0xFFFF will\r
431 /// match any Vendor ID.\r
432 ///\r
433 UINT16 VendorId;\r
434 ///\r
435 /// Product ID assigned by USB-IF. A value of 0xFFFF will\r
436 /// match any Product ID.\r
437 ///\r
438 UINT16 ProductId;\r
439 ///\r
440 /// The class code assigned by the USB-IF. A value of 0xFF\r
441 /// will match any class code.\r
442 ///\r
443 UINT8 DeviceClass;\r
444 ///\r
445 /// The subclass code assigned by the USB-IF. A value of\r
446 /// 0xFF will match any subclass code.\r
447 ///\r
448 UINT8 DeviceSubClass;\r
449 ///\r
450 /// The protocol code assigned by the USB-IF. A value of\r
451 /// 0xFF will match any protocol code.\r
452 ///\r
453 UINT8 DeviceProtocol;\r
959ccb23 454} USB_CLASS_DEVICE_PATH;\r
455\r
f1004231 456///\r
af2dc6a7 457/// USB WWID Device Path SubType.\r
f1004231 458///\r
959ccb23 459#define MSG_USB_WWID_DP 0x10\r
9319d2c2
LG
460\r
461///\r
462/// This device path describes a USB device using its serial number.\r
463///\r
959ccb23 464typedef struct {\r
f1004231
LG
465 EFI_DEVICE_PATH_PROTOCOL Header;\r
466 ///\r
af2dc6a7 467 /// USB interface number.\r
f1004231
LG
468 ///\r
469 UINT16 InterfaceNumber;\r
470 ///\r
af2dc6a7 471 /// USB vendor id of the device.\r
f1004231
LG
472 ///\r
473 UINT16 VendorId;\r
474 ///\r
af2dc6a7 475 /// USB product id of the device.\r
f1004231
LG
476 ///\r
477 UINT16 ProductId;\r
478 ///\r
479 /// Last 64-or-fewer UTF-16 characters of the USB\r
480 /// serial number. The length of the string is\r
481 /// determined by the Length field less the offset of the\r
482 /// Serial Number field (10)\r
483 ///\r
484 /// CHAR16 SerialNumber[...];\r
959ccb23 485} USB_WWID_DEVICE_PATH;\r
486\r
f1004231 487///\r
af2dc6a7 488/// Device Logical Unit SubType.\r
f1004231 489///\r
959ccb23 490#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11\r
491typedef struct {\r
f1004231
LG
492 EFI_DEVICE_PATH_PROTOCOL Header;\r
493 ///\r
af2dc6a7 494 /// Logical Unit Number for the interface.\r
f1004231
LG
495 ///\r
496 UINT8 Lun;\r
959ccb23 497} DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
498\r
f1004231 499///\r
af2dc6a7 500/// SATA Device Path SubType.\r
f1004231 501///\r
00edb218 502#define MSG_SATA_DP 0x12\r
959ccb23 503typedef struct {\r
00edb218 504 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
505 ///\r
506 /// The HBA port number that facilitates the connection to the\r
507 /// device or a port multiplier. The value 0xFFFF is reserved.\r
508 ///\r
7d582d6b 509 UINT16 HBAPortNumber;\r
f1004231
LG
510 ///\r
511 /// The Port multiplier port number that facilitates the connection\r
b87031be 512 /// to the device. Must be set to 0xFFFF if the device is directly\r
f1004231
LG
513 /// connected to the HBA.\r
514 ///\r
7d582d6b 515 UINT16 PortMultiplierPortNumber;\r
f1004231
LG
516 ///\r
517 /// Logical Unit Number.\r
518 ///\r
7d582d6b 519 UINT16 Lun;\r
959ccb23 520} SATA_DEVICE_PATH;\r
521\r
efb86b3a 522///\r
523/// Flag for if the device is directly connected to the HBA.\r
524///\r
525#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000\r
526\r
f1004231 527///\r
af2dc6a7 528/// I2O Device Path SubType.\r
f1004231 529///\r
959ccb23 530#define MSG_I2O_DP 0x06\r
531typedef struct {\r
532 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 533 ///\r
af2dc6a7 534 /// Target ID (TID) for a device.\r
f1004231 535 ///\r
959ccb23 536 UINT32 Tid;\r
537} I2O_DEVICE_PATH;\r
538\r
f1004231 539///\r
af2dc6a7 540/// MAC Address Device Path SubType.\r
f1004231 541///\r
959ccb23 542#define MSG_MAC_ADDR_DP 0x0b\r
543typedef struct {\r
544 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 545 ///\r
af2dc6a7 546 /// The MAC address for a network interface padded with 0s.\r
f1004231 547 ///\r
959ccb23 548 EFI_MAC_ADDRESS MacAddress;\r
f1004231
LG
549 ///\r
550 /// Network interface type(i.e. 802.3, FDDI).\r
551 ///\r
959ccb23 552 UINT8 IfType;\r
553} MAC_ADDR_DEVICE_PATH;\r
554\r
f1004231 555///\r
9319d2c2 556/// IPv4 Device Path SubType\r
f1004231 557///\r
959ccb23 558#define MSG_IPv4_DP 0x0c\r
559typedef struct {\r
560 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 561 ///\r
af2dc6a7 562 /// The local IPv4 address.\r
f1004231 563 ///\r
959ccb23 564 EFI_IPv4_ADDRESS LocalIpAddress;\r
f1004231 565 ///\r
af2dc6a7 566 /// The remote IPv4 address.\r
f1004231 567 ///\r
959ccb23 568 EFI_IPv4_ADDRESS RemoteIpAddress;\r
f1004231 569 ///\r
af2dc6a7 570 /// The local port number.\r
f1004231 571 ///\r
959ccb23 572 UINT16 LocalPort;\r
f1004231 573 ///\r
af2dc6a7 574 /// The remote port number.\r
f1004231 575 ///\r
959ccb23 576 UINT16 RemotePort;\r
f1004231
LG
577 ///\r
578 /// The network protocol(i.e. UDP, TCP).\r
579 ///\r
959ccb23 580 UINT16 Protocol;\r
f1004231 581 ///\r
af2dc6a7 582 /// 0x00 - The Source IP Address was assigned though DHCP.\r
583 /// 0x01 - The Source IP Address is statically bound.\r
f1004231 584 ///\r
959ccb23 585 BOOLEAN StaticIpAddress;\r
09e19629
RN
586 ///\r
587 /// The gateway IP address\r
588 ///\r
589 EFI_IPv4_ADDRESS GatewayIpAddress;\r
590 ///\r
591 /// The subnet mask\r
592 ///\r
593 EFI_IPv4_ADDRESS SubnetMask;\r
959ccb23 594} IPv4_DEVICE_PATH;\r
595\r
f1004231 596///\r
af2dc6a7 597/// IPv6 Device Path SubType.\r
f1004231 598///\r
959ccb23 599#define MSG_IPv6_DP 0x0d\r
600typedef struct {\r
601 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 602 ///\r
af2dc6a7 603 /// The local IPv6 address.\r
f1004231 604 ///\r
959ccb23 605 EFI_IPv6_ADDRESS LocalIpAddress;\r
f1004231 606 ///\r
af2dc6a7 607 /// The remote IPv6 address.\r
f1004231 608 ///\r
959ccb23 609 EFI_IPv6_ADDRESS RemoteIpAddress;\r
f1004231 610 ///\r
af2dc6a7 611 /// The local port number.\r
f1004231 612 ///\r
959ccb23 613 UINT16 LocalPort;\r
f1004231 614 ///\r
af2dc6a7 615 /// The remote port number.\r
f1004231 616 ///\r
959ccb23 617 UINT16 RemotePort;\r
f1004231
LG
618 ///\r
619 /// The network protocol(i.e. UDP, TCP).\r
620 ///\r
959ccb23 621 UINT16 Protocol;\r
f1004231 622 ///\r
501793fa
RN
623 /// 0x00 - The Local IP Address was manually configured.\r
624 /// 0x01 - The Local IP Address is assigned through IPv6\r
625 /// stateless auto-configuration.\r
626 /// 0x02 - The Local IP Address is assigned through IPv6\r
627 /// stateful configuration.\r
f1004231 628 ///\r
501793fa
RN
629 UINT8 IpAddressOrigin;\r
630 ///\r
631 /// The prefix length\r
632 ///\r
633 UINT8 PrefixLength;\r
634 ///\r
635 /// The gateway IP address\r
636 ///\r
637 EFI_IPv6_ADDRESS GatewayIpAddress;\r
959ccb23 638} IPv6_DEVICE_PATH;\r
639\r
f1004231 640///\r
af2dc6a7 641/// InfiniBand Device Path SubType.\r
f1004231 642///\r
959ccb23 643#define MSG_INFINIBAND_DP 0x09\r
644typedef struct {\r
645 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
646 ///\r
647 /// Flags to help identify/manage InfiniBand device path elements:\r
af2dc6a7 648 /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).\r
649 /// Bit 1 - Extend Boot Environment.\r
650 /// Bit 2 - Console Protocol.\r
651 /// Bit 3 - Storage Protocol.\r
652 /// Bit 4 - Network Protocol.\r
f1004231
LG
653 /// All other bits are reserved.\r
654 ///\r
959ccb23 655 UINT32 ResourceFlags;\r
f1004231 656 ///\r
af2dc6a7 657 /// 128-bit Global Identifier for remote fabric port.\r
f1004231 658 ///\r
959ccb23 659 UINT8 PortGid[16];\r
f1004231
LG
660 ///\r
661 /// 64-bit unique identifier to remote IOC or server process.\r
af2dc6a7 662 /// Interpretation of field specified by Resource Flags (bit 0).\r
f1004231 663 ///\r
959ccb23 664 UINT64 ServiceId;\r
f1004231 665 ///\r
af2dc6a7 666 /// 64-bit persistent ID of remote IOC port.\r
f1004231 667 ///\r
959ccb23 668 UINT64 TargetPortId;\r
f1004231 669 ///\r
af2dc6a7 670 /// 64-bit persistent ID of remote device.\r
f1004231 671 ///\r
959ccb23 672 UINT64 DeviceId;\r
673} INFINIBAND_DEVICE_PATH;\r
674\r
675#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01\r
676#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02\r
677#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04\r
678#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08\r
679#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10\r
680\r
f1004231 681///\r
af2dc6a7 682/// UART Device Path SubType.\r
f1004231 683///\r
959ccb23 684#define MSG_UART_DP 0x0e\r
685typedef struct {\r
686 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 687 ///\r
af2dc6a7 688 /// Reserved.\r
f1004231 689 ///\r
959ccb23 690 UINT32 Reserved;\r
f1004231
LG
691 ///\r
692 /// The baud rate setting for the UART style device. A value of 0\r
693 /// means that the device's default baud rate will be used.\r
694 ///\r
959ccb23 695 UINT64 BaudRate;\r
f1004231
LG
696 ///\r
697 /// The number of data bits for the UART style device. A value\r
698 /// of 0 means that the device's default number of data bits will be used.\r
699 ///\r
959ccb23 700 UINT8 DataBits;\r
f1004231
LG
701 ///\r
702 /// The parity setting for the UART style device.\r
af2dc6a7 703 /// Parity 0x00 - Default Parity.\r
704 /// Parity 0x01 - No Parity.\r
705 /// Parity 0x02 - Even Parity.\r
706 /// Parity 0x03 - Odd Parity.\r
707 /// Parity 0x04 - Mark Parity.\r
708 /// Parity 0x05 - Space Parity.\r
f1004231 709 ///\r
959ccb23 710 UINT8 Parity;\r
f1004231
LG
711 ///\r
712 /// The number of stop bits for the UART style device.\r
af2dc6a7 713 /// Stop Bits 0x00 - Default Stop Bits.\r
714 /// Stop Bits 0x01 - 1 Stop Bit.\r
715 /// Stop Bits 0x02 - 1.5 Stop Bits.\r
716 /// Stop Bits 0x03 - 2 Stop Bits.\r
f1004231 717 ///\r
959ccb23 718 UINT8 StopBits;\r
719} UART_DEVICE_PATH;\r
720\r
721//\r
722// Use VENDOR_DEVICE_PATH struct\r
723//\r
724#define MSG_VENDOR_DP 0x0a\r
00edb218 725typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;\r
959ccb23 726\r
727#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID\r
728#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID\r
729#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID\r
730#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID\r
731\r
f1004231
LG
732///\r
733/// A new device path node is defined to declare flow control characteristics.\r
734/// UART Flow Control Messaging Device Path\r
735///\r
959ccb23 736typedef struct {\r
737 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 738 ///\r
af2dc6a7 739 /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.\r
f1004231 740 ///\r
959ccb23 741 EFI_GUID Guid;\r
f1004231
LG
742 ///\r
743 /// Bitmap of supported flow control types.\r
744 /// Bit 0 set indicates hardware flow control.\r
745 /// Bit 1 set indicates Xon/Xoff flow control.\r
746 /// All other bits are reserved and are clear.\r
747 ///\r
959ccb23 748 UINT32 FlowControlMap;\r
749} UART_FLOW_CONTROL_DEVICE_PATH;\r
750\r
a58cc068
RN
751#define UART_FLOW_CONTROL_HARDWARE 0x00000001\r
752#define UART_FLOW_CONTROL_XON_XOFF 0x00000010\r
753\r
960212a3 754#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID\r
f1004231 755///\r
960212a3 756/// Serial Attached SCSI (SAS) Device Path.\r
f1004231 757///\r
959ccb23 758typedef struct {\r
759 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 760 ///\r
af2dc6a7 761 /// DEVICE_PATH_MESSAGING_SAS GUID.\r
f1004231 762 ///\r
959ccb23 763 EFI_GUID Guid;\r
f1004231
LG
764 ///\r
765 /// Reserved for future use.\r
766 ///\r
959ccb23 767 UINT32 Reserved;\r
f1004231
LG
768 ///\r
769 /// SAS Address for Serial Attached SCSI Target.\r
770 ///\r
959ccb23 771 UINT64 SasAddress;\r
f1004231
LG
772 ///\r
773 /// SAS Logical Unit Number.\r
774 ///\r
959ccb23 775 UINT64 Lun;\r
f1004231 776 ///\r
af2dc6a7 777 /// More Information about the device and its interconnect.\r
f1004231 778 ///\r
959ccb23 779 UINT16 DeviceTopology;\r
f1004231 780 ///\r
af2dc6a7 781 /// Relative Target Port (RTP).\r
f1004231 782 ///\r
959ccb23 783 UINT16 RelativeTargetPort;\r
784} SAS_DEVICE_PATH;\r
785\r
501793fa
RN
786///\r
787/// Serial Attached SCSI (SAS) Ex Device Path SubType\r
788///\r
789#define MSG_SASEX_DP 0x16\r
790typedef struct {\r
791 EFI_DEVICE_PATH_PROTOCOL Header;\r
792 ///\r
793 /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port.\r
794 ///\r
795 UINT8 SasAddress[8];\r
796 ///\r
797 /// 8-byte array of the SAS Logical Unit Number.\r
798 ///\r
799 UINT8 Lun[8];\r
800 ///\r
801 /// More Information about the device and its interconnect.\r
802 ///\r
803 UINT16 DeviceTopology;\r
804 ///\r
805 /// Relative Target Port (RTP).\r
806 ///\r
807 UINT16 RelativeTargetPort;\r
808} SASEX_DEVICE_PATH;\r
809\r
17625930
FT
810///\r
811/// NvmExpress Namespace Device Path SubType.\r
812///\r
813#define MSG_NVME_NAMESPACE_DP 0x17\r
814typedef struct {\r
815 EFI_DEVICE_PATH_PROTOCOL Header;\r
816 UINT32 NamespaceId;\r
817 UINT64 NamespaceUuid;\r
818} NVME_NAMESPACE_DEVICE_PATH;\r
819\r
ecbabb7f
JW
820///\r
821/// DNS Device Path SubType\r
822///\r
823#define MSG_DNS_DP 0x1F\r
824typedef struct {\r
825 EFI_DEVICE_PATH_PROTOCOL Header;\r
826 ///\r
827 /// Indicates the DNS server address is IPv4 or IPv6 address.\r
828 ///\r
829 UINT8 IsIPv6;\r
830 ///\r
831 /// Instance of the DNS server address.\r
832 ///\r
833 EFI_IP_ADDRESS DnsServerIp[];\r
834} DNS_DEVICE_PATH;\r
835\r
4128acd9
RN
836///\r
837/// Uniform Resource Identifiers (URI) Device Path SubType\r
838///\r
839#define MSG_URI_DP 0x18\r
840typedef struct {\r
841 EFI_DEVICE_PATH_PROTOCOL Header;\r
842 ///\r
843 /// Instance of the URI pursuant to RFC 3986.\r
844 ///\r
845 CHAR8 Uri[];\r
846} URI_DEVICE_PATH;\r
847\r
52306166
FT
848///\r
849/// Universal Flash Storage (UFS) Device Path SubType.\r
850///\r
851#define MSG_UFS_DP 0x19\r
852typedef struct {\r
853 EFI_DEVICE_PATH_PROTOCOL Header;\r
854 ///\r
855 /// Target ID on the UFS bus (PUN).\r
856 ///\r
857 UINT8 Pun;\r
858 ///\r
859 /// Logical Unit Number (LUN).\r
860 ///\r
861 UINT8 Lun;\r
862} UFS_DEVICE_PATH;\r
863\r
ab8686b8
FT
864///\r
865/// SD (Secure Digital) Device Path SubType.\r
866///\r
867#define MSG_SD_DP 0x1A\r
868typedef struct {\r
869 EFI_DEVICE_PATH_PROTOCOL Header;\r
870 UINT8 SlotNumber;\r
871} SD_DEVICE_PATH;\r
872\r
5c67fb2f
FT
873///\r
874/// EMMC (Embedded MMC) Device Path SubType.\r
875///\r
876#define MSG_EMMC_DP 0x1D\r
877typedef struct {\r
878 EFI_DEVICE_PATH_PROTOCOL Header;\r
879 UINT8 SlotNumber;\r
880} EMMC_DEVICE_PATH;\r
881\r
f1004231 882///\r
9319d2c2 883/// iSCSI Device Path SubType\r
f1004231 884///\r
959ccb23 885#define MSG_ISCSI_DP 0x13\r
886typedef struct {\r
887 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 888 ///\r
af2dc6a7 889 /// Network Protocol (0 = TCP, 1+ = reserved).\r
f1004231 890 ///\r
959ccb23 891 UINT16 NetworkProtocol;\r
f1004231 892 ///\r
af2dc6a7 893 /// iSCSI Login Options.\r
f1004231 894 ///\r
959ccb23 895 UINT16 LoginOption;\r
f1004231 896 ///\r
af2dc6a7 897 /// iSCSI Logical Unit Number.\r
f1004231 898 ///\r
ab2abe4c 899 UINT64 Lun;\r
f1004231
LG
900 ///\r
901 /// iSCSI Target Portal group tag the initiator intends\r
902 /// to establish a session with.\r
903 ///\r
959ccb23 904 UINT16 TargetPortalGroupTag;\r
f1004231
LG
905 ///\r
906 /// iSCSI NodeTarget Name. The length of the name\r
907 /// is determined by subtracting the offset of this field from Length.\r
908 ///\r
af2dc6a7 909 /// CHAR8 iSCSI Target Name.\r
959ccb23 910} ISCSI_DEVICE_PATH;\r
911\r
912#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000\r
913#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002\r
914#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000\r
915#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008\r
916#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000\r
917#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000\r
918#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000\r
919#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000\r
920\r
8f97f911 921///\r
af2dc6a7 922/// VLAN Device Path SubType.\r
8f97f911 923///\r
924#define MSG_VLAN_DP 0x14\r
925typedef struct {\r
926 EFI_DEVICE_PATH_PROTOCOL Header;\r
927 ///\r
af2dc6a7 928 /// VLAN identifier (0-4094).\r
8f97f911 929 ///\r
930 UINT16 VlanId;\r
931} VLAN_DEVICE_PATH;\r
932\r
362c355c
QS
933///\r
934/// Bluetooth Device Path SubType.\r
935///\r
936#define MSG_BLUETOOTH_DP 0x1b\r
937typedef struct {\r
938 EFI_DEVICE_PATH_PROTOCOL Header;\r
939 ///\r
940 /// 48bit Bluetooth device address.\r
941 ///\r
942 BLUETOOTH_ADDRESS BD_ADDR;\r
943} BLUETOOTH_DEVICE_PATH;\r
944\r
3bafd562
HW
945///\r
946/// Wi-Fi Device Path SubType.\r
947///\r
948#define MSG_WIFI_DP 0x1C\r
949typedef struct {\r
950 EFI_DEVICE_PATH_PROTOCOL Header;\r
951 ///\r
952 /// Service set identifier. A 32-byte octets string.\r
953 ///\r
954 UINT8 SSId[32];\r
955} WIFI_DEVICE_PATH;\r
956\r
ff5623e9
RN
957///\r
958/// Bluetooth LE Device Path SubType.\r
959///\r
960#define MSG_BLUETOOTH_LE_DP 0x1E\r
961typedef struct {\r
962 EFI_DEVICE_PATH_PROTOCOL Header;\r
963 BLUETOOTH_LE_ADDRESS Address;\r
964} BLUETOOTH_LE_DEVICE_PATH;\r
965\r
959ccb23 966//\r
967// Media Device Path\r
968//\r
969#define MEDIA_DEVICE_PATH 0x04\r
970\r
f1004231 971///\r
af2dc6a7 972/// Hard Drive Media Device Path SubType.\r
f1004231 973///\r
959ccb23 974#define MEDIA_HARDDRIVE_DP 0x01\r
9319d2c2
LG
975\r
976///\r
977/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.\r
978///\r
959ccb23 979typedef struct {\r
980 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
981 ///\r
982 /// Describes the entry in a partition table, starting with entry 1.\r
983 /// Partition number zero represents the entire device. Valid\r
984 /// partition numbers for a MBR partition are [1, 4]. Valid\r
8e7b8fb4 985 /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].\r
f1004231 986 ///\r
959ccb23 987 UINT32 PartitionNumber;\r
f1004231 988 ///\r
af2dc6a7 989 /// Starting LBA of the partition on the hard drive.\r
f1004231 990 ///\r
959ccb23 991 UINT64 PartitionStart;\r
f1004231 992 ///\r
af2dc6a7 993 /// Size of the partition in units of Logical Blocks.\r
f1004231 994 ///\r
959ccb23 995 UINT64 PartitionSize;\r
f1004231 996 ///\r
8e7b8fb4 997 /// Signature unique to this partition:\r
998 /// If SignatureType is 0, this field has to be initialized with 16 zeros.\r
999 /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.\r
1000 /// The other 12 bytes are initialized with zeros.\r
1001 /// If SignatureType is 2, this field contains a 16 byte signature.\r
f1004231 1002 ///\r
959ccb23 1003 UINT8 Signature[16];\r
f1004231 1004 ///\r
af2dc6a7 1005 /// Partition Format: (Unused values reserved).\r
1006 /// 0x01 - PC-AT compatible legacy MBR.\r
1007 /// 0x02 - GUID Partition Table.\r
f1004231 1008 ///\r
959ccb23 1009 UINT8 MBRType;\r
f1004231 1010 ///\r
af2dc6a7 1011 /// Type of Disk Signature: (Unused values reserved).\r
cd2ed84a 1012 /// 0x00 - No Disk Signature.\r
1013 /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.\r
1014 /// 0x02 - GUID signature.\r
f1004231 1015 ///\r
959ccb23 1016 UINT8 SignatureType;\r
1017} HARDDRIVE_DEVICE_PATH;\r
1018\r
1019#define MBR_TYPE_PCAT 0x01\r
1020#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02\r
1021\r
f1004231 1022#define NO_DISK_SIGNATURE 0x00\r
959ccb23 1023#define SIGNATURE_TYPE_MBR 0x01\r
1024#define SIGNATURE_TYPE_GUID 0x02\r
1025\r
f1004231 1026///\r
af2dc6a7 1027/// CD-ROM Media Device Path SubType.\r
f1004231 1028///\r
959ccb23 1029#define MEDIA_CDROM_DP 0x02\r
9319d2c2
LG
1030\r
1031///\r
1032/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.\r
1033///\r
959ccb23 1034typedef struct {\r
1035 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
1036 ///\r
1037 /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.\r
1038 ///\r
959ccb23 1039 UINT32 BootEntry;\r
f1004231
LG
1040 ///\r
1041 /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.\r
1042 ///\r
959ccb23 1043 UINT64 PartitionStart;\r
f1004231
LG
1044 ///\r
1045 /// Size of the partition in units of Blocks, also called Sectors.\r
1046 ///\r
959ccb23 1047 UINT64 PartitionSize;\r
1048} CDROM_DEVICE_PATH;\r
1049\r
9319d2c2
LG
1050//\r
1051// Use VENDOR_DEVICE_PATH struct\r
1052//\r
af2dc6a7 1053#define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype.\r
959ccb23 1054\r
f1004231 1055///\r
9319d2c2 1056/// File Path Media Device Path SubType\r
f1004231 1057///\r
959ccb23 1058#define MEDIA_FILEPATH_DP 0x04\r
1059typedef struct {\r
1060 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 1061 ///\r
fbf926ad 1062 /// A NULL-terminated Path string including directory and file names.\r
f1004231 1063 ///\r
959ccb23 1064 CHAR16 PathName[1];\r
1065} FILEPATH_DEVICE_PATH;\r
1066\r
07636730 1067#define SIZE_OF_FILEPATH_DEVICE_PATH OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)\r
959ccb23 1068\r
9319d2c2 1069///\r
af2dc6a7 1070/// Media Protocol Device Path SubType.\r
9319d2c2
LG
1071///\r
1072#define MEDIA_PROTOCOL_DP 0x05\r
1073\r
f1004231 1074///\r
9095d37b
LG
1075/// The Media Protocol Device Path is used to denote the protocol that is being\r
1076/// used in a device path at the location of the path specified.\r
f1004231
LG
1077/// Many protocols are inherent to the style of device path.\r
1078///\r
959ccb23 1079typedef struct {\r
1080 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
1081 ///\r
1082 /// The ID of the protocol.\r
1083 ///\r
959ccb23 1084 EFI_GUID Protocol;\r
1085} MEDIA_PROTOCOL_DEVICE_PATH;\r
1086\r
f1004231 1087///\r
960212a3 1088/// PIWG Firmware File SubType.\r
f1004231 1089///\r
56bed2f4 1090#define MEDIA_PIWG_FW_FILE_DP 0x06\r
9319d2c2
LG
1091\r
1092///\r
56bed2f4 1093/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.\r
9319d2c2 1094///\r
146332ae 1095typedef struct {\r
1096 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 1097 ///\r
56bed2f4 1098 /// Firmware file name\r
f1004231 1099 ///\r
56bed2f4 1100 EFI_GUID FvFileName;\r
1101} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
959ccb23 1102\r
f1004231 1103///\r
af2dc6a7 1104/// PIWG Firmware Volume Device Path SubType.\r
f1004231 1105///\r
56bed2f4 1106#define MEDIA_PIWG_FW_VOL_DP 0x07\r
9319d2c2
LG
1107\r
1108///\r
56bed2f4 1109/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.\r
9319d2c2 1110///\r
146332ae 1111typedef struct {\r
1112 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231 1113 ///\r
56bed2f4 1114 /// Firmware volume name.\r
f1004231 1115 ///\r
56bed2f4 1116 EFI_GUID FvName;\r
1117} MEDIA_FW_VOL_DEVICE_PATH;\r
959ccb23 1118\r
deb7f094 1119///\r
af2dc6a7 1120/// Media relative offset range device path.\r
deb7f094 1121///\r
1122#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08\r
1123\r
1124///\r
1125/// Used to describe the offset range of media relative.\r
1126///\r
1127typedef struct {\r
1128 EFI_DEVICE_PATH_PROTOCOL Header;\r
56bed2f4 1129 UINT32 Reserved;\r
deb7f094 1130 UINT64 StartingOffset;\r
1131 UINT64 EndingOffset;\r
1132} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;\r
1133\r
6a46c1a2
FT
1134///\r
1135/// This GUID defines a RAM Disk supporting a raw disk format in volatile memory.\r
1136///\r
1137#define EFI_VIRTUAL_DISK_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_VOLATILE\r
1138\r
1139extern EFI_GUID gEfiVirtualDiskGuid;\r
1140\r
1141///\r
1142/// This GUID defines a RAM Disk supporting an ISO image in volatile memory.\r
1143///\r
1144#define EFI_VIRTUAL_CD_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_VOLATILE\r
1145\r
1146extern EFI_GUID gEfiVirtualCdGuid;\r
1147\r
1148///\r
1149/// This GUID defines a RAM Disk supporting a raw disk format in persistent memory.\r
1150///\r
1151#define EFI_PERSISTENT_VIRTUAL_DISK_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_DISK_REGION_PERSISTENT\r
1152\r
1153extern EFI_GUID gEfiPersistentVirtualDiskGuid;\r
1154\r
1155///\r
1156/// This GUID defines a RAM Disk supporting an ISO image in persistent memory.\r
1157///\r
1158#define EFI_PERSISTENT_VIRTUAL_CD_GUID EFI_ACPI_6_0_NFIT_GUID_RAM_DISK_SUPPORTING_VIRTUAL_CD_REGION_PERSISTENT\r
1159\r
1160extern EFI_GUID gEfiPersistentVirtualCdGuid;\r
1161\r
1162///\r
1163/// Media ram disk device path.\r
1164///\r
1165#define MEDIA_RAM_DISK_DP 0x09\r
1166\r
1167///\r
1168/// Used to describe the ram disk device path.\r
1169///\r
1170typedef struct {\r
1171 EFI_DEVICE_PATH_PROTOCOL Header;\r
1172 ///\r
1173 /// Starting Memory Address.\r
1174 ///\r
1175 UINT32 StartingAddr[2];\r
1176 ///\r
1177 /// Ending Memory Address.\r
1178 ///\r
1179 UINT32 EndingAddr[2];\r
1180 ///\r
1181 /// GUID that defines the type of the RAM Disk.\r
1182 ///\r
1183 EFI_GUID TypeGuid;\r
1184 ///\r
1185 /// RAM Diskinstance number, if supported. The default value is zero.\r
1186 ///\r
1187 UINT16 Instance;\r
1188} MEDIA_RAM_DISK_DEVICE_PATH;\r
1189\r
f1004231 1190///\r
af2dc6a7 1191/// BIOS Boot Specification Device Path.\r
f1004231 1192///\r
959ccb23 1193#define BBS_DEVICE_PATH 0x05\r
9319d2c2
LG
1194\r
1195///\r
af2dc6a7 1196/// BIOS Boot Specification Device Path SubType.\r
9319d2c2 1197///\r
959ccb23 1198#define BBS_BBS_DP 0x01\r
9319d2c2
LG
1199\r
1200///\r
1201/// This Device Path is used to describe the booting of non-EFI-aware operating systems.\r
1202///\r
959ccb23 1203typedef struct {\r
1204 EFI_DEVICE_PATH_PROTOCOL Header;\r
f1004231
LG
1205 ///\r
1206 /// Device Type as defined by the BIOS Boot Specification.\r
1207 ///\r
959ccb23 1208 UINT16 DeviceType;\r
f1004231 1209 ///\r
af2dc6a7 1210 /// Status Flags as defined by the BIOS Boot Specification.\r
f1004231 1211 ///\r
959ccb23 1212 UINT16 StatusFlag;\r
f1004231 1213 ///\r
4f077902 1214 /// Null-terminated ASCII string that describes the boot device to a user.\r
f1004231 1215 ///\r
959ccb23 1216 CHAR8 String[1];\r
1217} BBS_BBS_DEVICE_PATH;\r
1218\r
1219//\r
1220// DeviceType definitions - from BBS specification\r
1221//\r
1222#define BBS_TYPE_FLOPPY 0x01\r
1223#define BBS_TYPE_HARDDRIVE 0x02\r
1224#define BBS_TYPE_CDROM 0x03\r
1225#define BBS_TYPE_PCMCIA 0x04\r
1226#define BBS_TYPE_USB 0x05\r
1227#define BBS_TYPE_EMBEDDED_NETWORK 0x06\r
1228#define BBS_TYPE_BEV 0x80\r
1229#define BBS_TYPE_UNKNOWN 0xFF\r
1230\r
1231\r
99e8ed21 1232///\r
af2dc6a7 1233/// Union of all possible Device Paths and pointers to Device Paths.\r
99e8ed21 1234///\r
959ccb23 1235typedef union {\r
960212a3 1236 EFI_DEVICE_PATH_PROTOCOL DevPath;\r
1237 PCI_DEVICE_PATH Pci;\r
1238 PCCARD_DEVICE_PATH PcCard;\r
1239 MEMMAP_DEVICE_PATH MemMap;\r
1240 VENDOR_DEVICE_PATH Vendor;\r
1241\r
1242 CONTROLLER_DEVICE_PATH Controller;\r
624f017e 1243 BMC_DEVICE_PATH Bmc;\r
960212a3 1244 ACPI_HID_DEVICE_PATH Acpi;\r
1245 ACPI_EXTENDED_HID_DEVICE_PATH ExtendedAcpi;\r
1246 ACPI_ADR_DEVICE_PATH AcpiAdr;\r
1247\r
1248 ATAPI_DEVICE_PATH Atapi;\r
1249 SCSI_DEVICE_PATH Scsi;\r
1250 ISCSI_DEVICE_PATH Iscsi;\r
1251 FIBRECHANNEL_DEVICE_PATH FibreChannel;\r
09e19629 1252 FIBRECHANNELEX_DEVICE_PATH FibreChannelEx;\r
960212a3 1253\r
1254 F1394_DEVICE_PATH F1394;\r
1255 USB_DEVICE_PATH Usb;\r
1256 SATA_DEVICE_PATH Sata;\r
1257 USB_CLASS_DEVICE_PATH UsbClass;\r
1258 USB_WWID_DEVICE_PATH UsbWwid;\r
1259 DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit;\r
1260 I2O_DEVICE_PATH I2O;\r
1261 MAC_ADDR_DEVICE_PATH MacAddr;\r
1262 IPv4_DEVICE_PATH Ipv4;\r
1263 IPv6_DEVICE_PATH Ipv6;\r
1264 VLAN_DEVICE_PATH Vlan;\r
1265 INFINIBAND_DEVICE_PATH InfiniBand;\r
1266 UART_DEVICE_PATH Uart;\r
1267 UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;\r
1268 SAS_DEVICE_PATH Sas;\r
501793fa 1269 SASEX_DEVICE_PATH SasEx;\r
17625930 1270 NVME_NAMESPACE_DEVICE_PATH NvmeNamespace;\r
9095d37b 1271 DNS_DEVICE_PATH Dns;\r
4128acd9 1272 URI_DEVICE_PATH Uri;\r
362c355c 1273 BLUETOOTH_DEVICE_PATH Bluetooth;\r
3bafd562 1274 WIFI_DEVICE_PATH WiFi;\r
52306166 1275 UFS_DEVICE_PATH Ufs;\r
ab8686b8 1276 SD_DEVICE_PATH Sd;\r
5c67fb2f 1277 EMMC_DEVICE_PATH Emmc;\r
960212a3 1278 HARDDRIVE_DEVICE_PATH HardDrive;\r
1279 CDROM_DEVICE_PATH CD;\r
1280\r
1281 FILEPATH_DEVICE_PATH FilePath;\r
1282 MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;\r
1283\r
1284 MEDIA_FW_VOL_DEVICE_PATH FirmwareVolume;\r
1285 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FirmwareFile;\r
1286 MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset;\r
6a46c1a2 1287 MEDIA_RAM_DISK_DEVICE_PATH RamDisk;\r
960212a3 1288 BBS_BBS_DEVICE_PATH Bbs;\r
959ccb23 1289} EFI_DEV_PATH;\r
1290\r
1291\r
1292\r
1293typedef union {\r
960212a3 1294 EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
1295 PCI_DEVICE_PATH *Pci;\r
1296 PCCARD_DEVICE_PATH *PcCard;\r
1297 MEMMAP_DEVICE_PATH *MemMap;\r
1298 VENDOR_DEVICE_PATH *Vendor;\r
1299\r
1300 CONTROLLER_DEVICE_PATH *Controller;\r
624f017e 1301 BMC_DEVICE_PATH *Bmc;\r
960212a3 1302 ACPI_HID_DEVICE_PATH *Acpi;\r
1303 ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;\r
1304 ACPI_ADR_DEVICE_PATH *AcpiAdr;\r
1305\r
1306 ATAPI_DEVICE_PATH *Atapi;\r
1307 SCSI_DEVICE_PATH *Scsi;\r
1308 ISCSI_DEVICE_PATH *Iscsi;\r
1309 FIBRECHANNEL_DEVICE_PATH *FibreChannel;\r
09e19629 1310 FIBRECHANNELEX_DEVICE_PATH *FibreChannelEx;\r
960212a3 1311\r
1312 F1394_DEVICE_PATH *F1394;\r
1313 USB_DEVICE_PATH *Usb;\r
1314 SATA_DEVICE_PATH *Sata;\r
1315 USB_CLASS_DEVICE_PATH *UsbClass;\r
1316 USB_WWID_DEVICE_PATH *UsbWwid;\r
1317 DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicUnit;\r
1318 I2O_DEVICE_PATH *I2O;\r
1319 MAC_ADDR_DEVICE_PATH *MacAddr;\r
1320 IPv4_DEVICE_PATH *Ipv4;\r
1321 IPv6_DEVICE_PATH *Ipv6;\r
1322 VLAN_DEVICE_PATH *Vlan;\r
1323 INFINIBAND_DEVICE_PATH *InfiniBand;\r
1324 UART_DEVICE_PATH *Uart;\r
1325 UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;\r
1326 SAS_DEVICE_PATH *Sas;\r
501793fa 1327 SASEX_DEVICE_PATH *SasEx;\r
17625930 1328 NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace;\r
ecbabb7f 1329 DNS_DEVICE_PATH *Dns;\r
4128acd9 1330 URI_DEVICE_PATH *Uri;\r
362c355c 1331 BLUETOOTH_DEVICE_PATH *Bluetooth;\r
3bafd562 1332 WIFI_DEVICE_PATH *WiFi;\r
52306166 1333 UFS_DEVICE_PATH *Ufs;\r
ab8686b8 1334 SD_DEVICE_PATH *Sd;\r
5c67fb2f 1335 EMMC_DEVICE_PATH *Emmc;\r
960212a3 1336 HARDDRIVE_DEVICE_PATH *HardDrive;\r
1337 CDROM_DEVICE_PATH *CD;\r
1338\r
1339 FILEPATH_DEVICE_PATH *FilePath;\r
1340 MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;\r
1341\r
1342 MEDIA_FW_VOL_DEVICE_PATH *FirmwareVolume;\r
1343 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FirmwareFile;\r
1344 MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;\r
6a46c1a2 1345 MEDIA_RAM_DISK_DEVICE_PATH *RamDisk;\r
960212a3 1346 BBS_BBS_DEVICE_PATH *Bbs;\r
1347 UINT8 *Raw;\r
959ccb23 1348} EFI_DEV_PATH_PTR;\r
1349\r
1350#pragma pack()\r
9095d37b 1351\r
d1f95000 1352#define END_DEVICE_PATH_TYPE 0x7f\r
e5dab016 1353#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF\r
1354#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01\r
d1f95000 1355\r
1356extern EFI_GUID gEfiDevicePathProtocolGuid;\r
959ccb23 1357\r
1358#endif\r