\r
\r
/**\r
- This function create an ip child ,open the IP protocol, return the opened\r
- Ip protocol to Interface.\r
+ This function create an IP child, open the IP protocol and return the opened\r
+ IP protocol as Interface.\r
\r
@param ControllerHandle The controller handle.\r
@param ImageHandle The image handle.\r
- @param ChildHandle Pointer to the buffer to save the ip child handle.\r
- @param Interface Pointer used to get the ip protocol interface.\r
+ @param ChildHandle Pointer to the buffer to save the IP child handle.\r
+ @param Interface Pointer used to get the IP protocol interface.\r
\r
- @retval EFI_SUCCESS The ip child is created and the ip protocol\r
+ @retval EFI_SUCCESS The IP child is created and the IP protocol\r
interface is retrieved.\r
- @retval other The required operation failed.\r
+ @retval Other The required operation failed.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
- This function close the previously openned ip protocol and destroy the ip child.\r
+ This function close the previously openned IP protocol and destroy the IP child.\r
\r
@param ControllerHandle The controller handle.\r
@param ImageHandle the image handle.\r
- @param ChildHandle The child handle of the ip child.\r
+ @param ChildHandle The child handle of the IP child.\r
\r
- @retval EFI_SUCCESS The ip protocol is closed and the relevant ip child\r
+ @retval EFI_SUCCESS The IP protocol is closed and the relevant IP child\r
is destroyed.\r
- @retval other The required operation failed.\r
+ @retval Other The required operation failed.\r
\r
**/\r
EFI_STATUS\r
\r
\r
/**\r
- Handle ICMP packets.\r
+ This function handles ICMP packets.\r
\r
@param IpIo Pointer to the IP_IO instance.\r
@param Pkt Pointer to the ICMP packet.\r
\r
\r
/**\r
- Ext free function for net buffer. This function is\r
- called when the net buffer is freed. It is used to\r
+ Free function for receive token of IP_IO. It is used to\r
signal the recycle event to notify IP to recycle the\r
data buffer.\r
\r
@param Event The event to be signaled.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
IpIoExtFree (\r
@param Override Pointer to the overriden IP_IO data.\r
\r
@return Pointer to the data structure created to wrap the packet. If NULL,\r
- @return resource limit occurred.\r
+ resource limit occurred.\r
\r
**/\r
IP_IO_SEND_ENTRY *\r
\r
/**\r
Destroy the SndEntry.\r
+ \r
+ This function pairs with IpIoCreateSndEntry().\r
\r
@param SndEntry Pointer to the send entry to be destroyed.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
IpIoDestroySndEntry (\r
\r
@param Context The context passed in by the event notifier.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
EFIAPI\r
@param Event The event signaled.\r
@param Context The context passed in by the event notifier.\r
\r
- @return None.\r
-\r
**/\r
\r
VOID\r
\r
@param Context The context passed in by the event notifier.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
EFIAPI\r
@param Event The event signaled.\r
@param Context The context passed in by the event notifier.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
EFIAPI\r
\r
@param Context The context passed in by the event notifier.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
EFIAPI\r
\r
/**\r
Create a new IP_IO instance.\r
+ \r
+ This function uses IP4 service binding protocol in Controller to create an IP4\r
+ child (aka IP4 instance).\r
\r
- @param Image The image handle of an IP_IO consumer protocol.\r
- @param Controller The controller handle of an IP_IO consumer protocol\r
- installed on.\r
+ @param Image The image handle of the driver or application that\r
+ consumes IP_IO.\r
+ @param Controller The controller handle that has IP4 service binding\r
+ protocol installed.\r
\r
- @return Pointer to a newly created IP_IO instance.\r
+ @return Pointer to a newly created IP_IO instance, or NULL if failed.\r
\r
**/\r
IP_IO *\r
\r
/**\r
Open an IP_IO instance for use.\r
+ \r
+ This function is called after IpIoCreate(). It is used for configuring the IP\r
+ instance and register the callbacks and their context data for sending and\r
+ receiving IP packets.\r
\r
@param IpIo Pointer to an IP_IO instance that needs to open.\r
- @param OpenData The configuration data for the IP_IO instance.\r
+ @param OpenData The configuration data and callbacks for the IP_IO\r
+ instance.\r
\r
@retval EFI_SUCCESS The IP_IO instance opened with OpenData\r
successfully.\r
- @retval other Error condition occurred.\r
+ @retval Other Error condition occurred.\r
\r
**/\r
EFI_STATUS\r
\r
/**\r
Stop an IP_IO instance.\r
+ \r
+ This function is paired with IpIoOpen(). The IP_IO will be unconfigured and all\r
+ the pending send/receive tokens will be canceled.\r
\r
@param IpIo Pointer to the IP_IO instance that needs to stop.\r
\r
@retval EFI_SUCCESS The IP_IO instance stopped successfully.\r
- @retval other Error condition occurred.\r
+ @retval Other Error condition occurred.\r
\r
**/\r
EFI_STATUS\r
+EFIAPI\r
IpIoStop (\r
IN IP_IO *IpIo\r
)\r
\r
/**\r
Destroy an IP_IO instance.\r
+ \r
+ This function is paired with IpIoCreate(). The IP_IO will be closed first.\r
+ Resource will be freed afterwards. See IpIoClose().\r
\r
- @param IpIo Pointer to the IP_IO instance that needs to\r
- destroy.\r
+ @param IpIo Pointer to the IP_IO instance that needs to be\r
+ destroyed.\r
\r
@retval EFI_SUCCESS The IP_IO instance destroyed successfully.\r
- @retval other Error condition occurred.\r
+ @retval Other Error condition occurred.\r
\r
**/\r
EFI_STATUS\r
\r
/**\r
Send out an IP packet.\r
+ \r
+ This function is called after IpIoOpen(). The data to be sent are wrapped in\r
+ Pkt. The IP instance wrapped in IpIo is used for sending by default but can be\r
+ overriden by Sender. Other sending configs, like source address and gateway\r
+ address etc., are specified in OverrideData.\r
\r
@param IpIo Pointer to an IP_IO instance used for sending IP\r
packet.\r
@param Pkt Pointer to the IP packet to be sent.\r
@param Sender The IP protocol instance used for sending.\r
- @param NotifyData\r
+ @param Context Optional context data\r
+ @param NotifyData Optional notify data\r
@param Dest The destination IP address to send this packet to.\r
@param OverrideData The data to override some configuration of the IP\r
instance used for sending.\r
IpIoSend (\r
IN IP_IO *IpIo,\r
IN NET_BUF *Pkt,\r
- IN IP_IO_IP_INFO *Sender,\r
- IN VOID *Context OPTIONAL,\r
- IN VOID *NotifyData OPTIONAL,\r
+ IN IP_IO_IP_INFO *Sender OPTIONAL,\r
+ IN VOID *Context OPTIONAL,\r
+ IN VOID *NotifyData OPTIONAL,\r
IN IP4_ADDR Dest,\r
- IN IP_IO_OVERRIDE *OverrideData\r
+ IN IP_IO_OVERRIDE *OverrideData OPTIONAL\r
)\r
{\r
EFI_STATUS Status;\r
Cancel the IP transmit token which wraps this Packet.\r
\r
@param IpIo Pointer to the IP_IO instance.\r
- @param Packet Pointer to the packet to cancel.\r
-\r
- @return N/A.\r
+ @param Packet Pointer to the packet of NET_BUF to cancel.\r
\r
**/\r
VOID\r
\r
/**\r
Add a new IP instance for sending data.\r
+ \r
+ The function is used to add the IP_IO to the IP_IO sending list. The caller\r
+ can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send\r
+ data.\r
\r
@param IpIo Pointer to a IP_IO instance to add a new IP\r
instance for sending purpose.\r
\r
- @return Pointer to the created IP_IO_IP_INFO structure, NULL is failed.\r
+ @return Pointer to the created IP_IO_IP_INFO structure, NULL if failed.\r
\r
**/\r
IP_IO_IP_INFO *\r
is not NULL.\r
\r
@param IpInfo Pointer to the IP_IO_IP_INFO instance.\r
- @param Ip4ConfigData The IP4 configure data used to configure the ip\r
- instance, if NULL the ip instance is reseted. If\r
+ @param Ip4ConfigData The IP4 configure data used to configure the IP\r
+ instance, if NULL the IP instance is reset. If\r
UseDefaultAddress is set to TRUE, and the configure\r
operation succeeds, the default address information\r
is written back in this Ip4ConfigData.\r
\r
@retval EFI_STATUS The status returned by IP4->Configure or\r
IP4->Receive.\r
+ @retval Other Configuration fails.\r
\r
**/\r
EFI_STATUS\r
/**\r
Destroy an IP instance maintained in IpIo->IpList for\r
sending purpose.\r
+ \r
+ This function pairs with IpIoAddIp(). The IpInfo is previously created by\r
+ IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance\r
+ will be dstroyed if the RefCnt is zero.\r
\r
@param IpIo Pointer to the IP_IO instance.\r
@param IpInfo Pointer to the IpInfo to be removed.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
EFIAPI\r
IpIoRemoveIp (\r
- IN IP_IO *IpIo,\r
- IN IP_IO_IP_INFO *IpInfo\r
+ IN IP_IO *IpIo,\r
+ IN IP_IO_IP_INFO *IpInfo\r
)\r
{\r
ASSERT (IpInfo->RefCnt > 0);\r
/**\r
Find the first IP protocol maintained in IpIo whose local\r
address is the same with Src.\r
+ \r
+ This function is called when the caller needs the IpIo to send data to the\r
+ specified Src. The IpIo was added previously by IpIoAddIp().\r
\r
@param IpIo Pointer to the pointer of the IP_IO instance.\r
@param Src The local IP address.\r
\r
@return Pointer to the IP protocol can be used for sending purpose and its local\r
- @return address is the same with Src.\r
+ address is the same with Src.\r
\r
**/\r
IP_IO_IP_INFO *\r
\r
\r
/**\r
- Get the ICMP error map information, the ErrorStatus will be returned.\r
- The IsHard and Notify are optional. If they are not NULL, this rouine will\r
- fill them.\r
- We move IcmpErrMap[] to local variable to enable EBC build.\r
+ Get the ICMP error map information.\r
+ \r
+ The ErrorStatus will be returned. The IsHard and Notify are optional. If they\r
+ are not NULL, this routine will fill them.\r
\r
@param IcmpError IcmpError Type\r
@param IsHard Whether it is a hard error\r
EFIAPI\r
IpIoGetIcmpErrStatus (\r
IN ICMP_ERROR IcmpError,\r
- OUT BOOLEAN *IsHard, OPTIONAL\r
- OUT BOOLEAN *Notify OPTIONAL\r
+ OUT BOOLEAN *IsHard OPTIONAL,\r
+ OUT BOOLEAN *Notify OPTIONAL\r
)\r
{\r
ASSERT ((IcmpError >= ICMP_ERR_UNREACH_NET) && (IcmpError <= ICMP_ERR_PARAMPROB));\r