1 /* $NetBSD: efinet.h,v 1.1 2006/04/07 14:21:29 cherry Exp $ */
2 /* $FreeBSD: src/sys/boot/efi/include/efinet.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
9 Copyright (c) 1999 Intel Corporation
15 EFI Simple Network protocol
21 #define EFI_SIMPLE_NETWORK_PROTOCOL \
22 { 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
24 INTERFACE_DECL(_EFI_SIMPLE_NETWORK
);
28 * Total number of frames received. Includes frames with errors and
33 /* Number of valid frames received and copied into receive buffers. */
37 * Number of frames below the minimum length for the media.
38 * This would be <64 for ethernet.
40 UINT64 RxUndersizeFrames
;
43 * Number of frames longer than the maxminum length for the
44 * media. This would be >1500 for ethernet.
46 UINT64 RxOversizeFrames
;
48 /* Valid frames that were dropped because receive buffers were full. */
49 UINT64 RxDroppedFrames
;
51 /* Number of valid unicast frames received and not dropped. */
52 UINT64 RxUnicastFrames
;
54 /* Number of valid broadcast frames received and not dropped. */
55 UINT64 RxBroadcastFrames
;
57 /* Number of valid mutlicast frames received and not dropped. */
58 UINT64 RxMulticastFrames
;
60 /* Number of frames w/ CRC or alignment errors. */
61 UINT64 RxCrcErrorFrames
;
64 * Total number of bytes received. Includes frames with errors
69 /* Transmit statistics. */
72 UINT64 TxUndersizeFrames
;
73 UINT64 TxOversizeFrames
;
74 UINT64 TxDroppedFrames
;
75 UINT64 TxUnicastFrames
;
76 UINT64 TxBroadcastFrames
;
77 UINT64 TxMulticastFrames
;
78 UINT64 TxCrcErrorFrames
;
81 /* Number of collisions detection on this subnet. */
84 /* Number of frames destined for unsupported protocol. */
85 UINT64 UnsupportedProtocol
;
87 } EFI_NETWORK_STATISTICS
;
90 EfiSimpleNetworkStopped
,
91 EfiSimpleNetworkStarted
,
92 EfiSimpleNetworkInitialized
,
93 EfiSimpleNetworkMaxState
94 } EFI_SIMPLE_NETWORK_STATE
;
96 #define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01
97 #define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02
98 #define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04
99 #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08
100 #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10
102 #define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01
103 #define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02
104 #define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04
105 #define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08
107 #define MAX_MCAST_FILTER_CNT 16
110 UINT32 HwAddressSize
;
111 UINT32 MediaHeaderSize
;
112 UINT32 MaxPacketSize
;
114 UINT32 NvRamAccessSize
;
115 UINT32 ReceiveFilterMask
;
116 UINT32 ReceiveFilterSetting
;
117 UINT32 MaxMCastFilterCount
;
118 UINT32 MCastFilterCount
;
119 EFI_MAC_ADDRESS MCastFilter
[MAX_MCAST_FILTER_CNT
];
120 EFI_MAC_ADDRESS CurrentAddress
;
121 EFI_MAC_ADDRESS BroadcastAddress
;
122 EFI_MAC_ADDRESS PermanentAddress
;
124 BOOLEAN MacAddressChangeable
;
125 BOOLEAN MultipleTxSupported
;
126 BOOLEAN MediaPresentSupported
;
127 BOOLEAN MediaPresent
;
128 } EFI_SIMPLE_NETWORK_MODE
;
132 (EFIAPI
*EFI_SIMPLE_NETWORK_START
) (
133 IN
struct _EFI_SIMPLE_NETWORK
*This
138 (EFIAPI
*EFI_SIMPLE_NETWORK_STOP
) (
139 IN
struct _EFI_SIMPLE_NETWORK
*This
144 (EFIAPI
*EFI_SIMPLE_NETWORK_INITIALIZE
) (
145 IN
struct _EFI_SIMPLE_NETWORK
*This
,
146 IN UINTN ExtraRxBufferSize OPTIONAL
,
147 IN UINTN ExtraTxBufferSize OPTIONAL
152 (EFIAPI
*EFI_SIMPLE_NETWORK_RESET
) (
153 IN
struct _EFI_SIMPLE_NETWORK
*This
,
154 IN BOOLEAN ExtendedVerification
159 (EFIAPI
*EFI_SIMPLE_NETWORK_SHUTDOWN
) (
160 IN
struct _EFI_SIMPLE_NETWORK
*This
165 (EFIAPI
*EFI_SIMPLE_NETWORK_RECEIVE_FILTERS
) (
166 IN
struct _EFI_SIMPLE_NETWORK
*This
,
169 IN BOOLEAN ResetMCastFilter
,
170 IN UINTN MCastFilterCnt OPTIONAL
,
171 IN EFI_MAC_ADDRESS
*MCastFilter OPTIONAL
176 (EFIAPI
*EFI_SIMPLE_NETWORK_STATION_ADDRESS
) (
177 IN
struct _EFI_SIMPLE_NETWORK
*This
,
179 IN EFI_MAC_ADDRESS
*New OPTIONAL
184 (EFIAPI
*EFI_SIMPLE_NETWORK_STATISTICS
) (
185 IN
struct _EFI_SIMPLE_NETWORK
*This
,
187 IN OUT UINTN
*StatisticsSize OPTIONAL
,
188 OUT EFI_NETWORK_STATISTICS
*StatisticsTable OPTIONAL
193 (EFIAPI
*EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC
) (
194 IN
struct _EFI_SIMPLE_NETWORK
*This
,
196 IN EFI_IP_ADDRESS
*IP
,
197 OUT EFI_MAC_ADDRESS
*MAC
202 (EFIAPI
*EFI_SIMPLE_NETWORK_NVDATA
) (
203 IN
struct _EFI_SIMPLE_NETWORK
*This
,
204 IN BOOLEAN ReadWrite
,
212 (EFIAPI
*EFI_SIMPLE_NETWORK_GET_STATUS
) (
213 IN
struct _EFI_SIMPLE_NETWORK
*This
,
214 OUT UINT32
*InterruptStatus OPTIONAL
,
215 OUT VOID
**TxBuf OPTIONAL
220 (EFIAPI
*EFI_SIMPLE_NETWORK_TRANSMIT
) (
221 IN
struct _EFI_SIMPLE_NETWORK
*This
,
225 IN EFI_MAC_ADDRESS
*SrcAddr OPTIONAL
,
226 IN EFI_MAC_ADDRESS
*DestAddr OPTIONAL
,
227 IN UINT16
*Protocol OPTIONAL
232 (EFIAPI
*EFI_SIMPLE_NETWORK_RECEIVE
) (
233 IN
struct _EFI_SIMPLE_NETWORK
*This
,
234 OUT UINTN
*HeaderSize OPTIONAL
,
235 IN OUT UINTN
*BufferSize
,
237 OUT EFI_MAC_ADDRESS
*SrcAddr OPTIONAL
,
238 OUT EFI_MAC_ADDRESS
*DestAddr OPTIONAL
,
239 OUT UINT16
*Protocol OPTIONAL
242 #define EFI_SIMPLE_NETWORK_INTERFACE_REVISION 0x00010000
244 typedef struct _EFI_SIMPLE_NETWORK
{
246 EFI_SIMPLE_NETWORK_START Start
;
247 EFI_SIMPLE_NETWORK_STOP Stop
;
248 EFI_SIMPLE_NETWORK_INITIALIZE Initialize
;
249 EFI_SIMPLE_NETWORK_RESET Reset
;
250 EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown
;
251 EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters
;
252 EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress
;
253 EFI_SIMPLE_NETWORK_STATISTICS Statistics
;
254 EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac
;
255 EFI_SIMPLE_NETWORK_NVDATA NvData
;
256 EFI_SIMPLE_NETWORK_GET_STATUS GetStatus
;
257 EFI_SIMPLE_NETWORK_TRANSMIT Transmit
;
258 EFI_SIMPLE_NETWORK_RECEIVE Receive
;
259 EFI_EVENT WaitForPacket
;
260 EFI_SIMPLE_NETWORK_MODE
*Mode
;
261 } EFI_SIMPLE_NETWORK
;
263 #endif /* _EFINET_H */