TianoCore EDK2 master
|
Go to the source code of this file.
Implementation of Managed Network Protocol I/O functions.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MnpIo.c.
VOID MnpAnalysePacket | ( | IN MNP_SERVICE_DATA * | MnpServiceData, |
IN NET_BUF * | Nbuf, | ||
IN OUT EFI_MANAGED_NETWORK_RECEIVE_DATA * | RxData, | ||
OUT MNP_GROUP_ADDRESS ** | GroupAddress, | ||
OUT UINT8 * | PktAttr | ||
) |
Analyse the received packets.
[in] | MnpServiceData | Pointer to the mnp service context data. |
[in] | Nbuf | Pointer to the net buffer holding the received packet. |
[in,out] | RxData | Pointer to the buffer used to save the analysed result in EFI_MANAGED_NETWORK_RECEIVE_DATA. |
[out] | GroupAddress | Pointer to pointer to a MNP_GROUP_ADDRESS used to pass out the address of the multicast address the received packet destinated to. |
[out] | PktAttr | Pointer to the buffer used to save the analysed packet attribute. |
EFI_STATUS MnpBuildTxPacket | ( | IN MNP_SERVICE_DATA * | MnpServiceData, |
IN EFI_MANAGED_NETWORK_TRANSMIT_DATA * | TxData, | ||
OUT UINT8 ** | PktBuf, | ||
OUT UINT32 * | PktLen | ||
) |
Build the packet to transmit from the TxData passed in.
[in] | MnpServiceData | Pointer to the mnp service context data. |
[in] | TxData | Pointer to the transmit data containing the information to build the packet. |
[out] | PktBuf | Pointer to record the address of the packet. |
[out] | PktLen | Pointer to a UINT32 variable used to record the packet's length. |
EFI_SUCCESS | TxPackage is built. |
EFI_OUT_OF_RESOURCES | The deliver fails due to lack of memory resource. |
VOID MnpDeliverPacket | ( | IN MNP_SERVICE_DATA * | MnpServiceData | ) |
VOID MnpEnqueuePacket | ( | IN MNP_SERVICE_DATA * | MnpServiceData, |
IN NET_BUF * | Nbuf | ||
) |
EFI_STATUS MnpInstanceDeliverPacket | ( | IN OUT MNP_INSTANCE_DATA * | Instance | ) |
Try to deliver the received packet to the instance.
[in,out] | Instance | Pointer to the mnp instance context data. |
EFI_SUCCESS | The received packet is delivered, or there is no packet to deliver, or there is no available receive token. |
EFI_OUT_OF_RESOURCES | The deliver fails due to lack of memory resource. |
BOOLEAN MnpIsValidTxToken | ( | IN MNP_INSTANCE_DATA * | Instance, |
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN * | Token | ||
) |
BOOLEAN MnpMatchPacket | ( | IN MNP_INSTANCE_DATA * | Instance, |
IN EFI_MANAGED_NETWORK_RECEIVE_DATA * | RxData, | ||
IN MNP_GROUP_ADDRESS *GroupAddress | OPTIONAL, | ||
IN UINT8 | PktAttr | ||
) |
Match the received packet with the instance receive filters.
[in] | Instance | Pointer to the mnp instance context data. |
[in] | RxData | Pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA. |
[in] | GroupAddress | Pointer to the GroupAddress, the GroupAddress is non-NULL and it contains the destination multicast mac address of the received packet if the packet destinated to a multicast mac address. |
[in] | PktAttr | The received packets attribute. |
VOID MnpQueueRcvdPacket | ( | IN OUT MNP_INSTANCE_DATA * | Instance, |
IN OUT MNP_RXDATA_WRAP * | RxDataWrap | ||
) |
EFI_STATUS MnpReceivePacket | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData | ) |
Try to receive a packet and deliver it.
[in,out] | MnpDeviceData | Pointer to the mnp device context data. |
EFI_SUCCESS | add return value to function comment |
EFI_NOT_STARTED | The simple network protocol is not started. |
EFI_NOT_READY | No packet received. |
EFI_DEVICE_ERROR | An unexpected error occurs. |
EFI_STATUS MnpSyncSendPacket | ( | IN MNP_SERVICE_DATA * | MnpServiceData, |
IN UINT8 * | Packet, | ||
IN UINT32 | Length, | ||
IN OUT EFI_MANAGED_NETWORK_COMPLETION_TOKEN * | Token | ||
) |
Synchronously send out the packet.
This function places the packet buffer to SNP driver's tansmit queue. The packet can be considered successfully sent out once SNP accept the packet, while the packet buffer recycle is deferred for better performance.
[in] | MnpServiceData | Pointer to the mnp service context data. |
[in] | Packet | Pointer to the packet buffer. |
[in] | Length | The length of the packet. |
[in,out] | Token | Pointer to the token the packet generated from. |
EFI_SUCCESS | The packet is sent out. |
EFI_TIMEOUT | Time out occurs, the packet isn't sent. |
EFI_DEVICE_ERROR | An unexpected network error occurs. |
Poll to receive the packets from Snp. This function is either called by upperlayer protocols/applications or the system poll timer notify mechanism.
[in] | Event | The event this notify function registered to. |
[in] | Context | Pointer to the context data registered to the event. |
MNP_RXDATA_WRAP * MnpWrapRxData | ( | IN MNP_INSTANCE_DATA * | Instance, |
IN EFI_MANAGED_NETWORK_RECEIVE_DATA * | RxData | ||
) |
Wrap the RxData.
[in] | Instance | Pointer to the mnp instance context data. |
[in] | RxData | Pointer to the receive data to wrap. |