]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
1. update timeout interval time from 10ms to 50ms
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Udp4Dxe / Udp4Impl.h
index ae6874715924956a753780a134bb9764781cad4d..0823b6995c67a5ca888000f044d7a774537cc919 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
-\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+  EFI UDPv4 protocol implementation.\r
+   \r
+Copyright (c) 2006 - 2009, 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,21 +10,12 @@ 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
-  Udp4Impl.h\r
-\r
-Abstract:\r
-\r
-  EFI UDPv4 protocol implementation\r
-\r
-\r
 **/\r
 \r
 #ifndef _UDP4_IMPL_H_\r
 #define _UDP4_IMPL_H_\r
 \r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
 \r
 #include <Protocol/Ip4.h>\r
 #include <Protocol/Udp4.h>\r
@@ -37,6 +29,8 @@ Abstract:
 #include <Library/UefiLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Library/TimerLib.h>\r
+#include <Library/DpcLib.h>\r
 \r
 #include "Udp4Driver.h"\r
 \r
@@ -56,7 +50,7 @@ extern UINT16                          mUdp4RandomPort;
 \r
 #define UDP4_PORT_KNOWN       1024\r
 \r
-#define UDP4_SERVICE_DATA_SIGNATURE  EFI_SIGNATURE_32('U', 'd', 'p', '4')\r
+#define UDP4_SERVICE_DATA_SIGNATURE  SIGNATURE_32('U', 'd', 'p', '4')\r
 \r
 #define UDP4_SERVICE_DATA_FROM_THIS(a) \\r
   CR ( \\r
@@ -80,7 +74,7 @@ typedef struct _UDP4_SERVICE_DATA_ {
   CHAR16                        *MacString;\r
 } UDP4_SERVICE_DATA;\r
 \r
-#define UDP4_INSTANCE_DATA_SIGNATURE  EFI_SIGNATURE_32('U', 'd', 'p', 'I')\r
+#define UDP4_INSTANCE_DATA_SIGNATURE  SIGNATURE_32('U', 'd', 'p', 'I')\r
 \r
 #define UDP4_INSTANCE_DATA_FROM_THIS(a) \\r
   CR ( \\r
@@ -170,8 +164,8 @@ Udp4GetModeData (
   With different parameters in UdpConfigData, Configure() can be used to bind\r
   this instance to specified port.\r
 \r
-  @param  This           Pointer to the EFI_UDP4_PROTOCOL instance.\r
-  @param  UdpConfigData  Pointer to the buffer to receive the current configuration data.\r
+  @param[in]  This              Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param[in]  UdpConfigData     Pointer to the buffer to receive the current configuration data.\r
 \r
   @retval EFI_SUCCESS           The configuration settings were set, changed, or reset successfully.\r
   @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
@@ -202,10 +196,10 @@ Udp4Configure (
   filtering. If the JoinFlag is FALSE and the MulticastAddress is NULL, then all\r
   currently joined groups are left.\r
 \r
-  @param  This             Pointer to the EFI_UDP4_PROTOCOL instance.\r
-  @param  JoinFlag         Set to TRUE to join a multicast group. Set to FALSE to leave one\r
-                           or all multicast groups.\r
-  @param  MulticastAddress Pointer to multicast group address to join or leave.\r
+  @param[in]  This              Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param[in]  JoinFlag          Set to TRUE to join a multicast group. Set to FALSE to leave one\r
+                                or all multicast groups.\r
+  @param[in]  MulticastAddress  Pointer to multicast group address to join or leave.\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
   @retval EFI_NOT_STARTED       The EFI UDPv4 Protocol instance has not been started.\r
@@ -253,12 +247,12 @@ Udp4Groups (
   copies will be updated automatically whenever the IP driver reconfigures its\r
   instances; as a result, the previous modification to these copies will be lost.\r
 \r
-  @param  This           Pointer to the EFI_UDP4_PROTOCOL instance.\r
-  @param  DeleteRoute    Set to TRUE to delete this route from the routing table.\r
-                         Set to FALSE to add this route to the routing table.\r
-  @param  SubnetAddress  The destination network address that needs to be routed.\r
-  @param  SubnetMask     The subnet mask of SubnetAddress.\r
-  @param  GatewayAddress The gateway IP address for this route.\r
+  @param[in]  This              Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param[in]  DeleteRoute       Set to TRUE to delete this route from the routing table.\r
+                                Set to FALSE to add this route to the routing table.\r
+  @param[in]  SubnetAddress     The destination network address that needs to be routed.\r
+  @param[in]  SubnetMask        The subnet mask of SubnetAddress.\r
+  @param[in]  GatewayAddress    The gateway IP address for this route.\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
   @retval EFI_NOT_STARTED       The EFI UDPv4 Protocol instance has not been started.\r
@@ -290,9 +284,9 @@ Udp4Routes (
   and context for the event will enable the user to receive the notification and\r
   transmitting status.\r
 \r
-  @param  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
-  @param  Token Pointer to the completion token that will be placed into the\r
-                transmit queue.\r
+  @param[in]  This              Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param[in]  Token             Pointer to the completion token that will be placed into the\r
+                                transmit queue.\r
 \r
   @retval EFI_SUCCESS           The data has been queued for transmission.\r
   @retval EFI_NOT_STARTED       This EFI UDPv4 Protocol instance has not been started.\r
@@ -329,9 +323,9 @@ Udp4Transmit (
   will enable the user to receive the notification and receiving status. That\r
   notification function is guaranteed to not be re-entered.\r
 \r
-  @param  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that is associated with the receive data\r
-                descriptor.\r
+  @param[in]  This              Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param[in]  Token             Pointer to a token that is associated with\r
+                                the receive data descriptor.\r
 \r
   @retval EFI_SUCCESS           The receive completion token was cached.\r
   @retval EFI_NOT_STARTED       This EFI UDPv4 Protocol instance has not been started.\r
@@ -363,11 +357,11 @@ Udp4Receive (
   the asynchronous operation has completed, this function will not signal the\r
   token and EFI_NOT_FOUND is returned.\r
 \r
-  @param  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
-  @param  Token Pointer to a token that has been issued by\r
-                EFI_UDP4_PROTOCOL.Transmit() or\r
-                EFI_UDP4_PROTOCOL.Receive().If NULL, all pending\r
-                tokens are aborted.\r
+  @param[in]  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param[in]  Token Pointer to a token that has been issued by\r
+                    EFI_UDP4_PROTOCOL.Transmit() or\r
+                    EFI_UDP4_PROTOCOL.Receive().If NULL, all pending\r
+                    tokens are aborted.\r
 \r
   @retval  EFI_SUCCESS           The asynchronous I/O request was aborted and Token.Event\r
                                  was signaled. When Token is NULL, all pending requests are\r
@@ -400,7 +394,7 @@ Udp4Cancel (
   Drivers and applications that are experiencing packet loss should try calling\r
   the Poll() function more often.\r
 \r
-  @param  This Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param[in]  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS           Incoming or outgoing data was processed.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -437,9 +431,7 @@ Udp4CreateService (
 /**\r
   Clean the Udp service context data.\r
 \r
-  @param  Udp4Service            Pointer to the UDP4_SERVICE_DATA.\r
-\r
-  @return None.\r
+  @param[in]  Udp4Service            Pointer to the UDP4_SERVICE_DATA.\r
 \r
 **/\r
 VOID\r
@@ -453,8 +445,6 @@ Udp4CleanService (
   @param  Udp4Service            Pointer to the UDP4_SERVICE_DATA.\r
   @param  Instance               Pointer to the un-initialized UDP4_INSTANCE_DATA.\r
 \r
-  @return None.\r
-\r
 **/\r
 VOID\r
 Udp4InitInstance (\r
@@ -465,9 +455,7 @@ Udp4InitInstance (
 /**\r
   This function cleans the udp instance.\r
 \r
-  @param  Instance               Pointer to the UDP4_INSTANCE_DATA to clean.\r
-\r
-  @return None.\r
+  @param[in]  Instance               Pointer to the UDP4_INSTANCE_DATA to clean.\r
 \r
 **/\r
 VOID\r
@@ -501,9 +489,9 @@ Udp4Bind (
   This function is used to check whether the NewConfigData has any un-reconfigurable\r
   parameters changed compared to the OldConfigData.\r
 \r
-  @param  OldConfigData          Pointer to the current ConfigData the udp instance\r
+  @param[in]  OldConfigData      Pointer to the current ConfigData the udp instance\r
                                  uses.\r
-  @param  NewConfigData          Pointer to the new ConfigData.\r
+  @param[in]  NewConfigData      Pointer to the new ConfigData.\r
 \r
   @retval TRUE     The instance is reconfigurable.\r
   @retval FALSE    Otherwise.\r
@@ -518,10 +506,8 @@ Udp4IsReconfigurable (
 /**\r
   This function builds the Ip4 configdata from the Udp4ConfigData.\r
 \r
-  @param  Udp4ConfigData         Pointer to the EFI_UDP4_CONFIG_DATA.\r
-  @param  Ip4ConfigData          Pointer to the EFI_IP4_CONFIG_DATA.\r
-\r
-  @return None.\r
+  @param[in]       Udp4ConfigData    Pointer to the EFI_UDP4_CONFIG_DATA.\r
+  @param[in, out]  Ip4ConfigData     Pointer to the EFI_IP4_CONFIG_DATA.\r
 \r
 **/\r
 VOID\r
@@ -533,8 +519,8 @@ Udp4BuildIp4ConfigData (
 /**\r
   This function validates the TxToken, it returns the error code according to the spec.\r
 \r
-  @param  Instance               Pointer to the udp instance context data.\r
-  @param  TxToken                Pointer to the token to be checked.\r
+  @param[in]  Instance           Pointer to the udp instance context data.\r
+  @param[in]  TxToken            Pointer to the token to be checked.\r
 \r
   @retval EFI_SUCCESS            The TxToken is valid.\r
   @retval EFI_INVALID_PARAMETER  One or more of the following are TRUE: This is\r
@@ -565,10 +551,10 @@ Udp4ValidateTxToken (
 /**\r
   This function checks whether the specified Token duplicates with the one in the Map.\r
 \r
-  @param  Map                    Pointer to the NET_MAP.\r
-  @param  Item                   Pointer to the NET_MAP_ITEM contain the pointer to\r
+  @param[in]  Map                Pointer to the NET_MAP.\r
+  @param[in]  Item               Pointer to the NET_MAP_ITEM contain the pointer to\r
                                  the Token.\r
-  @param  Context                Pointer to the Token to be checked.\r
+  @param[in]  Context            Pointer to the Token to be checked.\r
 \r
   @retval EFI_SUCCESS            The Token specified by Context differs from the\r
                                  one in the Item.\r
@@ -586,11 +572,11 @@ Udp4TokenExist (
   This function calculates the checksum for the Packet, utilizing the pre-calculated\r
   pseudo HeadSum to reduce some overhead.\r
 \r
-  @param  Packet                 Pointer to the NET_BUF contains the udp datagram.\r
-  @param  HeadSum                Checksum of the pseudo header execpt the length\r
+  @param[in]  Packet             Pointer to the NET_BUF contains the udp datagram.\r
+  @param[in]  HeadSum            Checksum of the pseudo header execpt the length\r
                                  field.\r
 \r
-  @return The 16-bit checksum of this udp datagram.\r
+  @retval The 16-bit checksum of this udp datagram.\r
 \r
 **/\r
 UINT16\r
@@ -602,8 +588,8 @@ Udp4Checksum (
 /**\r
   This function removes the specified Token from the TokenMap.\r
 \r
-  @param  TokenMap               Pointer to the NET_MAP containing the tokens.\r
-  @param  Token                  Pointer to the Token to be removed.\r
+  @param  TokenMap           Pointer to the NET_MAP containing the tokens.\r
+  @param  Token              Pointer to the Token to be removed.\r
 \r
   @retval EFI_SUCCESS            The specified Token is removed from the TokenMap.\r
   @retval EFI_NOT_FOUND          The specified Token is not found in the TokenMap.\r
@@ -638,9 +624,7 @@ Udp4LeaveGroup (
 /**\r
   This function removes all the Wrap datas in the RcvdDgramQue.\r
 \r
-  @param  Instance           Pointer to the udp instance context data.\r
-\r
-  @return None.\r
+  @param[in]  Instance           Pointer to the udp instance context data.\r
 \r
 **/\r
 VOID\r
@@ -651,8 +635,8 @@ Udp4FlushRcvdDgram (
 /**\r
   Cancel Udp4 tokens from the Udp4 instance.\r
 \r
-  @param  Instance               Pointer to the udp instance context data.\r
-  @param  Token                  Pointer to the token to be canceled, if NULL, all\r
+  @param[in]  Instance           Pointer to the udp instance context data.\r
+  @param[in]  Token              Pointer to the token to be canceled, if NULL, all\r
                                  tokens in this instance will be cancelled.\r
 \r
   @retval EFI_SUCCESS            The Token is cancelled.\r
@@ -668,9 +652,7 @@ Udp4InstanceCancelToken (
 /**\r
   This function delivers the received datagrams for the specified instance.\r
 \r
-  @param  Instance               Pointer to the instance context data.\r
-\r
-  @return None.\r
+  @param[in]  Instance               Pointer to the instance context data.\r
 \r
 **/\r
 VOID\r
@@ -681,9 +663,7 @@ Udp4InstanceDeliverDgram (
 /**\r
   This function reports the received ICMP error.\r
 \r
-  @param  Instance               Pointer to the udp instance context data.\r
-\r
-  @return None.\r
+  @param[in]  Instance               Pointer to the udp instance context data.\r
 \r
 **/\r
 VOID\r
@@ -695,9 +675,7 @@ Udp4ReportIcmpError (
   This function is a dummy ext-free function for the NET_BUF created for the output\r
   udp datagram.\r
 \r
-  @param  Context                Pointer to the context data.\r
-\r
-  @return None.\r
+  @param[in]  Context                Pointer to the context data.\r
 \r
 **/\r
 VOID\r
@@ -724,9 +702,7 @@ Udp4SetVariableData (
 /**\r
   Clear the variable and free the resource.\r
 \r
-  @param  Udp4Service            Udp4 service data.\r
-\r
-  @return None.\r
+  @param[[in]  Udp4Service            Udp4 service data.\r
 \r
 **/\r
 VOID\r