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/UfsPassThruDxe/UfsPassThruHci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index a9fde30..75970d6 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -2,7 +2,7 @@ UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU protocol interface for upper layer application to execute UFS-supported SCSI cmds. - Copyright (c) 2014 - 2015, 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 @@ -455,8 +455,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