]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add EFI UFS Device Config Protocol definitions
authorHao Wu <hao.a.wu@intel.com>
Thu, 15 Jun 2017 03:08:34 +0000 (11:08 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 20 Jun 2017 12:34:17 +0000 (20:34 +0800)
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>
MdePkg/Include/Protocol/UfsDeviceConfig.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/UfsDeviceConfig.h b/MdePkg/Include/Protocol/UfsDeviceConfig.h
new file mode 100644 (file)
index 0000000..6d4abc5
--- /dev/null
@@ -0,0 +1,143 @@
+/** @file\r
+  This file defines the EFI UFS Device Config Protocol.\r
+\r
+  Copyright (c) 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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  @par Revision Reference:\r
+  This Protocol is introduced in UEFI Specification 2.7\r
+\r
+**/\r
+\r
+#ifndef __UFS_DEVICE_CONFIG_PROTOCOL_H__\r
+#define __UFS_DEVICE_CONFIG_PROTOCOL_H__\r
+\r
+//\r
+// EFI UFS Device Config Protocol GUID value\r
+//\r
+#define EFI_UFS_DEVICE_CONFIG_GUID \\r
+  { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }};\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL  EFI_UFS_DEVICE_CONFIG_PROTOCOL;\r
+\r
+/**\r
+  Read or write specified device descriptor of a UFS device.\r
+\r
+  The service is used to read/write UFS device descriptors. The consumer of this API is responsible\r
+  for allocating the data buffer pointed by Descriptor.\r
+\r
+  @param[in]      This          The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r
+  @param[in]      Read          The boolean variable to show r/w direction.\r
+  @param[in]      DescId        The ID of device descriptor.\r
+  @param[in]      Index         The Index of device descriptor.\r
+  @param[in]      Selector      The Selector of device descriptor.\r
+  @param[in, out] Descriptor    The buffer of device descriptor to be read or written.\r
+  @param[in, out] DescSize      The size of device descriptor buffer. On input, the size, in bytes,\r
+                                of the data buffer specified by Descriptor. On output, the number\r
+                                of bytes that were actually transferred.\r
+\r
+  @retval EFI_SUCCESS           The device descriptor is read/written successfully.\r
+  @retval EFI_INVALID_PARAMETER This is NULL or Descriptor is NULL or DescSize is NULL.\r
+                                DescId, Index and Selector are invalid combination to point to a\r
+                                type of UFS device descriptor.\r
+  @retval EFI_DEVICE_ERROR      The device descriptor is not read/written successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR) (\r
+  IN EFI_UFS_DEVICE_CONFIG_PROTOCOL    *This,\r
+  IN BOOLEAN                           Read,\r
+  IN UINT8                             DescId,\r
+  IN UINT8                             Index,\r
+  IN UINT8                             Selector,\r
+  IN OUT UINT8                         *Descriptor,\r
+  IN OUT UINT32                        *DescSize\r
+  );\r
+\r
+/**\r
+  Read or write specified flag of a UFS device.\r
+\r
+  The service is used to read/write UFS flag descriptors. The consumer of this API is responsible\r
+  for allocating the buffer pointed by Flag. The buffer size is 1 byte as UFS flag descriptor is\r
+  just a single Boolean value that represents a TRUE or FALSE, '0' or '1', ON or OFF type of value.\r
+\r
+  @param[in]      This          The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r
+  @param[in]      Read          The boolean variable to show r/w direction.\r
+  @param[in]      FlagId        The ID of flag to be read or written.\r
+  @param[in, out] Flag          The buffer to set or clear flag.\r
+\r
+  @retval EFI_SUCCESS           The flag descriptor is set/clear successfully.\r
+  @retval EFI_INVALID_PARAMETER This is NULL or Flag is NULL.\r
+                                FlagId is an invalid UFS flag ID.\r
+  @retval EFI_DEVICE_ERROR      The flag is not set/clear successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_FLAG) (\r
+  IN EFI_UFS_DEVICE_CONFIG_PROTOCOL    *This,\r
+  IN BOOLEAN                           Read,\r
+  IN UINT8                             FlagId,\r
+  IN OUT UINT8                         *Flag\r
+  );\r
+\r
+/**\r
+  Read or write specified attribute of a UFS device.\r
+\r
+  The service is used to read/write UFS attributes. The consumer of this API is responsible for\r
+  allocating the data buffer pointed by Attribute.\r
+\r
+  @param[in]      This          The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\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] Attribute     The buffer of Attribute to be read or written.\r
+  @param[in, out] AttrSize      The size of Attribute buffer. On input, the size, in bytes, of the\r
+                                data buffer specified by Attribute. On output, the number of bytes\r
+                                that were actually transferred.\r
+\r
+  @retval EFI_SUCCESS           The attribute is read/written successfully.\r
+  @retval EFI_INVALID_PARAMETER This is NULL or Attribute is NULL or AttrSize is NULL.\r
+                                AttrId, Index and Selector are invalid combination to point to a\r
+                                type of UFS attribute.\r
+  @retval EFI_DEVICE_ERROR      The attribute is not read/written successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE) (\r
+  IN EFI_UFS_DEVICE_CONFIG_PROTOCOL    *This,\r
+  IN BOOLEAN                           Read,\r
+  IN UINT8                             AttrId,\r
+  IN UINT8                             Index,\r
+  IN UINT8                             Selector,\r
+  IN OUT UINT8                         *Attribute,\r
+  IN OUT UINT32                        *AttrSize\r
+  );\r
+\r
+///\r
+/// UFS Device Config Protocol structure.\r
+///\r
+struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL {\r
+  EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR    RwUfsDescriptor;\r
+  EFI_UFS_DEVICE_CONFIG_RW_FLAG          RwUfsFlag;\r
+  EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE     RwUfsAttribute;\r
+};\r
+\r
+///\r
+/// UFS Device Config Protocol GUID variable.\r
+///\r
+extern EFI_GUID gEfiUfsDeviceConfigProtocolGuid;\r
+\r
+#endif\r
index 1ae1fbcc0dded16f5c28b42eac5b7adab2c63c0f..74e1fbcdcdb5e76b9a51e6fda605b336e5e1072b 100644 (file)
   ## Include/Protocol/BluetoothLeConfig.h\r
   gEfiBluetoothLeConfigProtocolGuid         = { 0x8f76da58, 0x1f99, 0x4275, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 } }\r
 \r
+  ## Include/Protocol/UfsDeviceConfig.h\r
+  gEfiUfsDeviceConfigProtocolGuid           = { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }}\r
+\r
   #\r
   # Protocols defined in Shell2.0\r
   #\r