]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioNetDxe/SnpReceive.c
BaseTools: Add YAML files with path env and tool extdeps
[mirror_edk2.git] / OvmfPkg / VirtioNetDxe / SnpReceive.c
index 99abd7ebe454dde610296f665b12cf3c7b1cd6a7..cdee9a2aee477f750b8015e245ca54420e59807f 100644 (file)
@@ -5,13 +5,7 @@
   Copyright (C) 2013, Red Hat, Inc.\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
-  distribution. The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
-  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -82,6 +76,7 @@ VirtioNetReceive (
   UINT8      *RxPtr;\r
   UINT16     AvailIdx;\r
   EFI_STATUS NotifyStatus;\r
+  UINTN      RxBufOffset;\r
 \r
   if (This == NULL || BufferSize == NULL || Buffer == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -143,7 +138,9 @@ VirtioNetReceive (
     *HeaderSize = Dev->Snm.MediaHeaderSize;\r
   }\r
 \r
-  RxPtr = (UINT8 *)(UINTN) Dev->RxRing.Desc[DescIdx + 1].Addr;\r
+  RxBufOffset = (UINTN)(Dev->RxRing.Desc[DescIdx + 1].Addr -\r
+                        Dev->RxBufDeviceBase);\r
+  RxPtr = Dev->RxBuf + RxBufOffset;\r
   CopyMem (Buffer, RxPtr, RxLen);\r
 \r
   if (DestAddr != NULL) {\r