]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Network/PxeBc/Dxe/pxe_bc_dhcp.c
1. Removed #ifdef SNP_DEBUG and used debug lib to output information
[mirror_edk2.git] / EdkModulePkg / Universal / Network / PxeBc / Dxe / pxe_bc_dhcp.c
index 79bce9d4d8a76eacb2f532c8af00b939940c28be..101c030bc84ba468afd4d0cd7d5cf91942d75589 100644 (file)
@@ -1,17 +1,17 @@
 /*++\r
 \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
+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
 Module Name:\r
   pxe_bc_dhcp.c\r
-  \r
+\r
 Abstract:\r
   DHCP and PXE discovery protocol implementations.\r
 \r
@@ -43,13 +43,6 @@ typedef union {
   UINT8                     *BytePtr;\r
 } UNION_PTR;\r
 \r
-//\r
-// 1 for Itanium-based, 0 for IA32\r
-//\r
-#define IA64SZ    ((sizeof (UINTN) / sizeof (UINT32)) - 1)\r
-\r
-#define SYS_ARCH  (SYS_ARCH_EFI32 - (SYS_ARCH_EFI32 - IA64) * IA64SZ)\r
-\r
 #pragma pack(1)\r
 //\r
 // option structure for DHCPREQUEST at end of DISCOVER options\r
@@ -218,7 +211,7 @@ OptionsStrucInit (
   CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMajor, "yyy", sizeof ("yyy"));\r
   CopyMem (DHCPOpStart.DhcpClassIdentifier.Data.UndiMinor, "xxx", sizeof ("xxx"));\r
   DHCPOpStart.End[0] = OP_END;\r
-};\r
+}\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
 \r
@@ -406,6 +399,7 @@ STATIC UINT8  OurDhcpOptions[MAX_OUR_OPT] = {
 #pragma pack()\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 CHAR8 *\r
 PxeBcLibGetSmbiosString (\r
   IN  SMBIOS_STRUCTURE_POINTER  *Smbios,\r
@@ -417,7 +411,7 @@ Routine description:
 \r
 Arguments:\r
   Smbios - Pointer to SMBIOS structure\r
-  StringNumber - String number to return. 0 is used to skip all strings and \r
+  StringNumber - String number to return. 0 is used to skip all strings and\r
     point to the next SMBIOS structure.\r
 \r
 Returns:\r
@@ -862,6 +856,7 @@ DecodeOptions (
 }\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 VOID\r
 Parse (\r
   DHCP_RECEIVE_BUFFER *RxBufPtr,\r
@@ -965,6 +960,7 @@ CopyParse (
 }\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 BOOLEAN\r
 AckEdit (\r
   DHCP_RECEIVE_BUFFER *DhcpRxBuf\r
@@ -991,6 +987,7 @@ AckEdit (
 //\r
 // if a discover type packet, make sure all required fields are present\r
 //\r
+STATIC\r
 BOOLEAN\r
 DHCPOfferAckEdit (\r
   DHCP_RECEIVE_BUFFER *DhcpRxBuf\r
@@ -1133,6 +1130,7 @@ DHCPOfferAckEdit (
 }\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 BOOLEAN\r
 DHCPAckEdit (\r
   DHCP_RECEIVE_BUFFER *RxBufPtr\r
@@ -1146,6 +1144,7 @@ DHCPAckEdit (
 //\r
 // get an offer/ack\r
 //\r
+STATIC\r
 EFI_STATUS\r
 GetOfferAck (\r
   PXE_BASECODE_DEVICE          *Private,\r
@@ -1166,11 +1165,11 @@ Parameters:
   Private := Pointer to PxeBc interface\r
   ExtraEdit := Pointer to extra option checking function\r
   OpFlags := UdpRead() option flags\r
-  ServerIpPtr := \r
-  ServerPortPtr := \r
-  ClientIpPtr := \r
-  ClientPortPtr := \r
-  DhcpRxBuf := \r
+  ServerIpPtr :=\r
+  ServerPortPtr :=\r
+  ClientIpPtr :=\r
+  ClientPortPtr :=\r
+  DhcpRxBuf :=\r
   TimeoutEvent :=\r
 \r
 Returns:\r
@@ -1256,6 +1255,7 @@ Returns:
 //\r
 // get DHCPOFFER's\r
 //\r
+STATIC\r
 EFI_STATUS\r
 GetOffers (\r
   PXE_BASECODE_DEVICE *Private\r
@@ -2153,6 +2153,7 @@ DoDhcpDora (
 //\r
 // determine if the server ip is in the ip list\r
 //\r
+STATIC\r
 BOOLEAN\r
 InServerList (\r
   EFI_IP_ADDRESS    *ServerIpPtr,\r
@@ -2179,6 +2180,7 @@ InServerList (
 }\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 BOOLEAN\r
 ExtractBootServerList (\r
   UINT16            Type,\r
@@ -2216,6 +2218,7 @@ ExtractBootServerList (
 }\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 VOID\r
 FreeMem (\r
   PXE_BASECODE_DEVICE *Private\r
@@ -2233,6 +2236,7 @@ FreeMem (
 }\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 BOOLEAN\r
 GetMem (\r
   PXE_BASECODE_DEVICE *Private\r
@@ -2305,7 +2309,7 @@ Routine description:
 \r
 Parameters:\r
   This := Pointer to PxeBc interface\r
-  SortOffers := \r
+  SortOffers :=\r
 \r
 Returns:\r
 --*/\r
