Adding upstream version 6.03~pre1+dfsg.
[syslinux-debian/hramrach.git] / efi32 / include / efi / efinet.h
blobb2e5aa8ad27c7f2dc0d38953648138c51dd5547e
1 #ifndef _EFINET_H
2 #define _EFINET_H
5 /*++
6 Copyright (c) 1999 Intel Corporation
8 Module Name:
9 efinet.h
11 Abstract:
12 EFI Simple Network protocol
14 Revision History
15 --*/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Simple Network Protocol
23 #define EFI_SIMPLE_NETWORK_PROTOCOL \
24 { 0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
27 INTERFACE_DECL(_EFI_SIMPLE_NETWORK);
29 ///////////////////////////////////////////////////////////////////////////////
32 typedef struct {
34 // Total number of frames received. Includes frames with errors and
35 // dropped frames.
37 UINT64 RxTotalFrames;
40 // Number of valid frames received and copied into receive buffers.
42 UINT64 RxGoodFrames;
45 // Number of frames below the minimum length for the media.
46 // This would be <64 for ethernet.
48 UINT64 RxUndersizeFrames;
51 // Number of frames longer than the maxminum length for the
52 // media. This would be >1500 for ethernet.
54 UINT64 RxOversizeFrames;
57 // Valid frames that were dropped because receive buffers were full.
59 UINT64 RxDroppedFrames;
62 // Number of valid unicast frames received and not dropped.
64 UINT64 RxUnicastFrames;
67 // Number of valid broadcast frames received and not dropped.
69 UINT64 RxBroadcastFrames;
72 // Number of valid mutlicast frames received and not dropped.
74 UINT64 RxMulticastFrames;
77 // Number of frames w/ CRC or alignment errors.
79 UINT64 RxCrcErrorFrames;
82 // Total number of bytes received. Includes frames with errors
83 // and dropped frames.
85 UINT64 RxTotalBytes;
88 // Transmit statistics.
90 UINT64 TxTotalFrames;
91 UINT64 TxGoodFrames;
92 UINT64 TxUndersizeFrames;
93 UINT64 TxOversizeFrames;
94 UINT64 TxDroppedFrames;
95 UINT64 TxUnicastFrames;
96 UINT64 TxBroadcastFrames;
97 UINT64 TxMulticastFrames;
98 UINT64 TxCrcErrorFrames;
99 UINT64 TxTotalBytes;
102 // Number of collisions detection on this subnet.
104 UINT64 Collisions;
107 // Number of frames destined for unsupported protocol.
109 UINT64 UnsupportedProtocol;
111 } EFI_NETWORK_STATISTICS;
113 ///////////////////////////////////////////////////////////////////////////////
116 typedef enum {
117 EfiSimpleNetworkStopped,
118 EfiSimpleNetworkStarted,
119 EfiSimpleNetworkInitialized,
120 EfiSimpleNetworkMaxState
121 } EFI_SIMPLE_NETWORK_STATE;
123 ///////////////////////////////////////////////////////////////////////////////
126 #define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01
127 #define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02
128 #define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04
129 #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08
130 #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10
132 ///////////////////////////////////////////////////////////////////////////////
135 #define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01
136 #define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02
137 #define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04
138 #define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08
140 ///////////////////////////////////////////////////////////////////////////////
142 #define MAX_MCAST_FILTER_CNT 16
143 typedef struct {
144 UINT32 State;
145 UINT32 HwAddressSize;
146 UINT32 MediaHeaderSize;
147 UINT32 MaxPacketSize;
148 UINT32 NvRamSize;
149 UINT32 NvRamAccessSize;
150 UINT32 ReceiveFilterMask;
151 UINT32 ReceiveFilterSetting;
152 UINT32 MaxMCastFilterCount;
153 UINT32 MCastFilterCount;
154 EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];
155 EFI_MAC_ADDRESS CurrentAddress;
156 EFI_MAC_ADDRESS BroadcastAddress;
157 EFI_MAC_ADDRESS PermanentAddress;
158 UINT8 IfType;
159 BOOLEAN MacAddressChangeable;
160 BOOLEAN MultipleTxSupported;
161 BOOLEAN MediaPresentSupported;
162 BOOLEAN MediaPresent;
163 } EFI_SIMPLE_NETWORK_MODE;
165 ///////////////////////////////////////////////////////////////////////////////
168 typedef
169 EFI_STATUS
170 (EFIAPI *EFI_SIMPLE_NETWORK_START) (
171 IN struct _EFI_SIMPLE_NETWORK *This
174 ///////////////////////////////////////////////////////////////////////////////
177 typedef
178 EFI_STATUS
179 (EFIAPI *EFI_SIMPLE_NETWORK_STOP) (
180 IN struct _EFI_SIMPLE_NETWORK *This
183 ///////////////////////////////////////////////////////////////////////////////
186 typedef
187 EFI_STATUS
188 (EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (
189 IN struct _EFI_SIMPLE_NETWORK *This,
190 IN UINTN ExtraRxBufferSize OPTIONAL,
191 IN UINTN ExtraTxBufferSize OPTIONAL
194 ///////////////////////////////////////////////////////////////////////////////
197 typedef
198 EFI_STATUS
199 (EFIAPI *EFI_SIMPLE_NETWORK_RESET) (
200 IN struct _EFI_SIMPLE_NETWORK *This,
201 IN BOOLEAN ExtendedVerification
204 ///////////////////////////////////////////////////////////////////////////////
207 typedef
208 EFI_STATUS
209 (EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (
210 IN struct _EFI_SIMPLE_NETWORK *This
213 ///////////////////////////////////////////////////////////////////////////////
216 typedef
217 EFI_STATUS
218 (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (
219 IN struct _EFI_SIMPLE_NETWORK *This,
220 IN UINT32 Enable,
221 IN UINT32 Disable,
222 IN BOOLEAN ResetMCastFilter,
223 IN UINTN MCastFilterCnt OPTIONAL,
224 IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL
227 ///////////////////////////////////////////////////////////////////////////////
230 typedef
231 EFI_STATUS
232 (EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (
233 IN struct _EFI_SIMPLE_NETWORK *This,
234 IN BOOLEAN Reset,
235 IN EFI_MAC_ADDRESS *New OPTIONAL
238 ///////////////////////////////////////////////////////////////////////////////
241 typedef
242 EFI_STATUS
243 (EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (
244 IN struct _EFI_SIMPLE_NETWORK *This,
245 IN BOOLEAN Reset,
246 IN OUT UINTN *StatisticsSize OPTIONAL,
247 OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
250 ///////////////////////////////////////////////////////////////////////////////
253 typedef
254 EFI_STATUS
255 (EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (
256 IN struct _EFI_SIMPLE_NETWORK *This,
257 IN BOOLEAN IPv6,
258 IN EFI_IP_ADDRESS *IP,
259 OUT EFI_MAC_ADDRESS *MAC
262 ///////////////////////////////////////////////////////////////////////////////
265 typedef
266 EFI_STATUS
267 (EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (
268 IN struct _EFI_SIMPLE_NETWORK *This,
269 IN BOOLEAN ReadWrite,
270 IN UINTN Offset,
271 IN UINTN BufferSize,
272 IN OUT VOID *Buffer
275 ///////////////////////////////////////////////////////////////////////////////
278 typedef
279 EFI_STATUS
280 (EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (
281 IN struct _EFI_SIMPLE_NETWORK *This,
282 OUT UINT32 *InterruptStatus OPTIONAL,
283 OUT VOID **TxBuf OPTIONAL
286 ///////////////////////////////////////////////////////////////////////////////
289 typedef
290 EFI_STATUS
291 (EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (
292 IN struct _EFI_SIMPLE_NETWORK *This,
293 IN UINTN HeaderSize,
294 IN UINTN BufferSize,
295 IN VOID *Buffer,
296 IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
297 IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
298 IN UINT16 *Protocol OPTIONAL
301 ///////////////////////////////////////////////////////////////////////////////
304 typedef
305 EFI_STATUS
306 (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (
307 IN struct _EFI_SIMPLE_NETWORK *This,
308 OUT UINTN *HeaderSize OPTIONAL,
309 IN OUT UINTN *BufferSize,
310 OUT VOID *Buffer,
311 OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
312 OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,
313 OUT UINT16 *Protocol OPTIONAL
316 ///////////////////////////////////////////////////////////////////////////////
319 #define EFI_SIMPLE_NETWORK_INTERFACE_REVISION 0x00010000
321 typedef struct _EFI_SIMPLE_NETWORK {
322 UINT64 Revision;
323 EFI_SIMPLE_NETWORK_START Start;
324 EFI_SIMPLE_NETWORK_STOP Stop;
325 EFI_SIMPLE_NETWORK_INITIALIZE Initialize;
326 EFI_SIMPLE_NETWORK_RESET Reset;
327 EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown;
328 EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters;
329 EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress;
330 EFI_SIMPLE_NETWORK_STATISTICS Statistics;
331 EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac;
332 EFI_SIMPLE_NETWORK_NVDATA NvData;
333 EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;
334 EFI_SIMPLE_NETWORK_TRANSMIT Transmit;
335 EFI_SIMPLE_NETWORK_RECEIVE Receive;
336 EFI_EVENT WaitForPacket;
337 EFI_SIMPLE_NETWORK_MODE *Mode;
338 } EFI_SIMPLE_NETWORK;
340 #endif /* _EFINET_H */