efidevp.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. #ifndef _DEVPATH_H
  2. #define _DEVPATH_H
  3. /*++
  4. Copyright (c) 1998 Intel Corporation
  5. Module Name:
  6. devpath.h
  7. Abstract:
  8. Defines for parsing the EFI Device Path structures
  9. Revision History
  10. --*/
  11. //
  12. // Device Path structures - Section C
  13. //
  14. typedef struct _EFI_DEVICE_PATH_PROTOCOL {
  15. UINT8 Type;
  16. UINT8 SubType;
  17. UINT8 Length[2];
  18. } EFI_DEVICE_PATH_PROTOCOL;
  19. typedef struct _EFI_DEVICE_PATH_PROTOCOL _EFI_DEVICE_PATH;
  20. typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;
  21. #define EFI_DP_TYPE_MASK 0x7F
  22. #define EFI_DP_TYPE_UNPACKED 0x80
  23. //#define END_DEVICE_PATH_TYPE 0xff
  24. #define END_DEVICE_PATH_TYPE 0x7f
  25. //#define END_DEVICE_PATH_TYPE_UNPACKED 0x7f
  26. #define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
  27. #define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
  28. #define END_DEVICE_PATH_LENGTH (sizeof(EFI_DEVICE_PATH_PROTOCOL))
  29. #define DP_IS_END_TYPE(a)
  30. #define DP_IS_END_SUBTYPE(a) ( ((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
  31. #define DevicePathType(a) ( ((a)->Type) & EFI_DP_TYPE_MASK )
  32. #define DevicePathSubType(a) ( (a)->SubType )
  33. #define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) )
  34. #define NextDevicePathNode(a) ( (EFI_DEVICE_PATH_PROTOCOL *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a)))
  35. //#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE_UNPACKED )
  36. #define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE )
  37. #define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
  38. #define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) )
  39. #define IsDevicePathUnpacked(a) ( (a)->Type & EFI_DP_TYPE_UNPACKED )
  40. #define SetDevicePathNodeLength(a,l) { \
  41. (a)->Length[0] = (UINT8) (l); \
  42. (a)->Length[1] = (UINT8) ((l) >> 8); \
  43. }
  44. #define SetDevicePathEndNode(a) { \
  45. (a)->Type = END_DEVICE_PATH_TYPE; \
  46. (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
  47. (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL); \
  48. (a)->Length[1] = 0; \
  49. }
  50. /*
  51. * Hardware Device Path (UEFI 2.4 specification, version 2.4 § 9.3.2.)
  52. */
  53. #define HARDWARE_DEVICE_PATH 0x01
  54. #define HW_PCI_DP 0x01
  55. typedef struct _PCI_DEVICE_PATH {
  56. EFI_DEVICE_PATH_PROTOCOL Header;
  57. UINT8 Function;
  58. UINT8 Device;
  59. } PCI_DEVICE_PATH;
  60. #define HW_PCCARD_DP 0x02
  61. typedef struct _PCCARD_DEVICE_PATH {
  62. EFI_DEVICE_PATH_PROTOCOL Header;
  63. UINT8 FunctionNumber ;
  64. } PCCARD_DEVICE_PATH;
  65. #define HW_MEMMAP_DP 0x03
  66. typedef struct _MEMMAP_DEVICE_PATH {
  67. EFI_DEVICE_PATH_PROTOCOL Header;
  68. UINT32 MemoryType;
  69. EFI_PHYSICAL_ADDRESS StartingAddress;
  70. EFI_PHYSICAL_ADDRESS EndingAddress;
  71. } MEMMAP_DEVICE_PATH;
  72. #define HW_VENDOR_DP 0x04
  73. typedef struct _VENDOR_DEVICE_PATH {
  74. EFI_DEVICE_PATH_PROTOCOL Header;
  75. EFI_GUID Guid;
  76. } VENDOR_DEVICE_PATH;
  77. #define UNKNOWN_DEVICE_GUID \
  78. { 0xcf31fac5, 0xc24e, 0x11d2, {0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} }
  79. typedef struct _UKNOWN_DEVICE_VENDOR_DP {
  80. VENDOR_DEVICE_PATH DevicePath;
  81. UINT8 LegacyDriveLetter;
  82. } UNKNOWN_DEVICE_VENDOR_DEVICE_PATH;
  83. #define HW_CONTROLLER_DP 0x05
  84. typedef struct _CONTROLLER_DEVICE_PATH {
  85. EFI_DEVICE_PATH_PROTOCOL Header;
  86. UINT32 Controller;
  87. } CONTROLLER_DEVICE_PATH;
  88. /*
  89. * ACPI Device Path (UEFI 2.4 specification, version 2.4 § 9.3.3 and 9.3.4.)
  90. */
  91. #define ACPI_DEVICE_PATH 0x02
  92. #define ACPI_DP 0x01
  93. typedef struct _ACPI_HID_DEVICE_PATH {
  94. EFI_DEVICE_PATH_PROTOCOL Header;
  95. UINT32 HID;
  96. UINT32 UID;
  97. } ACPI_HID_DEVICE_PATH;
  98. #define EXPANDED_ACPI_DP 0x02
  99. typedef struct _EXPANDED_ACPI_HID_DEVICE_PATH {
  100. EFI_DEVICE_PATH_PROTOCOL Header;
  101. UINT32 HID;
  102. UINT32 UID;
  103. UINT32 CID;
  104. UINT8 HidStr[1];
  105. } EXPANDED_ACPI_HID_DEVICE_PATH;
  106. #define ACPI_ADR_DP 3
  107. typedef struct _ACPI_ADR_DEVICE_PATH {
  108. EFI_DEVICE_PATH_PROTOCOL Header ;
  109. UINT32 ADR ;
  110. } ACPI_ADR_DEVICE_PATH ;
  111. //
  112. // EISA ID Macro
  113. // EISA ID Definition 32-bits
  114. // bits[15:0] - three character compressed ASCII EISA ID.
  115. // bits[31:16] - binary number
  116. // Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
  117. //
  118. #define PNP_EISA_ID_CONST 0x41d0
  119. #define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
  120. #define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
  121. #define PNP_EISA_ID_MASK 0xffff
  122. #define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
  123. /*
  124. * Messaging Device Path (UEFI 2.4 specification, version 2.4 § 9.3.5.)
  125. */
  126. #define MESSAGING_DEVICE_PATH 0x03
  127. #define MSG_ATAPI_DP 0x01
  128. typedef struct _ATAPI_DEVICE_PATH {
  129. EFI_DEVICE_PATH_PROTOCOL Header;
  130. UINT8 PrimarySecondary;
  131. UINT8 SlaveMaster;
  132. UINT16 Lun;
  133. } ATAPI_DEVICE_PATH;
  134. #define MSG_SCSI_DP 0x02
  135. typedef struct _SCSI_DEVICE_PATH {
  136. EFI_DEVICE_PATH_PROTOCOL Header;
  137. UINT16 Pun;
  138. UINT16 Lun;
  139. } SCSI_DEVICE_PATH;
  140. #define MSG_FIBRECHANNEL_DP 0x03
  141. typedef struct _FIBRECHANNEL_DEVICE_PATH {
  142. EFI_DEVICE_PATH_PROTOCOL Header;
  143. UINT32 Reserved;
  144. UINT64 WWN;
  145. UINT64 Lun;
  146. } FIBRECHANNEL_DEVICE_PATH;
  147. /**
  148. * Fibre Channel Ex SubType.
  149. * UEFI 2.0 specification version 2.4 § 9.3.5.6.
  150. */
  151. #define MSG_FIBRECHANNELEX_DP 21
  152. typedef struct _FIBRECHANNELEX_DEVICE_PATH {
  153. EFI_DEVICE_PATH_PROTOCOL Header ;
  154. UINT32 Reserved ;
  155. UINT8 WWN[ 8 ] ; /* World Wide Name */
  156. UINT8 Lun[ 8 ] ; /* Logical unit, T-10 SCSI Architecture Model 4 specification */
  157. } FIBRECHANNELEX_DEVICE_PATH ;
  158. #define MSG_1394_DP 0x04
  159. typedef struct _F1394_DEVICE_PATH {
  160. EFI_DEVICE_PATH_PROTOCOL Header;
  161. UINT32 Reserved;
  162. UINT64 Guid;
  163. } F1394_DEVICE_PATH;
  164. #define MSG_USB_DP 0x05
  165. typedef struct _USB_DEVICE_PATH {
  166. EFI_DEVICE_PATH_PROTOCOL Header;
  167. UINT8 Port;
  168. UINT8 Endpoint;
  169. } USB_DEVICE_PATH;
  170. /**
  171. * SATA Device Path SubType.
  172. * UEFI 2.0 specification version 2.4 § 9.3.5.6.
  173. */
  174. #define MSG_SATA_DP 18
  175. typedef struct _SATA_DEVICE_PATH {
  176. EFI_DEVICE_PATH_PROTOCOL Header ;
  177. UINT16 HBAPortNumber ;
  178. UINT16 PortMultiplierPortNumber ;
  179. UINT16 Lun ; /* Logical Unit Number */
  180. } SATA_DEVICE_PATH ;
  181. /**
  182. * USB WWID Device Path SubType.
  183. * UEFI 2.0 specification version 2.4 § 9.3.5.7.
  184. */
  185. #define MSG_USB_WWID_DP 16
  186. typedef struct _USB_WWID_DEVICE_PATH {
  187. EFI_DEVICE_PATH_PROTOCOL Header ;
  188. UINT16 InterfaceNumber ;
  189. UINT16 VendorId ;
  190. UINT16 ProductId ;
  191. CHAR16 SerialNumber[ 1 ] ; /* UTF-16 characters of the USB serial number */
  192. } USB_WWID_DEVICE_PATH ;
  193. /**
  194. * Device Logical Unit SubType.
  195. * UEFI 2.0 specification version 2.4 § 9.3.5.8.
  196. */
  197. #define MSG_DEVICE_LOGICAL_UNIT_DP 17
  198. typedef struct _DEVICE_LOGICAL_UNIT_DEVICE_PATH {
  199. EFI_DEVICE_PATH_PROTOCOL Header ;
  200. UINT8 Lun ; /* Logical Unit Number */
  201. } DEVICE_LOGICAL_UNIT_DEVICE_PATH ;
  202. #define MSG_USB_CLASS_DP 0x0F
  203. typedef struct _USB_CLASS_DEVICE_PATH {
  204. EFI_DEVICE_PATH_PROTOCOL Header;
  205. UINT16 VendorId;
  206. UINT16 ProductId;
  207. UINT8 DeviceClass;
  208. UINT8 DeviceSubclass;
  209. UINT8 DeviceProtocol;
  210. } USB_CLASS_DEVICE_PATH;
  211. #define MSG_I2O_DP 0x06
  212. typedef struct _I2O_DEVICE_PATH {
  213. EFI_DEVICE_PATH_PROTOCOL Header;
  214. UINT32 Tid;
  215. } I2O_DEVICE_PATH;
  216. #define MSG_MAC_ADDR_DP 0x0b
  217. typedef struct _MAC_ADDR_DEVICE_PATH {
  218. EFI_DEVICE_PATH_PROTOCOL Header;
  219. EFI_MAC_ADDRESS MacAddress;
  220. UINT8 IfType;
  221. } MAC_ADDR_DEVICE_PATH;
  222. #define MSG_IPv4_DP 0x0c
  223. typedef struct _IPv4_DEVICE_PATH {
  224. EFI_DEVICE_PATH_PROTOCOL Header;
  225. EFI_IPv4_ADDRESS LocalIpAddress;
  226. EFI_IPv4_ADDRESS RemoteIpAddress;
  227. UINT16 LocalPort;
  228. UINT16 RemotePort;
  229. UINT16 Protocol;
  230. BOOLEAN StaticIpAddress;
  231. /* new from UEFI version 2, code must check Length field in Header */
  232. EFI_IPv4_ADDRESS GatewayIpAddress ;
  233. EFI_IPv4_ADDRESS SubnetMask ;
  234. } IPv4_DEVICE_PATH;
  235. #define MSG_IPv6_DP 0x0d
  236. typedef struct _IPv6_DEVICE_PATH {
  237. EFI_DEVICE_PATH_PROTOCOL Header;
  238. EFI_IPv6_ADDRESS LocalIpAddress;
  239. EFI_IPv6_ADDRESS RemoteIpAddress;
  240. UINT16 LocalPort;
  241. UINT16 RemotePort;
  242. UINT16 Protocol;
  243. BOOLEAN IPAddressOrigin ;
  244. /* new from UEFI version 2, code must check Length field in Header */
  245. UINT8 PrefixLength ;
  246. EFI_IPv6_ADDRESS GatewayIpAddress ;
  247. } IPv6_DEVICE_PATH;
  248. /**
  249. * Uniform Resource Identifiers SubType.
  250. * UEFI 2.0 specification version 2.4C § 9.3.5.23.
  251. */
  252. #define MSG_URI_DP 24
  253. typedef struct _URI_DEVICE_PATH {
  254. EFI_DEVICE_PATH_PROTOCOL Header;
  255. CHAR8 Uri[1];
  256. } URI_DEVICE_PATH;
  257. /**
  258. * Device Logical Unit SubType.
  259. * UEFI 2.0 specification version 2.4 § 9.3.5.8.
  260. */
  261. #define MSG_VLAN_DP 20
  262. typedef struct _VLAN_DEVICE_PATH {
  263. EFI_DEVICE_PATH_PROTOCOL Header ;
  264. UINT16 VlanId ;
  265. } VLAN_DEVICE_PATH;
  266. #define MSG_INFINIBAND_DP 0x09
  267. typedef struct _INFINIBAND_DEVICE_PATH {
  268. EFI_DEVICE_PATH_PROTOCOL Header;
  269. UINT32 ResourceFlags;
  270. UINT8 PortGid[16];
  271. UINT64 ServiceId;
  272. UINT64 TargetPortId;
  273. UINT64 DeviceId;
  274. } INFINIBAND_DEVICE_PATH;
  275. #define MSG_UART_DP 0x0e
  276. typedef struct _UART_DEVICE_PATH {
  277. EFI_DEVICE_PATH_PROTOCOL Header;
  278. UINT32 Reserved;
  279. UINT64 BaudRate;
  280. UINT8 DataBits;
  281. UINT8 Parity;
  282. UINT8 StopBits;
  283. } UART_DEVICE_PATH;
  284. #define MSG_VENDOR_DP 0x0A
  285. /* Use VENDOR_DEVICE_PATH struct */
  286. #define EFI_PC_ANSI_GUID \
  287. { 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
  288. #define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID
  289. #define EFI_VT_100_GUID \
  290. { 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
  291. #define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID
  292. #define EFI_VT_100_PLUS_GUID \
  293. { 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43} }
  294. #define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
  295. #define EFI_VT_UTF8_GUID \
  296. { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} }
  297. #define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID
  298. /*
  299. * Media Device Path (UEFI 2.4 specification, version 2.4 § 9.3.6.)
  300. */
  301. #define MEDIA_DEVICE_PATH 0x04
  302. #define MEDIA_HARDDRIVE_DP 0x01
  303. typedef struct _HARDDRIVE_DEVICE_PATH {
  304. EFI_DEVICE_PATH_PROTOCOL Header;
  305. UINT32 PartitionNumber;
  306. UINT64 PartitionStart;
  307. UINT64 PartitionSize;
  308. UINT8 Signature[16];
  309. UINT8 MBRType;
  310. UINT8 SignatureType;
  311. } HARDDRIVE_DEVICE_PATH;
  312. #define MBR_TYPE_PCAT 0x01
  313. #define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
  314. #define SIGNATURE_TYPE_MBR 0x01
  315. #define SIGNATURE_TYPE_GUID 0x02
  316. #define MEDIA_CDROM_DP 0x02
  317. typedef struct _CDROM_DEVICE_PATH {
  318. EFI_DEVICE_PATH_PROTOCOL Header;
  319. UINT32 BootEntry;
  320. UINT64 PartitionStart;
  321. UINT64 PartitionSize;
  322. } CDROM_DEVICE_PATH;
  323. #define MEDIA_VENDOR_DP 0x03
  324. /* Use VENDOR_DEVICE_PATH struct */
  325. #define MEDIA_FILEPATH_DP 0x04
  326. typedef struct _FILEPATH_DEVICE_PATH {
  327. EFI_DEVICE_PATH_PROTOCOL Header;
  328. CHAR16 PathName[1];
  329. } FILEPATH_DEVICE_PATH;
  330. #define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
  331. #define MEDIA_PROTOCOL_DP 0x05
  332. typedef struct _MEDIA_PROTOCOL_DEVICE_PATH {
  333. EFI_DEVICE_PATH_PROTOCOL Header;
  334. EFI_GUID Protocol;
  335. } MEDIA_PROTOCOL_DEVICE_PATH;
  336. /**
  337. * PIWG Firmware File SubType.
  338. * UEFI 2.0 specification version 2.4 § 9.3.6.6.
  339. */
  340. #define MEDIA_PIWG_FW_FILE_DP 6
  341. typedef struct _MEDIA_FW_VOL_FILEPATH_DEVICE_PATH {
  342. EFI_DEVICE_PATH_PROTOCOL Header ;
  343. EFI_GUID FvFileName ;
  344. } MEDIA_FW_VOL_FILEPATH_DEVICE_PATH ;
  345. /**
  346. * PIWG Firmware Volume Device Path SubType.
  347. * UEFI 2.0 specification version 2.4 § 9.3.6.7.
  348. */
  349. #define MEDIA_PIWG_FW_VOL_DP 7
  350. typedef struct _MEDIA_FW_VOL_DEVICE_PATH {
  351. EFI_DEVICE_PATH_PROTOCOL Header ;
  352. EFI_GUID FvName ;
  353. } MEDIA_FW_VOL_DEVICE_PATH ;
  354. /**
  355. * Media relative offset range device path.
  356. * UEFI 2.0 specification version 2.4 § 9.3.6.8.
  357. */
  358. #define MEDIA_RELATIVE_OFFSET_RANGE_DP 8
  359. typedef struct _MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH {
  360. EFI_DEVICE_PATH_PROTOCOL Header ;
  361. UINT32 Reserved ;
  362. UINT64 StartingOffset ;
  363. UINT64 EndingOffset ;
  364. } MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH ;
  365. /*
  366. * BIOS Boot Specification Device Path (UEFI 2.4 specification, version 2.4 § 9.3.7.)
  367. */
  368. #define BBS_DEVICE_PATH 0x05
  369. #define BBS_BBS_DP 0x01
  370. typedef struct _BBS_BBS_DEVICE_PATH {
  371. EFI_DEVICE_PATH_PROTOCOL Header;
  372. UINT16 DeviceType;
  373. UINT16 StatusFlag;
  374. CHAR8 String[1];
  375. } BBS_BBS_DEVICE_PATH;
  376. /* DeviceType definitions - from BBS specification */
  377. #define BBS_TYPE_FLOPPY 0x01
  378. #define BBS_TYPE_HARDDRIVE 0x02
  379. #define BBS_TYPE_CDROM 0x03
  380. #define BBS_TYPE_PCMCIA 0x04
  381. #define BBS_TYPE_USB 0x05
  382. #define BBS_TYPE_EMBEDDED_NETWORK 0x06
  383. #define BBS_TYPE_DEV 0x80
  384. #define BBS_TYPE_UNKNOWN 0xFF
  385. typedef union {
  386. EFI_DEVICE_PATH_PROTOCOL DevPath;
  387. PCI_DEVICE_PATH Pci;
  388. PCCARD_DEVICE_PATH PcCard;
  389. MEMMAP_DEVICE_PATH MemMap;
  390. VENDOR_DEVICE_PATH Vendor;
  391. UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor;
  392. CONTROLLER_DEVICE_PATH Controller;
  393. ACPI_HID_DEVICE_PATH Acpi;
  394. ATAPI_DEVICE_PATH Atapi;
  395. SCSI_DEVICE_PATH Scsi;
  396. FIBRECHANNEL_DEVICE_PATH FibreChannel;
  397. F1394_DEVICE_PATH F1394;
  398. USB_DEVICE_PATH Usb;
  399. USB_CLASS_DEVICE_PATH UsbClass;
  400. I2O_DEVICE_PATH I2O;
  401. MAC_ADDR_DEVICE_PATH MacAddr;
  402. IPv4_DEVICE_PATH Ipv4;
  403. IPv6_DEVICE_PATH Ipv6;
  404. URI_DEVICE_PATH Uri;
  405. INFINIBAND_DEVICE_PATH InfiniBand;
  406. UART_DEVICE_PATH Uart;
  407. HARDDRIVE_DEVICE_PATH HardDrive;
  408. CDROM_DEVICE_PATH CD;
  409. FILEPATH_DEVICE_PATH FilePath;
  410. MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
  411. BBS_BBS_DEVICE_PATH Bbs;
  412. } EFI_DEV_PATH;
  413. typedef union {
  414. EFI_DEVICE_PATH_PROTOCOL *DevPath;
  415. PCI_DEVICE_PATH *Pci;
  416. PCCARD_DEVICE_PATH *PcCard;
  417. MEMMAP_DEVICE_PATH *MemMap;
  418. VENDOR_DEVICE_PATH *Vendor;
  419. UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor;
  420. CONTROLLER_DEVICE_PATH *Controller;
  421. ACPI_HID_DEVICE_PATH *Acpi;
  422. ATAPI_DEVICE_PATH *Atapi;
  423. SCSI_DEVICE_PATH *Scsi;
  424. FIBRECHANNEL_DEVICE_PATH *FibreChannel;
  425. F1394_DEVICE_PATH *F1394;
  426. USB_DEVICE_PATH *Usb;
  427. USB_CLASS_DEVICE_PATH *UsbClass;
  428. I2O_DEVICE_PATH *I2O;
  429. MAC_ADDR_DEVICE_PATH *MacAddr;
  430. IPv4_DEVICE_PATH *Ipv4;
  431. IPv6_DEVICE_PATH *Ipv6;
  432. URI_DEVICE_PATH *Uri;
  433. INFINIBAND_DEVICE_PATH *InfiniBand;
  434. UART_DEVICE_PATH *Uart;
  435. HARDDRIVE_DEVICE_PATH *HardDrive;
  436. FILEPATH_DEVICE_PATH *FilePath;
  437. MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
  438. CDROM_DEVICE_PATH *CD;
  439. BBS_BBS_DEVICE_PATH *Bbs;
  440. } EFI_DEV_PATH_PTR;
  441. #define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
  442. { 0x8b843e20, 0x8132, 0x4852, {0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c} }
  443. typedef
  444. CHAR16*
  445. (EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
  446. IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
  447. IN BOOLEAN DisplayOnly,
  448. IN BOOLEAN AllowShortcuts
  449. );
  450. typedef
  451. CHAR16*
  452. (EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
  453. IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
  454. IN BOOLEAN DisplayOnly,
  455. IN BOOLEAN AllowShortcuts
  456. );
  457. typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL {
  458. EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
  459. EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
  460. } EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
  461. #define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
  462. { 0x5c99a21, 0xc70f, 0x4ad2, {0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e} }
  463. typedef
  464. EFI_DEVICE_PATH_PROTOCOL*
  465. (EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (
  466. IN CONST CHAR16 *TextDeviceNode
  467. );
  468. typedef
  469. EFI_DEVICE_PATH_PROTOCOL*
  470. (EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) (
  471. IN CONST CHAR16 *TextDevicePath
  472. );
  473. typedef struct {
  474. EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertTextToDeviceNode;
  475. EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertTextToDevicePath;
  476. } EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
  477. #define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
  478. { 0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4} }
  479. typedef
  480. UINTN
  481. (EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE) (
  482. IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
  483. );
  484. typedef
  485. EFI_DEVICE_PATH_PROTOCOL*
  486. (EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH) (
  487. IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
  488. );
  489. typedef
  490. EFI_DEVICE_PATH_PROTOCOL*
  491. (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH) (
  492. IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
  493. IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
  494. );
  495. typedef
  496. EFI_DEVICE_PATH_PROTOCOL*
  497. (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE) (
  498. IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
  499. IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
  500. );
  501. typedef
  502. EFI_DEVICE_PATH_PROTOCOL*
  503. (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE) (
  504. IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
  505. IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
  506. );
  507. typedef
  508. EFI_DEVICE_PATH_PROTOCOL*
  509. (EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE) (
  510. IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
  511. OUT UINTN *DevicePathInstanceSize OPTIONAL
  512. );
  513. typedef
  514. EFI_DEVICE_PATH_PROTOCOL*
  515. (EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE) (
  516. IN UINT8 NodeType,
  517. IN UINT8 NodeSubType,
  518. IN UINT16 NodeLength
  519. );
  520. typedef
  521. BOOLEAN
  522. (EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE) (
  523. IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
  524. );
  525. typedef struct _EFI_DEVICE_PATH_UTILITIES_PROTOCOL {
  526. EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
  527. EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath;
  528. EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath;
  529. EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode;
  530. EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance;
  531. EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance;
  532. EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance;
  533. EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode;
  534. } EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
  535. #endif