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

Go to the source code of this file.

Functions

EFI_STATUS PxeRecvFilterEnable (SNP_DRIVER *Snp, UINT32 EnableFlags, UINTN MCastAddressCount, EFI_MAC_ADDRESS *MCastAddressList)
 
EFI_STATUS PxeRecvFilterDisable (SNP_DRIVER *Snp, UINT32 DisableFlags, BOOLEAN ResetMCastList)
 
EFI_STATUS PxeRecvFilterRead (SNP_DRIVER *Snp)
 
EFI_STATUS EFIAPI SnpUndi32ReceiveFilters (IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINT32 Enable, IN UINT32 Disable, IN BOOLEAN ResetMCastFilter, IN UINTN MCastFilterCnt OPTIONAL, IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL)
 

Detailed Description

Implementation of managing the multicast receive filters of a network interface.

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

Definition in file Receive_filters.c.

Function Documentation

◆ PxeRecvFilterDisable()

EFI_STATUS PxeRecvFilterDisable ( SNP_DRIVER Snp,
UINT32  DisableFlags,
BOOLEAN  ResetMCastList 
)

Call undi to disable the receive filters.

Parameters
SnpPointer to snp driver structure
DisableFlagsBit mask for disabling the receive filters
ResetMCastListBoolean flag to reset/delete the multicast filter list.
Return values
EFI_SUCCESSThe multicast receive filter list was updated.
EFI_DEVICE_ERRORFail to execute UNDI command.

Definition at line 119 of file Receive_filters.c.

◆ PxeRecvFilterEnable()

EFI_STATUS PxeRecvFilterEnable ( SNP_DRIVER Snp,
UINT32  EnableFlags,
UINTN  MCastAddressCount,
EFI_MAC_ADDRESS MCastAddressList 
)

Call undi to enable the receive filters.

Parameters
SnpPointer to snp driver structure.
EnableFlagsBit mask for enabling the receive filters.
MCastAddressCountMulticast address count for a new multicast address list.
MCastAddressListList of new multicast addresses.
Return values
EFI_SUCCESSThe multicast receive filter list was updated.
EFI_INVALID_PARAMETERInvalid UNDI command.
EFI_UNSUPPORTEDCommand is not supported by UNDI.
EFI_DEVICE_ERRORFail to execute UNDI command.

Definition at line 28 of file Receive_filters.c.

◆ PxeRecvFilterRead()

EFI_STATUS PxeRecvFilterRead ( SNP_DRIVER Snp)

Call undi to read the receive filters.

Parameters
SnpPointer to snp driver structure.
Return values
EFI_SUCCESSThe receive filter was read.
EFI_DEVICE_ERRORFail to execute UNDI command.

Definition at line 195 of file Receive_filters.c.

◆ SnpUndi32ReceiveFilters()

EFI_STATUS EFIAPI SnpUndi32ReceiveFilters ( IN EFI_SIMPLE_NETWORK_PROTOCOL This,
IN UINT32  Enable,
IN UINT32  Disable,
IN BOOLEAN  ResetMCastFilter,
IN UINTN MCastFilterCnt  OPTIONAL,
IN EFI_MAC_ADDRESS *MCastFilter  OPTIONAL 
)

Manages the multicast receive filters of a network interface.

This function is used enable and disable the hardware and software receive filters for the underlying network device. The receive filter change is broken down into three steps: The filter mask bits that are set (ON) in the Enable parameter are added to the current receive filter settings. The filter mask bits that are set (ON) in the Disable parameter are subtracted from the updated receive filter settings. If the resulting receive filter setting is not supported by the hardware a more liberal setting is selected. If the same bits are set in the Enable and Disable parameters, then the bits in the Disable parameter takes precedence. If the ResetMCastFilter parameter is TRUE, then the multicast address list filter is disabled (irregardless of what other multicast bits are set in the Enable and Disable parameters). The SNP->Mode->MCastFilterCount field is set to zero. The Snp->Mode->MCastFilter contents are undefined. After enabling or disabling receive filter settings, software should verify the new settings by checking the Snp->Mode->ReceiveFilterSettings, Snp->Mode->MCastFilterCount and Snp->Mode->MCastFilter fields. Note: Some network drivers and/or devices will automatically promote receive filter settings if the requested setting can not be honored. For example, if a request for four multicast addresses is made and the underlying hardware only supports two multicast addresses the driver might set the promiscuous or promiscuous multicast receive filters instead. The receiving software is responsible for discarding any extra packets that get through the hardware receive filters. Note: Note: To disable all receive filter hardware, the network driver must be Shutdown() and Stopped(). Calling ReceiveFilters() with Disable set to Snp->Mode->ReceiveFilterSettings will make it so no more packets are returned by the Receive() function, but the receive hardware may still be moving packets into system memory before inspecting and discarding them. Unexpected system errors, reboots and hangs can occur if an OS is loaded and the network devices are not Shutdown() and Stopped(). If ResetMCastFilter is TRUE, then the multicast receive filter list on the network interface will be reset to the default multicast receive filter list. If ResetMCastFilter is FALSE, and this network interface allows the multicast receive filter list to be modified, then the MCastFilterCnt and MCastFilter are used to update the current multicast receive filter list. The modified receive filter list settings can be found in the MCastFilter field of EFI_SIMPLE_NETWORK_MODE. If the network interface does not allow the multicast receive filter list to be modified, then EFI_INVALID_PARAMETER will be returned. If the driver has not been initialized, EFI_DEVICE_ERROR will be returned. If the receive filter mask and multicast receive filter list have been successfully updated on the network interface, EFI_SUCCESS will be returned.

Parameters
ThisA pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.
EnableA bit mask of receive filters to enable on the network interface.
DisableA bit mask of receive filters to disable on the network interface. For backward compatibility with EFI 1.1 platforms, the EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit must be set when the ResetMCastFilter parameter is TRUE.
ResetMCastFilterSet to TRUE to reset the contents of the multicast receive filters on the network interface to their default values.
MCastFilterCntNumber of multicast HW MAC addresses in the new MCastFilter list. This value must be less than or equal to the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This field is optional if ResetMCastFilter is TRUE.
MCastFilterA pointer to a list of new multicast receive filter HW MAC addresses. This list will replace any existing multicast HW MAC address list. This field is optional if ResetMCastFilter is TRUE.
Return values
EFI_SUCCESSThe multicast receive filter list was updated.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: This is NULL There are bits set in Enable that are not set in Snp->Mode->ReceiveFilterMask There are bits set in Disable that are not set in Snp->Mode->ReceiveFilterMask Multicast is being enabled (the EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit is set in Enable, it is not set in Disable, and ResetMCastFilter is FALSE) and MCastFilterCount is zero Multicast is being enabled and MCastFilterCount is greater than Snp->Mode->MaxMCastFilterCount Multicast is being enabled and MCastFilter is NULL Multicast is being enabled and one or more of the addresses in the MCastFilter list are not valid multicast MAC addresses
EFI_DEVICE_ERROROne or more of the following conditions is TRUE: The network interface has been started but has not been initialized An unexpected error was returned by the underlying network driver or device
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 384 of file Receive_filters.c.