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

Go to the source code of this file.

Functions

EFI_STATUS PxeReceive (SNP_DRIVER *Snp, VOID *Buffer, UINTN *BufferSize, UINTN *HeaderSize, EFI_MAC_ADDRESS *SrcAddr, EFI_MAC_ADDRESS *DestAddr, UINT16 *Protocol)
 
EFI_STATUS EFIAPI SnpUndi32Receive (IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINTN *HeaderSize OPTIONAL, IN OUT UINTN *BufferSize, OUT VOID *Buffer, OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL, OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL)
 

Detailed Description

Implementation of receiving a packet from a network interface.

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

Definition in file Receive.c.

Function Documentation

◆ PxeReceive()

EFI_STATUS PxeReceive ( SNP_DRIVER Snp,
VOID *  Buffer,
UINTN BufferSize,
UINTN HeaderSize,
EFI_MAC_ADDRESS SrcAddr,
EFI_MAC_ADDRESS DestAddr,
UINT16 *  Protocol 
)

Call UNDI to receive a packet and fills in the data in the input pointers.

Parameters
SnpPointer to snp driver structure
BufferPointer to the memory for the received data
BufferSizePointer to the length of the buffer on entry and contains the length of the received data on return
HeaderSizePointer to the header portion of the data received.
SrcAddrPointer to contain the source ethernet address on return
DestAddrPointer to contain the destination ethernet address on return
ProtocolPointer to contain the protocol type from the ethernet header on return
Return values
EFI_SUCCESSThe received data was stored in Buffer, and BufferSize has been updated to the number of bytes received.
EFI_DEVICE_ERRORFail to execute UNDI command.
EFI_NOT_READYNo packets have been received on the network interface.
EFI_BUFFER_TOO_SMALLBufferSize is too small for the received packets. BufferSize has been updated to the required size.

Definition at line 38 of file Receive.c.

◆ SnpUndi32Receive()

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

Receives a packet from a network interface.

This function retrieves one packet from the receive queue of a network interface. If there are no packets on the receive queue, then EFI_NOT_READY will be returned. If there is a packet on the receive queue, and the size of the packet is smaller than BufferSize, then the contents of the packet will be placed in Buffer, and BufferSize will be updated with the actual size of the packet. In addition, if SrcAddr, DestAddr, and Protocol are not NULL, then these values will be extracted from the media header and returned. EFI_SUCCESS will be returned if a packet was successfully received. If BufferSize is smaller than the received packet, then the size of the receive packet will be placed in BufferSize and EFI_BUFFER_TOO_SMALL will be returned. 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 received on the network interface. If this parameter is NULL, then the media header size will not be returned.
BufferSizeOn entry, the size, in bytes, of Buffer. On exit, the size, in bytes, of the packet that was received on the network interface.
BufferA pointer to the data buffer to receive both the media header and the data.
SrcAddrThe source HW MAC address. If this parameter is NULL, the HW MAC source address will not be extracted from the media header.
DestAddrThe destination HW MAC address. If this parameter is NULL, the HW MAC destination address will not be extracted from the media header.
ProtocolThe media header type. If this parameter is NULL, then the protocol will not be extracted from the media header. See RFC 1700 section "Ether Types" for examples.
Return values
EFI_SUCCESSThe received data was stored in Buffer, and BufferSize has been updated to the number of bytes received.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_NOT_READYNo packets have been received on the network interface.
EFI_BUFFER_TOO_SMALLBufferSize is too small for the received packets. BufferSize has been updated to the required size.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: The This parameter is NULL The This parameter does not point to a valid EFI_SIMPLE_NETWORK_PROTOCOL structure. The BufferSize parameter is NULL The Buffer parameter is NULL
EFI_DEVICE_ERRORThe command could not be sent to the network interface.

Definition at line 191 of file Receive.c.