]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Network/PxeBc/Dxe/bc.c
1. Remove #ifdef _MSC_EXTENSION_ from all source files
[mirror_edk2.git] / EdkModulePkg / Universal / Network / PxeBc / Dxe / bc.c
index 44f7cf22c68c2bc7b0d386a3e9d8511ee3eacc55..4444b20d0012456990347b0d879c39d154b33e8d 100644 (file)
@@ -1,12 +1,13 @@
 /*++\r
-Copyright (c) 2006, 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
-                                                                                          \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
+Copyright (c) 2006 - 2007, 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
+\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
         bc.c\r
@@ -162,7 +163,7 @@ SeedRandom (
   Arguments:\r
 \r
   Returns:\r
-    none                - \r
+    none                -\r
 \r
 --*/\r
 {\r
@@ -216,7 +217,7 @@ IpChecksum (
     Length             - Length to be checksummed\r
 \r
   Returns:\r
-    Checksum           - Returns the 16 bit ones complement of \r
+    Checksum           - Returns the 16 bit ones complement of\r
                          ones complement sum of 16 bit words\r
 \r
 --*/\r
@@ -264,7 +265,7 @@ IpChecksum2 (
     MessageLen    - Length to be checksummed\r
 \r
   Returns:\r
-    Checksum      - Returns the 16 bit ones complement of \r
+    Checksum      - Returns the 16 bit ones complement of\r
                     ones complement sum of 16 bit words\r
 \r
 --*/\r
@@ -298,7 +299,7 @@ UpdateChecksum (
     NewWord            - New Value\r
 \r
   Returns:\r
-    Checksum           - Returns the 16 bit ones complement of \r
+    Checksum           - Returns the 16 bit ones complement of\r
                          ones complement sum of 16 bit words\r
 \r
 --*/\r
@@ -328,7 +329,7 @@ SetMakeCallback (
 \r
   Returns:\r
     0                  - Callbacks are active on the handle\r
-    1                  - Callbacks are not active on the handle                         \r
+    1                  - Callbacks are not active on the handle\r
 \r
 --*/\r
 {\r
@@ -385,7 +386,7 @@ WaitForReceive (
   Arguments:\r
     Private       - Pointer to Pxe BaseCode Protocol\r
     Function      - What PXE function to callback\r
-    TimeoutEvent  - Timer event that will trigger when we have waited too \r
+    TimeoutEvent  - Timer event that will trigger when we have waited too\r
                     long for an incoming packet\r
     HeaderSizePtr - Pointer to the size of the Header size\r
     BufferSizePtr - Pointer to the size of the Buffer size\r
@@ -446,52 +447,6 @@ WaitForReceive (
   //\r
   for (;;)\r
   {\r
-#if 0\r
-    //\r
-    // Check for received packet event.\r
-    //\r
-    if (!EFI_ERROR (gBS->CheckEvent (SnpPtr->WaitForPacket))) {\r
-      //\r
-      // Packet should be available.  Attempt to read it.\r
-      //\r
-      *BufferSizePtr = BUFFER_ALLOCATE_SIZE;\r
-\r
-      StatCode = SnpPtr->Receive (\r
-                          SnpPtr,\r
-                          HeaderSizePtr,\r
-                          BufferSizePtr,\r
-                          Private->ReceiveBufferPtr,\r
-                          0,\r
-                          0,\r
-                          ProtocolPtr\r
-                          );\r
-\r
-      if (EFI_ERROR (StatCode)) {\r
-        break;\r
-      }\r
-      //\r
-      // Packet was received.  Make received callback then return.\r
-      //\r
-      if (CallbackPtr != NULL) {\r
-        StatCode = CallbackPtr (\r
-                    Private->CallbackProtocolPtr,\r
-                    Function,\r
-                    TRUE,\r
-                    (UINT32) *BufferSizePtr,\r
-                    (EFI_PXE_BASE_CODE_PACKET *) Private->ReceiveBufferPtr\r
-                    );\r
-\r
-        if (StatCode != EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE) {\r
-          StatCode = EFI_ABORTED;\r
-        } else {\r
-          StatCode = EFI_SUCCESS;\r
-        }\r
-      }\r
-\r
-      break;\r
-    }\r
-\r
-#else\r
     //\r
     // Poll for received packet.\r
     //\r
@@ -533,7 +488,7 @@ WaitForReceive (
     if (StatCode != EFI_NOT_READY) {\r
       break;\r
     }\r
-#endif\r
+\r
     //\r
     // Check for callback event.\r
     //\r
@@ -599,7 +554,7 @@ SendPacket (
 \r
   Arguments:\r
     Private       - Pointer to Pxe BaseCode Protocol\r
-    HeaderPtr          - Pointer to the buffer \r
+    HeaderPtr          - Pointer to the buffer\r
     PacketPtr          - Pointer to the packet to send\r
     PacketLen        - The length of the entire packet to send\r
     HardwareAddr        - Pointer to the MAC address of the destination\r
@@ -1263,7 +1218,6 @@ BcStart (
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
-#if !SUPPORT_IPV6\r
   //\r
   // Fail if IPv6 is requested and not supported.\r
   //\r
@@ -1272,7 +1226,7 @@ BcStart (
     EfiReleaseLock (&Private->Lock);\r
     return EFI_UNSUPPORTED;\r
   }\r
-#endif\r
+\r
   //\r
   // Setup shortcuts to SNP protocol and data structure.\r
   //\r
@@ -1505,12 +1459,8 @@ BcStart (
   // supports IPv6.\r
   //\r
   Private->EfiBc.Mode->Ipv6Supported = SUPPORT_IPV6;\r
-\r
-#if SUPPORT_IPV6\r
-  Private->EfiBc.Mode->Ipv6Available = Private->NiiPtr->Ipv6Supported;\r
-#else\r
   Private->EfiBc.Mode->Ipv6Available = FALSE;\r
-#endif\r
+\r
   //\r
   // Set to TRUE by the BC constructor if this BC implementation\r
   // supports BIS.\r
@@ -1756,14 +1706,7 @@ IpFilter (
           //\r
           if (!Index2)\r
           {\r
-#if SUPPORT_IPV6\r
-            if (PxebcMode->UsingIpv6) {\r
-              //\r
-              // TBD\r
-              //\r
-            } else\r
-#endif\r
-              TmpIp = (EFI_IP_ADDRESS *) &AllSystemsGroup;\r
+            TmpIp = (EFI_IP_ADDRESS *) &AllSystemsGroup;\r
             --Index;\r
           } else {\r
             TmpIp = (EFI_IP_ADDRESS *) &Filter->IpList[Index];\r
@@ -2309,12 +2252,8 @@ PxeBcDriverStart (
   // implementation supports IPv6.\r
   //\r
   Private->EfiBc.Mode->Ipv6Supported = SUPPORT_IPV6;\r
-\r
-#if SUPPORT_IPV6\r
-  Private->EfiBc.Mode->Ipv6Available = Private->NiiPtr->Ipv6Supported;\r
-#else\r
   Private->EfiBc.Mode->Ipv6Available = FALSE;\r
-#endif\r
+\r
   //\r
   // Set to TRUE by the BC constructor if this BC\r
   // implementation supports BIS.\r