/** @file\r
- Simple Network protocol as defined in the UEFI 2.0 specification.\r
+ The EFI_SIMPLE_NETWORK_PROTOCOL provides services to initialize a network interface, \r
+ transmit packets, receive packets, and close a network interface.\r
\r
Basic network device abstraction.\r
\r
MCast - MultiCast\r
...\r
\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
- http://opensource.org/licenses/bsd-license.php \r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution. \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php. \r
+ \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
- 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
+ @par Revision Reference: \r
+ This Protocol is introduced in EFI Specification 1.10. \r
\r
**/\r
\r
typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK_PROTOCOL;\r
\r
\r
-//\r
-// Protocol defined in EFI1.1.\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
+///\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
+ ///\r
+ /// Number of valid frames received that were duplicated.\r
+ ///\r
+ UINT64 RxDuplicatedFrames;\r
+\r
+ ///\r
+ /// Number of encrypted frames received that failed to decrypt.\r
+ ///\r
+ UINT64 RxDecryptErrorFrames;\r
+\r
+ ///\r
+ /// Number of frames that failed to transmit after exceeding the retry limit.\r
+ ///\r
+ UINT64 TxErrorFrames;\r
+\r
+ ///\r
+ /// Number of frames transmitted successfully after more than one attempt.\r
+ ///\r
+ UINT64 TxRetryFrames;\r
} EFI_NETWORK_STATISTICS;\r
\r
+///\r
+/// The 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
#define MAX_MCAST_FILTER_CNT 16\r
typedef struct {\r
+ ///\r
+ /// Reports the current state of the network interface.\r
+ ///\r
UINT32 State;\r
+ ///\r
+ /// The size, in bytes, of the network interface's HW address.\r
+ ///\r
UINT32 HwAddressSize;\r
+ ///\r
+ /// The size, in bytes, of the network interface's media header.\r
+ ///\r
UINT32 MediaHeaderSize;\r
+ ///\r
+ /// The maximum size, in bytes, of the packets supported by the network interface.\r
+ ///\r
UINT32 MaxPacketSize;\r
+ ///\r
+ /// The size, in bytes, of the NVRAM device attached to the network interface.\r
+ ///\r
UINT32 NvRamSize;\r
+ ///\r
+ /// The size that must be used for all NVRAM reads and writes. The\r
+ /// start address for NVRAM read and write operations and the total\r
+ /// length of those operations, must be a multiple of this value. The\r
+ /// legal values for this field are 0, 1, 2, 4, and 8.\r
+ ///\r
UINT32 NvRamAccessSize;\r
+ ///\r
+ /// The multicast receive filter settings supported by the network interface.\r
+ ///\r
UINT32 ReceiveFilterMask;\r
+ ///\r
+ /// The current multicast receive filter settings.\r
+ ///\r
UINT32 ReceiveFilterSetting;\r
+ ///\r
+ /// The maximum number of multicast address receive filters supported by the driver.\r
+ ///\r
UINT32 MaxMCastFilterCount;\r
+ ///\r
+ /// The current number of multicast address receive filters.\r
+ ///\r
UINT32 MCastFilterCount;\r
+ ///\r
+ /// Array containing the addresses of the current multicast address receive filters.\r
+ ///\r
EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];\r
+ ///\r
+ /// The current HW MAC address for the network interface.\r
+ ///\r
EFI_MAC_ADDRESS CurrentAddress;\r
+ ///\r
+ /// The current HW MAC address for broadcast packets.\r
+ ///\r
EFI_MAC_ADDRESS BroadcastAddress;\r
+ ///\r
+ /// The permanent HW MAC address for the network interface.\r
+ ///\r
EFI_MAC_ADDRESS PermanentAddress;\r
+ ///\r
+ /// The interface type of the network interface.\r
+ ///\r
UINT8 IfType;\r
+ ///\r
+ /// TRUE if the HW MAC address can be changed.\r
+ ///\r
BOOLEAN MacAddressChangeable;\r
+ ///\r
+ /// TRUE if the network interface can transmit more than one packet at a time.\r
+ ///\r
BOOLEAN MultipleTxSupported;\r
+ ///\r
+ /// TRUE if the presence of media can be determined; otherwise FALSE.\r
+ ///\r
BOOLEAN MediaPresentSupported;\r
+ ///\r
+ /// TRUE if media are connected to the network interface; otherwise FALSE.\r
+ ///\r
BOOLEAN MediaPresent;\r
} EFI_SIMPLE_NETWORK_MODE;\r
\r
EFI_STATUS\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
EFI_STATUS\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
required by the network interface; optionally, also requests allocation \r
of additional transmit and receive buffers.\r
\r
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param ExtraRxBufferSize The size, in bytes, of the extra receive buffer space\r
that the driver should allocate for the network interface.\r
Some network interfaces will not be able to use the extra\r
being used.\r
\r
@retval EFI_SUCCESS The network interface was initialized.\r
- @retval EFI_NOT_STARTED The network interface has not been started\r
+ @retval EFI_NOT_STARTED The network interface has not been started.\r
@retval EFI_OUT_OF_RESOURCES There was not enough memory for the transmit and\r
- receive buffers. .\r
+ receive buffers.\r
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
@retval EFI_UNSUPPORTED This function is not supported by the network interface.\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
provided in the previous call to Initialize(). \r
\r
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param ExtendedVerification Indicates that the driver may perform a more\r
exhaustive verification operation of the device\r
during reset.\r
\r
@retval EFI_SUCCESS The network interface was reset.\r
- @retval EFI_NOT_STARTED The network interface has not been started\r
+ @retval EFI_NOT_STARTED The network interface has not been started.\r
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
@retval EFI_UNSUPPORTED This function is not supported by the network interface.\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
@param This Protocol instance pointer.\r
\r
@retval EFI_SUCCESS The network interface was shutdown.\r
- @retval EFI_NOT_STARTED The network interface has not been started\r
+ @retval EFI_NOT_STARTED The network interface has not been started.\r
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
@retval EFI_UNSUPPORTED This function is not supported by the network interface.\r
EFI_STATUS\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
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param Enable A bit mask of receive filters to enable on the network interface.\r
@param Disable A bit mask of receive filters to disable on the network interface.\r
@param ResetMCastFilter Set to TRUE to reset the contents of the multicast receive\r
ResetMCastFilter is TRUE.\r
\r
@retval EFI_SUCCESS The multicast receive filter list was updated.\r
- @retval EFI_NOT_STARTED The network interface has not been started\r
+ @retval EFI_NOT_STARTED The network interface has not been started.\r
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
@retval EFI_UNSUPPORTED This function is not supported by the network interface.\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
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param Reset Flag used to reset the station address to the network interfaces\r
permanent address.\r
- @param New New station address to be used for the network interface.\r
+ @param New The new station address to be used for the network interface.\r
\r
@retval EFI_SUCCESS The network interfaces station address was updated.\r
- @retval EFI_NOT_STARTED The network interface has not been started\r
+ @retval EFI_NOT_STARTED The network interface has not been started.\r
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r
@retval EFI_UNSUPPORTED This function is not supported by the network interface.\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
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
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param IPv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set\r
to FALSE if the multicast IP address is IPv4 [RFC 791].\r
@param IP The multicast IP address that is to be converted to a multicast\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
network interface.\r
\r
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param ReadWrite TRUE for read operations, FALSE for write operations.\r
@param Offset Byte offset in the NVRAM device at which to start the read or\r
write operation. This must be a multiple of NvRamAccessSize and\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
a network interface.\r
\r
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param InterruptStatus A pointer to the bit mask of the currently active interrupts\r
If this is NULL, the interrupt status will not be read from\r
the device. If this is not NULL, the interrupt status will\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
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param HeaderSize The size, in bytes, of the media header to be filled in by\r
the Transmit() function. If HeaderSize is non-zero, then it\r
must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
@param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter\r
is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
This->Mode->CurrentAddress is used for the source HW MAC address.\r
- @param DsetAddr The destination HW MAC address. If HeaderSize is zero, then this\r
+ @param DestAddr The destination HW MAC address. If HeaderSize is zero, then this\r
parameter is ignored.\r
@param Protocol The type of header to build. If HeaderSize is zero, then this\r
parameter is ignored. See RFC 1700, section "Ether Types", for\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
- @param This Protocol instance pointer.\r
+ @param This The protocol instance pointer.\r
@param HeaderSize The size, in bytes, of the media header received on the network\r
interface. If this parameter is NULL, then the media header size\r
will not be returned.\r
@param SrcAddr The source HW MAC address. If this parameter is NULL, the\r
HW MAC source address will not be extracted from the media\r
header.\r
- @param DsetAddr The destination HW MAC address. If this parameter is NULL,\r
+ @param DestAddr The destination HW MAC address. If this parameter is NULL,\r
the HW MAC destination address will not be extracted from the\r
media header.\r
@param Protocol The media header type. If this parameter is NULL, then the\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
#define EFI_SIMPLE_NETWORK_INTERFACE_REVISION EFI_SIMPLE_NETWORK_PROTOCOL_REVISION\r
\r
-/** \r
- @par Protocol Description:\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
- @param Revision\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
- @param Start\r
- Prepares the network interface for further command operations. \r
- No other EFI_SIMPLE_NETWORK_PROTOCOL interface functions will operate \r
- until this call is made. \r
-\r
- @param Stop\r
- Stops further network interface command processing. \r
- No other EFI_SIMPLE_NETWORK_PROTOCOL interface functions will operate \r
- after this call is made until another Start() call is made. \r
-\r
- @param Initialize\r
- Resets the network adapter and allocates the transmit and receive buffers. \r
-\r
- @param Reset\r
- Resets the network adapter and reinitializes it with the parameters \r
- provided in the previous call to Initialize(). \r
-\r
- @param Shutdown\r
- Resets the network adapter and leaves it in a state safe for another driver \r
- to initialize. The memory buffers assigned in the Initialize() call are released. \r
- After this call, only the Initialize() or Stop() calls may be used. \r
-\r
- @param ReceiveFilters\r
- Enables and disables the receive filters for the network interface and, \r
- if supported, manages the filtered multicast \r
- HW MAC (Hardware Media Access Control) address list. \r
-\r
- @param StationAddress\r
- Modifies or resets the current station address, if supported. \r
-\r
- @param Statistics\r
- Collects statistics from the network interface and allows the statistics to be reset. \r
-\r
- @param MCastIpToMac\r
- Maps a multicast IP address to a multicast HW MAC address. \r
-\r
- @param NvData\r
- Reads and writes the contents of the NVRAM devices attached to the network interface. \r
-\r
- @param GetStatus\r
- Reads the current interrupt status and the list of recycled transmit \r
- buffers from the network interface. \r
-\r
- @param Transmit\r
- Places a packet in the transmit queue. \r
-\r
- @param Receive\r
- Retrieves a packet from the receive queue, along with the status \r
- flags that describe the packet type. \r
-\r
- @param WaitForPacket\r
- Event used with WaitForEvent() to wait for a packet to be received.\r
-\r
- @param Mode\r
- Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device. \r
-\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