]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h
MdeModulePkg/Ufs: Wait fDeviceInit be cleared by devices during init
[mirror_edk2.git] / MdeModulePkg / Bus / Ufs / UfsPassThruDxe / UfsPassThru.h
index 7fc82bae7a3e0783ca083cc2f4e4b49a7b688d84..bdc64f779309039f9c451cf94c4e0ea1649bfbbc 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -122,16 +122,13 @@ typedef struct {
 \r
 typedef struct _UFS_DEVICE_MANAGEMENT_REQUEST_PACKET {\r
   UINT64           Timeout;\r
-  VOID             *InDataBuffer;\r
-  VOID             *OutDataBuffer;\r
+  VOID             *DataBuffer;\r
   UINT8            Opcode;\r
   UINT8            DescId;\r
   UINT8            Index;\r
   UINT8            Selector;\r
-  UINT32           InTransferLength;\r
-  UINT32           OutTransferLength;\r
+  UINT32           TransferLength;\r
   UINT8            DataDirection;\r
-  UINT8            Ocs;\r
 } UFS_DEVICE_MANAGEMENT_REQUEST_PACKET;\r
 \r
 //\r
@@ -716,6 +713,25 @@ UfsSetFlag (
   IN  UINT8                        FlagId\r
   );\r
 \r
+/**\r
+  Read specified flag from a UFS device.\r
+\r
+  @param[in]  Private           The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure.\r
+  @param[in]  FlagId            The ID of flag to be read.\r
+  @param[out] Value             The flag's value.\r
+\r
+  @retval EFI_SUCCESS           The flag was read successfully.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to read the flag.\r
+  @retval EFI_TIMEOUT           A timeout occurred while waiting for the completion of reading the flag.\r
+\r
+**/\r
+EFI_STATUS\r
+UfsReadFlag (\r
+  IN     UFS_PASS_THRU_PRIVATE_DATA   *Private,\r
+  IN     UINT8                        FlagId,\r
+     OUT UINT8                        *Value\r
+  );\r
+\r
 /**\r
   Read or write specified device descriptor of a UFS device.\r
 \r
@@ -743,6 +759,31 @@ UfsRwDeviceDesc (
   IN     UINT32                       DescSize\r
   );\r
 \r
+/**\r
+  Read or write specified attribute of a UFS device.\r
+\r
+  @param[in]      Private       The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure.\r
+  @param[in]      Read          The boolean variable to show r/w direction.\r
+  @param[in]      AttrId        The ID of Attribute.\r
+  @param[in]      Index         The Index of Attribute.\r
+  @param[in]      Selector      The Selector of Attribute.\r
+  @param[in, out] Attributes    The value of Attribute to be read or written.\r
+\r
+  @retval EFI_SUCCESS           The Attribute was read/written successfully.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to r/w the Attribute.\r
+  @retval EFI_TIMEOUT           A timeout occurred while waiting for the completion of r/w the Attribute.\r
+\r
+**/\r
+EFI_STATUS\r
+UfsRwAttributes (\r
+  IN     UFS_PASS_THRU_PRIVATE_DATA   *Private,\r
+  IN     BOOLEAN                      Read,\r
+  IN     UINT8                        AttrId,\r
+  IN     UINT8                        Index,\r
+  IN     UINT8                        Selector,\r
+  IN OUT UINT32                       *Attributes\r
+  );\r
+\r
 /**\r
   Sends NOP IN cmd to a UFS device for initialization process request.\r
   For more details, please refer to UFS 2.0 spec Figure 13.3.\r