1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support.
2. Fix the driver binding Stop() hang issue in the network stack. 3. Add Ip4 raw data support. 4. Add iSCSI Dhcp option 60 support. Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Ouyang Qian <qian.ouyang@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13995 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implementation of driver entry point and driver binding protocol.
|
||||
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2012, 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
|
||||
@@ -26,6 +26,50 @@ EFI_DRIVER_BINDING_PROTOCOL gMnpDriverBinding = {
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
Callback function which provided by user to remove one node in NetDestroyLinkList process.
|
||||
|
||||
@param[in] Entry The entry to be removed.
|
||||
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
|
||||
|
||||
@retval EFI_SUCCESS The entry has been removed successfully.
|
||||
@retval Others Fail to remove the entry.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
MnpDestroyServiceDataEntry (
|
||||
IN LIST_ENTRY *Entry,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
MNP_SERVICE_DATA *MnpServiceData;
|
||||
|
||||
MnpServiceData = MNP_SERVICE_DATA_FROM_LINK (Entry);
|
||||
return MnpDestroyServiceData (MnpServiceData);
|
||||
}
|
||||
|
||||
/**
|
||||
Callback function which provided by user to remove one node in NetDestroyLinkList process.
|
||||
|
||||
@param[in] Entry The entry to be removed.
|
||||
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
|
||||
|
||||
@retval EFI_SUCCESS The entry has been removed successfully.
|
||||
@retval Others Fail to remove the entry.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
MnpDestroyServiceChildEntry (
|
||||
IN LIST_ENTRY *Entry,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
MNP_SERVICE_DATA *MnpServiceData;
|
||||
|
||||
MnpServiceData = MNP_SERVICE_DATA_FROM_LINK (Entry);
|
||||
return MnpDestroyServiceChild (MnpServiceData);
|
||||
}
|
||||
|
||||
/**
|
||||
Test to see if this driver supports ControllerHandle. This service
|
||||
is called by the EFI boot service ConnectController(). In
|
||||
@@ -276,8 +320,8 @@ MnpDriverBindingStop (
|
||||
EFI_VLAN_CONFIG_PROTOCOL *VlanConfig;
|
||||
MNP_DEVICE_DATA *MnpDeviceData;
|
||||
MNP_SERVICE_DATA *MnpServiceData;
|
||||
BOOLEAN AllChildrenStopped;
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *List;
|
||||
UINTN ListLength;
|
||||
|
||||
//
|
||||
// Try to retrieve MNP service binding protocol from the ControllerHandle
|
||||
@@ -317,10 +361,15 @@ MnpDriverBindingStop (
|
||||
//
|
||||
// Destroy all MNP service data
|
||||
//
|
||||
while (!IsListEmpty (&MnpDeviceData->ServiceList)) {
|
||||
Entry = GetFirstNode (&MnpDeviceData->ServiceList);
|
||||
MnpServiceData = MNP_SERVICE_DATA_FROM_LINK (Entry);
|
||||
MnpDestroyServiceData (MnpServiceData);
|
||||
List = &MnpDeviceData->ServiceList;
|
||||
Status = NetDestroyLinkList (
|
||||
List,
|
||||
MnpDestroyServiceDataEntry,
|
||||
NULL,
|
||||
&ListLength
|
||||
);
|
||||
if (EFI_ERROR (Status) || ListLength !=0) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -341,23 +390,24 @@ MnpDriverBindingStop (
|
||||
MnpDestroyDeviceData (MnpDeviceData, This->DriverBindingHandle);
|
||||
FreePool (MnpDeviceData);
|
||||
|
||||
if (gMnpControllerNameTable != NULL) {
|
||||
FreeUnicodeStringTable (gMnpControllerNameTable);
|
||||
gMnpControllerNameTable = NULL;
|
||||
}
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Stop all MNP child
|
||||
//
|
||||
AllChildrenStopped = TRUE;
|
||||
NET_LIST_FOR_EACH (Entry, &MnpDeviceData->ServiceList) {
|
||||
MnpServiceData = MNP_SERVICE_DATA_FROM_LINK (Entry);
|
||||
|
||||
Status = MnpDestroyServiceChild (MnpServiceData);
|
||||
if (EFI_ERROR (Status)) {
|
||||
AllChildrenStopped = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!AllChildrenStopped) {
|
||||
List = &MnpDeviceData->ServiceList;
|
||||
Status = NetDestroyLinkList (
|
||||
List,
|
||||
MnpDestroyServiceChildEntry,
|
||||
NULL,
|
||||
&ListLength
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user