As per UFS spec, flag value is stored in the 'last byte' of value
field. Existing code is attempting to read first byte.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2208
Test: Verified the Fix by sending command to set fPowerOnWPEn flag
and then reading it to verify the set value.
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
}\r
\r
if (Trd->Ocs == 0) {\r
- *Value = (UINT8)QueryResp->Tsf.Value;\r
+ //\r
+ // The 'FLAG VALUE' field is at byte offset 3 of QueryResp->Tsf.Value\r
+ //\r
+ *Value = *((UINT8*)&(QueryResp->Tsf.Value) + 3);\r
} else {\r
Status = EFI_DEVICE_ERROR;\r
}\r
case UtpQueryFuncOpcodeSetFlag:\r
case UtpQueryFuncOpcodeClrFlag:\r
case UtpQueryFuncOpcodeTogFlag:\r
- CopyMem (Packet->DataBuffer, &QueryResp->Tsf.Value, sizeof (UINT8));\r
+ //\r
+ // The 'FLAG VALUE' field is at byte offset 3 of QueryResp->Tsf.Value\r
+ //\r
+ *((UINT8*)(Packet->DataBuffer)) = *((UINT8*)&(QueryResp->Tsf.Value) + 3);\r
break;\r
case UtpQueryFuncOpcodeRdAttr:\r
case UtpQueryFuncOpcodeWrAttr:\r