kernel - pmap (i386) - Reduce kmem use for foreign pmap mapping
[dragonfly.git] / sys / boot / efi / include / efinet.h
blobf391d1d6a01dd22fa3a587ed2b8658f0321c02fe
1 /*
2 * $FreeBSD: src/sys/boot/efi/include/efinet.h,v 1.2 2002/05/19 03:17:20 marcel Exp $
3 * $DragonFly: src/sys/boot/efi/include/efinet.h,v 1.1 2003/11/10 06:08:32 dillon Exp $
4 */
5 #ifndef _EFINET_H
6 #define _EFINET_H
9 /*++
10 Copyright (c) 1999 Intel Corporation
12 Module Name:
13 efinet.h
15 Abstract:
16 EFI Simple Network protocol
18 Revision History
19 --*/
22 #define EFI_SIMPLE_NETWORK_PROTOCOL \
23 { 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
25 INTERFACE_DECL(_EFI_SIMPLE_NETWORK);
27 typedef struct {
29 * Total number of frames received. Includes frames with errors and
30 * dropped frames.
32 UINT64 RxTotalFrames;
34 /* Number of valid frames received and copied into receive buffers. */
35 UINT64 RxGoodFrames;
38 * Number of frames below the minimum length for the media.
39 * This would be <64 for ethernet.
41 UINT64 RxUndersizeFrames;
44 * Number of frames longer than the maxminum length for the
45 * media. This would be >1500 for ethernet.
47 UINT64 RxOversizeFrames;
49 /* Valid frames that were dropped because receive buffers were full. */
50 UINT64 RxDroppedFrames;
52 /* Number of valid unicast frames received and not dropped. */
53 UINT64 RxUnicastFrames;
55 /* Number of valid broadcast frames received and not dropped. */
56 UINT64 RxBroadcastFrames;
58 /* Number of valid mutlicast frames received and not dropped. */
59 UINT64 RxMulticastFrames;
61 /* Number of frames w/ CRC or alignment errors. */
62 UINT64 RxCrcErrorFrames;
65 * Total number of bytes received. Includes frames with errors
66 * and dropped frames.
68 UINT64 RxTotalBytes;
70 /* Transmit statistics. */
71 UINT64 TxTotalFrames;
72 UINT64 TxGoodFrames;
73 UINT64 TxUndersizeFrames;
74 UINT64 TxOversizeFrames;
75 UINT64 TxDroppedFrames;
76 UINT64 TxUnicastFrames;
77 UINT64 TxBroadcastFrames;
78 UINT64 TxMulticastFrames;
79 UINT64 TxCrcErrorFrames;
80 UINT64 TxTotalBytes;
82 /* Number of collisions detection on this subnet. */
83 UINT64 Collisions;
85 /* Number of frames destined for unsupported protocol. */
86 UINT64 UnsupportedProtocol;
88 } EFI_NETWORK_STATISTICS;
90 typedef enum {
91 EfiSimpleNetworkStopped,
92 EfiSimpleNetworkStarted,
93 EfiSimpleNetworkInitialized,
94 EfiSimpleNetworkMaxState
95 } EFI_SIMPLE_NETWORK_STATE;
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
103 #define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01
104 #define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02
105 #define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04
106 #define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08
108 #define MAX_MCAST_FILTER_CNT 16
109 typedef struct {
110 UINT32 State;
111 UINT32 HwAddressSize;
112 UINT32 MediaHeaderSize;
113 UINT32 MaxPacketSize;
114 UINT32 NvRamSize;
115 UINT32 NvRamAccessSize;
116 UINT32 ReceiveFilterMask;
117 UINT32 ReceiveFilterSetting;
118 UINT32 MaxMCastFilterCount;
119 UINT32 MCastFilterCount;
120 EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];
121 EFI_MAC_ADDRESS CurrentAddress;
122 EFI_MAC_ADDRESS BroadcastAddress;
123 EFI_MAC_ADDRESS PermanentAddress;
124 UINT8 IfType;
125 BOOLEAN MacAddressChangeable;
126 BOOLEAN MultipleTxSupported;
127 BOOLEAN MediaPresentSupported;
128 BOOLEAN MediaPresent;
129 } EFI_SIMPLE_NETWORK_MODE;
131 typedef
132 EFI_STATUS
133 (EFIAPI *EFI_SIMPLE_NETWORK_START) (
134 IN struct _EFI_SIMPLE_NETWORK *This
137 typedef
138 EFI_STATUS
139 (EFIAPI *EFI_SIMPLE_NETWORK_STOP) (
140 IN struct _EFI_SIMPLE_NETWORK *This
143 typedef
144 EFI_STATUS
145 (EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (
146 IN struct _EFI_SIMPLE_NETWORK *This,
147 IN UINTN ExtraRxBufferSize OPTIONAL,
148 IN UINTN ExtraTxBufferSize OPTIONAL
151 typedef
152 EFI_STATUS
153 (EFIAPI *EFI_SIMPLE_NETWORK_RESET) (
154 IN struct _EFI_SIMPLE_NETWORK *This,
155 IN BOOLEAN ExtendedVerification
158 typedef
159 EFI_STATUS
160 (EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (
161 IN struct _EFI_SIMPLE_NETWORK *This
164 typedef
165 EFI_STATUS
166 (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (
167 IN struct _EFI_SIMPLE_NETWORK *This,
168 IN UINT32 Enable,
169 IN UINT32 Disable,
170 IN BOOLEAN ResetMCastFilter,
171 IN UINTN MCastFilterCnt OPTIONAL,
172 IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL
175 typedef
176 EFI_STATUS
177 (EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (
178 IN struct _EFI_SIMPLE_NETWORK *This,
179 IN BOOLEAN Reset,
180 IN EFI_MAC_ADDRESS *New OPTIONAL
183 typedef
184 EFI_STATUS
185 (EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (
186 IN struct _EFI_SIMPLE_NETWORK *This,
187 IN BOOLEAN Reset,
188 IN OUT UINTN *StatisticsSize OPTIONAL,
189 OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
192 typedef
193 EFI_STATUS
194 (EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (
195 IN struct _EFI_SIMPLE_NETWORK *This,
196 IN BOOLEAN IPv6,
197 IN EFI_IP_ADDRESS *IP,
198 OUT EFI_MAC_ADDRESS *MAC
201 typedef
202 EFI_STATUS
203 (EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (
204 IN struct _EFI_SIMPLE_NETWORK *This,
205 IN BOOLEAN ReadWrite,
206 IN UINTN Offset,
207 IN UINTN BufferSize,
208 IN OUT VOID *Buffer
211 typedef
212 EFI_STATUS
213 (EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (
214 IN struct _EFI_SIMPLE_NETWORK *This,
215 OUT UINT32 *InterruptStatus OPTIONAL,
216 OUT VOID **TxBuf OPTIONAL
219 typedef
220 EFI_STATUS
221 (EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (
222 IN struct _EFI_SIMPLE_NETWORK *This,
223 IN UINTN HeaderSize,
224 IN UINTN BufferSize,
225 IN VOID *Buffer,
226 IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
227 IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
228 IN UINT16 *Protocol OPTIONAL
231 typedef
232 EFI_STATUS
233 (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (
234 IN struct _EFI_SIMPLE_NETWORK *This,
235 OUT UINTN *HeaderSize OPTIONAL,
236 IN OUT UINTN *BufferSize,
237 OUT VOID *Buffer,
238 OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
239 OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,
240 OUT UINT16 *Protocol OPTIONAL
243 #define EFI_SIMPLE_NETWORK_INTERFACE_REVISION 0x00010000
245 typedef struct _EFI_SIMPLE_NETWORK {
246 UINT64 Revision;
247 EFI_SIMPLE_NETWORK_START Start;
248 EFI_SIMPLE_NETWORK_STOP Stop;
249 EFI_SIMPLE_NETWORK_INITIALIZE Initialize;
250 EFI_SIMPLE_NETWORK_RESET Reset;
251 EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown;
252 EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters;
253 EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress;
254 EFI_SIMPLE_NETWORK_STATISTICS Statistics;
255 EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac;
256 EFI_SIMPLE_NETWORK_NVDATA NvData;
257 EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;
258 EFI_SIMPLE_NETWORK_TRANSMIT Transmit;
259 EFI_SIMPLE_NETWORK_RECEIVE Receive;
260 EFI_EVENT WaitForPacket;
261 EFI_SIMPLE_NETWORK_MODE *Mode;
262 } EFI_SIMPLE_NETWORK;
264 #endif /* _EFINET_H */