63 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
64 ASSERT ((Count > 0) && (MnpDeviceData->BufferLength > 0));
67 for (Index = 0; Index < Count; Index++) {
68 Nbuf =
NetbufAlloc (MnpDeviceData->BufferLength + MnpDeviceData->PaddingSize);
70 DEBUG ((DEBUG_ERROR,
"MnpAddFreeNbuf: NetBufAlloc failed.\n"));
72 Status = EFI_OUT_OF_RESOURCES;
76 if (MnpDeviceData->PaddingSize > 0) {
81 NetbufTrim (Nbuf, MnpDeviceData->PaddingSize, NET_BUF_HEAD);
87 MnpDeviceData->NbufCnt += Index;
112 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
114 FreeNbufQue = &MnpDeviceData->FreeNbufQue;
115 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
120 if (FreeNbufQue->BufNum == 0) {
121 if ((MnpDeviceData->NbufCnt + MNP_NET_BUFFER_INCREASEMENT) > MNP_MAX_NET_BUFFER_NUM) {
124 "MnpAllocNbuf: The maximum NET_BUF size is reached for MNP driver instance %p.\n",
132 Status =
MnpAddFreeNbuf (MnpDeviceData, MNP_NET_BUFFER_INCREASEMENT);
133 if (EFI_ERROR (Status)) {
136 "MnpAllocNbuf: Failed to add NET_BUFs into the FreeNbufQue, %r.\n",
157 gBS->RestoreTPL (OldTpl);
177 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
178 ASSERT (Nbuf->RefCnt > 1);
180 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
184 if (Nbuf->RefCnt == 1) {
188 NetbufTrim (Nbuf, Nbuf->TotalSize, NET_BUF_TAIL);
194 NetbufTrim (Nbuf, NET_VLAN_TAG_LEN, NET_BUF_TAIL);
200 gBS->RestoreTPL (OldTpl);
224 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
225 ASSERT ((Count > 0) && (MnpDeviceData->BufferLength > 0));
228 for (Index = 0; Index < Count; Index++) {
230 if (TxBufWrap ==
NULL) {
231 DEBUG ((DEBUG_ERROR,
"MnpAddFreeTxBuf: TxBuf Alloc failed.\n"));
233 Status = EFI_OUT_OF_RESOURCES;
237 DEBUG ((DEBUG_VERBOSE,
"MnpAddFreeTxBuf: Add TxBufWrap %p, TxBuf %p\n", TxBufWrap, TxBufWrap->TxBuf));
238 TxBufWrap->Signature = MNP_TX_BUF_WRAP_SIGNATURE;
239 TxBufWrap->InUse =
FALSE;
240 InsertTailList (&MnpDeviceData->FreeTxBufList, &TxBufWrap->WrapEntry);
241 InsertTailList (&MnpDeviceData->AllTxBufList, &TxBufWrap->AllEntry);
244 MnpDeviceData->TxBufCount += Index;
270 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
272 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
279 if (EFI_ERROR (Status)) {
288 if ((MnpDeviceData->TxBufCount + MNP_TX_BUFFER_INCREASEMENT) > MNP_MAX_TX_BUFFER_NUM) {
291 "MnpAllocTxBuf: The maximum TxBuf size is reached for MNP driver instance %p.\n",
303 "MnpAllocNbuf: Failed to add TxBuf into the FreeTxBufList, %r.\n",
313 ASSERT (!
IsListEmpty (&MnpDeviceData->FreeTxBufList));
314 Entry = MnpDeviceData->FreeTxBufList.ForwardLink;
316 TxBufWrap = NET_LIST_USER_STRUCT_S (Entry,
MNP_TX_BUF_WRAP, WrapEntry, MNP_TX_BUF_WRAP_SIGNATURE);
317 TxBufWrap->InUse =
TRUE;
318 TxBuf = TxBufWrap->TxBuf;
321 gBS->RestoreTPL (OldTpl);
342 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
349 if (TxBufWrap->Signature != MNP_TX_BUF_WRAP_SIGNATURE) {
352 "MnpFreeTxBuf: Signature check failed in MnpFreeTxBuf.\n")
357 if (!TxBufWrap->InUse) {
360 "MnpFreeTxBuf: Duplicated recycle report from SNP.\n")
365 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
366 InsertTailList (&MnpDeviceData->FreeTxBufList, &TxBufWrap->WrapEntry);
367 TxBufWrap->InUse =
FALSE;
368 gBS->RestoreTPL (OldTpl);
389 Snp = MnpDeviceData->Snp;
390 ASSERT (Snp !=
NULL);
394 Status = Snp->GetStatus (Snp,
NULL, (VOID **)&TxBuf);
395 if (EFI_ERROR (Status)) {
402 }
while (TxBuf !=
NULL);
430 MnpDeviceData->Signature = MNP_DEVICE_DATA_SIGNATURE;
431 MnpDeviceData->ImageHandle = ImageHandle;
432 MnpDeviceData->ControllerHandle = ControllerHandle;
442 Status =
gBS->OpenProtocol (
444 &gEfiSimpleNetworkProtocolGuid,
448 EFI_OPEN_PROTOCOL_BY_DRIVER
450 if (EFI_ERROR (Status)) {
451 return EFI_UNSUPPORTED;
458 MnpDeviceData->Snp = Snp;
477 MnpDeviceData->PaddingSize = ((4 - SnpMode->
MediaHeaderSize) & 0x3) + NET_VLAN_TAG_LEN;
482 Status =
NetLibGetMacString (ControllerHandle, ImageHandle, &MnpDeviceData->MacString);
483 if (EFI_ERROR (Status)) {
492 if (EFI_ERROR (Status)) {
493 DEBUG ((DEBUG_ERROR,
"MnpInitializeDeviceData: MnpAddFreeNbuf failed, %r.\n", Status));
501 MnpDeviceData->RxNbufCache =
MnpAllocNbuf (MnpDeviceData);
503 MnpDeviceData->RxNbufCache,
504 MnpDeviceData->BufferLength,
513 MnpDeviceData->TxBufCount = 0;
518 Status =
gBS->CreateEvent (
519 EVT_NOTIFY_SIGNAL | EVT_TIMER,
523 &MnpDeviceData->PollTimer
525 if (EFI_ERROR (Status)) {
526 DEBUG ((DEBUG_ERROR,
"MnpInitializeDeviceData: CreateEvent for poll timer failed.\n"));
534 Status =
gBS->CreateEvent (
535 EVT_NOTIFY_SIGNAL | EVT_TIMER,
539 &MnpDeviceData->TimeoutCheckTimer
541 if (EFI_ERROR (Status)) {
542 DEBUG ((DEBUG_ERROR,
"MnpInitializeDeviceData: CreateEvent for packet timeout check failed.\n"));
550 Status =
gBS->CreateEvent (
551 EVT_NOTIFY_SIGNAL | EVT_TIMER,
555 &MnpDeviceData->MediaDetectTimer
557 if (EFI_ERROR (Status)) {
558 DEBUG ((DEBUG_ERROR,
"MnpInitializeDeviceData: CreateEvent for media detection failed.\n"));
564 if (EFI_ERROR (Status)) {
568 if (MnpDeviceData->MacString !=
NULL) {
569 FreePool (MnpDeviceData->MacString);
572 if (MnpDeviceData->TimeoutCheckTimer !=
NULL) {
573 gBS->CloseEvent (MnpDeviceData->TimeoutCheckTimer);
576 if (MnpDeviceData->MediaDetectTimer !=
NULL) {
577 gBS->CloseEvent (MnpDeviceData->MediaDetectTimer);
580 if (MnpDeviceData->PollTimer !=
NULL) {
581 gBS->CloseEvent (MnpDeviceData->PollTimer);
584 if (MnpDeviceData->RxNbufCache !=
NULL) {
585 MnpFreeNbuf (MnpDeviceData, MnpDeviceData->RxNbufCache);
588 if (MnpDeviceData->FreeNbufQue.BufNum != 0) {
597 &gEfiSimpleNetworkProtocolGuid,
623 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
628 if (MnpDeviceData->MacString !=
NULL) {
629 FreePool (MnpDeviceData->MacString);
635 ASSERT (
IsListEmpty (&MnpDeviceData->GroupAddressList));
640 gBS->CloseEvent (MnpDeviceData->TimeoutCheckTimer);
641 gBS->CloseEvent (MnpDeviceData->MediaDetectTimer);
642 gBS->CloseEvent (MnpDeviceData->PollTimer);
647 NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &MnpDeviceData->AllTxBufList) {
651 MnpDeviceData->TxBufCount--;
653 ASSERT (
IsListEmpty (&MnpDeviceData->AllTxBufList));
654 ASSERT (MnpDeviceData->TxBufCount == 0);
659 MnpFreeNbuf (MnpDeviceData, MnpDeviceData->RxNbufCache);
664 MnpDeviceData->NbufCnt -= MnpDeviceData->FreeNbufQue.BufNum;
671 MnpDeviceData->ControllerHandle,
672 &gEfiSimpleNetworkProtocolGuid,
674 MnpDeviceData->ControllerHandle
693 IN UINT8 Priority OPTIONAL
706 if (MnpServiceData ==
NULL) {
707 DEBUG ((DEBUG_ERROR,
"MnpCreateServiceData: Failed to allocate memory for the new Mnp Service Data.\n"));
715 InsertTailList (&MnpDeviceData->ServiceList, &MnpServiceData->Link);
717 MnpServiceData->Signature = MNP_SERVICE_DATA_SIGNATURE;
718 MnpServiceData->MnpDeviceData = MnpDeviceData;
730 SnpMode = MnpDeviceData->Snp->Mode;
736 MnpDeviceData->ImageHandle,
737 MnpDeviceData->ControllerHandle,
739 &MnpServiceData->DevicePath
741 if (MnpServiceHandle ==
NULL) {
742 DEBUG ((DEBUG_ERROR,
"MnpCreateServiceData: Failed to create child handle.\n"));
750 Status =
gBS->OpenProtocol (
751 MnpDeviceData->ControllerHandle,
752 &gEfiVlanConfigProtocolGuid,
753 (VOID **)&VlanConfig,
754 MnpDeviceData->ImageHandle,
756 EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
758 if (EFI_ERROR (Status)) {
765 MnpServiceData->Mtu = SnpMode->
MaxPacketSize - NET_VLAN_TAG_LEN;
770 MnpServiceHandle = MnpDeviceData->ControllerHandle;
774 MnpServiceData->ServiceHandle = MnpServiceHandle;
775 MnpServiceData->VlanId = VlanId;
776 MnpServiceData->Priority = Priority;
781 Status =
gBS->InstallMultipleProtocolInterfaces (
783 &gEfiManagedNetworkServiceBindingProtocolGuid,
784 &MnpServiceData->ServiceBinding,
789 if (EFI_ERROR (Status)) {
791 MnpServiceData =
NULL;
794 return MnpServiceData;
816 Status =
gBS->UninstallMultipleProtocolInterfaces (
817 MnpServiceData->ServiceHandle,
818 &gEfiManagedNetworkServiceBindingProtocolGuid,
819 &MnpServiceData->ServiceBinding,
822 if (EFI_ERROR (Status)) {
826 if (MnpServiceData->VlanId != 0) {
830 Status =
gBS->CloseProtocol (
831 MnpServiceData->MnpDeviceData->ControllerHandle,
832 &gEfiVlanConfigProtocolGuid,
833 MnpServiceData->MnpDeviceData->ImageHandle,
834 MnpServiceData->ServiceHandle
836 if (EFI_ERROR (Status)) {
843 Status =
gBS->UninstallMultipleProtocolInterfaces (
844 MnpServiceData->ServiceHandle,
845 &gEfiDevicePathProtocolGuid,
846 MnpServiceData->DevicePath,
849 if (EFI_ERROR (Status)) {
853 if (MnpServiceData->DevicePath !=
NULL) {
854 FreePool (MnpServiceData->DevicePath);
890 return ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
911 List = &MnpServiceData->ChildrenList;
916 &MnpServiceData->ServiceBinding,
919 if (EFI_ERROR (Status) || (ListLength != 0)) {
920 return EFI_DEVICE_ERROR;
944 NET_LIST_FOR_EACH (Entry, &MnpDeviceData->ServiceList) {
948 MnpServiceData = MNP_SERVICE_DATA_FROM_LINK (Entry);
949 if (MnpServiceData->VlanId == VlanId) {
950 return MnpServiceData;
971 NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
972 ASSERT (Instance !=
NULL);
977 Instance->Signature = MNP_INSTANCE_DATA_SIGNATURE;
982 CopyMem (&Instance->ManagedNetwork, &mMnpProtocolTemplate, sizeof (Instance->ManagedNetwork));
987 CopyMem (&Instance->ConfigData, &mMnpDefaultConfigData, sizeof (Instance->ConfigData));
1004 Instance->MnpServiceData = MnpServiceData;
1035 if ((Token == TokenInItem) || (Token->
Event == TokenInItem->
Event)) {
1040 return EFI_ACCESS_DENIED;
1071 if ((Arg !=
NULL) && (Item->Key != Arg)) {
1088 TokenToCancel->
Status = EFI_ABORTED;
1089 gBS->SignalEvent (TokenToCancel->
Event);
1117 ASSERT (Snp !=
NULL);
1122 Status = Snp->Start (Snp);
1124 if (!EFI_ERROR (Status)) {
1128 Status = Snp->Initialize (Snp, 0, 0);
1151 Snp = MnpDeviceData->Snp;
1152 ASSERT (Snp !=
NULL);
1158 if (EFI_ERROR (Status)) {
1165 Status = Snp->Shutdown (Snp);
1166 if (!EFI_ERROR (Status)) {
1170 Status = Snp->Stop (Snp);
1193 IN BOOLEAN IsConfigUpdate,
1194 IN BOOLEAN EnableSystemPoll
1201 NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
1204 MnpDeviceData = MnpServiceData->MnpDeviceData;
1206 if (!IsConfigUpdate) {
1210 MnpDeviceData->ConfiguredChildrenNumber++;
1212 if (MnpDeviceData->ConfiguredChildrenNumber == 1) {
1217 if (EFI_ERROR (Status)) {
1218 DEBUG ((DEBUG_ERROR,
"MnpStart: MnpStartSnp failed, %r.\n", Status));
1226 Status =
gBS->SetTimer (
1227 MnpDeviceData->TimeoutCheckTimer,
1229 MNP_TIMEOUT_CHECK_INTERVAL
1231 if (EFI_ERROR (Status)) {
1234 "MnpStart, gBS->SetTimer for TimeoutCheckTimer %r.\n",
1244 Status =
gBS->SetTimer (
1245 MnpDeviceData->MediaDetectTimer,
1247 MNP_MEDIA_DETECT_INTERVAL
1249 if (EFI_ERROR (Status)) {
1252 "MnpStart, gBS->SetTimer for MediaDetectTimer %r.\n",
1261 if (MnpDeviceData->EnableSystemPoll ^ EnableSystemPoll) {
1268 Status =
gBS->SetTimer (MnpDeviceData->PollTimer, TimerOpType, MNP_SYS_POLL_INTERVAL);
1269 if (EFI_ERROR (Status)) {
1270 DEBUG ((DEBUG_ERROR,
"MnpStart: gBS->SetTimer for PollTimer failed, %r.\n", Status));
1275 MnpDeviceData->EnableSystemPoll = EnableSystemPoll;
1304 NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
1305 MnpDeviceData = MnpServiceData->MnpDeviceData;
1306 ASSERT (MnpDeviceData->ConfiguredChildrenNumber > 0);
1316 MnpDeviceData->ConfiguredChildrenNumber--;
1318 if (MnpDeviceData->ConfiguredChildrenNumber > 0) {
1329 if (MnpDeviceData->EnableSystemPoll) {
1333 Status =
gBS->SetTimer (MnpDeviceData->PollTimer,
TimerCancel, 0);
1334 MnpDeviceData->EnableSystemPoll =
FALSE;
1340 Status =
gBS->SetTimer (MnpDeviceData->TimeoutCheckTimer,
TimerCancel, 0);
1345 Status =
gBS->SetTimer (MnpDeviceData->MediaDetectTimer,
TimerCancel, 0);
1368 NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
1370 OldTpl =
gBS->RaiseTPL (TPL_NOTIFY);
1372 while (!
IsListEmpty (&Instance->RcvdPacketQueue)) {
1376 RxDataWrap = NET_LIST_HEAD (&Instance->RcvdPacketQueue,
MNP_RXDATA_WRAP, WrapEntry);
1382 Instance->RcvdPacketQueueSize--;
1385 ASSERT (Instance->RcvdPacketQueueSize == 0);
1387 gBS->RestoreTPL (OldTpl);
1414 BOOLEAN IsConfigUpdate;
1416 NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
1418 if ((ConfigData !=
NULL) && ConfigData->EnableReceiveTimestamps) {
1422 return EFI_UNSUPPORTED;
1427 MnpServiceData = Instance->MnpServiceData;
1428 MnpDeviceData = MnpServiceData->MnpDeviceData;
1429 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
1431 IsConfigUpdate = (BOOLEAN)((Instance->Configured) && (ConfigData !=
NULL));
1433 OldConfigData = &Instance->ConfigData;
1434 NewConfigData = ConfigData;
1435 if (NewConfigData ==
NULL) {
1440 NewConfigData = &mMnpDefaultConfigData;
1446 Instance->ReceiveFilter = 0;
1452 MnpDeviceData->UnicastCount--;
1456 MnpDeviceData->MulticastCount--;
1460 MnpDeviceData->BroadcastCount--;
1464 MnpDeviceData->PromiscuousCount--;
1472 MnpDeviceData->UnicastCount++;
1473 Instance->ReceiveFilter |= MNP_RECEIVE_UNICAST;
1477 MnpDeviceData->MulticastCount++;
1481 MnpDeviceData->BroadcastCount++;
1482 Instance->ReceiveFilter |= MNP_RECEIVE_BROADCAST;
1486 MnpDeviceData->PromiscuousCount++;
1493 if (ConfigData ==
NULL) {
1494 Instance->ManagedNetwork.Cancel (&Instance->ManagedNetwork,
NULL);
1504 CopyMem (OldConfigData, NewConfigData,
sizeof (*OldConfigData));
1506 Instance->Configured = (BOOLEAN)(ConfigData !=
NULL);
1507 if (Instance->Configured) {
1520 Status =
MnpStop (MnpServiceData);
1545 UINT32 MCastFilterCnt;
1546 UINT32 EnableFilterBits;
1547 UINT32 DisableFilterBits;
1548 BOOLEAN ResetMCastFilters;
1553 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
1555 Snp = MnpDeviceData->Snp;
1560 EnableFilterBits = 0;
1563 if (MnpDeviceData->UnicastCount != 0) {
1567 EnableFilterBits |= EFI_SIMPLE_NETWORK_RECEIVE_UNICAST;
1570 if (MnpDeviceData->BroadcastCount != 0) {
1574 EnableFilterBits |= EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
1579 ResetMCastFilters =
TRUE;
1581 if ((MnpDeviceData->MulticastCount != 0) && (MnpDeviceData->GroupAddressCount != 0)) {
1587 ResetMCastFilters =
FALSE;
1595 EnableFilterBits |= EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST;
1600 MCastFilterCnt = MnpDeviceData->GroupAddressCount;
1602 if (MCastFilter ==
NULL) {
1603 DEBUG ((DEBUG_ERROR,
"MnpConfigReceiveFilters: Failed to allocate memory resource for MCastFilter.\n"));
1605 return EFI_OUT_OF_RESOURCES;
1612 NET_LIST_FOR_EACH (Entry, &MnpDeviceData->GroupAddressList) {
1614 CopyMem (MCastFilter + Index, &GroupAddress->Address, sizeof (*(MCastFilter + Index)));
1617 ASSERT (Index <= MCastFilterCnt);
1626 EnableFilterBits |= EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST;
1633 EnableFilterBits |= EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS;
1638 if (MnpDeviceData->PromiscuousCount != 0) {
1642 EnableFilterBits |= EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS;
1648 DisableFilterBits ^= EnableFilterBits;
1653 Status = Snp->ReceiveFilters (
1662 if (EFI_ERROR (Status)) {
1665 "MnpConfigReceiveFilters: Snp->ReceiveFilters failed, %r.\n",
1672 if (MCastFilter !=
NULL) {
1702 IN UINT32 HwAddressSize
1707 NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
1709 MnpDeviceData = Instance->MnpServiceData->MnpDeviceData;
1710 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
1712 if (GroupAddress ==
NULL) {
1713 ASSERT (MacAddress !=
NULL);
1719 if (GroupAddress ==
NULL) {
1720 DEBUG ((DEBUG_ERROR,
"MnpGroupOpFormCtrlBlk: Failed to allocate memory resource.\n"));
1722 return EFI_OUT_OF_RESOURCES;
1725 CopyMem (&GroupAddress->Address, MacAddress, sizeof (GroupAddress->Address));
1726 GroupAddress->RefCnt = 0;
1728 &MnpDeviceData->GroupAddressList,
1729 &GroupAddress->AddrEntry
1731 MnpDeviceData->GroupAddressCount++;
1737 GroupAddress->RefCnt++;
1742 CtrlBlk->GroupAddress = GroupAddress;
1743 InsertTailList (&Instance->GroupCtrlBlkList, &CtrlBlk->CtrlBlkEntry);
1767 NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
1769 MnpDeviceData = Instance->MnpServiceData->MnpDeviceData;
1770 NET_CHECK_SIGNATURE (MnpDeviceData, MNP_DEVICE_DATA_SIGNATURE);
1775 GroupAddress = CtrlBlk->GroupAddress;
1779 ASSERT (GroupAddress->RefCnt > 0);
1784 GroupAddress->RefCnt--;
1786 if (GroupAddress->RefCnt == 0) {
1790 MnpDeviceData->GroupAddressCount--;
1818 IN BOOLEAN JoinFlag,
1830 BOOLEAN AddressExist;
1833 NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
1835 MnpDeviceData = Instance->MnpServiceData->MnpDeviceData;
1836 SnpMode = MnpDeviceData->Snp->
Mode;
1842 GroupAddress =
NULL;
1843 AddressExist =
FALSE;
1849 if (NewCtrlBlk ==
NULL) {
1850 DEBUG ((DEBUG_ERROR,
"MnpGroupOp: Failed to allocate memory resource.\n"));
1852 return EFI_OUT_OF_RESOURCES;
1855 NET_LIST_FOR_EACH (Entry, &MnpDeviceData->GroupAddressList) {
1861 AddressExist =
TRUE;
1866 if (!AddressExist) {
1867 GroupAddress =
NULL;
1880 if (EFI_ERROR (Status)) {
1886 if (MacAddress !=
NULL) {
1887 ASSERT (CtrlBlk !=
NULL);
1899 NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Instance->GroupCtrlBlkList) {
1900 NewCtrlBlk = NET_LIST_USER_STRUCT (
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
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 AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define OFFSET_OF(TYPE, Field)
#define DEBUG_CODE_BEGIN()
#define DEBUG(Expression)
#define CR(Record, TYPE, Field, TestSignature)
EFI_STATUS MnpStopSnp(IN MNP_DEVICE_DATA *MnpDeviceData)
VOID MnpFreeTxBuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN OUT UINT8 *TxBuf)
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)
EFI_STATUS EFIAPI MnpCancelTokens(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, IN VOID *Arg)
BOOLEAN MnpGroupOpDelCtrlBlk(IN MNP_INSTANCE_DATA *Instance, IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk)
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)
MNP_SERVICE_DATA * MnpFindServiceData(IN MNP_DEVICE_DATA *MnpDeviceData, IN UINT16 VlanId)
EFI_STATUS MnpDestroyServiceChild(IN OUT MNP_SERVICE_DATA *MnpServiceData)
UINT8 * MnpAllocTxBuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData)
EFI_STATUS MnpStartSnp(IN EFI_SIMPLE_NETWORK_PROTOCOL *Snp)
EFI_STATUS MnpDestroyServiceData(IN OUT MNP_SERVICE_DATA *MnpServiceData)
EFI_STATUS EFIAPI MnpTokenExist(IN NET_MAP *Map, IN NET_MAP_ITEM *Item, IN VOID *Arg)
EFI_STATUS MnpConfigReceiveFilters(IN MNP_DEVICE_DATA *MnpDeviceData)
EFI_STATUS MnpAddFreeTxBuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN UINTN Count)
EFI_STATUS MnpStart(IN OUT MNP_SERVICE_DATA *MnpServiceData, IN BOOLEAN IsConfigUpdate, IN BOOLEAN EnableSystemPoll)
EFI_STATUS MnpAddFreeNbuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN UINTN Count)
VOID MnpDestroyDeviceData(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN EFI_HANDLE ImageHandle)
EFI_STATUS MnpInitializeDeviceData(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ControllerHandle)
EFI_STATUS EFIAPI MnpDestoryChildEntry(IN LIST_ENTRY *Entry, IN VOID *Context)
EFI_STATUS MnpConfigureInstance(IN OUT MNP_INSTANCE_DATA *Instance, IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL)
VOID MnpFreeNbuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData, IN OUT NET_BUF *Nbuf)
MNP_SERVICE_DATA * MnpCreateServiceData(IN MNP_DEVICE_DATA *MnpDeviceData, IN UINT16 VlanId, IN UINT8 Priority OPTIONAL)
EFI_STATUS MnpRecycleTxBuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData)
NET_BUF * MnpAllocNbuf(IN OUT MNP_DEVICE_DATA *MnpDeviceData)
VOID MnpInitializeInstanceData(IN MNP_SERVICE_DATA *MnpServiceData, IN OUT MNP_INSTANCE_DATA *Instance)
VOID MnpFlushRcvdDataQueue(IN OUT MNP_INSTANCE_DATA *Instance)
EFI_STATUS MnpStop(IN OUT MNP_SERVICE_DATA *MnpServiceData)
EFI_STATUS EFIAPI MnpServiceBindingDestroyChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN EFI_HANDLE ChildHandle)
EFI_STATUS EFIAPI MnpServiceBindingCreateChild(IN EFI_SERVICE_BINDING_PROTOCOL *This, IN OUT EFI_HANDLE *ChildHandle)
EFI_STATUS EFIAPI MnpMcastIpToMac(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN BOOLEAN Ipv6Flag, IN EFI_IP_ADDRESS *IpAddress, OUT EFI_MAC_ADDRESS *MacAddress)
VOID EFIAPI MnpCheckMediaStatus(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI MnpTransmit(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
EFI_STATUS EFIAPI MnpGetModeData(IN EFI_MANAGED_NETWORK_PROTOCOL *This, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
EFI_STATUS EFIAPI MnpConfigure(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL)
VOID EFIAPI MnpRecycleRxData(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI MnpSystemPoll(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI MnpReceive(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token)
EFI_STATUS EFIAPI MnpCancel(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL)
EFI_STATUS EFIAPI MnpPoll(IN EFI_MANAGED_NETWORK_PROTOCOL *This)
EFI_STATUS EFIAPI MnpGroups(IN EFI_MANAGED_NETWORK_PROTOCOL *This, IN BOOLEAN JoinFlag, IN EFI_MAC_ADDRESS *MacAddress OPTIONAL)
VOID EFIAPI MnpCheckPacketTimeout(IN EFI_EVENT Event, IN VOID *Context)
EFI_HANDLE MnpCreateVlanChild(IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ControllerHandle, IN UINT16 VlanId, OUT EFI_DEVICE_PATH_PROTOCOL **Devicepath OPTIONAL)
VOID EFIAPI NetbufQueInit(IN OUT NET_BUF_QUEUE *NbufQue)
UINT32 EFIAPI NetbufTrim(IN OUT NET_BUF *Nbuf, IN UINT32 Len, IN BOOLEAN FromHead)
EFI_STATUS EFIAPI NetLibGetMacString(IN EFI_HANDLE ServiceHandle, IN EFI_HANDLE ImageHandle OPTIONAL, OUT CHAR16 **MacString)
VOID EFIAPI NetbufQueFlush(IN OUT NET_BUF_QUEUE *NbufQue)
NET_BUF *EFIAPI NetbufAlloc(IN UINT32 Len)
VOID EFIAPI NetMapInit(IN OUT NET_MAP *Map)
UINT8 *EFIAPI NetbufAllocSpace(IN OUT NET_BUF *Nbuf, IN UINT32 Len, IN BOOLEAN FromHead)
VOID *EFIAPI NetMapRemoveItem(IN OUT NET_MAP *Map, IN OUT NET_MAP_ITEM *Item, OUT VOID **Value OPTIONAL)
EFI_STATUS EFIAPI NetDestroyLinkList(IN LIST_ENTRY *List, IN NET_DESTROY_LINK_LIST_CALLBACK CallBack, IN VOID *Context OPTIONAL, OUT UINTN *ListLength OPTIONAL)
VOID EFIAPI NetbufQueAppend(IN OUT NET_BUF_QUEUE *NbufQue, IN OUT NET_BUF *Nbuf)
NET_BUF *EFIAPI NetbufQueRemove(IN OUT NET_BUF_QUEUE *NbufQue)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI Exit(IN EFI_STATUS Status)
EFI_SIMPLE_NETWORK_MODE * Mode
BOOLEAN EnableBroadcastReceive
BOOLEAN EnableMulticastReceive
BOOLEAN FlushQueuesOnReset
BOOLEAN DisableBackgroundPolling
BOOLEAN EnableUnicastReceive
BOOLEAN EnablePromiscuousReceive
UINT32 MaxMCastFilterCount