Revision: 16700
          http://sourceforge.net/p/edk2/code/16700
Author:   tye1
Date:     2015-02-03 00:53:37 +0000 (Tue, 03 Feb 2015)
Log Message:
-----------
Update the code not require optional parameters include DataPDUInOrder and 
DataSequenceInOrder.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Roy Franz <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Reviewed-by: Tian Feng <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c

Modified: trunk/edk2/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c     
2015-02-02 21:02:56 UTC (rev 16699)
+++ trunk/edk2/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c     
2015-02-03 00:53:37 UTC (rev 16700)
@@ -1291,23 +1291,27 @@
   //
   // DataPDUInOrder, result function is OR.
   //
-  Value = IScsiGetValueByKeyFromList (KeyValueList, 
ISCSI_KEY_DATA_PDU_IN_ORDER);
-  if (Value == NULL) {
-    goto ON_ERROR;
+  if (!Session->DataPDUInOrder) {
+    Value = IScsiGetValueByKeyFromList (KeyValueList, 
ISCSI_KEY_DATA_PDU_IN_ORDER);
+    if (Value == NULL) {
+      goto ON_ERROR;
+    }
+
+    Session->DataPDUInOrder = (BOOLEAN) (AsciiStrCmp (Value, "Yes") == 0);
   }
 
-  Session->DataPDUInOrder = (BOOLEAN) (Session->DataPDUInOrder || (AsciiStrCmp 
(Value, "Yes") == 0));
-
   //
   // DataSequenceInorder, result function is OR.
   //
-  Value = IScsiGetValueByKeyFromList (KeyValueList, 
ISCSI_KEY_DATA_SEQUENCE_IN_ORDER);
-  if (Value == NULL) {
-    goto ON_ERROR;
+  if (!Session->DataSequenceInOrder) {
+    Value = IScsiGetValueByKeyFromList (KeyValueList, 
ISCSI_KEY_DATA_SEQUENCE_IN_ORDER);
+    if (Value == NULL) {
+      goto ON_ERROR;
+    }
+
+    Session->DataSequenceInOrder = (BOOLEAN) (AsciiStrCmp (Value, "Yes") == 0);
   }
 
-  Session->DataSequenceInOrder = (BOOLEAN) (Session->DataSequenceInOrder || 
(AsciiStrCmp (Value, "Yes") == 0));
-
   //
   // DefaultTime2Wait, result function is Maximum.
   //
@@ -1361,6 +1365,11 @@
   IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_SESSION_TYPE);
   IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_ALIAS);
   IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_TARGET_PORTAL_GROUP_TAG);
+  //
+  // Remove the key-value that may not needed for result function is OR.
+  //
+  IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_DATA_PDU_IN_ORDER);
+  IScsiGetValueByKeyFromList (KeyValueList, ISCSI_KEY_DATA_SEQUENCE_IN_ORDER);
 
   if (IsListEmpty (KeyValueList)) {
     //


------------------------------------------------------------------------------
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