您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

efi_snp.h 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef _IPXE_EFI_SNP_H
  2. #define _IPXE_EFI_SNP_H
  3. /** @file
  4. *
  5. * iPXE EFI SNP interface
  6. *
  7. */
  8. #include <ipxe/list.h>
  9. #include <ipxe/netdevice.h>
  10. #include <ipxe/efi/efi.h>
  11. #include <ipxe/efi/Protocol/SimpleNetwork.h>
  12. #include <ipxe/efi/Protocol/NetworkInterfaceIdentifier.h>
  13. #include <ipxe/efi/Protocol/ComponentName2.h>
  14. #include <ipxe/efi/Protocol/DevicePath.h>
  15. #include <ipxe/efi/Protocol/HiiConfigAccess.h>
  16. #include <ipxe/efi/Protocol/HiiDatabase.h>
  17. #include <ipxe/efi/Protocol/LoadFile.h>
  18. /** An SNP device */
  19. struct efi_snp_device {
  20. /** List of SNP devices */
  21. struct list_head list;
  22. /** The underlying iPXE network device */
  23. struct net_device *netdev;
  24. /** The underlying EFI device */
  25. struct efi_device *efidev;
  26. /** EFI device handle */
  27. EFI_HANDLE handle;
  28. /** The SNP structure itself */
  29. EFI_SIMPLE_NETWORK_PROTOCOL snp;
  30. /** The SNP "mode" (parameters) */
  31. EFI_SIMPLE_NETWORK_MODE mode;
  32. /** Started flag */
  33. int started;
  34. /** Outstanding TX packet count (via "interrupt status")
  35. *
  36. * Used in order to generate TX completions.
  37. */
  38. unsigned int tx_count_interrupts;
  39. /** Outstanding TX packet count (via "recycled tx buffers")
  40. *
  41. * Used in order to generate TX completions.
  42. */
  43. unsigned int tx_count_txbufs;
  44. /** Outstanding RX packet count (via "interrupt status") */
  45. unsigned int rx_count_interrupts;
  46. /** Outstanding RX packet count (via WaitForPacket event) */
  47. unsigned int rx_count_events;
  48. /** The network interface identifier */
  49. EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii;
  50. /** Component name protocol */
  51. EFI_COMPONENT_NAME2_PROTOCOL name2;
  52. /** Load file protocol handle */
  53. EFI_LOAD_FILE_PROTOCOL load_file;
  54. /** HII configuration access protocol */
  55. EFI_HII_CONFIG_ACCESS_PROTOCOL hii;
  56. /** HII package list */
  57. EFI_HII_PACKAGE_LIST_HEADER *package_list;
  58. /** HII handle */
  59. EFI_HII_HANDLE hii_handle;
  60. /** Device name */
  61. wchar_t name[ sizeof ( ( ( struct net_device * ) NULL )->name ) ];
  62. /** Driver name */
  63. wchar_t driver_name[16];
  64. /** Controller name */
  65. wchar_t controller_name[64];
  66. /** The device path
  67. *
  68. * This field is variable in size and must appear at the end
  69. * of the structure.
  70. */
  71. EFI_DEVICE_PATH_PROTOCOL path;
  72. };
  73. extern int efi_snp_hii_install ( struct efi_snp_device *snpdev );
  74. extern void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev );
  75. extern struct efi_snp_device * find_snpdev ( EFI_HANDLE handle );
  76. extern struct efi_snp_device * last_opened_snpdev ( void );
  77. extern void efi_snp_claim ( void );
  78. extern void efi_snp_release ( void );
  79. #endif /* _IPXE_EFI_SNP_H */