]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/WaitForPacket.c
sync comments, fix function header, rename variable name to follow coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / WaitForPacket.c
index 57d82ea160203fc5f3b2da8a387f5812ac3fe0d7..8dd8fd997e8c6b3730132712b80eeecf15adb7fd 100644 (file)
@@ -1,28 +1,25 @@
 /** @file\r
 /** @file\r
-Copyright (c) 2004, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+    Event handler to check for available packet.\r
+\r
+Copyright (c) 2004 - 2008, 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
+http://opensource.org/licenses/bsd-license.php \r
 \r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 \r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module name:\r
-  WaitForPacket.c\r
-\r
-Abstract:\r
-  Event handler to check for available packet.\r
-\r
-\r
 **/\r
 \r
 #include "Snp.h"\r
 \r
 \r
 /**\r
 **/\r
 \r
 #include "Snp.h"\r
 \r
 \r
 /**\r
+  Nofication call back function for WaitForPacket event.\r
 \r
 \r
-\r
+  @param  Event       EFI Event.\r
+  @param  SnpPtr      Pointer to SNP_DRIVER structure.\r
 \r
 **/\r
 VOID\r
 \r
 **/\r
 VOID\r
@@ -43,7 +40,7 @@ SnpWaitForPacketNotify (
   //\r
   // Do nothing if the SNP interface is not initialized.\r
   //\r
   //\r
   // Do nothing if the SNP interface is not initialized.\r
   //\r
-  switch (((SNP_DRIVER *) SnpPtr)->mode.State) {\r
+  switch (((SNP_DRIVER *) SnpPtr)->Mode.State) {\r
   case EfiSimpleNetworkInitialized:\r
     break;\r
 \r
   case EfiSimpleNetworkInitialized:\r
     break;\r
 \r
@@ -55,28 +52,28 @@ SnpWaitForPacketNotify (
   //\r
   // Fill in CDB for UNDI GetStatus().\r
   //\r
   //\r
   // Fill in CDB for UNDI GetStatus().\r
   //\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.OpCode     = PXE_OPCODE_GET_STATUS;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.OpFlags    = 0;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.CPBsize    = PXE_CPBSIZE_NOT_USED;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.CPBaddr    = PXE_CPBADDR_NOT_USED;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.DBsize     = sizeof (UINT32) * 2;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.DBaddr     = (UINT64)(UINTN) (((SNP_DRIVER *) SnpPtr)->db);\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.StatCode   = PXE_STATCODE_INITIALIZE;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.StatFlags  = PXE_STATFLAGS_INITIALIZE;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.IFnum      = ((SNP_DRIVER *) SnpPtr)->if_num;\r
-  ((SNP_DRIVER *) SnpPtr)->cdb.Control    = PXE_CONTROL_LAST_CDB_IN_LIST;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.OpCode     = PXE_OPCODE_GET_STATUS;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.OpFlags    = 0;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.CPBsize    = PXE_CPBSIZE_NOT_USED;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.CPBaddr    = PXE_CPBADDR_NOT_USED;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.DBsize     = sizeof (UINT32) * 2;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.DBaddr     = (UINT64)(UINTN) (((SNP_DRIVER *) SnpPtr)->Db);\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.StatCode   = PXE_STATCODE_INITIALIZE;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.StatFlags  = PXE_STATFLAGS_INITIALIZE;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.IFnum      = ((SNP_DRIVER *) SnpPtr)->IfNum;\r
+  ((SNP_DRIVER *) SnpPtr)->Cdb.Control    = PXE_CONTROL_LAST_CDB_IN_LIST;\r
 \r
   //\r
   // Clear contents of DB buffer.\r
   //\r
 \r
   //\r
   // Clear contents of DB buffer.\r
   //\r
-  ZeroMem (((SNP_DRIVER *) SnpPtr)->db, sizeof (UINT32) * 2);\r
+  ZeroMem (((SNP_DRIVER *) SnpPtr)->Db, sizeof (UINT32) * 2);\r
 \r
   //\r
   // Issue UNDI command and check result.\r
   //\r
 \r
   //\r
   // Issue UNDI command and check result.\r
   //\r
-  (*((SNP_DRIVER *) SnpPtr)->issue_undi32_command) ((UINT64)(UINTN) &((SNP_DRIVER *) SnpPtr)->cdb);\r
+  (*((SNP_DRIVER *) SnpPtr)->IssueUndi32Command) ((UINT64)(UINTN) &((SNP_DRIVER *) SnpPtr)->Cdb);\r
 \r
 \r
-  if (((SNP_DRIVER *) SnpPtr)->cdb.StatCode != EFI_SUCCESS) {\r
+  if (((SNP_DRIVER *) SnpPtr)->Cdb.StatCode != EFI_SUCCESS) {\r
     return ;\r
   }\r
   //\r
     return ;\r
   }\r
   //\r
@@ -85,7 +82,7 @@ SnpWaitForPacketNotify (
   //\r
   CopyMem (\r
     &PxeDbGetStatus,\r
   //\r
   CopyMem (\r
     &PxeDbGetStatus,\r
-    ((SNP_DRIVER *) SnpPtr)->db,\r
+    ((SNP_DRIVER *) SnpPtr)->Db,\r
     sizeof (UINT32) * 2\r
     );\r
 \r
     sizeof (UINT32) * 2\r
     );\r
 \r