]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Variable driver: add checking to make sure flash is properly initialized
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 29 Mar 2007 07:48:48 +0000 (07:48 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 29 Mar 2007 07:48:48 +0000 (07:48 +0000)
PxeBc driver: fix the issue that the giaddr is wrongly interpreted to "gateway address"

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2515 6f19259b-4bc3-4df7-8a09-765794883524

EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
EdkModulePkg/Universal/Variable/RuntimeDxe/Variable.c

index 101c030bc84ba468afd4d0cd7d5cf91942d75589..2e22fc5a350c7bf57e3b86e6cf1fc6acf786698e 100644 (file)
@@ -621,8 +621,6 @@ AddRouters (
   DHCP_RECEIVE_BUFFER *RxBufPtr\r
   )\r
 {\r
-  Ip4AddRouter (Private, &RxBufPtr->u.Dhcpv4.giaddr);\r
-\r
   Ip4AddRouterList (\r
     Private,\r
     (DHCPV4_OP_IP_LIST *) RxBufPtr->OpAdds.PktOptAdds[OP_ROUTER_LIST_IX - 1]\r
index e224558651e24fa5c100a9ea1b0435b630a83d73..589217a992c3a88e28ce9b362159b994e9485f9e 100644 (file)
@@ -1403,6 +1403,15 @@ Returns:
                 sizeof (UINT32),\r
                 (UINT8 *) &VariableStoreEntry.Length\r
                 );\r
+      // \r
+      // As Variables are stored in NV storage, which are slow devices,such as flash.\r
+      // Variable operation may skip checking variable program result to improve performance,\r
+      // We can assume Variable program is OK through some check point.\r
+      // Variable Store Size Setting should be the first Variable write operation,\r
+      // We can assume all Read/Write is OK if we can set Variable store size successfully.\r
+      // If write fail, we will assert here\r
+      //\r
+      ASSERT(VariableStoreHeader->Size == VariableStoreEntry.Length);\r
 \r
       if (EFI_ERROR (Status)) {\r
         return Status;\r