Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / ia64 / stand / efi / include / efinet.h
blob0bce3e13e9d9a5e8a5df0d98f603c7c9597604be
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 $ */
4 #ifndef _EFINET_H
5 #define _EFINET_H
8 /*++
9 Copyright (c) 1999 Intel Corporation
11 Module Name:
12 efinet.h
14 Abstract:
15 EFI Simple Network protocol
17 Revision History
18 --*/
21 #define EFI_SIMPLE_NETWORK_PROTOCOL \
22 { 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
24 INTERFACE_DECL(_EFI_SIMPLE_NETWORK);
26 typedef struct {
28 * Total number of frames received. Includes frames with errors and
29 * dropped frames.
31 UINT64 RxTotalFrames;
33 /* Number of valid frames received and copied into receive buffers. */
34 UINT64 RxGoodFrames;
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
65 * and dropped frames.
67 UINT64 RxTotalBytes;
69 /* Transmit statistics. */
70 UINT64 TxTotalFrames;
71 UINT64 TxGoodFrames;
72 UINT64 TxUndersizeFrames;
73 UINT64 TxOversizeFrames;
74 UINT64 TxDroppedFrames;
75 UINT64 TxUnicastFrames;
76 UINT64 TxBroadcastFrames;
77 UINT64 TxMulticastFrames;
78 UINT64 TxCrcErrorFrames;
79 UINT64 TxTotalBytes;
81 /* Number of collisions detection on this subnet. */
82 UINT64 Collisions;
84 /* Number of frames destined for unsupported protocol. */
85 UINT64 UnsupportedProtocol;
87 } EFI_NETWORK_STATISTICS;
89 typedef enum {
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
108 typedef struct {
109 UINT32 State;
110 UINT32 HwAddressSize;
111 UINT32 MediaHeaderSize;
112 UINT32 MaxPacketSize;
113 UINT32 NvRamSize;
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;
123 UINT8 IfType;
124 BOOLEAN MacAddressChangeable;
125 BOOLEAN MultipleTxSupported;
126 BOOLEAN MediaPresentSupported;
127 BOOLEAN MediaPresent;
128 } EFI_SIMPLE_NETWORK_MODE;
130 typedef
131 EFI_STATUS
132 (EFIAPI *EFI_SIMPLE_NETWORK_START) (
133 IN struct _EFI_SIMPLE_NETWORK *This
136 typedef
137 EFI_STATUS
138 (EFIAPI *EFI_SIMPLE_NETWORK_STOP) (
139 IN struct _EFI_SIMPLE_NETWORK *This
142 typedef
143 EFI_STATUS
144 (EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (
145 IN struct _EFI_SIMPLE_NETWORK *This,
146 IN UINTN ExtraRxBufferSize OPTIONAL,
147 IN UINTN ExtraTxBufferSize OPTIONAL
150 typedef
151 EFI_STATUS
152 (EFIAPI *EFI_SIMPLE_NETWORK_RESET) (
153 IN struct _EFI_SIMPLE_NETWORK *This,
154 IN BOOLEAN ExtendedVerification
157 typedef
158 EFI_STATUS
159 (EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (
160 IN struct _EFI_SIMPLE_NETWORK *This
163 typedef
164 EFI_STATUS
165 (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (
166 IN struct _EFI_SIMPLE_NETWORK *This,
167 IN UINT32 Enable,
168 IN UINT32 Disable,
169 IN BOOLEAN ResetMCastFilter,
170 IN UINTN MCastFilterCnt OPTIONAL,
171 IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL
174 typedef
175 EFI_STATUS
176 (EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (
177 IN struct _EFI_SIMPLE_NETWORK *This,
178 IN BOOLEAN Reset,
179 IN EFI_MAC_ADDRESS *New OPTIONAL
182 typedef
183 EFI_STATUS
184 (EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (
185 IN struct _EFI_SIMPLE_NETWORK *This,
186 IN BOOLEAN Reset,
187 IN OUT UINTN *StatisticsSize OPTIONAL,
188 OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
191 typedef
192 EFI_STATUS
193 (EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (
194 IN struct _EFI_SIMPLE_NETWORK *This,
195 IN BOOLEAN IPv6,
196 IN EFI_IP_ADDRESS *IP,
197 OUT EFI_MAC_ADDRESS *MAC
200 typedef
201 EFI_STATUS
202 (EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (
203 IN struct _EFI_SIMPLE_NETWORK *This,
204 IN BOOLEAN ReadWrite,
205 IN UINTN Offset,
206 IN UINTN BufferSize,
207 IN OUT VOID *Buffer
210 typedef
211 EFI_STATUS
212 (EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (
213 IN struct _EFI_SIMPLE_NETWORK *This,
214 OUT UINT32 *InterruptStatus OPTIONAL,
215 OUT VOID **TxBuf OPTIONAL
218 typedef
219 EFI_STATUS
220 (EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (
221 IN struct _EFI_SIMPLE_NETWORK *This,
222 IN UINTN HeaderSize,
223 IN UINTN BufferSize,
224 IN VOID *Buffer,
225 IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
226 IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
227 IN UINT16 *Protocol OPTIONAL
230 typedef
231 EFI_STATUS
232 (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (
233 IN struct _EFI_SIMPLE_NETWORK *This,
234 OUT UINTN *HeaderSize OPTIONAL,
235 IN OUT UINTN *BufferSize,
236 OUT VOID *Buffer,
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 {
245 UINT64 Revision;
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 */