Open default Tcp child via BY_CHILD_CONTROLLER.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16774 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Wu Jiaxin 2015-02-05 07:56:09 +00:00 committed by jiaxinwu
parent 52801687d0
commit d63a52ebf3
1 changed files with 34 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
The entry point of IScsi driver. The entry point of IScsi driver.
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials 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
@ -290,7 +290,7 @@ IScsiStart (
} }
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Private->ChildHandle, Private->ChildHandle, /// Default Tcp child
ProtocolGuid, ProtocolGuid,
&Interface, &Interface,
Image, Image,
@ -750,6 +750,30 @@ IScsiStart (
goto ON_ERROR; goto ON_ERROR;
} }
//
// ISCSI children should share the default Tcp child, just open the default Tcp child via BY_CHILD_CONTROLLER.
//
Status = gBS->OpenProtocol (
Private->ChildHandle, /// Default Tcp child
ProtocolGuid,
&Interface,
Image,
Private->ExtScsiPassThruHandle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
);
if (EFI_ERROR (Status)) {
gBS->UninstallMultipleProtocolInterfaces (
Private->ExtScsiPassThruHandle,
&gEfiExtScsiPassThruProtocolGuid,
&Private->IScsiExtScsiPassThru,
&gEfiDevicePathProtocolGuid,
Private->DevicePath,
NULL
);
goto ON_ERROR;
}
ON_EXIT: ON_EXIT:
// //
@ -838,6 +862,13 @@ IScsiStop (
ProtocolGuid = &gEfiTcp6ProtocolGuid; ProtocolGuid = &gEfiTcp6ProtocolGuid;
} }
gBS->CloseProtocol (
Private->ChildHandle,
ProtocolGuid,
Private->Image,
Private->ExtScsiPassThruHandle
);
gBS->CloseProtocol ( gBS->CloseProtocol (
Conn->TcpIo.Handle, Conn->TcpIo.Handle,
ProtocolGuid, ProtocolGuid,
@ -847,6 +878,7 @@ IScsiStop (
return EFI_SUCCESS; return EFI_SUCCESS;
} }
// //
// Get the handle of the controller we are controling. // Get the handle of the controller we are controling.
// //