]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
code scrub fix
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Impl.c
index 26f03c9fc49f80854a7ab4680b8f0d925bd0037d..e964f6b292615023ea066344b53758e7bf6acb30 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
-\r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+  This file implement the EFI_DHCP4_PROTOCOL interface.\r
+  \r
+Copyright (c) 2006 - 2008, Intel Corporation.<BR>\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
@@ -9,15 +10,6 @@ http://opensource.org/licenses/bsd-license.php
 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
-\r
-  Dhcp4Impl.c\r
-\r
-Abstract:\r
-\r
-  This file implement the EFI_DHCP4_PROTOCOL interface.\r
-\r
-\r
 **/\r
 \r
 \r
@@ -29,8 +21,8 @@ Abstract:
   The GetModeData() function returns the current operating mode and cached data\r
   packet for the EFI DHCPv4 Protocol driver.\r
 \r
-  @param  This          Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r
+  @param[in]  This          Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[out] Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r
 \r
   @retval EFI_SUCCESS           The mode data was returned.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -69,8 +61,8 @@ EfiDhcp4GetModeData (
   wants to make it possible for another instance to configure the EFI DHCPv4 Protocol\r
   driver, it must call this function with Dhcp4CfgData set to NULL.\r
 \r
-  @param  This                   Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  Dhcp4CfgData           Pointer to the EFI_DHCP4_CONFIG_DATA.\r
+  @param[in]  This                   Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  Dhcp4CfgData           Pointer to the EFI_DHCP4_CONFIG_DATA.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or\r
                                 Dhcp4InitReboot state, if the original state of this driver\r
@@ -109,14 +101,14 @@ EfiDhcp4Configure (
   by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r
   opportunity to control the process.\r
   \r
-  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
-                          EFI DHCPv4 Protocol driver is transferred into the\r
-                          Dhcp4Bound state or when the DHCP process is aborted.\r
-                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
-                          check the completion status. If NULL,\r
-                          EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r
-                          is transferred into the Dhcp4Bound state or the process fails.\r
+  @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
+                              EFI DHCPv4 Protocol driver is transferred into the\r
+                              Dhcp4Bound state or when the DHCP process is aborted.\r
+                              EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                              check the completion status. If NULL,\r
+                              EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r
+                              is transferred into the Dhcp4Bound state or the process fails.\r
 \r
   @retval EFI_SUCCESS           The DHCP configuration process has started, or it has completed\r
                                 when CompletionEvent is NULL.\r
@@ -154,16 +146,16 @@ EfiDhcp4Start (
   state and the previous configuration is restored. The outgoing and incoming packets\r
   can be captured by the EFI_DHCP4_CALLBACK function.\r
 \r
-  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  RebindRequest   If TRUE, this function broadcasts the request packets and enters\r
-                          the Dhcp4Rebinding state. Otherwise, it sends a unicast\r
-                          request packet and enters the Dhcp4Renewing state.\r
-  @param  CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r
-                          completes or some error occurs.\r
-                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
-                          check the completion status. If NULL,\r
-                          EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r
-                          until the DHCP process finishes.\r
+  @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  RebindRequest   If TRUE, this function broadcasts the request packets and enters\r
+                              the Dhcp4Rebinding state. Otherwise, it sends a unicast\r
+                              request packet and enters the Dhcp4Renewing state.\r
+  @param[in]  CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r
+                              completes or some error occurs.\r
+                              EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                              check the completion status. If NULL,\r
+                              EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r
+                              until the DHCP process finishes.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the\r
                                 Dhcp4Renewing state or is back to the Dhcp4Bound state.\r
@@ -198,7 +190,7 @@ EfiDhcp4RenewRebind (
   After a successful call to this function, the EFI DHCPv4 Protocol driver returns\r
   to the Dhcp4Init state and any subsequent incoming packets will be discarded silently.\r
 \r
-  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -221,7 +213,7 @@ EfiDhcp4Release (
   before DHCP configuration process can be started again. This function can be\r
   called when the EFI DHCPv4 Protocol driver is in any state.\r
 \r
-  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -241,19 +233,19 @@ EfiDhcp4Stop (
   does not change any state of the EFI DHCPv4 Protocol driver and can be used at\r
   any time.\r
 \r
-  @param  This        Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  SeedPacket  Initial packet to be used as a base for building new packet.\r
-  @param  DeleteCount Number of opcodes in the DeleteList.\r
-  @param  DeleteList  List of opcodes to be deleted from the seed packet.\r
-                      Ignored if DeleteCount is zero.\r
-  @param  AppendCount Number of entries in the OptionList.\r
-  @param  AppendList  Pointer to a DHCP option list to be appended to SeedPacket.\r
-                      If SeedPacket also contains options in this list, they are\r
-                      replaced by new options (except pad option). Ignored if\r
-                      AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r
-  @param  NewPacket   Pointer to storage for the pointer to the new allocated packet.\r
-                      Use the EFI Boot Service FreePool() on the resulting pointer\r
-                      when done with the packet.\r
+  @param[in]  This        Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  SeedPacket  Initial packet to be used as a base for building new packet.\r
+  @param[in]  DeleteCount Number of opcodes in the DeleteList.\r
+  @param[in]  DeleteList  List of opcodes to be deleted from the seed packet.\r
+                          Ignored if DeleteCount is zero.\r
+  @param[in]  AppendCount Number of entries in the OptionList.\r
+  @param[in]  AppendList  Pointer to a DHCP option list to be appended to SeedPacket.\r
+                          If SeedPacket also contains options in this list, they are\r
+                          replaced by new options (except pad option). Ignored if\r
+                          AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r
+  @param[out] NewPacket   Pointer to storage for the pointer to the new allocated packet.\r
+                          Use the EFI Boot Service FreePool() on the resulting pointer\r
+                          when done with the packet.\r
 \r
   @retval EFI_SUCCESS           The new packet was built.\r
   @retval EFI_OUT_OF_RESOURCES  Storage for the new packet could not be allocated.\r
@@ -272,15 +264,15 @@ EfiDhcp4Build (
   OUT EFI_DHCP4_PACKET        **NewPacket\r
   );\r
   \r
-  /**\r
+/**\r
   Transmits a DHCP formatted packet and optionally waits for responses.\r
   \r
   The TransmitReceive() function is used to transmit a DHCP packet and optionally\r
   wait for the response from servers. This function does not change the state of\r
   the EFI DHCPv4 Protocol driver and thus can be used at any time.\r
 \r
-  @param  This    Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  Token   Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
+  @param[in]  This    Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  Token   Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
 \r
   @retval EFI_SUCCESS           The packet was successfully queued for transmission.\r
   @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
@@ -352,8 +344,8 @@ EFI_DHCP4_PROTOCOL  mDhcp4ProtocolTemplate = {
   The GetModeData() function returns the current operating mode and cached data\r
   packet for the EFI DHCPv4 Protocol driver.\r
 \r
-  @param  This          Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r
+  @param[in]  This          Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[out] Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r
 \r
   @retval EFI_SUCCESS           The mode data was returned.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -426,8 +418,6 @@ EfiDhcp4GetModeData (
 \r
   @param  Config                 The DHCP configure data\r
 \r
-  @return None\r
-\r
 **/\r
 VOID\r
 DhcpCleanConfigure (\r
@@ -462,8 +452,8 @@ DhcpCleanConfigure (
   Allocate memory for configure parameter such as timeout value for Dst,\r
   then copy the configure parameter from Src to Dst.\r
 \r
-  @param  Dst                    The destination DHCP configure data.\r
-  @param  Src                    The source DHCP configure data.\r
+  @param[out]  Dst                    The destination DHCP configure data.\r
+  @param[in]   Src                    The source DHCP configure data.\r
 \r
   @retval EFI_OUT_OF_RESOURCES   Failed to allocate memory.\r
   @retval EFI_SUCCESS            The configure is copied.\r
@@ -560,8 +550,6 @@ ON_ERROR:
 \r
   @param  DhcpSb                 The DHCP service instance.\r
 \r
-  @return None\r
-\r
 **/\r
 VOID\r
 DhcpYieldControl (\r
@@ -620,8 +608,8 @@ DhcpYieldControl (
   wants to make it possible for another instance to configure the EFI DHCPv4 Protocol\r
   driver, it must call this function with Dhcp4CfgData set to NULL.\r
 \r
-  @param  This                   Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  Dhcp4CfgData           Pointer to the EFI_DHCP4_CONFIG_DATA.\r
+  @param[in]  This                   Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  Dhcp4CfgData           Pointer to the EFI_DHCP4_CONFIG_DATA.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or\r
                                 Dhcp4InitReboot state, if the original state of this driver\r
@@ -761,14 +749,14 @@ ON_EXIT:
   by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r
   opportunity to control the process.\r
   \r
-  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
-                          EFI DHCPv4 Protocol driver is transferred into the\r
-                          Dhcp4Bound state or when the DHCP process is aborted.\r
-                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
-                          check the completion status. If NULL,\r
-                          EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r
-                          is transferred into the Dhcp4Bound state or the process fails.\r
+  @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
+                              EFI DHCPv4 Protocol driver is transferred into the\r
+                              Dhcp4Bound state or when the DHCP process is aborted.\r
+                              EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                              check the completion status. If NULL,\r
+                              EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r
+                              is transferred into the Dhcp4Bound state or the process fails.\r
 \r
   @retval EFI_SUCCESS           The DHCP configuration process has started, or it has completed\r
                                 when CompletionEvent is NULL.\r
@@ -875,16 +863,16 @@ ON_ERROR:
   state and the previous configuration is restored. The outgoing and incoming packets\r
   can be captured by the EFI_DHCP4_CALLBACK function.\r
 \r
-  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  RebindRequest   If TRUE, this function broadcasts the request packets and enters\r
-                          the Dhcp4Rebinding state. Otherwise, it sends a unicast\r
-                          request packet and enters the Dhcp4Renewing state.\r
-  @param  CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r
-                          completes or some error occurs.\r
-                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
-                          check the completion status. If NULL,\r
-                          EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r
-                          until the DHCP process finishes.\r
+  @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  RebindRequest   If TRUE, this function broadcasts the request packets and enters\r
+                              the Dhcp4Rebinding state. Otherwise, it sends a unicast\r
+                              request packet and enters the Dhcp4Renewing state.\r
+  @param[in]  CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r
+                              completes or some error occurs.\r
+                              EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                              check the completion status. If NULL,\r
+                              EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r
+                              until the DHCP process finishes.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the\r
                                 Dhcp4Renewing state or is back to the Dhcp4Bound state.\r
@@ -998,7 +986,7 @@ ON_ERROR:
   After a successful call to this function, the EFI DHCPv4 Protocol driver returns\r
   to the Dhcp4Init state and any subsequent incoming packets will be discarded silently.\r
 \r
-  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -1071,7 +1059,7 @@ ON_EXIT:
   before DHCP configuration process can be started again. This function can be\r
   called when the EFI DHCPv4 Protocol driver is in any state.\r
 \r
-  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -1121,19 +1109,19 @@ EfiDhcp4Stop (
   does not change any state of the EFI DHCPv4 Protocol driver and can be used at\r
   any time.\r
 \r
-  @param  This        Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  SeedPacket  Initial packet to be used as a base for building new packet.\r
-  @param  DeleteCount Number of opcodes in the DeleteList.\r
-  @param  DeleteList  List of opcodes to be deleted from the seed packet.\r
-                      Ignored if DeleteCount is zero.\r
-  @param  AppendCount Number of entries in the OptionList.\r
-  @param  AppendList  Pointer to a DHCP option list to be appended to SeedPacket.\r
-                      If SeedPacket also contains options in this list, they are\r
-                      replaced by new options (except pad option). Ignored if\r
-                      AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r
-  @param  NewPacket   Pointer to storage for the pointer to the new allocated packet.\r
-                      Use the EFI Boot Service FreePool() on the resulting pointer\r
-                      when done with the packet.\r
+  @param[in]  This        Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  SeedPacket  Initial packet to be used as a base for building new packet.\r
+  @param[in]  DeleteCount Number of opcodes in the DeleteList.\r
+  @param[in]  DeleteList  List of opcodes to be deleted from the seed packet.\r
+                          Ignored if DeleteCount is zero.\r
+  @param[in]  AppendCount Number of entries in the OptionList.\r
+  @param[in]  AppendList  Pointer to a DHCP option list to be appended to SeedPacket.\r
+                          If SeedPacket also contains options in this list, they are\r
+                          replaced by new options (except pad option). Ignored if\r
+                          AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r
+  @param[out] NewPacket   Pointer to storage for the pointer to the new allocated packet.\r
+                          Use the EFI Boot Service FreePool() on the resulting pointer\r
+                          when done with the packet.\r
 \r
   @retval EFI_SUCCESS           The new packet was built.\r
   @retval EFI_OUT_OF_RESOURCES  Storage for the new packet could not be allocated.\r
@@ -1185,8 +1173,8 @@ EfiDhcp4Build (
 /**\r
   Callback by UdpIoCreatePort() when creating UdpIo for this Dhcp4 instance.\r
   \r
-  @param UdpIo      The UdpIo being created.\r
-  @param Context    Dhcp4 instance.\r
+  @param[in] UdpIo      The UdpIo being created.\r
+  @param[in] Context    Dhcp4 instance.\r
   \r
   @retval EFI_SUCCESS   UdpIo is configured successfully.\r
   @retval other         Other error occurs.\r
@@ -1260,8 +1248,7 @@ Dhcp4InstanceCreateUdpIo (
   Callback of Dhcp packet. Does nothing.\r
   \r
   @param Arg           The context.\r
-  \r
-  @return  None.\r
+\r
 **/\r
 VOID\r
 DhcpDummyExtFree (\r
@@ -1281,8 +1268,6 @@ DhcpDummyExtFree (
   @param IoStatus         Status of the input.\r
   @param Context          Extra info for the input.\r
   \r
-  @return None.\r
-  \r
 **/\r
 VOID\r
 PxeDhcpInput (\r
@@ -1385,8 +1370,6 @@ RESTART:
   Complete a Dhcp4 transaction and signal the upper layer.\r
   \r
   @param Instance      Dhcp4 instance.\r
-  \r
-  @return None.\r
 \r
 **/\r
 VOID\r
@@ -1439,8 +1422,8 @@ SIGNAL_USER:
   wait for the response from servers. This function does not change the state of\r
   the EFI DHCPv4 Protocol driver and thus can be used at any time.\r
 \r
-  @param  This    Pointer to the EFI_DHCP4_PROTOCOL instance.\r
-  @param  Token   Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
+  @param[in]  This    Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param[in]  Token   Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
 \r
   @retval EFI_SUCCESS           The packet was successfully queued for transmission.\r
   @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
@@ -1614,10 +1597,10 @@ ON_ERROR:
   EFI_DHCP4_PACKET_OPTION array in the DHCP_PARSE_CONTEXT to point\r
   the individual DHCP option in the packet.\r
 \r
-  @param  Tag                    The DHCP option type\r
-  @param  Len                    Length of the DHCP option data\r
-  @param  Data                   The DHCP option data\r
-  @param  Context                The context, to pass several parameters in.\r
+  @param[in]  Tag                    The DHCP option type\r
+  @param[in]  Len                    Length of the DHCP option data\r
+  @param[in]  Data                   The DHCP option data\r
+  @param[in]  Context                The context, to pass several parameters in.\r
 \r
   @retval EFI_SUCCESS            It always returns EFI_SUCCESS\r
 \r