]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/Receive.c
1). Fix the debug level for DEBUG macro
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / Receive.c
index bfabe11aa5e61e63348a90ca09f33e4ae03a8c4c..23924982838651b325d89cddb0f6fa58afeb8709 100644 (file)
@@ -16,21 +16,29 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Snp.h"\r
 \r
 /**\r
-  this routine calls undi to receive a packet and fills in the data in the\r
-  input pointers!\r
-\r
-  @param  Snp                 pointer to snp driver structure\r
-  @param  Buffer           pointer to the memory for the received data\r
-  @param  BufferSize         is a pointer to the length of the buffer on entry and\r
-                              contains the length of the received data on return\r
-  @param  HeaderSize       pointer to the header portion of the data received.\r
-  @param  SrcAddr       optional parameter, is a pointer to contain the\r
-                              source ethernet address on return\r
-  @param  DestAddr  optional parameter, is a pointer to contain the\r
-                              destination ethernet address on return\r
-  @param  Protocol         optional parameter, is a pointer to contain the\r
-                              protocol type from the ethernet header on return\r
+  Call UNDI to receive a packet and fills in the data in the input pointers.\r
 \r
+  @param  Snp          Pointer to snp driver structure\r
+  @param  Buffer       Pointer to the memory for the received data\r
+  @param  BufferSize   Pointer to the length of the buffer on entry and contains\r
+                       the length of the received data on return\r
+  @param  HeaderSize   Pointer to the header portion of the data received.\r
+  @param  SrcAddr      Pointer to contain the source ethernet address on return \r
+  @param  DestAddr     Pointer to contain the destination ethernet address on \r
+                       return\r
+  @param  Protocol     Pointer to contain the protocol type from the ethernet \r
+                       header on return\r
+\r
+\r
+  @retval EFI_SUCCESS           The received data was stored in Buffer, and \r
+                                BufferSize has been updated to the number of \r
+                                bytes received.\r
+  @retval EFI_DEVICE_ERROR      Fail to execute UNDI command. \r
+  @retval EFI_NOT_READY         No packets have been received on the network \r
+                                interface.\r
+  @retval EFI_BUFFER_TOO_SMALL  BufferSize is too small for the received \r
+                                packets. BufferSize has been updated to the\r
+                                required size.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -74,7 +82,7 @@ PxeReceive (
   //\r
   // Issue UNDI command and check result.\r
   //\r
-  DEBUG ((EFI_D_NET, "\nsnp->undi.receive ()  "));\r
+  DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.receive ()  "));\r
 \r
   (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);\r
 \r
@@ -84,7 +92,7 @@ PxeReceive (
 \r
   case PXE_STATCODE_NO_DATA:\r
     DEBUG (\r
-      (EFI_D_NET,\r
+      (EFI_D_ERROR | EFI_D_NET,\r
       "\nsnp->undi.receive ()  %xh:%xh\n",\r
       Snp->Cdb.StatFlags,\r
       Snp->Cdb.StatCode)\r
@@ -94,7 +102,7 @@ PxeReceive (
 \r
   default:\r
     DEBUG (\r
-      (EFI_D_ERROR,\r
+      (EFI_D_ERROR | EFI_D_NET,\r
       "\nsnp->undi.receive()  %xh:%xh\n",\r
       Snp->Cdb.StatFlags,\r
       Snp->Cdb.StatCode)\r
@@ -118,7 +126,10 @@ PxeReceive (
   }\r
 \r
   if (Protocol != NULL) {\r
-    *Protocol = (UINT16) PXE_SWAP_UINT16 (Db->Protocol); /*  we need to do the byte swapping */\r
+    //\r
+    // We need to do the byte swapping\r
+    //\r
+    *Protocol = (UINT16) PXE_SWAP_UINT16 (Db->Protocol);\r
   }\r
 \r
   return (*BufferSize <= BuffSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;\r