31 UINTN MCastAddressCount,
36 Snp->Cdb.OpFlags = PXE_OPFLAGS_RECEIVE_FILTER_ENABLE;
41 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
42 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
43 Snp->Cdb.IFnum = Snp->IfNum;
44 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
46 if ((EnableFlags & EFI_SIMPLE_NETWORK_RECEIVE_UNICAST) != 0) {
50 if ((EnableFlags & EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST) != 0) {
54 if ((EnableFlags & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS) != 0) {
58 if ((EnableFlags & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST) != 0) {
62 if ((EnableFlags & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) {
66 if (MCastAddressCount != 0) {
67 Snp->Cdb.CPBsize = (UINT16)(MCastAddressCount *
sizeof (
EFI_MAC_ADDRESS));
68 Snp->Cdb.CPBaddr = (UINT64)(
UINTN)Snp->Cpb;
69 CopyMem (Snp->Cpb, MCastAddressList, Snp->Cdb.CPBsize);
75 DEBUG ((DEBUG_NET,
"\nsnp->undi.receive_filters() "));
77 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
85 "\nsnp->undi.receive_filters() %xh:%xh\n",
90 switch (Snp->Cdb.StatCode) {
91 case PXE_STATCODE_INVALID_CDB:
92 case PXE_STATCODE_INVALID_CPB:
93 case PXE_STATCODE_INVALID_PARAMETER:
94 return EFI_INVALID_PARAMETER;
96 case PXE_STATCODE_UNSUPPORTED:
97 return EFI_UNSUPPORTED;
100 return EFI_DEVICE_ERROR;
122 BOOLEAN ResetMCastList
130 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
131 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
132 Snp->Cdb.IFnum = Snp->IfNum;
133 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
135 Snp->Cdb.OpFlags = (UINT16)((DisableFlags != 0) ? PXE_OPFLAGS_RECEIVE_FILTER_DISABLE : PXE_OPFLAGS_NOT_USED);
137 if (ResetMCastList) {
141 if ((DisableFlags & EFI_SIMPLE_NETWORK_RECEIVE_UNICAST) != 0) {
145 if ((DisableFlags & EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST) != 0) {
149 if ((DisableFlags & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS) != 0) {
153 if ((DisableFlags & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST) != 0) {
157 if ((DisableFlags & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) {
164 DEBUG ((DEBUG_NET,
"\nsnp->undi.receive_filters() "));
166 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
174 "\nsnp->undi.receive_filters() %xh:%xh\n",
179 return EFI_DEVICE_ERROR;
200 Snp->Cdb.OpFlags = PXE_OPFLAGS_RECEIVE_FILTER_READ;
204 if (Snp->Cdb.DBsize == 0) {
207 Snp->Cdb.DBaddr = (UINT64)(
UINTN)Snp->Db;
208 ZeroMem (Snp->Db, Snp->Cdb.DBsize);
211 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
212 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
213 Snp->Cdb.IFnum = Snp->IfNum;
214 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
216 DEBUG ((DEBUG_NET,
"\nsnp->undi.receive_filters() "));
218 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
226 "\nsnp->undi.receive_filters() %xh:%xh\n",
231 return EFI_DEVICE_ERROR;
267 SetMem (&ZeroMacAddr,
sizeof ZeroMacAddr, 0);
388 IN BOOLEAN ResetMCastFilter,
389 IN UINTN MCastFilterCnt OPTIONAL,
398 return EFI_INVALID_PARAMETER;
401 Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
403 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
405 switch (Snp->Mode.
State) {
406 case EfiSimpleNetworkInitialized:
409 case EfiSimpleNetworkStopped:
410 Status = EFI_NOT_STARTED;
414 Status = EFI_DEVICE_ERROR;
425 Status = EFI_INVALID_PARAMETER;
429 if (ResetMCastFilter) {
434 if (MCastFilterCnt != 0) {
436 (MCastFilter ==
NULL))
438 Status = EFI_INVALID_PARAMETER;
444 if ((Enable == 0) && (Disable == 0) && !ResetMCastFilter && (MCastFilterCnt == 0)) {
449 if (((Enable & EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST) != 0) && (MCastFilterCnt == 0)) {
450 Status = EFI_INVALID_PARAMETER;
454 if ((Enable != 0) || (MCastFilterCnt != 0)) {
462 if (EFI_ERROR (Status)) {
467 if ((Disable != 0) || ResetMCastFilter) {
470 if (EFI_ERROR (Status)) {
478 gBS->RestoreTPL (OldTpl);
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define DEBUG(Expression)
EFI_STATUS PxeRecvFilterDisable(SNP_DRIVER *Snp, UINT32 DisableFlags, BOOLEAN ResetMCastList)
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)
EFI_STATUS PxeRecvFilterRead(SNP_DRIVER *Snp)
EFI_STATUS PxeRecvFilterEnable(SNP_DRIVER *Snp, UINT32 EnableFlags, UINTN MCastAddressCount, EFI_MAC_ADDRESS *MCastAddressList)
#define PXE_CPBSIZE_NOT_USED
zero
#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST
#define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST
#define PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST
#define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST
#define PXE_STATFLAGS_RECEIVE_FILTER_UNICAST
#define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST
#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS
#define PXE_DBSIZE_NOT_USED
zero
#define PXE_CPBADDR_NOT_USED
zero
#define PXE_DBADDR_NOT_USED
zero
#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST
#define PXE_OPCODE_RECEIVE_FILTERS
#define PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST
#define PXE_STATCODE_SUCCESS
#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST
EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT]
UINT32 MaxMCastFilterCount
UINT32 ReceiveFilterSetting