41 Snp->Cdb.OpFlags = (UINT16)(IPv6 ? PXE_OPFLAGS_MCAST_IPV6_TO_MAC : PXE_OPFLAGS_MCAST_IPV4_TO_MAC);
45 Snp->Cdb.CPBaddr = (UINT64)(
UINTN)Cpb;
46 Snp->Cdb.DBaddr = (UINT64)(
UINTN)Db;
48 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
49 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
50 Snp->Cdb.IFnum = Snp->IfNum;
51 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
58 DEBUG ((DEBUG_NET,
"\nSnp->undi.mcast_ip_to_mac() "));
60 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
62 switch (Snp->Cdb.StatCode) {
66 case PXE_STATCODE_INVALID_CPB:
67 return EFI_INVALID_PARAMETER;
69 case PXE_STATCODE_UNSUPPORTED:
72 "\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n",
76 return EFI_UNSUPPORTED;
85 "\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n",
90 return EFI_DEVICE_ERROR;
93 CopyMem (MAC, &Db->
MAC, sizeof (PXE_MAC_ADDR));
142 return EFI_INVALID_PARAMETER;
145 if ((IP ==
NULL) || (MAC ==
NULL)) {
146 return EFI_INVALID_PARAMETER;
149 Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
151 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
153 switch (Snp->Mode.
State) {
154 case EfiSimpleNetworkInitialized:
157 case EfiSimpleNetworkStopped:
158 Status = EFI_NOT_STARTED;
162 Status = EFI_DEVICE_ERROR;
169 gBS->RestoreTPL (OldTpl);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS PxeIp2Mac(IN SNP_DRIVER *Snp, IN BOOLEAN IPv6, IN EFI_IP_ADDRESS *IP, IN OUT EFI_MAC_ADDRESS *MAC)
EFI_STATUS EFIAPI SnpUndi32McastIpToMac(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN IPv6, IN EFI_IP_ADDRESS *IP, OUT EFI_MAC_ADDRESS *MAC)
#define DEBUG(Expression)
#define PXE_OPCODE_MCAST_IP_TO_MAC
#define PXE_STATCODE_SUCCESS