Revision: 16781
          http://sourceforge.net/p/edk2/code/16781
Author:   vanjeff
Date:     2015-02-06 02:33:22 +0000 (Fri, 06 Feb 2015)
Log Message:
-----------
Open default Tcp child via BY_CHILD_CONTROLLER.

(Sync patch r16774 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/16774

Modified Paths:
--------------
    branches/UDK2014.SP1/NetworkPkg/IScsiDxe/IScsiDriver.c

Modified: branches/UDK2014.SP1/NetworkPkg/IScsiDxe/IScsiDriver.c
===================================================================
--- branches/UDK2014.SP1/NetworkPkg/IScsiDxe/IScsiDriver.c      2015-02-05 
18:25:01 UTC (rev 16780)
+++ branches/UDK2014.SP1/NetworkPkg/IScsiDxe/IScsiDriver.c      2015-02-06 
02:33:22 UTC (rev 16781)
@@ -1,7 +1,7 @@
 /** @file
   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
 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
@@ -290,7 +290,7 @@
   }
 
   Status = gBS->OpenProtocol (
-                  Private->ChildHandle,
+                  Private->ChildHandle, /// Default Tcp child
                   ProtocolGuid,
                   &Interface,
                   Image,
@@ -750,6 +750,30 @@
     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:
 
   //
@@ -839,6 +863,13 @@
     }
 
     gBS->CloseProtocol (
+           Private->ChildHandle,
+           ProtocolGuid,
+           Private->Image,
+           Private->ExtScsiPassThruHandle
+           );
+    
+    gBS->CloseProtocol (
            Conn->TcpIo.Handle,
            ProtocolGuid,
            Private->Image,
@@ -847,6 +878,7 @@
 
     return EFI_SUCCESS;
   }
+  
   //
   // Get the handle of the controller we are controling.
   //


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to