efi_api.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  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. struct efi_mac_addr {
  245. u8 addr[32];
  246. };
  247. #define DEVICE_PATH_TYPE_MESSAGING_DEVICE 0x03
  248. # define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR 0x0b
  249. struct efi_device_path_mac_addr {
  250. struct efi_device_path dp;
  251. struct efi_mac_addr mac;
  252. u8 if_type;
  253. };
  254. #define DEVICE_PATH_TYPE_MEDIA_DEVICE 0x04
  255. # define DEVICE_PATH_SUB_TYPE_FILE_PATH 0x04
  256. struct efi_device_path_file_path {
  257. struct efi_device_path dp;
  258. u16 str[32];
  259. };
  260. #define BLOCK_IO_GUID \
  261. EFI_GUID(0x964e5b21, 0x6459, 0x11d2, \
  262. 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
  263. struct efi_block_io_media
  264. {
  265. u32 media_id;
  266. char removable_media;
  267. char media_present;
  268. char logical_partition;
  269. char read_only;
  270. char write_caching;
  271. u8 pad[3];
  272. u32 block_size;
  273. u32 io_align;
  274. u8 pad2[4];
  275. u64 last_block;
  276. };
  277. struct efi_block_io {
  278. u64 revision;
  279. struct efi_block_io_media *media;
  280. efi_status_t (EFIAPI *reset)(struct efi_block_io *this,
  281. char extended_verification);
  282. efi_status_t (EFIAPI *read_blocks)(struct efi_block_io *this,
  283. u32 media_id, u64 lba, unsigned long buffer_size,
  284. void *buffer);
  285. efi_status_t (EFIAPI *write_blocks)(struct efi_block_io *this,
  286. u32 media_id, u64 lba, unsigned long buffer_size,
  287. void *buffer);
  288. efi_status_t (EFIAPI *flush_blocks)(struct efi_block_io *this);
  289. };
  290. struct simple_text_output_mode {
  291. s32 max_mode;
  292. s32 mode;
  293. s32 attribute;
  294. s32 cursor_column;
  295. s32 cursor_row;
  296. bool cursor_visible;
  297. };
  298. struct efi_simple_text_output_protocol {
  299. void *reset;
  300. efi_status_t (EFIAPI *output_string)(
  301. struct efi_simple_text_output_protocol *this,
  302. const unsigned short *str);
  303. efi_status_t (EFIAPI *test_string)(
  304. struct efi_simple_text_output_protocol *this,
  305. const unsigned short *str);
  306. efi_status_t(EFIAPI *query_mode)(
  307. struct efi_simple_text_output_protocol *this,
  308. unsigned long mode_number, unsigned long *columns,
  309. unsigned long *rows);
  310. efi_status_t(EFIAPI *set_mode)(
  311. struct efi_simple_text_output_protocol *this,
  312. unsigned long mode_number);
  313. efi_status_t(EFIAPI *set_attribute)(
  314. struct efi_simple_text_output_protocol *this,
  315. unsigned long attribute);
  316. efi_status_t(EFIAPI *clear_screen) (
  317. struct efi_simple_text_output_protocol *this);
  318. efi_status_t(EFIAPI *set_cursor_position) (
  319. struct efi_simple_text_output_protocol *this,
  320. unsigned long column, unsigned long row);
  321. efi_status_t(EFIAPI *enable_cursor)(
  322. struct efi_simple_text_output_protocol *this,
  323. bool enable);
  324. struct simple_text_output_mode *mode;
  325. };
  326. struct efi_input_key {
  327. u16 scan_code;
  328. s16 unicode_char;
  329. };
  330. struct efi_simple_input_interface {
  331. efi_status_t(EFIAPI *reset)(struct efi_simple_input_interface *this,
  332. bool ExtendedVerification);
  333. efi_status_t(EFIAPI *read_key_stroke)(
  334. struct efi_simple_input_interface *this,
  335. struct efi_input_key *key);
  336. void *wait_for_key;
  337. };
  338. #define CONSOLE_CONTROL_GUID \
  339. EFI_GUID(0xf42f7782, 0x12e, 0x4c12, \
  340. 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21)
  341. #define EFI_CONSOLE_MODE_TEXT 0
  342. #define EFI_CONSOLE_MODE_GFX 1
  343. struct efi_console_control_protocol
  344. {
  345. efi_status_t (EFIAPI *get_mode)(
  346. struct efi_console_control_protocol *this, int *mode,
  347. char *uga_exists, char *std_in_locked);
  348. efi_status_t (EFIAPI *set_mode)(
  349. struct efi_console_control_protocol *this, int mode);
  350. efi_status_t (EFIAPI *lock_std_in)(
  351. struct efi_console_control_protocol *this,
  352. uint16_t *password);
  353. };
  354. #define EFI_GOP_GUID \
  355. EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, \
  356. 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a)
  357. #define EFI_GOT_RGBA8 0
  358. #define EFI_GOT_BGRA8 1
  359. #define EFI_GOT_BITMASK 2
  360. struct efi_gop_mode_info
  361. {
  362. u32 version;
  363. u32 width;
  364. u32 height;
  365. u32 pixel_format;
  366. u32 pixel_bitmask[4];
  367. u32 pixels_per_scanline;
  368. };
  369. struct efi_gop_mode
  370. {
  371. u32 max_mode;
  372. u32 mode;
  373. struct efi_gop_mode_info *info;
  374. unsigned long info_size;
  375. efi_physical_addr_t fb_base;
  376. unsigned long fb_size;
  377. };
  378. #define EFI_BLT_VIDEO_FILL 0
  379. #define EFI_BLT_VIDEO_TO_BLT_BUFFER 1
  380. #define EFI_BLT_BUFFER_TO_VIDEO 2
  381. #define EFI_BLT_VIDEO_TO_VIDEO 3
  382. struct efi_gop
  383. {
  384. efi_status_t (EFIAPI *query_mode)(struct efi_gop *this, u32 mode_number,
  385. unsigned long *size_of_info,
  386. struct efi_gop_mode_info **info);
  387. efi_status_t (EFIAPI *set_mode)(struct efi_gop *this, u32 mode_number);
  388. efi_status_t (EFIAPI *blt)(struct efi_gop *this, void *buffer,
  389. unsigned long operation, unsigned long sx,
  390. unsigned long sy, unsigned long dx,
  391. unsigned long dy, unsigned long width,
  392. unsigned long height, unsigned long delta);
  393. struct efi_gop_mode *mode;
  394. };
  395. #define EFI_SIMPLE_NETWORK_GUID \
  396. EFI_GUID(0xa19832b9, 0xac25, 0x11d3, \
  397. 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
  398. struct efi_mac_address {
  399. char mac_addr[32];
  400. };
  401. struct efi_ip_address {
  402. u8 ip_addr[16];
  403. };
  404. enum efi_simple_network_state {
  405. EFI_NETWORK_STOPPED,
  406. EFI_NETWORK_STARTED,
  407. EFI_NETWORK_INITIALIZED,
  408. };
  409. struct efi_simple_network_mode {
  410. enum efi_simple_network_state state;
  411. u32 hwaddr_size;
  412. u32 media_header_size;
  413. u32 max_packet_size;
  414. u32 nvram_size;
  415. u32 nvram_access_size;
  416. u32 receive_filter_mask;
  417. u32 receive_filter_setting;
  418. u32 max_mcast_filter_count;
  419. u32 mcast_filter_count;
  420. struct efi_mac_address mcast_filter[16];
  421. struct efi_mac_address current_address;
  422. struct efi_mac_address broadcast_address;
  423. struct efi_mac_address permanent_address;
  424. u8 if_type;
  425. u8 mac_changeable;
  426. u8 multitx_supported;
  427. u8 media_present_supported;
  428. u8 media_present;
  429. };
  430. #define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01,
  431. #define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02,
  432. #define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04,
  433. #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08,
  434. #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10,
  435. struct efi_simple_network
  436. {
  437. u64 revision;
  438. efi_status_t (EFIAPI *start)(struct efi_simple_network *this);
  439. efi_status_t (EFIAPI *stop)(struct efi_simple_network *this);
  440. efi_status_t (EFIAPI *initialize)(struct efi_simple_network *this,
  441. ulong extra_rx, ulong extra_tx);
  442. efi_status_t (EFIAPI *reset)(struct efi_simple_network *this,
  443. int extended_verification);
  444. efi_status_t (EFIAPI *shutdown)(struct efi_simple_network *this);
  445. efi_status_t (EFIAPI *receive_filters)(struct efi_simple_network *this,
  446. u32 enable, u32 disable, int reset_mcast_filter,
  447. ulong mcast_filter_count,
  448. struct efi_mac_address *mcast_filter);
  449. efi_status_t (EFIAPI *station_address)(struct efi_simple_network *this,
  450. int reset, struct efi_mac_address *new_mac);
  451. efi_status_t (EFIAPI *statistics)(struct efi_simple_network *this,
  452. int reset, ulong *stat_size, void *stat_table);
  453. efi_status_t (EFIAPI *mcastiptomac)(struct efi_simple_network *this,
  454. int ipv6, struct efi_ip_address *ip,
  455. struct efi_mac_address *mac);
  456. efi_status_t (EFIAPI *nvdata)(struct efi_simple_network *this,
  457. int read_write, ulong offset, ulong buffer_size,
  458. char *buffer);
  459. efi_status_t (EFIAPI *get_status)(struct efi_simple_network *this,
  460. u32 *int_status, void **txbuf);
  461. efi_status_t (EFIAPI *transmit)(struct efi_simple_network *this,
  462. ulong header_size, ulong buffer_size, void *buffer,
  463. struct efi_mac_address *src_addr,
  464. struct efi_mac_address *dest_addr, u16 *protocol);
  465. efi_status_t (EFIAPI *receive)(struct efi_simple_network *this,
  466. ulong *header_size, ulong *buffer_size, void *buffer,
  467. struct efi_mac_address *src_addr,
  468. struct efi_mac_address *dest_addr, u16 *protocol);
  469. void (EFIAPI *waitforpacket)(void);
  470. struct efi_simple_network_mode *mode;
  471. };
  472. #define EFI_PXE_GUID \
  473. EFI_GUID(0x03c4e603, 0xac28, 0x11d3, \
  474. 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
  475. struct efi_pxe_packet {
  476. u8 packet[1472];
  477. };
  478. struct efi_pxe_mode
  479. {
  480. u8 unused[52];
  481. struct efi_pxe_packet dhcp_discover;
  482. struct efi_pxe_packet dhcp_ack;
  483. struct efi_pxe_packet proxy_offer;
  484. struct efi_pxe_packet pxe_discover;
  485. struct efi_pxe_packet pxe_reply;
  486. };
  487. struct efi_pxe {
  488. u64 rev;
  489. void (EFIAPI *start)(void);
  490. void (EFIAPI *stop)(void);
  491. void (EFIAPI *dhcp)(void);
  492. void (EFIAPI *discover)(void);
  493. void (EFIAPI *mftp)(void);
  494. void (EFIAPI *udpwrite)(void);
  495. void (EFIAPI *udpread)(void);
  496. void (EFIAPI *setipfilter)(void);
  497. void (EFIAPI *arp)(void);
  498. void (EFIAPI *setparams)(void);
  499. void (EFIAPI *setstationip)(void);
  500. void (EFIAPI *setpackets)(void);
  501. struct efi_pxe_mode *mode;
  502. };
  503. #endif