Sync the latest version from R8.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4400 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2007-12-18 07:01:23 +00:00
parent 372787b85a
commit c4a62a12c2
26 changed files with 790 additions and 424 deletions

View File

@ -219,64 +219,54 @@ MnpDriverBindingStop (
("MnpDriverBindingStop: Locate MNP Service Binding Protocol failed, %r.\n",
Status)
);
goto EXIT;
return EFI_DEVICE_ERROR;
}
MnpServiceData = MNP_SERVICE_DATA_FROM_THIS (ServiceBinding);
while (!NetListIsEmpty (&MnpServiceData->ChildrenList)) {
if (NumberOfChildren == 0) {
//
// Don't use NetListRemoveHead here, the remove opreration will be done
// in ServiceBindingDestroyChild.
// Uninstall the MNP Service Binding Protocol.
//
Instance = NET_LIST_HEAD (
&MnpServiceData->ChildrenList,
MNP_INSTANCE_DATA,
InstEntry
);
gBS->UninstallMultipleProtocolInterfaces (
ControllerHandle,
&gEfiManagedNetworkServiceBindingProtocolGuid,
ServiceBinding,
NULL
);
ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
//
// Close the openned Snp protocol.
//
gBS->CloseProtocol (
ControllerHandle,
&gEfiSimpleNetworkProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
//
// Flush the Mnp service data.
//
MnpFlushServiceData (MnpServiceData);
NetFreePool (MnpServiceData);
} else {
while (!NetListIsEmpty (&MnpServiceData->ChildrenList)) {
//
// Don't use NetListRemoveHead here, the remove opreration will be done
// in ServiceBindingDestroyChild.
//
Instance = NET_LIST_HEAD (
&MnpServiceData->ChildrenList,
MNP_INSTANCE_DATA,
InstEntry
);
ServiceBinding->DestroyChild (ServiceBinding, Instance->Handle);
}
}
//
// Uninstall the MNP Service Binding Protocol.
//
Status = gBS->UninstallMultipleProtocolInterfaces (
ControllerHandle,
&gEfiManagedNetworkServiceBindingProtocolGuid,
ServiceBinding,
NULL
);
if (EFI_ERROR (Status)) {
MNP_DEBUG_ERROR (("MnpDriverBindingStop: Uninstall MNP Service Binding Protocol failed, %r.\n"));
goto EXIT;
}
//
// Close the openned Snp protocol.
//
Status = gBS->CloseProtocol (
ControllerHandle,
&gEfiSimpleNetworkProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
if (EFI_ERROR (Status)) {
MNP_DEBUG_ERROR (("MnpDriverBindingStop: Close SNP Protocol failed, %r.\n", Status));
goto EXIT;
}
//
// Flush the Mnp service data.
//
MnpFlushServiceData (MnpServiceData);
NetFreePool (MnpServiceData);
EXIT:
return Status;
}