MdeModulePkg: Update Ip4Dxe driver to support Ip4Config2 protocol,
and also add new UI configuration support in Ip4Dxe driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: jiaxinwu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17853 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implement IP4 pesudo interface.
|
||||
|
||||
Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
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
|
||||
@@ -423,12 +423,12 @@ Ip4CancelFrameArp (
|
||||
either queued on ARP queues or that have already been delivered to
|
||||
MNP and not yet recycled.
|
||||
|
||||
@param[in] Interface Interface to remove the frames from
|
||||
@param[in] Interface Interface to remove the frames from.
|
||||
@param[in] IoStatus The transmit status returned to the frames'
|
||||
callback
|
||||
callback.
|
||||
@param[in] FrameToCancel Function to select the frame to cancel, NULL to
|
||||
select all
|
||||
@param[in] Context Opaque parameters passed to FrameToCancel
|
||||
select all.
|
||||
@param[in] Context Opaque parameters passed to FrameToCancel.
|
||||
|
||||
**/
|
||||
VOID
|
||||
@@ -476,10 +476,10 @@ Ip4CancelFrames (
|
||||
the interface is configured.
|
||||
|
||||
@param[in] Mnp The shared MNP child of this IP4 service binding
|
||||
instance
|
||||
instance.
|
||||
@param[in] Controller The controller this IP4 service binding instance
|
||||
is installed. Most like the UNDI handle.
|
||||
@param[in] ImageHandle This driver's image handle
|
||||
@param[in] ImageHandle This driver's image handle.
|
||||
|
||||
@return Point to the created IP4_INTERFACE, otherwise NULL.
|
||||
|
||||
@@ -542,9 +542,9 @@ Ip4CreateInterface (
|
||||
Set the interface's address, create and configure
|
||||
the ARP child if necessary.
|
||||
|
||||
@param Interface The interface to set the address
|
||||
@param IpAddr The interface's IP address
|
||||
@param SubnetMask The interface's netmask
|
||||
@param Interface The interface to set the address.
|
||||
@param IpAddr The interface's IP address.
|
||||
@param SubnetMask The interface's netmask.
|
||||
|
||||
@retval EFI_SUCCESS The interface is configured with Ip/netmask pair,
|
||||
and a ARP is created for it.
|
||||
@@ -566,8 +566,6 @@ Ip4SetAddress (
|
||||
|
||||
NET_CHECK_SIGNATURE (Interface, IP4_INTERFACE_SIGNATURE);
|
||||
|
||||
ASSERT (!Interface->Configured);
|
||||
|
||||
//
|
||||
// Set the ip/netmask, then compute the subnet broadcast
|
||||
// and network broadcast for easy access. When computing
|
||||
@@ -587,13 +585,35 @@ Ip4SetAddress (
|
||||
Netmask = gIp4AllMasks[MIN (Len, Type << 3)];
|
||||
Interface->NetBrdcast = (IpAddr | ~Netmask);
|
||||
|
||||
//
|
||||
// Do clean up for Arp child
|
||||
//
|
||||
if (Interface->ArpHandle != NULL) {
|
||||
if (Interface->Arp != NULL) {
|
||||
gBS->CloseProtocol (
|
||||
Interface->ArpHandle,
|
||||
&gEfiArpProtocolGuid,
|
||||
Interface->Image,
|
||||
Interface->Controller
|
||||
);
|
||||
|
||||
Interface->Arp = NULL;
|
||||
}
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Interface->Controller,
|
||||
Interface->Image,
|
||||
&gEfiArpServiceBindingProtocolGuid,
|
||||
&Interface->ArpHandle
|
||||
);
|
||||
|
||||
Interface->ArpHandle = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// If the address is NOT all zero, create then configure an ARP child.
|
||||
// Pay attention: DHCP configures its station address as 0.0.0.0/0
|
||||
//
|
||||
Interface->Arp = NULL;
|
||||
Interface->ArpHandle = NULL;
|
||||
|
||||
if (IpAddr != IP4_ALLZERO_ADDRESS) {
|
||||
Status = NetLibCreateServiceChild (
|
||||
Interface->Controller,
|
||||
@@ -603,7 +623,7 @@ Ip4SetAddress (
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;;
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
@@ -631,11 +651,11 @@ Ip4SetAddress (
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
gBS->CloseProtocol (
|
||||
Interface->ArpHandle,
|
||||
&gEfiArpProtocolGuid,
|
||||
Interface->Image,
|
||||
Interface->Controller
|
||||
);
|
||||
Interface->ArpHandle,
|
||||
&gEfiArpProtocolGuid,
|
||||
Interface->Image,
|
||||
Interface->Controller
|
||||
);
|
||||
|
||||
goto ON_ERROR;
|
||||
}
|
||||
@@ -721,7 +741,7 @@ Ip4CancelReceive (
|
||||
Because the IpInstance is optional, the caller must remove
|
||||
IpInstance from the interface's instance list itself.
|
||||
|
||||
@param[in] Interface The interface used by the IpInstance
|
||||
@param[in] Interface The interface used by the IpInstance.
|
||||
@param[in] IpInstance The Ip instance that free the interface. NULL if
|
||||
the Ip driver is releasing the default interface.
|
||||
|
||||
@@ -1197,14 +1217,14 @@ Ip4OnFrameReceived (
|
||||
/**
|
||||
Request to receive the packet from the interface.
|
||||
|
||||
@param[in] Interface The interface to receive the frames from
|
||||
@param[in] Interface The interface to receive the frames from.
|
||||
@param[in] IpInstance The instance that requests the receive. NULL for
|
||||
the driver itself.
|
||||
@param[in] CallBack Function to call when receive finished.
|
||||
@param[in] Context Opaque parameter to the callback
|
||||
@param[in] Context Opaque parameter to the callback.
|
||||
|
||||
@retval EFI_ALREADY_STARTED There is already a pending receive request.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource to receive
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate resource to receive.
|
||||
@retval EFI_SUCCESS The recieve request has been started.
|
||||
@retval other Other error occurs.
|
||||
|
||||
|
Reference in New Issue
Block a user