/** @file\r
- Simple Network protocol as defined in the EFI 1.0 specification.\r
+ Simple Network protocol as defined in the UEFI 2.0 specification.\r
\r
Basic network device abstraction.\r
\r
MCast - MultiCast\r
...\r
\r
- Copyright (c) 2006, Intel Corporation \r
+ Copyright (c) 2006 - 2008, Intel Corporation \r
All rights reserved. This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
\r
- Module Name: SimpleNetwork.h\r
-\r
**/\r
\r
#ifndef __SIMPLE_NETWORK_H__\r
\r
typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK_PROTOCOL;\r
\r
-//\r
-// Simple Network Protocol data structures\r
-//\r
+\r
+///\r
+/// Protocol defined in EFI1.1.\r
+/// \r
+typedef EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK;\r
+\r
+///\r
+/// Simple Network Protocol data structures\r
+///\r
typedef struct {\r
- //\r
- // Total number of frames received. Includes frames with errors and\r
- // dropped frames.\r
- //\r
+ ///\r
+ /// Total number of frames received. Includes frames with errors and\r
+ /// dropped frames.\r
+ ///\r
UINT64 RxTotalFrames;\r
\r
- //\r
- // Number of valid frames received and copied into receive buffers.\r
- //\r
+ ///\r
+ /// Number of valid frames received and copied into receive buffers.\r
+ ///\r
UINT64 RxGoodFrames;\r
\r
- //\r
- // Number of frames below the minimum length for the media.\r
- // This would be <64 for ethernet.\r
- //\r
+ ///\r
+ /// Number of frames below the minimum length for the media.\r
+ /// This would be <64 for ethernet.\r
+ ///\r
UINT64 RxUndersizeFrames;\r
\r
- //\r
- // Number of frames longer than the maxminum length for the\r
- // media. This would be >1500 for ethernet.\r
- //\r
+ ///\r
+ /// Number of frames longer than the maxminum length for the\r
+ /// media. This would be >1500 for ethernet.\r
+ ///\r
UINT64 RxOversizeFrames;\r
\r
- //\r
- // Valid frames that were dropped because receive buffers were full.\r
- //\r
+ ///\r
+ /// Valid frames that were dropped because receive buffers were full.\r
+ ///\r
UINT64 RxDroppedFrames;\r
\r
- //\r
- // Number of valid unicast frames received and not dropped.\r
- //\r
+ ///\r
+ /// Number of valid unicast frames received and not dropped.\r
+ ///\r
UINT64 RxUnicastFrames;\r
\r
- //\r
- // Number of valid broadcast frames received and not dropped.\r
- //\r
+ ///\r
+ /// Number of valid broadcast frames received and not dropped.\r
+ ///\r
UINT64 RxBroadcastFrames;\r
\r
- //\r
- // Number of valid mutlicast frames received and not dropped.\r
- //\r
+ ///\r
+ /// Number of valid mutlicast frames received and not dropped.\r
+ ///\r
UINT64 RxMulticastFrames;\r
\r
- //\r
- // Number of frames w/ CRC or alignment errors.\r
- //\r
+ ///\r
+ /// Number of frames w/ CRC or alignment errors.\r
+ ///\r
UINT64 RxCrcErrorFrames;\r
\r
- //\r
- // Total number of bytes received. Includes frames with errors\r
- // and dropped frames.\r
+ ///\r
+ /// Total number of bytes received. Includes frames with errors\r
+ /// and dropped frames.\r
//\r
UINT64 RxTotalBytes;\r
\r
- //\r
- // Transmit statistics.\r
- //\r
+ ///\r
+ /// Transmit statistics.\r
+ ///\r
UINT64 TxTotalFrames;\r
UINT64 TxGoodFrames;\r
UINT64 TxUndersizeFrames;\r
UINT64 TxCrcErrorFrames;\r
UINT64 TxTotalBytes;\r
\r
- //\r
- // Number of collisions detection on this subnet.\r
- //\r
+ ///\r
+ /// Number of collisions detection on this subnet.\r
+ ///\r
UINT64 Collisions;\r
\r
- //\r
- // Number of frames destined for unsupported protocol.\r
- //\r
+ ///\r
+ /// Number of frames destined for unsupported protocol.\r
+ ///\r
UINT64 UnsupportedProtocol;\r
\r
} EFI_NETWORK_STATISTICS;\r
\r
+///\r
+/// State of the network interface\r
+/// When an EFI_SIMPLE_NETWORK_PROTOCOL driver initializes a\r
+/// network interface, the network interface is left in the EfiSimpleNetworkStopped state.\r
+///\r
typedef enum {\r
EfiSimpleNetworkStopped,\r
EfiSimpleNetworkStarted,\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_START) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_START)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
- )\r
-;\r
+ );\r
\r
/**\r
Changes the state of a network interface from "started" to "stopped".\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_STOP) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_STOP)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
- )\r
-;\r
+ );\r
\r
/**\r
Resets a network adapter and allocates the transmit and receive buffers \r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN UINTN ExtraRxBufferSize OPTIONAL,\r
IN UINTN ExtraTxBufferSize OPTIONAL\r
- )\r
-;\r
+ );\r
\r
/**\r
Resets a network adapter and re-initializes it with the parameters that were \r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_RESET) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_RESET)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN BOOLEAN ExtendedVerification\r
- )\r
-;\r
+ );\r
\r
/**\r
Resets a network adapter and leaves it in a state that is safe for \r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This\r
- )\r
-;\r
+ );\r
\r
/**\r
Manages the multicast receive filters of a network interface.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN UINT32 Enable,\r
IN UINT32 Disable,\r
IN BOOLEAN ResetMCastFilter,\r
IN UINTN MCastFilterCnt OPTIONAL,\r
IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL\r
- )\r
-;\r
+ );\r
\r
/**\r
Modifies or resets the current station address, if supported.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN BOOLEAN Reset,\r
IN EFI_MAC_ADDRESS *New OPTIONAL\r
- )\r
-;\r
+ );\r
\r
/**\r
Resets or collects the statistics on a network interface.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN BOOLEAN Reset,\r
IN OUT UINTN *StatisticsSize OPTIONAL,\r
OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL\r
- )\r
-;\r
+ );\r
\r
/**\r
Converts a multicast IP address to a multicast HW MAC address.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN BOOLEAN IPv6,\r
IN EFI_IP_ADDRESS *IP,\r
OUT EFI_MAC_ADDRESS *MAC\r
- )\r
-;\r
+ );\r
\r
/**\r
Performs read and write operations on the NVRAM device attached to a \r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN BOOLEAN ReadWrite,\r
IN UINTN Offset,\r
IN UINTN BufferSize,\r
IN OUT VOID *Buffer\r
- )\r
-;\r
+ );\r
\r
/**\r
Reads the current interrupt status and recycled transmit buffer status from \r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
OUT UINT32 *InterruptStatus OPTIONAL,\r
OUT VOID **TxBuf OPTIONAL\r
- )\r
-;\r
+ );\r
\r
/**\r
Places a packet in the transmit queue of a network interface.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
IN UINTN HeaderSize,\r
IN UINTN BufferSize,\r
IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
IN UINT16 *Protocol OPTIONAL\r
- )\r
-;\r
+ );\r
\r
/**\r
Receives a packet from a network interface.\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (\r
+(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE)(\r
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
OUT UINTN *HeaderSize OPTIONAL,\r
IN OUT UINTN *BufferSize,\r
OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,\r
OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,\r
OUT UINT16 *Protocol OPTIONAL\r
- )\r
-;\r
+ );\r
\r
#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000\r
\r
+//\r
+// Revision defined in EFI1.1\r
+// \r
+#define EFI_SIMPLE_NETWORK_INTERFACE_REVISION EFI_SIMPLE_NETWORK_PROTOCOL_REVISION\r
+\r
+///\r
+/// The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access \r
+/// to a network adapter. Once the network adapter initializes, \r
+/// the EFI_SIMPLE_NETWORK_PROTOCOL protocol provides services that \r
+/// allow packets to be transmitted and received.\r
+///\r
struct _EFI_SIMPLE_NETWORK_PROTOCOL {\r
+ ///\r
+ /// Revision of the EFI_SIMPLE_NETWORK_PROTOCOL. All future revisions must \r
+ /// be backwards compatible. If a future version is not backwards compatible \r
+ /// it is not the same GUID.\r
+ ///\r
UINT64 Revision;\r
EFI_SIMPLE_NETWORK_START Start;\r
EFI_SIMPLE_NETWORK_STOP Stop;\r
EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;\r
EFI_SIMPLE_NETWORK_TRANSMIT Transmit;\r
EFI_SIMPLE_NETWORK_RECEIVE Receive;\r
+ ///\r
+ /// Event used with WaitForEvent() to wait for a packet to be received.\r
+ ///\r
EFI_EVENT WaitForPacket;\r
+ ///\r
+ /// Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device.\r
+ ///\r
EFI_SIMPLE_NETWORK_MODE *Mode;\r
};\r
\r