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