The DataSegmentLength field of Query Request UPIU doesn't set correctly, which 
causes a 0 value rather than right data length is set to this field

Cc: Hao Wu <hao.a...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.t...@intel.com>
---
 MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c 
b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c
index 6880057..8e028bd 100644
--- a/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2016, 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
@@ -384,8 +384,11 @@ UfsInitQueryRequestUpiu (
 {
   ASSERT (QueryReq != NULL);
 
-  QueryReq->TransCode = 0x16;
-  QueryReq->TaskTag   = TaskTag;
+  QueryReq->TransCode  = 0x16;
+  QueryReq->TaskTag    = TaskTag;
+  QueryReq->DataSegLen = (UINT16)DataSize;
+  SwapLittleEndianToBigEndian ((UINT8*)&QueryReq->DataSegLen, sizeof 
(QueryReq->DataSegLen));
+
   if ((Opcode == UtpQueryFuncOpcodeRdDesc) || (Opcode == 
UtpQueryFuncOpcodeRdFlag) || (Opcode == UtpQueryFuncOpcodeRdAttr)) {
     QueryReq->QueryFunc = QUERY_FUNC_STD_READ_REQ;
   } else {
-- 
2.7.1.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to