TianoCore EDK2 master
|
Go to the source code of this file.
Variables | |
EFI_SERVICE_BINDING_PROTOCOL | mMnpServiceBindingProtocol |
EFI_MANAGED_NETWORK_PROTOCOL | mMnpProtocolTemplate |
EFI_MANAGED_NETWORK_CONFIG_DATA | mMnpDefaultConfigData |
Implementation of Managed Network Protocol private services.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MnpConfig.c.
EFI_STATUS MnpAddFreeNbuf | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData, |
IN UINTN | Count | ||
) |
Add Count of net buffers to MnpDeviceData->FreeNbufQue. The length of the net buffer is specified by MnpDeviceData->BufferLength.
[in,out] | MnpDeviceData | Pointer to the MNP_DEVICE_DATA. |
[in] | Count | Number of NET_BUFFERs to add. |
EFI_SUCCESS | The specified amount of NET_BUFs are allocated and added to MnpDeviceData->FreeNbufQue. |
EFI_OUT_OF_RESOURCES | Failed to allocate a NET_BUF structure. |
Definition at line 54 of file MnpConfig.c.
EFI_STATUS MnpAddFreeTxBuf | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData, |
IN UINTN | Count | ||
) |
Add Count of TX buffers to MnpDeviceData->AllTxBufList and MnpDeviceData->FreeTxBufList. The length of the buffer is specified by MnpDeviceData->BufferLength.
[in,out] | MnpDeviceData | Pointer to the MNP_DEVICE_DATA. |
[in] | Count | Number of TX buffers to add. |
EFI_SUCCESS | The specified amount of TX buffers are allocated. |
EFI_OUT_OF_RESOURCES | Failed to allocate a TX buffer. |
Definition at line 215 of file MnpConfig.c.
NET_BUF * MnpAllocNbuf | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData | ) |
Allocate a free NET_BUF from MnpDeviceData->FreeNbufQue. If there is none in the queue, first try to allocate some and add them into the queue, then fetch the NET_BUF from the updated FreeNbufQue.
[in,out] | MnpDeviceData | Pointer to the MNP_DEVICE_DATA. |
Definition at line 103 of file MnpConfig.c.
UINT8 * MnpAllocTxBuf | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData | ) |
Allocate a free TX buffer from MnpDeviceData->FreeTxBufList. If there is none in the queue, first try to recycle some from SNP, then try to allocate some and add them into the queue, then fetch the NET_BUF from the updated FreeTxBufList.
[in,out] | MnpDeviceData | Pointer to the MNP_DEVICE_DATA. |
Definition at line 260 of file MnpConfig.c.
EFI_STATUS EFIAPI MnpCancelTokens | ( | IN OUT NET_MAP * | Map, |
IN OUT NET_MAP_ITEM * | Item, | ||
IN VOID * | Arg | ||
) |
Cancel the token specified by Arg if it matches the token in Item.
[in,out] | Map | Pointer to the NET_MAP. |
[in,out] | Item | Pointer to the NET_MAP_ITEM. |
[in] | Arg | Pointer to the Arg, it's a pointer to the token to cancel. |
EFI_SUCCESS | The Arg is NULL, and the token in Item is cancelled, or the Arg isn't NULL, and the token in Item is different from the Arg. |
EFI_ABORTED | The Arg isn't NULL, the token in Item mathces the Arg, and the token is cancelled. |
Definition at line 1063 of file MnpConfig.c.
EFI_STATUS MnpConfigReceiveFilters | ( | IN MNP_DEVICE_DATA * | MnpDeviceData | ) |
Configure the Snp receive filters according to the instances' receive filter settings.
[in] | MnpDeviceData | Pointer to the mnp device context data. |
EFI_SUCCESS | The receive filters is configured. |
EFI_OUT_OF_RESOURCES | The receive filters can't be configured due to lack of memory resource. |
Definition at line 1538 of file MnpConfig.c.
EFI_STATUS MnpConfigureInstance | ( | IN OUT MNP_INSTANCE_DATA * | Instance, |
IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData | OPTIONAL | ||
) |
Configure the Instance using ConfigData.
[in,out] | Instance | Pointer to the mnp instance context data. |
[in] | ConfigData | Pointer to the configuration data used to configure the instance. |
EFI_SUCCESS | The Instance is configured. |
EFI_UNSUPPORTED | EnableReceiveTimestamps is on and the implementation doesn't support it. |
Others | Other errors as indicated. |
Definition at line 1404 of file MnpConfig.c.
MNP_SERVICE_DATA * MnpCreateServiceData | ( | IN MNP_DEVICE_DATA * | MnpDeviceData, |
IN UINT16 | VlanId, | ||
IN UINT8 Priority | OPTIONAL | ||
) |
Create mnp service context data.
[in] | MnpDeviceData | Pointer to the mnp device context data. |
[in] | VlanId | The VLAN ID. |
[in] | Priority | The VLAN priority. If VlanId is 0, Priority is ignored. |
Definition at line 690 of file MnpConfig.c.
EFI_STATUS EFIAPI MnpDestoryChildEntry | ( | IN LIST_ENTRY * | Entry, |
IN VOID * | Context | ||
) |
Callback function which provided by user to remove one node in NetDestroyLinkList process.
[in] | Entry | The entry to be removed. |
[in] | Context | Pointer to the callback context corresponds to the Context in NetDestroyLinkList. |
EFI_SUCCESS | The entry has been removed successfully. |
Others | Fail to remove the entry. |
Definition at line 880 of file MnpConfig.c.
VOID MnpDestroyDeviceData | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData, |
IN EFI_HANDLE | ImageHandle | ||
) |
Destroy the MNP device context data.
[in,out] | MnpDeviceData | Pointer to the mnp device context data. |
[in] | ImageHandle | The driver image handle. |
Definition at line 614 of file MnpConfig.c.
EFI_STATUS MnpDestroyServiceChild | ( | IN OUT MNP_SERVICE_DATA * | MnpServiceData | ) |
Destroy all child of the MNP service data.
[in,out] | MnpServiceData | Pointer to the mnp service context data. |
EFI_SUCCESS | All child are destroyed. |
Others | Failed to destroy all child. |
Definition at line 903 of file MnpConfig.c.
EFI_STATUS MnpDestroyServiceData | ( | IN OUT MNP_SERVICE_DATA * | MnpServiceData | ) |
Destroy the MNP service context data.
[in,out] | MnpServiceData | Pointer to the mnp service context data. |
EFI_SUCCESS | The mnp service context is destroyed. |
Others | Errors as indicated. |
Definition at line 807 of file MnpConfig.c.
MNP_SERVICE_DATA * MnpFindServiceData | ( | IN MNP_DEVICE_DATA * | MnpDeviceData, |
IN UINT16 | VlanId | ||
) |
Find the MNP Service Data for given VLAN ID.
[in] | MnpDeviceData | Pointer to the mnp device context data. |
[in] | VlanId | The VLAN ID. |
Definition at line 936 of file MnpConfig.c.
VOID MnpFlushRcvdDataQueue | ( | IN OUT MNP_INSTANCE_DATA * | Instance | ) |
Flush the instance's received data.
[in,out] | Instance | Pointer to the mnp instance context data. |
Definition at line 1361 of file MnpConfig.c.
Try to reclaim the Nbuf into the buffer pool.
[in,out] | MnpDeviceData | Pointer to the mnp device context data. |
[in,out] | Nbuf | Pointer to the NET_BUF to free. |
Definition at line 170 of file MnpConfig.c.
VOID MnpFreeTxBuf | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData, |
IN OUT UINT8 * | TxBuf | ||
) |
Try to reclaim the TX buffer into the buffer pool.
[in,out] | MnpDeviceData | Pointer to the mnp device context data. |
[in,out] | TxBuf | Pointer to the TX buffer to free. |
Definition at line 334 of file MnpConfig.c.
EFI_STATUS MnpGroupOp | ( | IN OUT MNP_INSTANCE_DATA * | Instance, |
IN BOOLEAN | JoinFlag, | ||
IN EFI_MAC_ADDRESS *MacAddress | OPTIONAL, | ||
IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk | OPTIONAL | ||
) |
Do the group operations for this instance.
[in,out] | Instance | Pointer to the instance context data. |
[in] | JoinFlag | Set to TRUE to join a group. Set to TRUE to leave a group/groups. |
[in] | MacAddress | Pointer to the group address to join or leave. |
[in] | CtrlBlk | Pointer to the group control block if JoinFlag is FALSE. |
EFI_SUCCESS | The group operation finished. |
EFI_OUT_OF_RESOURCES | Failed due to lack of memory resources. |
Others | Other errors as indicated. |
Definition at line 1816 of file MnpConfig.c.
EFI_STATUS MnpGroupOpAddCtrlBlk | ( | IN OUT MNP_INSTANCE_DATA * | Instance, |
IN OUT MNP_GROUP_CONTROL_BLOCK * | CtrlBlk, | ||
IN OUT MNP_GROUP_ADDRESS *GroupAddress | OPTIONAL, | ||
IN EFI_MAC_ADDRESS * | MacAddress, | ||
IN UINT32 | HwAddressSize | ||
) |
Add a group address control block which controls the MacAddress for this instance.
[in,out] | Instance | Pointer to the mnp instance context data. |
[in,out] | CtrlBlk | Pointer to the group address control block. |
[in,out] | GroupAddress | Pointer to the group address. |
[in] | MacAddress | Pointer to the mac address. |
[in] | HwAddressSize | The hardware address size. |
EFI_SUCCESS | The group address control block is added. |
EFI_OUT_OF_RESOURCES | Failed due to lack of memory resources. |
Definition at line 1697 of file MnpConfig.c.
BOOLEAN MnpGroupOpDelCtrlBlk | ( | IN MNP_INSTANCE_DATA * | Instance, |
IN MNP_GROUP_CONTROL_BLOCK * | CtrlBlk | ||
) |
Delete a group control block from the instance. If the controlled group address's reference count reaches zero, the group address is removed too.
[in] | Instance | Pointer to the instance context data. |
[in] | CtrlBlk | Pointer to the group control block to delete. |
Definition at line 1759 of file MnpConfig.c.
EFI_STATUS MnpInitializeDeviceData | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData, |
IN EFI_HANDLE | ImageHandle, | ||
IN EFI_HANDLE | ControllerHandle | ||
) |
Initialize the mnp device context data.
[in,out] | MnpDeviceData | Pointer to the mnp device context data. |
[in] | ImageHandle | The driver image handle. |
[in] | ControllerHandle | Handle of device to bind driver to. |
EFI_SUCCESS | The mnp service context is initialized. |
EFI_UNSUPPORTED | ControllerHandle does not support Simple Network Protocol. |
Others | Other errors as indicated. |
Definition at line 420 of file MnpConfig.c.
VOID MnpInitializeInstanceData | ( | IN MNP_SERVICE_DATA * | MnpServiceData, |
IN OUT MNP_INSTANCE_DATA * | Instance | ||
) |
Initialize the mnp instance context data.
[in] | MnpServiceData | Pointer to the mnp service context data. |
[in,out] | Instance | Pointer to the mnp instance context data to initialize. |
Definition at line 966 of file MnpConfig.c.
EFI_STATUS MnpRecycleTxBuf | ( | IN OUT MNP_DEVICE_DATA * | MnpDeviceData | ) |
Try to recycle all the transmitted buffer address from SNP.
[in,out] | MnpDeviceData | Pointer to the mnp device context data. |
EFI_SUCCESS | Successed to recyclethe transmitted buffer address. |
Others | Failed to recyclethe transmitted buffer address. |
Definition at line 381 of file MnpConfig.c.
EFI_STATUS MnpStart | ( | IN OUT MNP_SERVICE_DATA * | MnpServiceData, |
IN BOOLEAN | IsConfigUpdate, | ||
IN BOOLEAN | EnableSystemPoll | ||
) |
Start the managed network, this function is called when one instance is configured or reconfigured.
[in,out] | MnpServiceData | Pointer to the mnp service context data. |
[in] | IsConfigUpdate | The instance is reconfigured or it's the first time the instanced is configured. |
[in] | EnableSystemPoll | Enable the system polling or not. |
EFI_SUCCESS | The managed network is started and some configuration is updated. |
Others | Other errors as indicated. |
Definition at line 1191 of file MnpConfig.c.
EFI_STATUS MnpStartSnp | ( | IN EFI_SIMPLE_NETWORK_PROTOCOL * | Snp | ) |
Start and initialize the simple network.
[in] | Snp | Pointer to the simple network protocol. |
EFI_SUCCESS | The simple network protocol is started. |
Others | Other errors as indicated. |
Definition at line 1111 of file MnpConfig.c.
EFI_STATUS MnpStop | ( | IN OUT MNP_SERVICE_DATA * | MnpServiceData | ) |
Stop the managed network.
[in,out] | MnpServiceData | Pointer to the mnp service context data. |
EFI_SUCCESS | The managed network is stopped. |
Others | Other errors as indicated. |
Definition at line 1297 of file MnpConfig.c.
EFI_STATUS MnpStopSnp | ( | IN MNP_DEVICE_DATA * | MnpDeviceData | ) |
Stop the simple network.
[in] | MnpDeviceData | Pointer to the MNP_DEVICE_DATA. |
EFI_SUCCESS | The simple network is stopped. |
Others | Other errors as indicated. |
Definition at line 1144 of file MnpConfig.c.
EFI_STATUS EFIAPI MnpTokenExist | ( | IN NET_MAP * | Map, |
IN NET_MAP_ITEM * | Item, | ||
IN VOID * | Arg | ||
) |
Check whether the token specified by Arg matches the token in Item.
[in] | Map | Pointer to the NET_MAP. |
[in] | Item | Pointer to the NET_MAP_ITEM. |
[in] | Arg | Pointer to the Arg, it's a pointer to the token to check. |
EFI_SUCCESS | The token specified by Arg is different from the token in Item. |
EFI_ACCESS_DENIED | The token specified by Arg is the same as that in Item. |
Definition at line 1023 of file MnpConfig.c.
EFI_MANAGED_NETWORK_CONFIG_DATA mMnpDefaultConfigData |
EFI_MANAGED_NETWORK_PROTOCOL mMnpProtocolTemplate |
Definition at line 17 of file MnpConfig.c.
EFI_SERVICE_BINDING_PROTOCOL mMnpServiceBindingProtocol |
Definition at line 12 of file MnpConfig.c.