mirror of https://github.com/acidanthera/audk.git
checking coding style issues:
correct include file path delete unused include files fix ECC error and so on git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7241 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
67d1416a43
commit
6aac5e5ff0
|
@ -1,6 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
IpIo Library.
|
||||||
|
|
||||||
Copyright (c) 2005 - 2007, Intel Corporation
|
Copyright (c) 2005 - 2007, Intel Corporation.<BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -8,19 +9,9 @@ http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
IpIo.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
The implementation of the IpIo layer.
|
|
||||||
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <PiDxe.h>
|
#include <Uefi.h>
|
||||||
|
|
||||||
#include <Protocol/Udp4.h>
|
#include <Protocol/Udp4.h>
|
||||||
|
|
||||||
|
@ -28,14 +19,8 @@ Abstract:
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
#include <Library/MemoryAllocationLib.h>
|
|
||||||
#include <Library/BaseMemoryLib.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define NET_PROTO_HDR(Buf, Type) ((Type *) ((Buf)->BlockOp[0].Head))
|
|
||||||
#define ICMP_ERRLEN(IpHdr) \
|
|
||||||
(sizeof(IP4_ICMP_HEAD) + EFI_IP4_HEADER_LEN(IpHdr) + 8)
|
|
||||||
|
|
||||||
LIST_ENTRY mActiveIpIoList = {
|
LIST_ENTRY mActiveIpIoList = {
|
||||||
&mActiveIpIoList,
|
&mActiveIpIoList,
|
||||||
&mActiveIpIoList
|
&mActiveIpIoList
|
||||||
|
@ -71,12 +56,27 @@ ICMP_ERROR_INFO mIcmpErrMap[10] = {
|
||||||
{FALSE, TRUE}
|
{FALSE, TRUE}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Notify function for IP transmit token.
|
||||||
|
|
||||||
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoTransmitHandlerDpc (
|
IpIoTransmitHandlerDpc (
|
||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Notify function for IP transmit token.
|
||||||
|
|
||||||
|
@param[in] Event The event signaled.
|
||||||
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoTransmitHandler (
|
IpIoTransmitHandler (
|
||||||
|
@ -86,17 +86,17 @@ IpIoTransmitHandler (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function create an IP child, open the IP protocol and return the opened
|
This function create an IP child ,open the IP protocol, and return the opened
|
||||||
IP protocol as Interface.
|
IP protocol as Interface.
|
||||||
|
|
||||||
@param ControllerHandle The controller handle.
|
@param[in] ControllerHandle The controller handle.
|
||||||
@param ImageHandle The image handle.
|
@param[in] ImageHandle The image handle.
|
||||||
@param ChildHandle Pointer to the buffer to save the IP child handle.
|
@param[in] ChildHandle Pointer to the buffer to save the IP child handle.
|
||||||
@param Interface Pointer used to get the IP protocol interface.
|
@param[out] Interface Pointer used to get the IP protocol interface.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The IP child is created and the IP protocol
|
@retval EFI_SUCCESS The IP child is created and the IP protocol
|
||||||
interface is retrieved.
|
interface is retrieved.
|
||||||
@retval Other The required operation failed.
|
@retval Others The required operation failed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -110,7 +110,7 @@ IpIoCreateIpChildOpenProtocol (
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create an ip child.
|
// Create an IP child.
|
||||||
//
|
//
|
||||||
Status = NetLibCreateServiceChild (
|
Status = NetLibCreateServiceChild (
|
||||||
ControllerHandle,
|
ControllerHandle,
|
||||||
|
@ -123,7 +123,7 @@ IpIoCreateIpChildOpenProtocol (
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open the ip protocol installed on the *ChildHandle.
|
// Open the IP protocol installed on the *ChildHandle.
|
||||||
//
|
//
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
*ChildHandle,
|
*ChildHandle,
|
||||||
|
@ -135,7 +135,7 @@ IpIoCreateIpChildOpenProtocol (
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
//
|
//
|
||||||
// On failure, destroy the ip child.
|
// On failure, destroy the IP child.
|
||||||
//
|
//
|
||||||
NetLibDestroyServiceChild (
|
NetLibDestroyServiceChild (
|
||||||
ControllerHandle,
|
ControllerHandle,
|
||||||
|
@ -152,13 +152,13 @@ IpIoCreateIpChildOpenProtocol (
|
||||||
/**
|
/**
|
||||||
This function close the previously openned IP protocol and destroy the IP child.
|
This function close the previously openned IP protocol and destroy the IP child.
|
||||||
|
|
||||||
@param ControllerHandle The controller handle.
|
@param[in] ControllerHandle The controller handle.
|
||||||
@param ImageHandle the image handle.
|
@param[in] ImageHandle The image handle.
|
||||||
@param ChildHandle The child handle of the IP child.
|
@param[in] ChildHandle The child handle of the IP child.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The IP protocol is closed and the relevant IP child
|
@retval EFI_SUCCESS The IP protocol is closed and the relevant IP child
|
||||||
is destroyed.
|
is destroyed.
|
||||||
@retval Other The required operation failed.
|
@retval Others The required operation failed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -171,7 +171,7 @@ IpIoCloseProtocolDestroyIpChild (
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Close the previously openned ip protocol.
|
// Close the previously openned IP protocol.
|
||||||
//
|
//
|
||||||
gBS->CloseProtocol (
|
gBS->CloseProtocol (
|
||||||
ChildHandle,
|
ChildHandle,
|
||||||
|
@ -181,7 +181,7 @@ IpIoCloseProtocolDestroyIpChild (
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Destroy the ip child.
|
// Destroy the IP child.
|
||||||
//
|
//
|
||||||
Status = NetLibDestroyServiceChild (
|
Status = NetLibDestroyServiceChild (
|
||||||
ControllerHandle,
|
ControllerHandle,
|
||||||
|
@ -197,19 +197,19 @@ IpIoCloseProtocolDestroyIpChild (
|
||||||
/**
|
/**
|
||||||
This function handles ICMP packets.
|
This function handles ICMP packets.
|
||||||
|
|
||||||
@param IpIo Pointer to the IP_IO instance.
|
@param[in] IpIo Pointer to the IP_IO instance.
|
||||||
@param Pkt Pointer to the ICMP packet.
|
@param[in, out] Pkt Pointer to the ICMP packet.
|
||||||
@param Session Pointer to the net session of this ICMP packet.
|
@param[in] Session Pointer to the net session of this ICMP packet.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The ICMP packet is handled successfully.
|
@retval EFI_SUCCESS The ICMP packet is handled successfully.
|
||||||
@retval EFI_ABORTED This type of ICMP packet is not supported.
|
@retval EFI_ABORTED This type of ICMP packet is not supported.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
IpIoIcmpHandler (
|
IpIoIcmpHandler (
|
||||||
IN IP_IO *IpIo,
|
IN IP_IO *IpIo,
|
||||||
IN NET_BUF *Pkt,
|
IN OUT NET_BUF *Pkt,
|
||||||
IN EFI_NET_SESSION_DATA *Session
|
IN EFI_NET_SESSION_DATA *Session
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IP4_ICMP_ERROR_HEAD *IcmpHdr;
|
IP4_ICMP_ERROR_HEAD *IcmpHdr;
|
||||||
|
@ -271,8 +271,6 @@ IpIoIcmpHandler (
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return EFI_ABORTED;
|
return EFI_ABORTED;
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -306,8 +304,6 @@ IpIoIcmpHandler (
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return EFI_ABORTED;
|
return EFI_ABORTED;
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -330,7 +326,7 @@ IpIoIcmpHandler (
|
||||||
signal the recycle event to notify IP to recycle the
|
signal the recycle event to notify IP to recycle the
|
||||||
data buffer.
|
data buffer.
|
||||||
|
|
||||||
@param Event The event to be signaled.
|
@param[in] Event The event to be signaled.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -346,26 +342,27 @@ IpIoExtFree (
|
||||||
Create a send entry to wrap a packet before sending
|
Create a send entry to wrap a packet before sending
|
||||||
out it through IP.
|
out it through IP.
|
||||||
|
|
||||||
@param IpIo Pointer to the IP_IO instance.
|
@param[in, out] IpIo Pointer to the IP_IO instance.
|
||||||
@param Pkt Pointer to the packet.
|
@param[in, out] Pkt Pointer to the packet.
|
||||||
@param Sender Pointer to the IP sender.
|
@param[in] Sender Pointer to the IP sender.
|
||||||
@param NotifyData Pointer to the notify data.
|
@param[in] Context Pointer to the context.
|
||||||
@param Dest Pointer to the destination IP address.
|
@param[in] NotifyData Pointer to the notify data.
|
||||||
@param Override Pointer to the overriden IP_IO data.
|
@param[in] Dest Pointer to the destination IP address.
|
||||||
|
@param[in] Override Pointer to the overriden IP_IO data.
|
||||||
|
|
||||||
@return Pointer to the data structure created to wrap the packet. If NULL,
|
@return Pointer to the data structure created to wrap the packet. If NULL,
|
||||||
resource limit occurred.
|
@return resource limit occurred.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
IP_IO_SEND_ENTRY *
|
IP_IO_SEND_ENTRY *
|
||||||
IpIoCreateSndEntry (
|
IpIoCreateSndEntry (
|
||||||
IN IP_IO *IpIo,
|
IN OUT IP_IO *IpIo,
|
||||||
IN NET_BUF *Pkt,
|
IN OUT NET_BUF *Pkt,
|
||||||
IN EFI_IP4_PROTOCOL *Sender,
|
IN EFI_IP4_PROTOCOL *Sender,
|
||||||
IN VOID *Context OPTIONAL,
|
IN VOID *Context OPTIONAL,
|
||||||
IN VOID *NotifyData OPTIONAL,
|
IN VOID *NotifyData OPTIONAL,
|
||||||
IN IP4_ADDR Dest,
|
IN IP4_ADDR Dest,
|
||||||
IN IP_IO_OVERRIDE *Override
|
IN IP_IO_OVERRIDE *Override
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IP_IO_SEND_ENTRY *SndEntry;
|
IP_IO_SEND_ENTRY *SndEntry;
|
||||||
|
@ -455,7 +452,7 @@ IpIoCreateSndEntry (
|
||||||
// Set the fields of SndEntry
|
// Set the fields of SndEntry
|
||||||
//
|
//
|
||||||
SndEntry->IpIo = IpIo;
|
SndEntry->IpIo = IpIo;
|
||||||
SndEntry->Ip = Sender;
|
SndEntry->Ip = Sender;
|
||||||
SndEntry->Context = Context;
|
SndEntry->Context = Context;
|
||||||
SndEntry->NotifyData = NotifyData;
|
SndEntry->NotifyData = NotifyData;
|
||||||
|
|
||||||
|
@ -489,7 +486,7 @@ ReleaseSndEntry:
|
||||||
|
|
||||||
This function pairs with IpIoCreateSndEntry().
|
This function pairs with IpIoCreateSndEntry().
|
||||||
|
|
||||||
@param SndEntry Pointer to the send entry to be destroyed.
|
@param[in] SndEntry Pointer to the send entry to be destroyed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -519,7 +516,7 @@ IpIoDestroySndEntry (
|
||||||
/**
|
/**
|
||||||
Notify function for IP transmit token.
|
Notify function for IP transmit token.
|
||||||
|
|
||||||
@param Context The context passed in by the event notifier.
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -547,14 +544,14 @@ IpIoTransmitHandlerDpc (
|
||||||
IpIoDestroySndEntry (SndEntry);
|
IpIoDestroySndEntry (SndEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Notify function for IP transmit token.
|
Notify function for IP transmit token.
|
||||||
|
|
||||||
@param Event The event signaled.
|
@param[in] Event The event signaled.
|
||||||
@param Context The context passed in by the event notifier.
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoTransmitHandler (
|
IpIoTransmitHandler (
|
||||||
|
@ -572,7 +569,7 @@ IpIoTransmitHandler (
|
||||||
/**
|
/**
|
||||||
The dummy handler for the dummy IP receive token.
|
The dummy handler for the dummy IP receive token.
|
||||||
|
|
||||||
@param Context The context passed in by the event notifier.
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -593,7 +590,7 @@ IpIoDummyHandlerDpc (
|
||||||
//
|
//
|
||||||
return;
|
return;
|
||||||
} else if (EFI_SUCCESS == DummyToken->Status) {
|
} else if (EFI_SUCCESS == DummyToken->Status) {
|
||||||
ASSERT (DummyToken->Packet.RxData);
|
ASSERT ((DummyToken->Packet.RxData)!= NULL);
|
||||||
|
|
||||||
gBS->SignalEvent (DummyToken->Packet.RxData->RecycleSignal);
|
gBS->SignalEvent (DummyToken->Packet.RxData->RecycleSignal);
|
||||||
}
|
}
|
||||||
|
@ -603,10 +600,10 @@ IpIoDummyHandlerDpc (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Request IpIoDummyHandlerDpc as a DPC at TPL_CALLBACK.
|
This function add IpIoDummyHandlerDpc to the end of the DPC queue.
|
||||||
|
|
||||||
@param Event The event signaled.
|
@param[in] Event The event signaled.
|
||||||
@param Context The context passed in by the event notifier.
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -627,7 +624,7 @@ IpIoDummyHandler (
|
||||||
Notify function for the IP receive token, used to process
|
Notify function for the IP receive token, used to process
|
||||||
the received IP packets.
|
the received IP packets.
|
||||||
|
|
||||||
@param Context The context passed in by the event notifier.
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -658,9 +655,9 @@ IpIoListenHandlerDpc (
|
||||||
|
|
||||||
if (((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) || (NULL == RxData)) {
|
if (((EFI_SUCCESS != Status) && (EFI_ICMP_ERROR != Status)) || (NULL == RxData)) {
|
||||||
//
|
//
|
||||||
// Only process the normal packets and the icmp error packets, if RxData is NULL
|
// @bug Only process the normal packets and the icmp error packets, if RxData is NULL
|
||||||
// with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although
|
// @bug with Status == EFI_SUCCESS or EFI_ICMP_ERROR, just resume the receive although
|
||||||
// this should be a bug of the low layer (IP).
|
// @bug this should be a bug of the low layer (IP).
|
||||||
//
|
//
|
||||||
goto Resume;
|
goto Resume;
|
||||||
}
|
}
|
||||||
|
@ -723,12 +720,10 @@ Resume:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Request IpIoListenHandlerDpc as a DPC at TPL_CALLBACK
|
This function add IpIoListenHandlerDpc to the end of the DPC queue.
|
||||||
|
|
||||||
@param Event The event signaled.
|
@param[in] Event The event signaled.
|
||||||
@param Context The context passed in by the event notifier.
|
@param[in] Context The context passed in by the event notifier.
|
||||||
|
|
||||||
@return None.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -751,9 +746,9 @@ IpIoListenHandler (
|
||||||
This function uses IP4 service binding protocol in Controller to create an IP4
|
This function uses IP4 service binding protocol in Controller to create an IP4
|
||||||
child (aka IP4 instance).
|
child (aka IP4 instance).
|
||||||
|
|
||||||
@param Image The image handle of the driver or application that
|
@param[in] Image The image handle of the driver or application that
|
||||||
consumes IP_IO.
|
consumes IP_IO.
|
||||||
@param Controller The controller handle that has IP4 service binding
|
@param[in] Controller The controller handle that has IP4 service binding
|
||||||
protocol installed.
|
protocol installed.
|
||||||
|
|
||||||
@return Pointer to a newly created IP_IO instance, or NULL if failed.
|
@return Pointer to a newly created IP_IO instance, or NULL if failed.
|
||||||
|
@ -824,20 +819,23 @@ ReleaseIpIo:
|
||||||
instance and register the callbacks and their context data for sending and
|
instance and register the callbacks and their context data for sending and
|
||||||
receiving IP packets.
|
receiving IP packets.
|
||||||
|
|
||||||
@param IpIo Pointer to an IP_IO instance that needs to open.
|
@param[in, out] IpIo Pointer to an IP_IO instance that needs
|
||||||
@param OpenData The configuration data and callbacks for the IP_IO
|
to open.
|
||||||
instance.
|
@param[in] OpenData The configuration data and callbacks for
|
||||||
|
the IP_IO instance.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The IP_IO instance opened with OpenData
|
@retval EFI_SUCCESS The IP_IO instance opened with OpenData
|
||||||
successfully.
|
successfully.
|
||||||
@retval Other Error condition occurred.
|
@retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to
|
||||||
|
reopen it.
|
||||||
|
@retval Others Error condition occurred.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoOpen (
|
IpIoOpen (
|
||||||
IN IP_IO *IpIo,
|
IN OUT IP_IO *IpIo,
|
||||||
IN IP_IO_OPEN_DATA *OpenData
|
IN IP_IO_OPEN_DATA *OpenData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -858,9 +856,9 @@ IpIoOpen (
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// bugbug: to delete the default route entry in this Ip, if it is:
|
// @bug To delete the default route entry in this Ip, if it is:
|
||||||
// (0.0.0.0, 0.0.0.0, 0.0.0.0). Delete this statement if Ip modified
|
// @bug (0.0.0.0, 0.0.0.0, 0.0.0.0). Delete this statement if Ip modified
|
||||||
// its code
|
// @bug its code
|
||||||
//
|
//
|
||||||
Status = Ip->Routes (Ip, TRUE, &mZeroIp4Addr, &mZeroIp4Addr, &mZeroIp4Addr);
|
Status = Ip->Routes (Ip, TRUE, &mZeroIp4Addr, &mZeroIp4Addr, &mZeroIp4Addr);
|
||||||
|
|
||||||
|
@ -900,16 +898,16 @@ ErrorExit:
|
||||||
This function is paired with IpIoOpen(). The IP_IO will be unconfigured and all
|
This function is paired with IpIoOpen(). The IP_IO will be unconfigured and all
|
||||||
the pending send/receive tokens will be canceled.
|
the pending send/receive tokens will be canceled.
|
||||||
|
|
||||||
@param IpIo Pointer to the IP_IO instance that needs to stop.
|
@param[in, out] IpIo Pointer to the IP_IO instance that needs to stop.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The IP_IO instance stopped successfully.
|
@retval EFI_SUCCESS The IP_IO instance stopped successfully.
|
||||||
@retval Other Error condition occurred.
|
@retval Others Error condition occurred.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoStop (
|
IpIoStop (
|
||||||
IN IP_IO *IpIo
|
IN OUT IP_IO *IpIo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -948,7 +946,7 @@ IpIoStop (
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// All pending snd tokens should be flushed by reseting the IP instances.
|
// All pending send tokens should be flushed by reseting the IP instances.
|
||||||
//
|
//
|
||||||
ASSERT (IsListEmpty (&IpIo->PendingSndList));
|
ASSERT (IsListEmpty (&IpIo->PendingSndList));
|
||||||
|
|
||||||
|
@ -967,17 +965,17 @@ IpIoStop (
|
||||||
This function is paired with IpIoCreate(). The IP_IO will be closed first.
|
This function is paired with IpIoCreate(). The IP_IO will be closed first.
|
||||||
Resource will be freed afterwards. See IpIoClose().
|
Resource will be freed afterwards. See IpIoClose().
|
||||||
|
|
||||||
@param IpIo Pointer to the IP_IO instance that needs to be
|
@param[in, out] IpIo Pointer to the IP_IO instance that needs to be
|
||||||
destroyed.
|
destroyed.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The IP_IO instance destroyed successfully.
|
@retval EFI_SUCCESS The IP_IO instance destroyed successfully.
|
||||||
@retval Other Error condition occurred.
|
@retval Others Error condition occurred.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoDestroy (
|
IpIoDestroy (
|
||||||
IN IP_IO *IpIo
|
IN OUT IP_IO *IpIo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -1004,31 +1002,31 @@ IpIoDestroy (
|
||||||
overriden by Sender. Other sending configs, like source address and gateway
|
overriden by Sender. Other sending configs, like source address and gateway
|
||||||
address etc., are specified in OverrideData.
|
address etc., are specified in OverrideData.
|
||||||
|
|
||||||
@param IpIo Pointer to an IP_IO instance used for sending IP
|
@param[in, out] IpIo Pointer to an IP_IO instance used for sending IP
|
||||||
packet.
|
packet.
|
||||||
@param Pkt Pointer to the IP packet to be sent.
|
@param[in, out] Pkt Pointer to the IP packet to be sent.
|
||||||
@param Sender The IP protocol instance used for sending.
|
@param[in] Sender The IP protocol instance used for sending.
|
||||||
@param Context Optional context data
|
@param[in] Context Optional context data
|
||||||
@param NotifyData Optional notify data
|
@param[in] NotifyData Optional notify data
|
||||||
@param Dest The destination IP address to send this packet to.
|
@param[in] Dest The destination IP address to send this packet to.
|
||||||
@param OverrideData The data to override some configuration of the IP
|
@param[in] OverrideData The data to override some configuration of the IP
|
||||||
instance used for sending.
|
instance used for sending.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The operation is completed successfully.
|
@retval EFI_SUCCESS The operation is completed successfully.
|
||||||
@retval EFI_NOT_STARTED The IpIo is not configured.
|
@retval EFI_NOT_STARTED The IpIo is not configured.
|
||||||
@retval EFI_OUT_OF_RESOURCES Failed due to resource limit.
|
@retval EFI_OUT_OF_RESOURCES Failed due to resource limit.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoSend (
|
IpIoSend (
|
||||||
IN IP_IO *IpIo,
|
IN OUT IP_IO *IpIo,
|
||||||
IN NET_BUF *Pkt,
|
IN OUT NET_BUF *Pkt,
|
||||||
IN IP_IO_IP_INFO *Sender OPTIONAL,
|
IN IP_IO_IP_INFO *Sender OPTIONAL,
|
||||||
IN VOID *Context OPTIONAL,
|
IN VOID *Context OPTIONAL,
|
||||||
IN VOID *NotifyData OPTIONAL,
|
IN VOID *NotifyData OPTIONAL,
|
||||||
IN IP4_ADDR Dest,
|
IN IP4_ADDR Dest,
|
||||||
IN IP_IO_OVERRIDE *OverrideData OPTIONAL
|
IN IP_IO_OVERRIDE *OverrideData OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -1064,8 +1062,8 @@ IpIoSend (
|
||||||
/**
|
/**
|
||||||
Cancel the IP transmit token which wraps this Packet.
|
Cancel the IP transmit token which wraps this Packet.
|
||||||
|
|
||||||
@param IpIo Pointer to the IP_IO instance.
|
@param[in] IpIo Pointer to the IP_IO instance.
|
||||||
@param Packet Pointer to the packet of NET_BUF to cancel.
|
@param[in] Packet Pointer to the packet of NET_BUF to cancel.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -1079,7 +1077,7 @@ IpIoCancelTxToken (
|
||||||
IP_IO_SEND_ENTRY *SndEntry;
|
IP_IO_SEND_ENTRY *SndEntry;
|
||||||
EFI_IP4_PROTOCOL *Ip;
|
EFI_IP4_PROTOCOL *Ip;
|
||||||
|
|
||||||
ASSERT (IpIo && Packet);
|
ASSERT ((IpIo)!= NULL && (Packet)!= NULL);
|
||||||
|
|
||||||
NET_LIST_FOR_EACH (Node, &IpIo->PendingSndList) {
|
NET_LIST_FOR_EACH (Node, &IpIo->PendingSndList) {
|
||||||
|
|
||||||
|
@ -1104,8 +1102,8 @@ IpIoCancelTxToken (
|
||||||
can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send
|
can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send
|
||||||
data.
|
data.
|
||||||
|
|
||||||
@param IpIo Pointer to a IP_IO instance to add a new IP
|
@param[in, out] IpIo Pointer to a IP_IO instance to add a new IP
|
||||||
instance for sending purpose.
|
instance for sending purpose.
|
||||||
|
|
||||||
@return Pointer to the created IP_IO_IP_INFO structure, NULL if failed.
|
@return Pointer to the created IP_IO_IP_INFO structure, NULL if failed.
|
||||||
|
|
||||||
|
@ -1113,13 +1111,13 @@ IpIoCancelTxToken (
|
||||||
IP_IO_IP_INFO *
|
IP_IO_IP_INFO *
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoAddIp (
|
IpIoAddIp (
|
||||||
IN IP_IO *IpIo
|
IN OUT IP_IO *IpIo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
IP_IO_IP_INFO *IpInfo;
|
IP_IO_IP_INFO *IpInfo;
|
||||||
|
|
||||||
ASSERT (IpIo);
|
ASSERT (IpIo != NULL);
|
||||||
|
|
||||||
IpInfo = AllocatePool (sizeof (IP_IO_IP_INFO));
|
IpInfo = AllocatePool (sizeof (IP_IO_IP_INFO));
|
||||||
if (IpInfo == NULL) {
|
if (IpInfo == NULL) {
|
||||||
|
@ -1190,22 +1188,22 @@ ReleaseIpInfo:
|
||||||
Configure the IP instance of this IpInfo and start the receiving if Ip4ConfigData
|
Configure the IP instance of this IpInfo and start the receiving if Ip4ConfigData
|
||||||
is not NULL.
|
is not NULL.
|
||||||
|
|
||||||
@param IpInfo Pointer to the IP_IO_IP_INFO instance.
|
@param[in, out] IpInfo Pointer to the IP_IO_IP_INFO instance.
|
||||||
@param Ip4ConfigData The IP4 configure data used to configure the IP
|
@param[in, out] Ip4ConfigData The IP4 configure data used to configure the IP
|
||||||
instance, if NULL the IP instance is reset. If
|
instance, if NULL the IP instance is reset. If
|
||||||
UseDefaultAddress is set to TRUE, and the configure
|
UseDefaultAddress is set to TRUE, and the configure
|
||||||
operation succeeds, the default address information
|
operation succeeds, the default address information
|
||||||
is written back in this Ip4ConfigData.
|
is written back in this Ip4ConfigData.
|
||||||
|
|
||||||
@retval EFI_STATUS The status returned by IP4->Configure or
|
@retval EFI_SUCCESS The IP instance of this IpInfo is configured successfully
|
||||||
IP4->Receive.
|
or no need to reconfigure it.
|
||||||
@retval Other Configuration fails.
|
@retval Others Configuration fails.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
IpIoConfigIp (
|
IpIoConfigIp (
|
||||||
IN IP_IO_IP_INFO *IpInfo,
|
IN OUT IP_IO_IP_INFO *IpInfo,
|
||||||
IN OUT EFI_IP4_CONFIG_DATA *Ip4ConfigData OPTIONAL
|
IN OUT EFI_IP4_CONFIG_DATA *Ip4ConfigData OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -1213,7 +1211,7 @@ IpIoConfigIp (
|
||||||
EFI_IP4_PROTOCOL *Ip;
|
EFI_IP4_PROTOCOL *Ip;
|
||||||
EFI_IP4_MODE_DATA Ip4ModeData;
|
EFI_IP4_MODE_DATA Ip4ModeData;
|
||||||
|
|
||||||
ASSERT (IpInfo);
|
ASSERT (IpInfo != NULL);
|
||||||
|
|
||||||
if (IpInfo->RefCnt > 1) {
|
if (IpInfo->RefCnt > 1) {
|
||||||
//
|
//
|
||||||
|
@ -1271,8 +1269,8 @@ OnExit:
|
||||||
IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance
|
IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance
|
||||||
will be dstroyed if the RefCnt is zero.
|
will be dstroyed if the RefCnt is zero.
|
||||||
|
|
||||||
@param IpIo Pointer to the IP_IO instance.
|
@param[in] IpIo Pointer to the IP_IO instance.
|
||||||
@param IpInfo Pointer to the IpInfo to be removed.
|
@param[in] IpInfo Pointer to the IpInfo to be removed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
|
@ -1310,11 +1308,11 @@ IpIoRemoveIp (
|
||||||
This function is called when the caller needs the IpIo to send data to the
|
This function is called when the caller needs the IpIo to send data to the
|
||||||
specified Src. The IpIo was added previously by IpIoAddIp().
|
specified Src. The IpIo was added previously by IpIoAddIp().
|
||||||
|
|
||||||
@param IpIo Pointer to the pointer of the IP_IO instance.
|
@param[in, out] IpIo Pointer to the pointer of the IP_IO instance.
|
||||||
@param Src The local IP address.
|
@param[in] Src The local IP address.
|
||||||
|
|
||||||
@return Pointer to the IP protocol can be used for sending purpose and its local
|
@return Pointer to the IP protocol can be used for sending purpose and its local
|
||||||
address is the same with Src.
|
@return address is the same with Src.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
IP_IO_IP_INFO *
|
IP_IO_IP_INFO *
|
||||||
|
@ -1359,11 +1357,11 @@ IpIoFindSender (
|
||||||
The ErrorStatus will be returned. The IsHard and Notify are optional. If they
|
The ErrorStatus will be returned. The IsHard and Notify are optional. If they
|
||||||
are not NULL, this routine will fill them.
|
are not NULL, this routine will fill them.
|
||||||
|
|
||||||
@param IcmpError IcmpError Type
|
@param[in] IcmpError IcmpError Type
|
||||||
@param IsHard Whether it is a hard error
|
@param[out] IsHard Whether it is a hard error
|
||||||
@param Notify Whether it need to notify SockError
|
@param[out] Notify Whether it need to notify SockError
|
||||||
|
|
||||||
@return ICMP Error Status
|
@return ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
|
Loading…
Reference in New Issue