+ 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
+ //\r
+ Status = Dev->VirtIo->AllocateSharedPages (\r
+ Dev->VirtIo,\r
+ EFI_SIZE_TO_PAGES (sizeof *Dev->TxSharedReq),\r
+ &TxSharedReqBuffer\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto UninitTxBufCollection;\r
+ }\r
+\r
+ ZeroMem (TxSharedReqBuffer, sizeof *Dev->TxSharedReq);\r
+\r
+ Status = VirtioMapAllBytesInSharedBuffer (\r
+ Dev->VirtIo,\r
+ VirtioOperationBusMasterCommonBuffer,\r
+ TxSharedReqBuffer,\r
+ sizeof *(Dev->TxSharedReq),\r
+ &DeviceAddress,\r
+ &Dev->TxSharedReqMap\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto FreeTxSharedReqBuffer;\r
+ }\r
+\r
+ Dev->TxSharedReq = TxSharedReqBuffer;\r
+\r
+\r