]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Open default Tcp child via BY_CHILD_CONTROLLER.
authorWu Jiaxin <jiaxin.wu@intel.com>
Thu, 5 Feb 2015 07:56:44 +0000 (07:56 +0000)
committerjiaxinwu <jiaxinwu@Edk2>
Thu, 5 Feb 2015 07:56:44 +0000 (07:56 +0000)
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@16775 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c

index b389610479561a829631aae7751aa80d937b35cb..e55bee8af94d0e25d399f3dd42e8303da8e291c0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The entry point of IScsi driver.\r
 \r
 /** @file\r
   The entry point of IScsi driver.\r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -276,6 +276,30 @@ IScsiDriverBindingStart (
     goto ON_ERROR;\r
   }\r
 \r
     goto ON_ERROR;\r
   }\r
 \r
+  //\r
+  // ISCSI children should share the default Tcp child, just open the default Tcp child via BY_CHILD_CONTROLLER.\r
+  //\r
+  Status = gBS->OpenProtocol (\r
+                  Private->ChildHandle, /// Default Tcp child\r
+                  &gEfiTcp4ProtocolGuid,\r
+                  &Interface,\r
+                  This->DriverBindingHandle,\r
+                  Private->ExtScsiPassThruHandle,\r
+                  EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
+                  );              \r
+  if (EFI_ERROR (Status)) {\r
+    gBS->UninstallMultipleProtocolInterfaces (\r
+           Private->ExtScsiPassThruHandle,\r
+           &gEfiExtScsiPassThruProtocolGuid,\r
+           &Private->IScsiExtScsiPassThru,\r
+           &gEfiDevicePathProtocolGuid,\r
+           Private->DevicePath,\r
+           NULL\r
+           );\r
+    \r
+    goto ON_ERROR;\r
+  }\r
+\r
   //\r
   // Update/Publish the iSCSI Boot Firmware Table.\r
   //\r
   //\r
   // Update/Publish the iSCSI Boot Firmware Table.\r
   //\r
@@ -356,6 +380,13 @@ IScsiDriverBindingStop (
     // the protocol here but not uninstall the device path protocol and\r
     // EXT SCSI PASS THRU protocol installed on ExtScsiPassThruHandle.\r
     //\r
     // the protocol here but not uninstall the device path protocol and\r
     // EXT SCSI PASS THRU protocol installed on ExtScsiPassThruHandle.\r
     //\r
+    gBS->CloseProtocol (\r
+           Private->ChildHandle,\r
+           &gEfiTcp4ProtocolGuid,\r
+           Private->Image,\r
+           Private->ExtScsiPassThruHandle\r
+           );\r
+    \r
     gBS->CloseProtocol (\r
           Conn->Tcp4Io.Handle,\r
           &gEfiTcp4ProtocolGuid,\r
     gBS->CloseProtocol (\r
           Conn->Tcp4Io.Handle,\r
           &gEfiTcp4ProtocolGuid,\r