Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

340 lines
9.9 KiB

  1. #ifndef _EFINET_H
  2. #define _EFINET_H
  3. /*++
  4. Copyright (c) 1999 Intel Corporation
  5. Module Name:
  6. efinet.h
  7. Abstract:
  8. EFI Simple Network protocol
  9. Revision History
  10. --*/
  11. /* /////////////////////////////////////////////////////////////////////////////
  12. *
  13. * Simple Network Protocol
  14. */
  15. #define EFI_SIMPLE_NETWORK_PROTOCOL \
  16. { 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
  17. INTERFACE_DECL(_EFI_SIMPLE_NETWORK);
  18. /* /////////////////////////////////////////////////////////////////////////////
  19. */
  20. typedef struct {
  21. /*
  22. * Total number of frames received. Includes frames with errors and
  23. * dropped frames.
  24. */
  25. UINT64 RxTotalFrames;
  26. /*
  27. * Number of valid frames received and copied into receive buffers.
  28. */
  29. UINT64 RxGoodFrames;
  30. /*
  31. * Number of frames below the minimum length for the media.
  32. * This would be <64 for ethernet.
  33. */
  34. UINT64 RxUndersizeFrames;
  35. /*
  36. * Number of frames longer than the maxminum length for the
  37. * media. This would be >1500 for ethernet.
  38. */
  39. UINT64 RxOversizeFrames;
  40. /*
  41. * Valid frames that were dropped because receive buffers were full.
  42. */
  43. UINT64 RxDroppedFrames;
  44. /*
  45. * Number of valid unicast frames received and not dropped.
  46. */
  47. UINT64 RxUnicastFrames;
  48. /*
  49. * Number of valid broadcast frames received and not dropped.
  50. */
  51. UINT64 RxBroadcastFrames;
  52. /*
  53. * Number of valid mutlicast frames received and not dropped.
  54. */
  55. UINT64 RxMulticastFrames;
  56. /*
  57. * Number of frames w/ CRC or alignment errors.
  58. */
  59. UINT64 RxCrcErrorFrames;
  60. /*
  61. * Total number of bytes received. Includes frames with errors
  62. * and dropped frames.
  63. */
  64. UINT64 RxTotalBytes;
  65. /*
  66. * Transmit statistics.
  67. */
  68. UINT64 TxTotalFrames;
  69. UINT64 TxGoodFrames;
  70. UINT64 TxUndersizeFrames;
  71. UINT64 TxOversizeFrames;
  72. UINT64 TxDroppedFrames;
  73. UINT64 TxUnicastFrames;
  74. UINT64 TxBroadcastFrames;
  75. UINT64 TxMulticastFrames;
  76. UINT64 TxCrcErrorFrames;
  77. UINT64 TxTotalBytes;
  78. /*
  79. * Number of collisions detection on this subnet.
  80. */
  81. UINT64 Collisions;
  82. /*
  83. * Number of frames destined for unsupported protocol.
  84. */
  85. UINT64 UnsupportedProtocol;
  86. } EFI_NETWORK_STATISTICS;
  87. /* /////////////////////////////////////////////////////////////////////////////
  88. */
  89. typedef enum {
  90. EfiSimpleNetworkStopped,
  91. EfiSimpleNetworkStarted,
  92. EfiSimpleNetworkInitialized,
  93. EfiSimpleNetworkMaxState
  94. } EFI_SIMPLE_NETWORK_STATE;
  95. /* /////////////////////////////////////////////////////////////////////////////
  96. */
  97. #define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01
  98. #define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02
  99. #define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04
  100. #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08
  101. #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10
  102. /* /////////////////////////////////////////////////////////////////////////////
  103. */
  104. #define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01
  105. #define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02
  106. #define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04
  107. #define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08
  108. /* /////////////////////////////////////////////////////////////////////////////
  109. */
  110. #define MAX_MCAST_FILTER_CNT 16
  111. typedef struct {
  112. UINT32 State;
  113. UINT32 HwAddressSize;
  114. UINT32 MediaHeaderSize;
  115. UINT32 MaxPacketSize;
  116. UINT32 NvRamSize;
  117. UINT32 NvRamAccessSize;
  118. UINT32 ReceiveFilterMask;
  119. UINT32 ReceiveFilterSetting;
  120. UINT32 MaxMCastFilterCount;
  121. UINT32 MCastFilterCount;
  122. EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];
  123. EFI_MAC_ADDRESS CurrentAddress;
  124. EFI_MAC_ADDRESS BroadcastAddress;
  125. EFI_MAC_ADDRESS PermanentAddress;
  126. UINT8 IfType;
  127. BOOLEAN MacAddressChangeable;
  128. BOOLEAN MultipleTxSupported;
  129. BOOLEAN MediaPresentSupported;
  130. BOOLEAN MediaPresent;
  131. } EFI_SIMPLE_NETWORK_MODE;
  132. /* /////////////////////////////////////////////////////////////////////////////
  133. */
  134. typedef
  135. EFI_STATUS
  136. (EFIAPI *EFI_SIMPLE_NETWORK_START) (
  137. IN struct _EFI_SIMPLE_NETWORK *This
  138. );
  139. /* /////////////////////////////////////////////////////////////////////////////
  140. */
  141. typedef
  142. EFI_STATUS
  143. (EFIAPI *EFI_SIMPLE_NETWORK_STOP) (
  144. IN struct _EFI_SIMPLE_NETWORK *This
  145. );
  146. /* /////////////////////////////////////////////////////////////////////////////
  147. */
  148. typedef
  149. EFI_STATUS
  150. (EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (
  151. IN struct _EFI_SIMPLE_NETWORK *This,
  152. IN UINTN ExtraRxBufferSize OPTIONAL,
  153. IN UINTN ExtraTxBufferSize OPTIONAL
  154. );
  155. /* /////////////////////////////////////////////////////////////////////////////
  156. */
  157. typedef
  158. EFI_STATUS
  159. (EFIAPI *EFI_SIMPLE_NETWORK_RESET) (
  160. IN struct _EFI_SIMPLE_NETWORK *This,
  161. IN BOOLEAN ExtendedVerification
  162. );
  163. /* /////////////////////////////////////////////////////////////////////////////
  164. */
  165. typedef
  166. EFI_STATUS
  167. (EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (
  168. IN struct _EFI_SIMPLE_NETWORK *This
  169. );
  170. /* /////////////////////////////////////////////////////////////////////////////
  171. */
  172. typedef
  173. EFI_STATUS
  174. (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (
  175. IN struct _EFI_SIMPLE_NETWORK *This,
  176. IN UINT32 Enable,
  177. IN UINT32 Disable,
  178. IN BOOLEAN ResetMCastFilter,
  179. IN UINTN MCastFilterCnt OPTIONAL,
  180. IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL
  181. );
  182. /* /////////////////////////////////////////////////////////////////////////////
  183. */
  184. typedef
  185. EFI_STATUS
  186. (EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (
  187. IN struct _EFI_SIMPLE_NETWORK *This,
  188. IN BOOLEAN Reset,
  189. IN EFI_MAC_ADDRESS *New OPTIONAL
  190. );
  191. /* /////////////////////////////////////////////////////////////////////////////
  192. */
  193. typedef
  194. EFI_STATUS
  195. (EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (
  196. IN struct _EFI_SIMPLE_NETWORK *This,
  197. IN BOOLEAN Reset,
  198. IN OUT UINTN *StatisticsSize OPTIONAL,
  199. OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
  200. );
  201. /* /////////////////////////////////////////////////////////////////////////////
  202. */
  203. typedef
  204. EFI_STATUS
  205. (EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (
  206. IN struct _EFI_SIMPLE_NETWORK *This,
  207. IN BOOLEAN IPv6,
  208. IN EFI_IP_ADDRESS *IP,
  209. OUT EFI_MAC_ADDRESS *MAC
  210. );
  211. /* /////////////////////////////////////////////////////////////////////////////
  212. */
  213. typedef
  214. EFI_STATUS
  215. (EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (
  216. IN struct _EFI_SIMPLE_NETWORK *This,
  217. IN BOOLEAN ReadWrite,
  218. IN UINTN Offset,
  219. IN UINTN BufferSize,
  220. IN OUT VOID *Buffer
  221. );
  222. /* /////////////////////////////////////////////////////////////////////////////
  223. */
  224. typedef
  225. EFI_STATUS
  226. (EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (
  227. IN struct _EFI_SIMPLE_NETWORK *This,
  228. OUT UINT32 *InterruptStatus OPTIONAL,
  229. OUT VOID **TxBuf OPTIONAL
  230. );
  231. /* /////////////////////////////////////////////////////////////////////////////
  232. */
  233. typedef
  234. EFI_STATUS
  235. (EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (
  236. IN struct _EFI_SIMPLE_NETWORK *This,
  237. IN UINTN HeaderSize,
  238. IN UINTN BufferSize,
  239. IN VOID *Buffer,
  240. IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
  241. IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
  242. IN UINT16 *Protocol OPTIONAL
  243. );
  244. /* /////////////////////////////////////////////////////////////////////////////
  245. */
  246. typedef
  247. EFI_STATUS
  248. (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (
  249. IN struct _EFI_SIMPLE_NETWORK *This,
  250. OUT UINTN *HeaderSize OPTIONAL,
  251. IN OUT UINTN *BufferSize,
  252. OUT VOID *Buffer,
  253. OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
  254. OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,
  255. OUT UINT16 *Protocol OPTIONAL
  256. );
  257. /* /////////////////////////////////////////////////////////////////////////////
  258. */
  259. #define EFI_SIMPLE_NETWORK_INTERFACE_REVISION 0x00010000
  260. typedef struct _EFI_SIMPLE_NETWORK {
  261. UINT64 Revision;
  262. EFI_SIMPLE_NETWORK_START Start;
  263. EFI_SIMPLE_NETWORK_STOP Stop;
  264. EFI_SIMPLE_NETWORK_INITIALIZE Initialize;
  265. EFI_SIMPLE_NETWORK_RESET Reset;
  266. EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown;
  267. EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters;
  268. EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress;
  269. EFI_SIMPLE_NETWORK_STATISTICS Statistics;
  270. EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac;
  271. EFI_SIMPLE_NETWORK_NVDATA NvData;
  272. EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;
  273. EFI_SIMPLE_NETWORK_TRANSMIT Transmit;
  274. EFI_SIMPLE_NETWORK_RECEIVE Receive;
  275. EFI_EVENT WaitForPacket;
  276. EFI_SIMPLE_NETWORK_MODE *Mode;
  277. } EFI_SIMPLE_NETWORK;
  278. #endif /* _EFINET_H */