X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FProtocol%2FSimpleNetwork.h;h=1d9cc67bdf921b4ccb8f85044c2dc9420bc9a229;hb=34860f7a069641fb9e14077c01605215aae68a9b;hp=ece9d3966d0c57fb530179ea16e6da4b57613873;hpb=a6508c051b680c94e8823070c655a857487e862e;p=mirror_edk2.git diff --git a/MdePkg/Include/Protocol/SimpleNetwork.h b/MdePkg/Include/Protocol/SimpleNetwork.h index ece9d3966d..1d9cc67bdf 100644 --- a/MdePkg/Include/Protocol/SimpleNetwork.h +++ b/MdePkg/Include/Protocol/SimpleNetwork.h @@ -1,5 +1,5 @@ /** @file - Simple Network protocol as defined in the EFI 1.0 specification. + Simple Network protocol as defined in the UEFI 2.0 specification. Basic network device abstraction. @@ -8,7 +8,7 @@ MCast - MultiCast ... - Copyright (c) 2006, Intel Corporation + Copyright (c) 2006 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -17,8 +17,6 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - Module Name: SimpleNetwork.h - **/ #ifndef __SIMPLE_NETWORK_H__ @@ -32,72 +30,72 @@ typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK_PROTOCOL; -// -// Protocol defined in EFI1.1. -// +/// +/// Protocol defined in EFI1.1. +/// typedef EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK; -// -// Simple Network Protocol data structures -// +/// +/// Simple Network Protocol data structures +/// typedef struct { - // - // Total number of frames received. Includes frames with errors and - // dropped frames. - // + /// + /// Total number of frames received. Includes frames with errors and + /// dropped frames. + /// UINT64 RxTotalFrames; - // - // Number of valid frames received and copied into receive buffers. - // + /// + /// Number of valid frames received and copied into receive buffers. + /// UINT64 RxGoodFrames; - // - // Number of frames below the minimum length for the media. - // This would be <64 for ethernet. - // + /// + /// Number of frames below the minimum length for the media. + /// This would be <64 for ethernet. + /// UINT64 RxUndersizeFrames; - // - // Number of frames longer than the maxminum length for the - // media. This would be >1500 for ethernet. - // + /// + /// Number of frames longer than the maxminum length for the + /// media. This would be >1500 for ethernet. + /// UINT64 RxOversizeFrames; - // - // Valid frames that were dropped because receive buffers were full. - // + /// + /// Valid frames that were dropped because receive buffers were full. + /// UINT64 RxDroppedFrames; - // - // Number of valid unicast frames received and not dropped. - // + /// + /// Number of valid unicast frames received and not dropped. + /// UINT64 RxUnicastFrames; - // - // Number of valid broadcast frames received and not dropped. - // + /// + /// Number of valid broadcast frames received and not dropped. + /// UINT64 RxBroadcastFrames; - // - // Number of valid mutlicast frames received and not dropped. - // + /// + /// Number of valid mutlicast frames received and not dropped. + /// UINT64 RxMulticastFrames; - // - // Number of frames w/ CRC or alignment errors. - // + /// + /// Number of frames w/ CRC or alignment errors. + /// UINT64 RxCrcErrorFrames; - // - // Total number of bytes received. Includes frames with errors - // and dropped frames. + /// + /// Total number of bytes received. Includes frames with errors + /// and dropped frames. // UINT64 RxTotalBytes; - // - // Transmit statistics. - // + /// + /// Transmit statistics. + /// UINT64 TxTotalFrames; UINT64 TxGoodFrames; UINT64 TxUndersizeFrames; @@ -109,18 +107,23 @@ typedef struct { UINT64 TxCrcErrorFrames; UINT64 TxTotalBytes; - // - // Number of collisions detection on this subnet. - // + /// + /// Number of collisions detection on this subnet. + /// UINT64 Collisions; - // - // Number of frames destined for unsupported protocol. - // + /// + /// Number of frames destined for unsupported protocol. + /// UINT64 UnsupportedProtocol; } EFI_NETWORK_STATISTICS; +/// +/// State of the network interface +/// When an EFI_SIMPLE_NETWORK_PROTOCOL driver initializes a +/// network interface, the network interface is left in the EfiSimpleNetworkStopped state. +/// typedef enum { EfiSimpleNetworkStopped, EfiSimpleNetworkStarted, @@ -141,24 +144,84 @@ typedef enum { #define MAX_MCAST_FILTER_CNT 16 typedef struct { + /// + /// Reports the current state of the network interface. + /// UINT32 State; + /// + /// The size, in bytes, of the network interface's HW address. + /// UINT32 HwAddressSize; + /// + /// The size, in bytes, of the network interface's media header. + /// UINT32 MediaHeaderSize; + /// + /// The maximum size, in bytes, of the packets supported by the network interface. + /// UINT32 MaxPacketSize; + /// + /// The size, in bytes, of the NVRAM device attached to the network interface. + /// UINT32 NvRamSize; + /// + /// The size that must be used for all NVRAM reads and writes. The + /// start address for NVRAM read and write operations and the total + /// length of those operations, must be a multiple of this value. The + /// legal values for this field are 0, 1, 2, 4, and 8. + /// UINT32 NvRamAccessSize; + /// + /// The multicast receive filter settings supported by the network interface. + /// UINT32 ReceiveFilterMask; + /// + /// The current multicast receive filter settings. + /// UINT32 ReceiveFilterSetting; + /// + /// The maximum number of multicast address receive filters supported by the driver. + /// UINT32 MaxMCastFilterCount; + /// + /// The current number of multicast address receive filters. + /// UINT32 MCastFilterCount; + /// + /// Array containing the addresses of the current multicast address receive filters. + /// EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT]; + /// + /// The current HW MAC address for the network interface. + /// EFI_MAC_ADDRESS CurrentAddress; + /// + /// The current HW MAC address for broadcast packets. + /// EFI_MAC_ADDRESS BroadcastAddress; + /// + /// The permanent HW MAC address for the network interface. + /// EFI_MAC_ADDRESS PermanentAddress; + /// + /// The interface type of the network interface. + /// UINT8 IfType; + /// + /// TRUE if the HW MAC address can be changed. + /// BOOLEAN MacAddressChangeable; + /// + /// TRUE if the network interface can transmit more than one packet at a time. + /// BOOLEAN MultipleTxSupported; + /// + /// TRUE if the presence of media can be determined; otherwise FALSE. + /// BOOLEAN MediaPresentSupported; + /// + /// TRUE if media are connected to the network interface; otherwise FALSE. + /// BOOLEAN MediaPresent; } EFI_SIMPLE_NETWORK_MODE; @@ -179,10 +242,9 @@ typedef struct { **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_START) ( +(EFIAPI *EFI_SIMPLE_NETWORK_START)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This - ) -; + ); /** Changes the state of a network interface from "started" to "stopped". @@ -198,10 +260,9 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_STOP) ( +(EFIAPI *EFI_SIMPLE_NETWORK_STOP)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This - ) -; + ); /** Resets a network adapter and allocates the transmit and receive buffers @@ -231,12 +292,11 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) ( +(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONAL - ) -; + ); /** Resets a network adapter and re-initializes it with the parameters that were @@ -256,11 +316,10 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_RESET) ( +(EFIAPI *EFI_SIMPLE_NETWORK_RESET)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN ExtendedVerification - ) -; + ); /** Resets a network adapter and leaves it in a state that is safe for @@ -277,10 +336,9 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) ( +(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This - ) -; + ); /** Manages the multicast receive filters of a network interface. @@ -308,15 +366,14 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) ( +(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINT32 Enable, IN UINT32 Disable, IN BOOLEAN ResetMCastFilter, IN UINTN MCastFilterCnt OPTIONAL, IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL - ) -; + ); /** Modifies or resets the current station address, if supported. @@ -335,12 +392,11 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) ( +(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN Reset, IN EFI_MAC_ADDRESS *New OPTIONAL - ) -; + ); /** Resets or collects the statistics on a network interface. @@ -365,13 +421,12 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) ( +(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN Reset, IN OUT UINTN *StatisticsSize OPTIONAL, OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL - ) -; + ); /** Converts a multicast IP address to a multicast HW MAC address. @@ -396,13 +451,12 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) ( +(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN IPv6, IN EFI_IP_ADDRESS *IP, OUT EFI_MAC_ADDRESS *MAC - ) -; + ); /** Performs read and write operations on the NVRAM device attached to a @@ -426,14 +480,13 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) ( +(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN ReadWrite, IN UINTN Offset, IN UINTN BufferSize, IN OUT VOID *Buffer - ) -; + ); /** Reads the current interrupt status and recycled transmit buffer status from @@ -462,12 +515,11 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) ( +(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINT32 *InterruptStatus OPTIONAL, OUT VOID **TxBuf OPTIONAL - ) -; + ); /** Places a packet in the transmit queue of a network interface. @@ -504,7 +556,7 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) ( +(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINTN HeaderSize, IN UINTN BufferSize, @@ -512,8 +564,7 @@ EFI_STATUS IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL, IN EFI_MAC_ADDRESS *DestAddr OPTIONAL, IN UINT16 *Protocol OPTIONAL - ) -; + ); /** Receives a packet from a network interface. @@ -549,7 +600,7 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) ( +(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE)( IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINTN *HeaderSize OPTIONAL, IN OUT UINTN *BufferSize, @@ -557,8 +608,7 @@ EFI_STATUS OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL, OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL - ) -; + ); #define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000 @@ -567,7 +617,18 @@ EFI_STATUS // #define EFI_SIMPLE_NETWORK_INTERFACE_REVISION EFI_SIMPLE_NETWORK_PROTOCOL_REVISION +/// +/// The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access +/// to a network adapter. Once the network adapter initializes, +/// the EFI_SIMPLE_NETWORK_PROTOCOL protocol provides services that +/// allow packets to be transmitted and received. +/// struct _EFI_SIMPLE_NETWORK_PROTOCOL { + /// + /// Revision of the EFI_SIMPLE_NETWORK_PROTOCOL. All future revisions must + /// be backwards compatible. If a future version is not backwards compatible + /// it is not the same GUID. + /// UINT64 Revision; EFI_SIMPLE_NETWORK_START Start; EFI_SIMPLE_NETWORK_STOP Stop; @@ -582,7 +643,13 @@ struct _EFI_SIMPLE_NETWORK_PROTOCOL { EFI_SIMPLE_NETWORK_GET_STATUS GetStatus; EFI_SIMPLE_NETWORK_TRANSMIT Transmit; EFI_SIMPLE_NETWORK_RECEIVE Receive; + /// + /// Event used with WaitForEvent() to wait for a packet to be received. + /// EFI_EVENT WaitForPacket; + /// + /// Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device. + /// EFI_SIMPLE_NETWORK_MODE *Mode; };