Implementation of the SNP.Receive() function and its private helpers if any.\r
\r
Copyright (C) 2013, Red Hat, Inc.\r
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
//\r
MemoryFence ();\r
RxCurUsed = *Dev->RxRing.Used.Idx;\r
+ MemoryFence ();\r
\r
if (Dev->RxLastUsed == RxCurUsed) {\r
Status = EFI_NOT_READY;\r
*HeaderSize = Dev->Snm.MediaHeaderSize;\r
}\r
\r
- RxPtr = (UINT8 *)Dev->RxRing.Desc[DescIdx + 1].Addr;\r
+ RxPtr = (UINT8 *)(UINTN) Dev->RxRing.Desc[DescIdx + 1].Addr;\r
CopyMem (Buffer, RxPtr, RxLen);\r
\r
if (DestAddr != NULL) {\r
- CopyMem (DestAddr, RxPtr, SIZE_OF_VNET (VhdrMac));\r
+ CopyMem (DestAddr, RxPtr, SIZE_OF_VNET (Mac));\r
}\r
- RxPtr += SIZE_OF_VNET (VhdrMac);\r
+ RxPtr += SIZE_OF_VNET (Mac);\r
\r
if (SrcAddr != NULL) {\r
- CopyMem (SrcAddr, RxPtr, SIZE_OF_VNET (VhdrMac));\r
+ CopyMem (SrcAddr, RxPtr, SIZE_OF_VNET (Mac));\r
}\r
- RxPtr += SIZE_OF_VNET (VhdrMac);\r
+ RxPtr += SIZE_OF_VNET (Mac);\r
\r
if (Protocol != NULL) {\r
*Protocol = (UINT16) ((RxPtr[0] << 8) | RxPtr[1]);\r
*Dev->RxRing.Avail.Idx = AvailIdx;\r
\r
MemoryFence ();\r
- NotifyStatus = VIRTIO_CFG_WRITE (Dev, Generic.VhdrQueueNotify,\r
- VIRTIO_NET_Q_RX);\r
-\r
+ NotifyStatus = Dev->VirtIo->SetQueueNotify (Dev->VirtIo, VIRTIO_NET_Q_RX);\r
if (!EFI_ERROR (Status)) { // earlier error takes precedence\r
Status = NotifyStatus;\r
}\r