]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/receive.c
Remove gEfiNetworkInterfaceIdentifierProtocolGuid reference from code base. Only...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / receive.c
index 58bfa34f90fbcdeeff1b169611899cdb8399ee0d..b6f0c55ddeb83dafdd13249d63327e74e5caa100 100644 (file)
@@ -54,47 +54,13 @@ pxe_receive (
   PXE_CPB_RECEIVE *cpb;\r
   PXE_DB_RECEIVE  *db;\r
   UINTN           buf_size;\r
-  UINT64          TempData;\r
 \r
   cpb       = snp->cpb;\r
   db        = snp->db;\r
   buf_size  = *BuffSizePtr;\r
-  //\r
-  // IMPORTANT NOTE:\r
-  // In case of the older 3.0 UNDI, if the input buffer address is beyond 4GB,\r
-  // DO NOT call the map function on the given buffer, instead use\r
-  // a global buffer. The reason is that UNDI3.0 has some unnecessary check of\r
-  // making sure that all the addresses (whether or not they will be given\r
-  // to the NIC ) supplied to it are below 4GB. It may or may not use\r
-  // the mapped address after all (like in case of CPB and DB)!\r
-  // Instead of using the global buffer whose address is allocated within the\r
-  // 2GB limit if I start mapping the given buffer we lose the data, here is\r
-  // why!!!\r
-  // if our address is > 4GB, the map call creates another buffer below 2GB and\r
-  // copies data to/from the original buffer to the mapped buffer either at\r
-  // map time or unmap time depending on the map direction.\r
-  // UNDI will not complain since we already mapped the buffer to be\r
-  // within the 2GB limit but will not use (I know undi) the mapped address\r
-  // since it does not give the user buffers to the NIC's receive unit,\r
-  // It just copies the received packet into the user buffer using the virtual\r
-  // (CPU) address rather than the mapped (device or physical) address.\r
-  // When the UNDI call returns, if we then unmap the buffer, we will lose\r
-  // the contents because unmap copies the contents of the mapped buffer into\r
-  // the original buffer (since the direction is FROM_DEVICE) !!!\r
-  //\r
-  // this is not a problem in Undi 3.1 because this undi uses it's map callback\r
-  // routine to map a cpu address to device address and it does it only if\r
-  // it is giving the address to the device and unmaps it before using the cpu\r
-  // address!\r
-  //\r
-  TempData = (UINT64) (UINTN) BufferPtr;\r
-  if (snp->IsOldUndi && (TempData >= FOUR_GIGABYTES)) {\r
-    cpb->BufferAddr = (UINT64)(UINTN) snp->receive_buf;\r
-    cpb->BufferLen  = (UINT32) (snp->init_info.MediaHeaderLen + snp->init_info.FrameDataLen);\r
-  } else {\r
-    cpb->BufferAddr = (UINT64)(UINTN) BufferPtr;\r
-    cpb->BufferLen  = (UINT32) *BuffSizePtr;\r
-  }\r
+\r
+  cpb->BufferAddr = (UINT64)(UINTN) BufferPtr;\r
+  cpb->BufferLen  = (UINT32) *BuffSizePtr;\r
 \r
   cpb->reserved       = 0;\r
 \r
@@ -162,11 +128,6 @@ pxe_receive (
     *ProtocolPtr = (UINT16) PXE_SWAP_UINT16 (db->Protocol); /*  we need to do the byte swapping */\r
   }\r
 \r
-  TempData = (UINT64) (UINTN) BufferPtr;\r
-  if (snp->IsOldUndi && (TempData >= FOUR_GIGABYTES)) {\r
-    CopyMem (BufferPtr, snp->receive_buf, snp->init_info.MediaHeaderLen + snp->init_info.FrameDataLen);\r
-  }\r
-\r
   return (*BuffSizePtr <= buf_size) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;\r
 }\r
 \r