@@ -2450,6 +2454,7 @@ VerifyCredentialOption (
 }\r
 \r
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */\r
+STATIC\r
 EFI_STATUS\r
 DoDiscover (\r
   PXE_BASECODE_DEVICE *Private,\r
@@ -2461,12 +2466,12 @@ DoDiscover (
   PXE_SERVER_LISTS    *ServerListPtr\r
   )\r
 /*++\r
-Routine description: \r
+Routine description:\r
   This function tries to complete the PXE Bootserver and/or boot image\r
   discovery sequence.  When this command completes successfully, the\r
   PXEdiscover and PXEreply fields in the BC instance data structure are\r
   updated.  If the Info pointer is set to NULL, the discovery information\r
-  in the DHCPack and ProxyOffer packets must be valid and will be used. \r
+  in the DHCPack and ProxyOffer packets must be valid and will be used.\r
   If Info is not set to NULL, the discovery methods in the Info field\r
   must be set and will be used.  When discovering any layer number other\r
   than zero (the credential flag does not count), only unicast discovery\r
@@ -2474,12 +2479,12 @@ Routine description:
 \r
 Parameters:\r
   Private := Pointer to PxeBc interface\r
-  OpFlags := \r
-  Type := \r
-  LayerPtr := \r
-  UseBis := \r
-  DestPtr := \r
-  ServerListPtr := \r
+  OpFlags :=\r
+  Type :=\r
+  LayerPtr :=\r
+  UseBis :=\r
+  DestPtr :=\r
+  ServerListPtr :=\r
 \r
 Returns:\r
 --*/\r
@@ -2766,12 +2771,12 @@ Routine Description:
 \r
 Parameters:\r
   Private := Pointer to PxeBc interface\r
-  Type := \r
-  LayerPtr := \r
-  UseBis := \r
-  DiscoverInfoPtr := \r
-  McastServerListPtr := \r
-  ServerListPtr := \r
+  Type :=\r
+  LayerPtr :=\r
+  UseBis :=\r
+  DiscoverInfoPtr :=\r
+  McastServerListPtr :=\r
+  ServerListPtr :=\r
 \r
 Returns:\r
 --*/\r
@@ -2902,11 +2907,11 @@ BcDiscover (
 Routine description:\r
 \r
 Parameters:\r
-  This := \r
-  Type := \r
-  LayerPtr := \r
-  UseBis := \r
-  DiscoverInfoPtr := \r
+  This :=\r
+  Type :=\r
+  LayerPtr :=\r
+  UseBis :=\r
+  DiscoverInfoPtr :=\r
 \r
 Returns:\r
 --*/\r
@@ -3217,13 +3222,11 @@ Returns:
 {\r
   EFI_PXE_BASE_CODE_MODE  *PxebcMode;\r
   EFI_STATUS              Status;\r
-  EFI_STATUS              StatCode;\r
   PXE_BASECODE_DEVICE     *Private;\r
 \r
   //\r
   // Lock the instance data and make sure started\r
   //\r
-  StatCode = EFI_SUCCESS;\r
 \r
   if (This == NULL) {\r
     DEBUG ((EFI_D_ERROR, "BC *This pointer == NULL"));\r