]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h
Retire NetLibQueueDpc() and NetLibDispatchDpc() and use QueueDpc() and DispatchDpc...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Impl.h
index 3f191676312b48caba32ffb407b6e2f1c3ca71fb..615e5ae2a8bcda4a2e02d51157bfccd37c060a14 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
-\r
-Copyright (c) 2005 - 2007, Intel Corporation                                                         \r
+  Ip4 internal functions and type defintions.\r
+  \r
+Copyright (c) 2005 - 2007, 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
-  Ip4Impl.h\r
-\r
-Abstract:\r
-\r
-  Ip4 internal functions and type defintions.\r
-\r
-\r
 **/\r
 \r
 #ifndef __EFI_IP4_IMPL_H__\r
 #define __EFI_IP4_IMPL_H__\r
 \r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
 \r
 #include <Protocol/Ip4.h>\r
 #include <Protocol/Ip4Config.h>\r
@@ -39,6 +31,7 @@ Abstract:
 #include <Library/NetLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Library/DpcLib.h>\r
 \r
 #include "Ip4Common.h"\r
 #include "Ip4Driver.h"\r
@@ -53,8 +46,8 @@ Abstract:
 \r
 \r
 typedef enum {\r
-  IP4_PROTOCOL_SIGNATURE = EFI_SIGNATURE_32 ('I', 'P', '4', 'P'),\r
-  IP4_SERVICE_SIGNATURE  = EFI_SIGNATURE_32 ('I', 'P', '4', 'S'),\r
+  IP4_PROTOCOL_SIGNATURE = SIGNATURE_32 ('I', 'P', '4', 'P'),\r
+  IP4_SERVICE_SIGNATURE  = SIGNATURE_32 ('I', 'P', '4', 'S'),\r
 \r
   //\r
   // The state of IP4 protocol. It starts from UNCONFIGED. if it is\r
@@ -216,36 +209,108 @@ struct _IP4_SERVICE {
 \r
 extern EFI_IP4_PROTOCOL mEfiIp4ProtocolTemplete;\r
 \r
+/**\r
+  Config the MNP parameter used by IP. The IP driver use one MNP\r
+  child to transmit/receive frames. By default, it configures MNP\r
+  to receive unicast/multicast/broadcast. And it will enable/disable\r
+  the promiscous receive according to whether there is IP child\r
+  enable that or not. If Force is FALSE, it will iterate through\r
+  all the IP children to check whether the promiscuous receive\r
+  setting has been changed. If it hasn't been changed, it won't\r
+  reconfigure the MNP. If Force is TRUE, the MNP is configured no\r
+  matter whether that is changed or not.\r
+\r
+  @param[in]  IpSb               The IP4 service instance that is to be changed.\r
+  @param[in]  Force              Force the configuration or not.\r
+\r
+  @retval EFI_SUCCESS            The MNP is successfully configured/reconfigured.\r
+  @retval Others                 Configuration failed.\r
+\r
+**/\r
 EFI_STATUS\r
 Ip4ServiceConfigMnp (\r
   IN IP4_SERVICE            *IpSb,\r
   IN BOOLEAN                Force\r
   );\r
 \r
+/**\r
+  Intiialize the IP4_PROTOCOL structure to the unconfigured states.\r
+\r
+  @param  IpSb                   The IP4 service instance.\r
+  @param  IpInstance             The IP4 child instance.\r
+\r
+**/\r
 VOID\r
 Ip4InitProtocol (\r
-  IN IP4_SERVICE            *IpSb,\r
-  IN IP4_PROTOCOL           *IpInstance\r
+  IN     IP4_SERVICE            *IpSb,\r
+  IN OUT IP4_PROTOCOL           *IpInstance\r
   );\r
 \r
+/**\r
+  Clean up the IP4 child, release all the resources used by it.\r
+\r
+  @param[in]  IpInstance         The IP4 child to clean up.\r
+\r
+  @retval EFI_SUCCESS            The IP4 child is cleaned up\r
+  @retval EFI_DEVICE_ERROR       Some resources failed to be released\r
+\r
+**/\r
 EFI_STATUS\r
 Ip4CleanProtocol (\r
   IN  IP4_PROTOCOL          *IpInstance\r
   );\r
 \r
+/**\r
+  Cancel the user's receive/transmit request.\r
+\r
+  @param[in]  IpInstance         The IP4 child\r
+  @param[in]  Token              The token to cancel. If NULL, all token will be\r
+                                 cancelled.\r
+\r
+  @retval EFI_SUCCESS            The token is cancelled\r
+  @retval EFI_NOT_FOUND          The token isn't found on either the\r
+                                 transmit/receive queue\r
+  @retval EFI_DEVICE_ERROR       Not all token is cancelled when Token is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 Ip4Cancel (\r
   IN IP4_PROTOCOL             *IpInstance,\r
-  IN EFI_IP4_COMPLETION_TOKEN *Token\r
+  IN EFI_IP4_COMPLETION_TOKEN *Token          OPTIONAL\r
   );\r
 \r
+/**\r
+  Change the IP4 child's multicast setting. The caller\r
+  should make sure that the parameters is valid.\r
+\r
+  @param[in]  IpInstance             The IP4 child to change the setting.\r
+  @param[in]  JoinFlag               TRUE to join the group, otherwise leave it\r
+  @param[in]  GroupAddress           The target group address\r
+\r
+  @retval EFI_ALREADY_STARTED    Want to join the group, but already a member of it\r
+  @retval EFI_OUT_OF_RESOURCES   Failed to allocate some resources.\r
+  @retval EFI_DEVICE_ERROR       Failed to set the group configuraton\r
+  @retval EFI_SUCCESS            Successfully updated the group setting.\r
+  @retval EFI_NOT_FOUND          Try to leave the group which it isn't a member.\r
+\r
+**/\r
 EFI_STATUS\r
 Ip4Groups (\r
   IN IP4_PROTOCOL           *IpInstance,\r
   IN BOOLEAN                JoinFlag,\r
-  IN EFI_IPv4_ADDRESS       *GroupAddress\r
+  IN EFI_IPv4_ADDRESS       *GroupAddress       OPTIONAL\r
   );\r
 \r
+/**\r
+  The heart beat timer of IP4 service instance. It times out\r
+  all of its IP4 children's received-but-not-delivered and\r
+  transmitted-but-not-recycle packets, and provides time input\r
+  for its IGMP protocol.\r
+\r
+  @param[in]  Event                  The IP4 service instance's heart beat timer.\r
+  @param[in]  Context                The IP4 service instance.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 Ip4TimerTicking (\r
@@ -253,6 +318,20 @@ Ip4TimerTicking (
   IN VOID                   *Context\r
   );\r
 \r
+/**\r
+  Decrease the life of the transmitted packets. If it is\r
+  decreased to zero, cancel the packet. This function is\r
+  called by Ip4PacketTimerTicking which time out both the\r
+  received-but-not-delivered and transmitted-but-not-recycle\r
+  packets.\r
+\r
+  @param[in]  Map                    The IP4 child's transmit map.\r
+  @param[in]  Item                   Current transmitted packet\r
+  @param[in]  Context                Not used.\r
+\r
+  @retval EFI_SUCCESS            Always returns EFI_SUCCESS\r
+\r
+**/\r
 EFI_STATUS\r
 Ip4SentPacketTicking (\r
   IN NET_MAP                *Map,\r