TianoCore EDK2 master
Loading...
Searching...
No Matches
Transmit.c File Reference
#include "Snp.h"

Go to the source code of this file.

Functions

EFI_STATUS PxeFillHeader (SNP_DRIVER *Snp, VOID *MacHeaderPtr, UINTN HeaderSize, VOID *Buffer, UINTN BufferSize, EFI_MAC_ADDRESS *DestAddr, EFI_MAC_ADDRESS *SrcAddr, UINT16 *ProtocolPtr)
 
EFI_STATUS PxeTransmit (SNP_DRIVER *Snp, VOID *Buffer, UINTN BufferSize)
 
EFI_STATUS EFIAPI SnpUndi32Transmit (IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINTN HeaderSize, IN UINTN BufferSize, IN VOID *Buffer, IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL, IN EFI_MAC_ADDRESS *DestAddr OPTIONAL, IN UINT16 *Protocol OPTIONAL)
 

Detailed Description

Implementation of transmitting a packet.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Transmit.c.

Function Documentation

◆ PxeFillHeader()

EFI_STATUS PxeFillHeader ( SNP_DRIVER Snp,
VOID *  MacHeaderPtr,
UINTN  HeaderSize,
VOID *  Buffer,
UINTN  BufferSize,
EFI_MAC_ADDRESS DestAddr,
EFI_MAC_ADDRESS SrcAddr,
UINT16 *  ProtocolPtr 
)

Call UNDI to create the meadia header for the given data buffer.

Parameters
SnpPointer to SNP driver structure.
MacHeaderPtrAddress where the media header will be filled in.
HeaderSizeSize of the memory at MacHeaderPtr.
BufferData buffer pointer.
BufferSizeSize of data in the Buffer
DestAddrAddress of the destination mac address buffer.
SrcAddrAddress of the source mac address buffer.
ProtocolPtrAddress of the protocol type.
Return values
EFI_SUCCESSSuccessfully completed the undi call.
OtherError return from undi call.

Definition at line 28 of file Transmit.c.

◆ PxeTransmit()

EFI_STATUS PxeTransmit ( SNP_DRIVER Snp,
VOID *  Buffer,
UINTN  BufferSize 
)

This routine calls undi to transmit the given data buffer

Parameters
Snppointer to SNP driver structure
Bufferdata buffer pointer
BufferSizeSize of data in the Buffer
Return values
EFI_SUCCESSif successfully completed the undi call
Othererror return from undi call.

Definition at line 139 of file Transmit.c.

◆ SnpUndi32Transmit()

EFI_STATUS EFIAPI SnpUndi32Transmit ( IN EFI_SIMPLE_NETWORK_PROTOCOL This,
IN UINTN  HeaderSize,
IN UINTN  BufferSize,
IN VOID *  Buffer,
IN EFI_MAC_ADDRESS *SrcAddr  OPTIONAL,
IN EFI_MAC_ADDRESS *DestAddr  OPTIONAL,
IN UINT16 *Protocol  OPTIONAL 
)

Places a packet in the transmit queue of a network interface.

This function places the packet specified by Header and Buffer on the transmit queue. If HeaderSize is nonzero and HeaderSize is not equal to This->Mode->MediaHeaderSize, then EFI_INVALID_PARAMETER will be returned. If BufferSize is less than This->Mode->MediaHeaderSize, then EFI_BUFFER_TOO_SMALL will be returned. If Buffer is NULL, then EFI_INVALID_PARAMETER will be returned. If HeaderSize is nonzero and DestAddr or Protocol is NULL, then EFI_INVALID_PARAMETER will be returned. If the transmit engine of the network interface is busy, then EFI_NOT_READY will be returned. If this packet can be accepted by the transmit engine of the network interface, the packet contents specified by Buffer will be placed on the transmit queue of the network interface, and EFI_SUCCESS will be returned. GetStatus() can be used to determine when the packet has actually been transmitted. The contents of the Buffer must not be modified until the packet has actually been transmitted. The Transmit() function performs nonblocking I/O. A caller who wants to perform blocking I/O, should call Transmit(), and then GetStatus() until the transmitted buffer shows up in the recycled transmit buffer. If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.

Parameters
ThisA pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.
HeaderSizeThe size, in bytes, of the media header to be filled in by the Transmit() function. If HeaderSize is nonzero, then it must be equal to This->Mode->MediaHeaderSize and the DestAddr and Protocol parameters must not be NULL.
BufferSizeThe size, in bytes, of the entire packet (media header and data) to be transmitted through the network interface.
BufferA pointer to the packet (media header followed by data) to be transmitted. This parameter cannot be NULL. If HeaderSize is zero, then the media header in Buffer must already be filled in by the caller. If HeaderSize is nonzero, then the media header will be filled in by the Transmit() function.
SrcAddrThe source HW MAC address. If HeaderSize is zero, then this parameter is ignored. If HeaderSize is nonzero and SrcAddr is NULL, then This->Mode->CurrentAddress is used for the source HW MAC address.
DestAddrThe destination HW MAC address. If HeaderSize is zero, then this parameter is ignored.
ProtocolThe type of header to build. If HeaderSize is zero, then this parameter is ignored. See RFC 1700, section "Ether Types," for examples.
Return values
EFI_SUCCESSThe packet was placed on the transmit queue.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_NOT_READYThe network interface is too busy to accept this transmit request.
EFI_BUFFER_TOO_SMALLThe BufferSize parameter is too small.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 270 of file Transmit.c.