efi_api.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. /*
  2. * Extensible Firmware Interface
  3. * Based on 'Extensible Firmware Interface Specification' version 0.9,
  4. * April 30, 1999
  5. *
  6. * Copyright (C) 1999 VA Linux Systems
  7. * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  8. * Copyright (C) 1999, 2002-2003 Hewlett-Packard Co.
  9. * David Mosberger-Tang <davidm@hpl.hp.com>
  10. * Stephane Eranian <eranian@hpl.hp.com>
  11. *
  12. * From include/linux/efi.h in kernel 4.1 with some additions/subtractions
  13. */
  14. #ifndef _EFI_API_H
  15. #define _EFI_API_H
  16. #include <efi.h>
  17. #ifdef CONFIG_EFI_LOADER
  18. #include <asm/setjmp.h>
  19. #endif
  20. /* Types and defines for EFI CreateEvent */
  21. enum efi_event_type {
  22. EFI_TIMER_STOP = 0,
  23. EFI_TIMER_PERIODIC = 1,
  24. EFI_TIMER_RELATIVE = 2
  25. };
  26. /* EFI Boot Services table */
  27. struct efi_boot_services {
  28. struct efi_table_hdr hdr;
  29. efi_status_t (EFIAPI *raise_tpl)(unsigned long new_tpl);
  30. void (EFIAPI *restore_tpl)(unsigned long old_tpl);
  31. efi_status_t (EFIAPI *allocate_pages)(int, int, unsigned long,
  32. efi_physical_addr_t *);
  33. efi_status_t (EFIAPI *free_pages)(efi_physical_addr_t, unsigned long);
  34. efi_status_t (EFIAPI *get_memory_map)(unsigned long *memory_map_size,
  35. struct efi_mem_desc *desc, unsigned long *key,
  36. unsigned long *desc_size, u32 *desc_version);
  37. efi_status_t (EFIAPI *allocate_pool)(int, unsigned long, void **);
  38. efi_status_t (EFIAPI *free_pool)(void *);
  39. efi_status_t (EFIAPI *create_event)(enum efi_event_type type,
  40. unsigned long notify_tpl,
  41. void (EFIAPI *notify_function) (void *event,
  42. void *context),
  43. void *notify_context, void **event);
  44. efi_status_t (EFIAPI *set_timer)(void *event, int type,
  45. uint64_t trigger_time);
  46. efi_status_t (EFIAPI *wait_for_event)(unsigned long number_of_events,
  47. void *event, unsigned long *index);
  48. efi_status_t (EFIAPI *signal_event)(void *event);
  49. efi_status_t (EFIAPI *close_event)(void *event);
  50. efi_status_t (EFIAPI *check_event)(void *event);
  51. efi_status_t (EFIAPI *install_protocol_interface)(
  52. void **handle, efi_guid_t *protocol,
  53. int protocol_interface_type, void *protocol_interface);
  54. efi_status_t (EFIAPI *reinstall_protocol_interface)(
  55. void *handle, efi_guid_t *protocol,
  56. void *old_interface, void *new_interface);
  57. efi_status_t (EFIAPI *uninstall_protocol_interface)(void *handle,
  58. efi_guid_t *protocol, void *protocol_interface);
  59. efi_status_t (EFIAPI *handle_protocol)(efi_handle_t, efi_guid_t *,
  60. void **);
  61. void *reserved;
  62. efi_status_t (EFIAPI *register_protocol_notify)(
  63. efi_guid_t *protocol, void *event,
  64. void **registration);
  65. efi_status_t (EFIAPI *locate_handle)(
  66. enum efi_locate_search_type search_type,
  67. efi_guid_t *protocol, void *search_key,
  68. unsigned long *buffer_size, efi_handle_t *buffer);
  69. efi_status_t (EFIAPI *locate_device_path)(efi_guid_t *protocol,
  70. struct efi_device_path **device_path,
  71. efi_handle_t *device);
  72. efi_status_t (EFIAPI *install_configuration_table)(
  73. efi_guid_t *guid, void *table);
  74. efi_status_t (EFIAPI *load_image)(bool boot_policiy,
  75. efi_handle_t parent_image,
  76. struct efi_device_path *file_path, void *source_buffer,
  77. unsigned long source_size, efi_handle_t *image);
  78. efi_status_t (EFIAPI *start_image)(efi_handle_t handle,
  79. unsigned long *exitdata_size,
  80. s16 **exitdata);
  81. efi_status_t (EFIAPI *exit)(efi_handle_t handle,
  82. efi_status_t exit_status,
  83. unsigned long exitdata_size, s16 *exitdata);
  84. efi_status_t (EFIAPI *unload_image)(void *image_handle);
  85. efi_status_t (EFIAPI *exit_boot_services)(efi_handle_t, unsigned long);
  86. efi_status_t (EFIAPI *get_next_monotonic_count)(u64 *count);
  87. efi_status_t (EFIAPI *stall)(unsigned long usecs);
  88. efi_status_t (EFIAPI *set_watchdog_timer)(unsigned long timeout,
  89. uint64_t watchdog_code, unsigned long data_size,
  90. uint16_t *watchdog_data);
  91. efi_status_t(EFIAPI *connect_controller)(efi_handle_t controller_handle,
  92. efi_handle_t *driver_image_handle,
  93. struct efi_device_path *remaining_device_path,
  94. bool recursive);
  95. efi_status_t (EFIAPI *disconnect_controller)(void *controller_handle,
  96. void *driver_image_handle, void *child_handle);
  97. #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
  98. #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
  99. #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
  100. #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
  101. #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
  102. #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
  103. efi_status_t (EFIAPI *open_protocol)(efi_handle_t handle,
  104. efi_guid_t *protocol, void **interface,
  105. efi_handle_t agent_handle,
  106. efi_handle_t controller_handle, u32 attributes);
  107. efi_status_t (EFIAPI *close_protocol)(void *handle,
  108. efi_guid_t *protocol, void *agent_handle,
  109. void *controller_handle);
  110. efi_status_t(EFIAPI *open_protocol_information)(efi_handle_t handle,
  111. efi_guid_t *protocol,
  112. struct efi_open_protocol_info_entry **entry_buffer,
  113. unsigned long *entry_count);
  114. efi_status_t (EFIAPI *protocols_per_handle)(efi_handle_t handle,
  115. efi_guid_t ***protocol_buffer,
  116. unsigned long *protocols_buffer_count);
  117. efi_status_t (EFIAPI *locate_handle_buffer) (
  118. enum efi_locate_search_type search_type,
  119. efi_guid_t *protocol, void *search_key,
  120. unsigned long *no_handles, efi_handle_t **buffer);
  121. efi_status_t (EFIAPI *locate_protocol)(efi_guid_t *protocol,
  122. void *registration, void **protocol_interface);
  123. efi_status_t (EFIAPI *install_multiple_protocol_interfaces)(
  124. void **handle, ...);
  125. efi_status_t (EFIAPI *uninstall_multiple_protocol_interfaces)(
  126. void *handle, ...);
  127. efi_status_t (EFIAPI *calculate_crc32)(void *data,
  128. unsigned long data_size, uint32_t *crc32);
  129. void (EFIAPI *copy_mem)(void *destination, void *source,
  130. unsigned long length);
  131. void (EFIAPI *set_mem)(void *buffer, unsigned long size,
  132. uint8_t value);
  133. void *create_event_ex;
  134. };
  135. /* Types and defines for EFI ResetSystem */
  136. enum efi_reset_type {
  137. EFI_RESET_COLD = 0,
  138. EFI_RESET_WARM = 1,
  139. EFI_RESET_SHUTDOWN = 2
  140. };
  141. /* EFI Runtime Services table */
  142. #define EFI_RUNTIME_SERVICES_SIGNATURE 0x5652453544e5552ULL
  143. #define EFI_RUNTIME_SERVICES_REVISION 0x00010000
  144. struct efi_runtime_services {
  145. struct efi_table_hdr hdr;
  146. efi_status_t (EFIAPI *get_time)(struct efi_time *time,
  147. struct efi_time_cap *capabilities);
  148. efi_status_t (EFIAPI *set_time)(struct efi_time *time);
  149. efi_status_t (EFIAPI *get_wakeup_time)(char *enabled, char *pending,
  150. struct efi_time *time);
  151. efi_status_t (EFIAPI *set_wakeup_time)(char enabled,
  152. struct efi_time *time);
  153. efi_status_t (EFIAPI *set_virtual_address_map)(
  154. unsigned long memory_map_size,
  155. unsigned long descriptor_size,
  156. uint32_t descriptor_version,
  157. struct efi_mem_desc *virtmap);
  158. efi_status_t (*convert_pointer)(unsigned long dbg, void **address);
  159. efi_status_t (EFIAPI *get_variable)(s16 *variable_name,
  160. efi_guid_t *vendor, u32 *attributes,
  161. unsigned long *data_size, void *data);
  162. efi_status_t (EFIAPI *get_next_variable)(
  163. unsigned long *variable_name_size,
  164. s16 *variable_name, efi_guid_t *vendor);
  165. efi_status_t (EFIAPI *set_variable)(s16 *variable_name,
  166. efi_guid_t *vendor, u32 attributes,
  167. unsigned long data_size, void *data);
  168. efi_status_t (EFIAPI *get_next_high_mono_count)(
  169. uint32_t *high_count);
  170. void (EFIAPI *reset_system)(enum efi_reset_type reset_type,
  171. efi_status_t reset_status,
  172. unsigned long data_size, void *reset_data);
  173. void *update_capsule;
  174. void *query_capsule_caps;
  175. void *query_variable_info;
  176. };
  177. /* EFI Configuration Table and GUID definitions */
  178. #define NULL_GUID \
  179. EFI_GUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, \
  180. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
  181. #define LOADED_IMAGE_PROTOCOL_GUID \
  182. EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, 0x8e, 0x3f, \
  183. 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
  184. #define EFI_FDT_GUID \
  185. EFI_GUID(0xb1b621d5, 0xf19c, 0x41a5, \
  186. 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0)
  187. #define SMBIOS_TABLE_GUID \
  188. EFI_GUID(0xeb9d2d31, 0x2d88, 0x11d3, \
  189. 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
  190. struct efi_configuration_table
  191. {
  192. efi_guid_t guid;
  193. void *table;
  194. };
  195. #define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
  196. struct efi_system_table {
  197. struct efi_table_hdr hdr;
  198. unsigned long fw_vendor; /* physical addr of wchar_t vendor string */
  199. u32 fw_revision;
  200. unsigned long con_in_handle;
  201. struct efi_simple_input_interface *con_in;
  202. unsigned long con_out_handle;
  203. struct efi_simple_text_output_protocol *con_out;
  204. unsigned long stderr_handle;
  205. struct efi_simple_text_output_protocol *std_err;
  206. struct efi_runtime_services *runtime;
  207. struct efi_boot_services *boottime;
  208. unsigned long nr_tables;
  209. struct efi_configuration_table *tables;
  210. };
  211. #define LOADED_IMAGE_GUID \
  212. EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, \
  213. 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
  214. struct efi_loaded_image {
  215. u32 revision;
  216. void *parent_handle;
  217. struct efi_system_table *system_table;
  218. void *device_handle;
  219. void *file_path;
  220. void *reserved;
  221. u32 load_options_size;
  222. void *load_options;
  223. void *image_base;
  224. aligned_u64 image_size;
  225. unsigned int image_code_type;
  226. unsigned int image_data_type;
  227. unsigned long unload;
  228. /* Below are efi loader private fields */
  229. #ifdef CONFIG_EFI_LOADER
  230. efi_status_t exit_status;
  231. struct jmp_buf_data exit_jmp;
  232. #endif
  233. };
  234. #define DEVICE_PATH_GUID \
  235. EFI_GUID(0x09576e91, 0x6d3f, 0x11d2, \
  236. 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b )
  237. #define DEVICE_PATH_TYPE_END 0x7f
  238. # define DEVICE_PATH_SUB_TYPE_END 0xff
  239. struct efi_device_path {
  240. u8 type;
  241. u8 sub_type;
  242. u16 length;
  243. };
  244. #define DEVICE_PATH_TYPE_MEDIA_DEVICE 0x04
  245. # define DEVICE_PATH_SUB_TYPE_FILE_PATH 0x04
  246. struct efi_device_path_file_path {
  247. struct efi_device_path dp;
  248. u16 str[32];
  249. };
  250. #define BLOCK_IO_GUID \
  251. EFI_GUID(0x964e5b21, 0x6459, 0x11d2, \
  252. 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
  253. struct efi_block_io_media
  254. {
  255. u32 media_id;
  256. char removable_media;
  257. char media_present;
  258. char logical_partition;
  259. char read_only;
  260. char write_caching;
  261. u8 pad[3];
  262. u32 block_size;
  263. u32 io_align;
  264. u8 pad2[4];
  265. u64 last_block;
  266. };
  267. struct efi_block_io {
  268. u64 revision;
  269. struct efi_block_io_media *media;
  270. efi_status_t (EFIAPI *reset)(struct efi_block_io *this,
  271. char extended_verification);
  272. efi_status_t (EFIAPI *read_blocks)(struct efi_block_io *this,
  273. u32 media_id, u64 lba, unsigned long buffer_size,
  274. void *buffer);
  275. efi_status_t (EFIAPI *write_blocks)(struct efi_block_io *this,
  276. u32 media_id, u64 lba, unsigned long buffer_size,
  277. void *buffer);
  278. efi_status_t (EFIAPI *flush_blocks)(struct efi_block_io *this);
  279. };
  280. struct simple_text_output_mode {
  281. s32 max_mode;
  282. s32 mode;
  283. s32 attribute;
  284. s32 cursor_column;
  285. s32 cursor_row;
  286. bool cursor_visible;
  287. };
  288. struct efi_simple_text_output_protocol {
  289. void *reset;
  290. efi_status_t (EFIAPI *output_string)(
  291. struct efi_simple_text_output_protocol *this,
  292. const unsigned short *str);
  293. efi_status_t (EFIAPI *test_string)(
  294. struct efi_simple_text_output_protocol *this,
  295. const unsigned short *str);
  296. efi_status_t(EFIAPI *query_mode)(
  297. struct efi_simple_text_output_protocol *this,
  298. unsigned long mode_number, unsigned long *columns,
  299. unsigned long *rows);
  300. efi_status_t(EFIAPI *set_mode)(
  301. struct efi_simple_text_output_protocol *this,
  302. unsigned long mode_number);
  303. efi_status_t(EFIAPI *set_attribute)(
  304. struct efi_simple_text_output_protocol *this,
  305. unsigned long attribute);
  306. efi_status_t(EFIAPI *clear_screen) (
  307. struct efi_simple_text_output_protocol *this);
  308. efi_status_t(EFIAPI *set_cursor_position) (
  309. struct efi_simple_text_output_protocol *this,
  310. unsigned long column, unsigned long row);
  311. efi_status_t(EFIAPI *enable_cursor)(
  312. struct efi_simple_text_output_protocol *this,
  313. bool enable);
  314. struct simple_text_output_mode *mode;
  315. };
  316. struct efi_input_key {
  317. u16 scan_code;
  318. s16 unicode_char;
  319. };
  320. struct efi_simple_input_interface {
  321. efi_status_t(EFIAPI *reset)(struct efi_simple_input_interface *this,
  322. bool ExtendedVerification);
  323. efi_status_t(EFIAPI *read_key_stroke)(
  324. struct efi_simple_input_interface *this,
  325. struct efi_input_key *key);
  326. void *wait_for_key;
  327. };
  328. #define CONSOLE_CONTROL_GUID \
  329. EFI_GUID(0xf42f7782, 0x12e, 0x4c12, \
  330. 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21)
  331. #define EFI_CONSOLE_MODE_TEXT 0
  332. #define EFI_CONSOLE_MODE_GFX 1
  333. struct efi_console_control_protocol
  334. {
  335. efi_status_t (EFIAPI *get_mode)(
  336. struct efi_console_control_protocol *this, int *mode,
  337. char *uga_exists, char *std_in_locked);
  338. efi_status_t (EFIAPI *set_mode)(
  339. struct efi_console_control_protocol *this, int mode);
  340. efi_status_t (EFIAPI *lock_std_in)(
  341. struct efi_console_control_protocol *this,
  342. uint16_t *password);
  343. };
  344. #define EFI_GOP_GUID \
  345. EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, \
  346. 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a)
  347. #define EFI_GOT_RGBA8 0
  348. #define EFI_GOT_BGRA8 1
  349. #define EFI_GOT_BITMASK 2
  350. struct efi_gop_mode_info
  351. {
  352. u32 version;
  353. u32 width;
  354. u32 height;
  355. u32 pixel_format;
  356. u32 pixel_bitmask[4];
  357. u32 pixels_per_scanline;
  358. };
  359. struct efi_gop_mode
  360. {
  361. u32 max_mode;
  362. u32 mode;
  363. struct efi_gop_mode_info *info;
  364. unsigned long info_size;
  365. efi_physical_addr_t fb_base;
  366. unsigned long fb_size;
  367. };
  368. #define EFI_BLT_VIDEO_FILL 0
  369. #define EFI_BLT_VIDEO_TO_BLT_BUFFER 1
  370. #define EFI_BLT_BUFFER_TO_VIDEO 2
  371. #define EFI_BLT_VIDEO_TO_VIDEO 3
  372. struct efi_gop
  373. {
  374. efi_status_t (EFIAPI *query_mode)(struct efi_gop *this, u32 mode_number,
  375. unsigned long *size_of_info,
  376. struct efi_gop_mode_info **info);
  377. efi_status_t (EFIAPI *set_mode)(struct efi_gop *this, u32 mode_number);
  378. efi_status_t (EFIAPI *blt)(struct efi_gop *this, void *buffer,
  379. unsigned long operation, unsigned long sx,
  380. unsigned long sy, unsigned long dx,
  381. unsigned long dy, unsigned long width,
  382. unsigned long height, unsigned long delta);
  383. struct efi_gop_mode *mode;
  384. };
  385. #define EFI_SIMPLE_NETWORK_GUID \
  386. EFI_GUID(0xa19832b9, 0xac25, 0x11d3, \
  387. 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
  388. struct efi_mac_address {
  389. char mac_addr[32];
  390. };
  391. struct efi_ip_address {
  392. u8 ip_addr[16];
  393. };
  394. enum efi_simple_network_state {
  395. EFI_NETWORK_STOPPED,
  396. EFI_NETWORK_STARTED,
  397. EFI_NETWORK_INITIALIZED,
  398. };
  399. struct efi_simple_network_mode {
  400. enum efi_simple_network_state state;
  401. u32 hwaddr_size;
  402. u32 media_header_size;
  403. u32 max_packet_size;
  404. u32 nvram_size;
  405. u32 nvram_access_size;
  406. u32 receive_filter_mask;
  407. u32 receive_filter_setting;
  408. u32 max_mcast_filter_count;
  409. u32 mcast_filter_count;
  410. struct efi_mac_address mcast_filter[16];
  411. struct efi_mac_address current_address;
  412. struct efi_mac_address broadcast_address;
  413. struct efi_mac_address permanent_address;
  414. u8 if_type;
  415. u8 mac_changeable;
  416. u8 multitx_supported;
  417. u8 media_present_supported;
  418. u8 media_present;
  419. };
  420. #define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01,
  421. #define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02,
  422. #define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04,
  423. #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08,
  424. #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10,
  425. struct efi_simple_network
  426. {
  427. u64 revision;
  428. efi_status_t (EFIAPI *start)(struct efi_simple_network *this);
  429. efi_status_t (EFIAPI *stop)(struct efi_simple_network *this);
  430. efi_status_t (EFIAPI *initialize)(struct efi_simple_network *this,
  431. ulong extra_rx, ulong extra_tx);
  432. efi_status_t (EFIAPI *reset)(struct efi_simple_network *this,
  433. int extended_verification);
  434. efi_status_t (EFIAPI *shutdown)(struct efi_simple_network *this);
  435. efi_status_t (EFIAPI *receive_filters)(struct efi_simple_network *this,
  436. u32 enable, u32 disable, int reset_mcast_filter,
  437. ulong mcast_filter_count,
  438. struct efi_mac_address *mcast_filter);
  439. efi_status_t (EFIAPI *station_address)(struct efi_simple_network *this,
  440. int reset, struct efi_mac_address *new_mac);
  441. efi_status_t (EFIAPI *statistics)(struct efi_simple_network *this,
  442. int reset, ulong *stat_size, void *stat_table);
  443. efi_status_t (EFIAPI *mcastiptomac)(struct efi_simple_network *this,
  444. int ipv6, struct efi_ip_address *ip,
  445. struct efi_mac_address *mac);
  446. efi_status_t (EFIAPI *nvdata)(struct efi_simple_network *this,
  447. int read_write, ulong offset, ulong buffer_size,
  448. char *buffer);
  449. efi_status_t (EFIAPI *get_status)(struct efi_simple_network *this,
  450. u32 *int_status, void **txbuf);
  451. efi_status_t (EFIAPI *transmit)(struct efi_simple_network *this,
  452. ulong header_size, ulong buffer_size, void *buffer,
  453. struct efi_mac_address *src_addr,
  454. struct efi_mac_address *dest_addr, u16 *protocol);
  455. efi_status_t (EFIAPI *receive)(struct efi_simple_network *this,
  456. ulong *header_size, ulong *buffer_size, void *buffer,
  457. struct efi_mac_address *src_addr,
  458. struct efi_mac_address *dest_addr, u16 *protocol);
  459. void (EFIAPI *waitforpacket)(void);
  460. struct efi_simple_network_mode *mode;
  461. };
  462. #define EFI_PXE_GUID \
  463. EFI_GUID(0x03c4e603, 0xac28, 0x11d3, \
  464. 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
  465. struct efi_pxe_packet {
  466. u8 packet[1472];
  467. };
  468. struct efi_pxe_mode
  469. {
  470. u8 unused[52];
  471. struct efi_pxe_packet dhcp_discover;
  472. struct efi_pxe_packet dhcp_ack;
  473. struct efi_pxe_packet proxy_offer;
  474. struct efi_pxe_packet pxe_discover;
  475. struct efi_pxe_packet pxe_reply;
  476. };
  477. struct efi_pxe {
  478. u64 rev;
  479. void (EFIAPI *start)(void);
  480. void (EFIAPI *stop)(void);
  481. void (EFIAPI *dhcp)(void);
  482. void (EFIAPI *discover)(void);
  483. void (EFIAPI *mftp)(void);
  484. void (EFIAPI *udpwrite)(void);
  485. void (EFIAPI *udpread)(void);
  486. void (EFIAPI *setipfilter)(void);
  487. void (EFIAPI *arp)(void);
  488. void (EFIAPI *setparams)(void);
  489. void (EFIAPI *setstationip)(void);
  490. void (EFIAPI *setpackets)(void);
  491. struct efi_pxe_mode *mode;
  492. };
  493. #endif