MdeModulePkg/Ufs: Set 'Data Segment Length' field for Write Descriptor

According to the Universal Flash Storage (UFS) Version 2.1 (JESD220C) spec
Section 10.7.8.5, the DATA SEGMENT LENGTH field of the UPIU shall also be
set to number of descriptor bytes to write.

The origin codes miss the above operation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Hao Wu 2017-06-15 15:15:59 +08:00
parent 32c9049de1
commit c16eee92d4
2 changed files with 6 additions and 0 deletions

View File

@ -407,6 +407,9 @@ UfsInitQueryRequestUpiu (
if (Opcode == UtpQueryFuncOpcodeWrDesc) {
CopyMem (QueryReq + 1, Data, DataSize);
SwapLittleEndianToBigEndian ((UINT8*)&DataSize, sizeof (UINT16));
QueryReq->DataSegLen = (UINT16)DataSize;
}
return EFI_SUCCESS;

View File

@ -478,6 +478,9 @@ UfsInitQueryRequestUpiu (
if (Opcode == UtpQueryFuncOpcodeWrDesc) {
CopyMem (QueryReq + 1, Data, DataSize);
SwapLittleEndianToBigEndian ((UINT8*)&DataSize, sizeof (UINT16));
QueryReq->DataSegLen = (UINT16)DataSize;
}
return EFI_SUCCESS;