EfiSimpleNetworkInitialized state.\r
\r
@retval EFI_OUT_OF_RESOURCES Failed to allocate the stack to track the heads\r
- of free descriptor chains.\r
+ of free descriptor chains or failed to init\r
+ TxBufCollection.\r
@return Status codes from VIRTIO_DEVICE_PROTOCOL.\r
AllocateSharedPages() or\r
VirtioMapAllBytesInSharedBuffer()\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
+ Dev->TxBufCollection = OrderedCollectionInit (\r
+ VirtioNetTxBufMapInfoCompare,\r
+ VirtioNetTxBufDeviceAddressCompare\r
+ );\r
+ if (Dev->TxBufCollection == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto FreeTxFreeStack;\r
+ }\r
+\r
//\r
// Allocate TxSharedReq header and map with BusMasterCommonBuffer so that it\r
// can be accessed equally by both processor and device.\r
&TxSharedReqBuffer\r
);\r
if (EFI_ERROR (Status)) {\r
- goto FreeTxFreeStack;\r
+ goto UninitTxBufCollection;\r
}\r
\r
ZeroMem (TxSharedReqBuffer, sizeof *Dev->TxSharedReq);\r
EFI_SIZE_TO_PAGES (sizeof *(Dev->TxSharedReq)),\r
TxSharedReqBuffer\r
);\r
+\r
+UninitTxBufCollection:\r
+ OrderedCollectionUninit (Dev->TxBufCollection);\r
+\r
FreeTxFreeStack:\r
FreePool (Dev->TxFreeStack);\r
\r
ASSERT (Dev->Snm.MediaPresentSupported ==\r
!!(Features & VIRTIO_NET_F_STATUS));\r
\r
- Features &= VIRTIO_NET_F_MAC | VIRTIO_NET_F_STATUS | VIRTIO_F_VERSION_1;\r
+ Features &= VIRTIO_NET_F_MAC | VIRTIO_NET_F_STATUS | VIRTIO_F_VERSION_1 |\r
+ VIRTIO_F_IOMMU_PLATFORM;\r
\r
//\r
// In virtio-1.0, feature negotiation is expected to complete before queue\r
// step 5 -- keep only the features we want\r
//\r
if (Dev->VirtIo->Revision < VIRTIO_SPEC_REVISION (1, 0, 0)) {\r
- Features &= ~(UINT64)VIRTIO_F_VERSION_1;\r
+ Features &= ~(UINT64)(VIRTIO_F_VERSION_1 | VIRTIO_F_IOMMU_PLATFORM);\r
Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features);\r
if (EFI_ERROR (Status)) {\r
goto ReleaseTxRing;\r