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