TianoCore EDK2 master
|
#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) |
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.
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.
Snp | Pointer to snp driver structure |
Buffer | Pointer to the memory for the received data |
BufferSize | Pointer to the length of the buffer on entry and contains the length of the received data on return |
HeaderSize | Pointer to the header portion of the data received. |
SrcAddr | Pointer to contain the source ethernet address on return |
DestAddr | Pointer to contain the destination ethernet address on return |
Protocol | Pointer to contain the protocol type from the ethernet header on return |
EFI_SUCCESS | The received data was stored in Buffer, and BufferSize has been updated to the number of bytes received. |
EFI_DEVICE_ERROR | Fail to execute UNDI command. |
EFI_NOT_READY | No packets have been received on the network interface. |
EFI_BUFFER_TOO_SMALL | BufferSize is too small for the received packets. BufferSize has been updated to the required size. |
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.
This | A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance. |
HeaderSize | The 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. |
BufferSize | On entry, the size, in bytes, of Buffer. On exit, the size, in bytes, of the packet that was received on the network interface. |
Buffer | A pointer to the data buffer to receive both the media header and the data. |
SrcAddr | The source HW MAC address. If this parameter is NULL, the HW MAC source address will not be extracted from the media header. |
DestAddr | The destination HW MAC address. If this parameter is NULL, the HW MAC destination address will not be extracted from the media header. |
Protocol | The 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. |
EFI_SUCCESS | The received data was stored in Buffer, and BufferSize has been updated to the number of bytes received. |
EFI_NOT_STARTED | The network interface has not been started. |
EFI_NOT_READY | No packets have been received on the network interface. |
EFI_BUFFER_TOO_SMALL | BufferSize is too small for the received packets. BufferSize has been updated to the required size. |
EFI_INVALID_PARAMETER | One 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_ERROR | The command could not be sent to the network interface. |