]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/VirtioNetDxe/SnpGetStatus.c
PcAtChipsetPkg/PcRtc: Fix bad EOL
[mirror_edk2.git] / OvmfPkg / VirtioNetDxe / SnpGetStatus.c
index eabcf93c4b504d7ad0901e0cb561905a37911558..694940ea1d976827bd890a734cb5e154b02a2470 100644 (file)
@@ -4,7 +4,7 @@
   any.\r
 \r
   Copyright (C) 2013, Red Hat, Inc.\r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2014, 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
@@ -90,11 +90,12 @@ VirtioNetGetStatus (
   if (Dev->Snm.MediaPresentSupported) {\r
     UINT16 LinkStatus;\r
 \r
-    Status = VIRTIO_CFG_READ (Dev, VhdrLinkStatus, &LinkStatus);\r
+    Status = VIRTIO_CFG_READ (Dev, LinkStatus, &LinkStatus);\r
     if (EFI_ERROR (Status)) {\r
       goto Exit;\r
     }\r
-    Dev->Snm.MediaPresent = !!(LinkStatus & VIRTIO_NET_S_LINK_UP);\r
+    Dev->Snm.MediaPresent =\r
+      (BOOLEAN) ((LinkStatus & VIRTIO_NET_S_LINK_UP) != 0);\r
   }\r
 \r
   //\r
@@ -103,6 +104,7 @@ VirtioNetGetStatus (
   MemoryFence ();\r
   RxCurUsed = *Dev->RxRing.Used.Idx;\r
   TxCurUsed = *Dev->TxRing.Used.Idx;\r
+  MemoryFence ();\r
 \r
   if (InterruptStatus != NULL) {\r
     //\r