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