]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/Nvdata.c
enhanced Dhcp4Dxe module to clean active configure data when Dhcp4->Stop() and Dhcp4...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / Nvdata.c
index d7c55a6f10d0f4c8a7fcc8b248932fc3660bc65d..8cd69bc37cd4bfe8eac321e92b17c8c8d43b23ef 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
-               Implementation of reading and writing operations on the NVRAM device\r
-               attached to a network interface.\r
+       Implementation of reading and writing operations on the NVRAM device\r
+       attached to a network interface.\r
  \r
-Copyright (c) 2004 - 2007, Intel Corporation. <BR> \r
+Copyright (c) 2004 - 2009, Intel Corporation. <BR> \r
 All rights reserved. This program and the accompanying materials are licensed \r
 and made available under the terms and conditions of the BSD License which \r
 accompanies this distribution. The full text of the license may be found at \r
@@ -59,7 +59,7 @@ PxeNvDataRead (
   //\r
   // Issue UNDI command and check result.\r
   //\r
-  DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.nvdata ()  "));\r
+  DEBUG ((EFI_D_NET, "\nsnp->undi.nvdata ()  "));\r
 \r
   (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);\r
 \r
@@ -69,7 +69,7 @@ PxeNvDataRead (
 \r
   case PXE_STATCODE_UNSUPPORTED:\r
     DEBUG (\r
-      (EFI_D_ERROR | EFI_D_NET,\r
+      (EFI_D_NET,\r
       "\nsnp->undi.nvdata()  %xh:%xh\n",\r
       Snp->Cdb.StatFlags,\r
       Snp->Cdb.StatCode)\r
@@ -79,7 +79,7 @@ PxeNvDataRead (
 \r
   default:\r
     DEBUG (\r
-      (EFI_D_ERROR | EFI_D_NET,\r
+      (EFI_D_NET,\r
       "\nsnp->undi.nvdata()  %xh:%xh\n",\r
       Snp->Cdb.StatFlags,\r
       Snp->Cdb.StatCode)\r
@@ -88,7 +88,9 @@ PxeNvDataRead (
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
-  CopyMem (Buffer, Db->Data.Byte + Offset, BufferSize);\r
+  ASSERT (Offset < sizeof (Db->Data));\r
+\r
+  CopyMem (Buffer, &Db->Data.Byte[Offset], BufferSize);\r
 \r
   return EFI_SUCCESS;\r
 }\r