/* The function is used to read/write UFS flag descriptors. The consumer of this API is responsible for allocating the buffer pointed by Flag. The buffer size is 1 byte as UFS flag descriptor is just a single Boolean value that represents a TRUE or FALSE, '0' or '1', ON or OFF type of value. */
EFI_STATUS EFIAPI UfsRwUfsFlag(IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This, IN BOOLEAN Read, IN UINT8 FlagId, IN OUT UINT8 *Flag)
/* The function is used to read/write UFS flag descriptors. The consumer of this API is responsible for allocating the buffer pointed by Flag. The buffer size is 1 byte as UFS flag descriptor is just a single Boolean value that represents a TRUE or FALSE, '0' or '1', ON or OFF type of value. */
EFI_STATUS EFIAPI UfsRwUfsFlag(IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This, IN BOOLEAN Read, IN UINT8 FlagId, IN OUT UINT8 *Flag)
{
  EFI_STATUS                  Status;
  UFS_PASS_THRU_PRIVATE_DATA  *Private;
  Private = UFS_PASS_THRU_PRIVATE_DATA_FROM_DEV_CONFIG (This);
  if ((This == NULL) || (Flag == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  Status = UfsRwFlags (Private, Read, FlagId, Flag);
  if (Status == EFI_TIMEOUT) {
    Status = EFI_DEVICE_ERROR;
  }
  return Status;
}