From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5334E21962334 for ; Sun, 18 Jun 2017 23:55:50 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2017 23:57:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,360,1493708400"; d="scan'208";a="116536287" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 18 Jun 2017 23:57:10 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 18 Jun 2017 23:57:10 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 18 Jun 2017 23:57:09 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.116]) with mapi id 14.03.0319.002; Mon, 19 Jun 2017 14:57:08 +0800 From: "Zeng, Star" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Gao, Liming" , "Zeng, Star" Thread-Topic: [PATCH] MdePkg: Add EFI UFS Device Config Protocol definitions Thread-Index: AQHS6LYR3BeGP53iNUiYbWGk7b27maIrwQKA Date: Mon, 19 Jun 2017 06:57:07 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B8E90DE@shsmsx102.ccr.corp.intel.com> References: <20170619043915.5108-1-hao.a.wu@intel.com> In-Reply-To: <20170619043915.5108-1-hao.a.wu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdePkg: Add EFI UFS Device Config Protocol definitions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jun 2017 06:55:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Wu, Hao A=20 Sent: Monday, June 19, 2017 12:39 PM To: edk2-devel@lists.01.org Cc: Wu, Hao A ; Zeng, Star ; Kinne= y, Michael D ; Gao, Liming Subject: [PATCH] MdePkg: Add EFI UFS Device Config Protocol definitions Cc: Star Zeng Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- MdePkg/Include/Protocol/UfsDeviceConfig.h | 143 ++++++++++++++++++++++++++= ++++ MdePkg/MdePkg.dec | 3 + 2 files changed, 146 insertions(+) create mode 100644 MdePkg/Include/Protocol/UfsDeviceConfig.h diff --git a/MdePkg/Include/Protocol/UfsDeviceConfig.h b/MdePkg/Include/Pro= tocol/UfsDeviceConfig.h new file mode 100644 index 0000000000..6d4abc5e57 --- /dev/null +++ b/MdePkg/Include/Protocol/UfsDeviceConfig.h @@ -0,0 +1,143 @@ +/** @file + This file defines the EFI UFS Device Config Protocol. + + Copyright (c) 2017, Intel Corporation. All rights reserved.
This=20 + program and the accompanying materials are licensed and made=20 + available under the terms and conditions of the BSD License which=20 + accompanies this distribution. The full text of the license may be=20 + found at http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + + @par Revision Reference: + This Protocol is introduced in UEFI Specification 2.7 + +**/ + +#ifndef __UFS_DEVICE_CONFIG_PROTOCOL_H__ #define=20 +__UFS_DEVICE_CONFIG_PROTOCOL_H__ + +// +// EFI UFS Device Config Protocol GUID value // #define=20 +EFI_UFS_DEVICE_CONFIG_GUID \ + { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36,=20 +0x16, 0x64 }}; + +// +// Forward reference for pure ANSI compatability // typedef struct=20 +_EFI_UFS_DEVICE_CONFIG_PROTOCOL EFI_UFS_DEVICE_CONFIG_PROTOCOL; + +/** + Read or write specified device descriptor of a UFS device. + + The service is used to read/write UFS device descriptors. The=20 + consumer of this API is responsible for allocating the data buffer point= ed by Descriptor. + + @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_P= ROTOCOL instance. + @param[in] Read The boolean variable to show r/w direction= . + @param[in] DescId The ID of device descriptor. + @param[in] Index The Index of device descriptor. + @param[in] Selector The Selector of device descriptor. + @param[in, out] Descriptor The buffer of device descriptor to be read= or written. + @param[in, out] DescSize The size of device descriptor buffer. On i= nput, the size, in bytes, + of the data buffer specified by Descriptor= . On output, the number + of bytes that were actually transferred. + + @retval EFI_SUCCESS The device descriptor is read/written succ= essfully. + @retval EFI_INVALID_PARAMETER This is NULL or Descriptor is NULL or Desc= Size is NULL. + DescId, Index and Selector are invalid com= bination to point to a + type of UFS device descriptor. + @retval EFI_DEVICE_ERROR The device descriptor is not read/written = successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR) ( + IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This, + IN BOOLEAN Read, + IN UINT8 DescId, + IN UINT8 Index, + IN UINT8 Selector, + IN OUT UINT8 *Descriptor, + IN OUT UINT32 *DescSize + ); + +/** + Read or write specified flag of a UFS device. + + The service is used to read/write UFS flag descriptors. The consumer=20 + of this API is responsible for allocating the buffer pointed by Flag.=20 + The buffer size is 1 byte as UFS flag descriptor is just a single Boolea= n value that represents a TRUE or FALSE, '0' or '1', ON or OFF type of valu= e. + + @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_P= ROTOCOL instance. + @param[in] Read The boolean variable to show r/w direction= . + @param[in] FlagId The ID of flag to be read or written. + @param[in, out] Flag The buffer to set or clear flag. + + @retval EFI_SUCCESS The flag descriptor is set/clear successfu= lly. + @retval EFI_INVALID_PARAMETER This is NULL or Flag is NULL. + FlagId is an invalid UFS flag ID. + @retval EFI_DEVICE_ERROR The flag is not set/clear successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_FLAG) ( + IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This, + IN BOOLEAN Read, + IN UINT8 FlagId, + IN OUT UINT8 *Flag + ); + +/** + Read or write specified attribute of a UFS device. + + The service is used to read/write UFS attributes. The consumer of=20 + this API is responsible for allocating the data buffer pointed by Attrib= ute. + + @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_P= ROTOCOL instance. + @param[in] Read The boolean variable to show r/w direction= . + @param[in] AttrId The ID of Attribute. + @param[in] Index The Index of Attribute. + @param[in] Selector The Selector of Attribute. + @param[in, out] Attribute The buffer of Attribute to be read or writ= ten. + @param[in, out] AttrSize The size of Attribute buffer. On input, th= e size, in bytes, of the + data buffer specified by Attribute. On out= put, the number of bytes + that were actually transferred. + + @retval EFI_SUCCESS The attribute is read/written successfully= . + @retval EFI_INVALID_PARAMETER This is NULL or Attribute is NULL or AttrS= ize is NULL. + AttrId, Index and Selector are invalid com= bination to point to a + type of UFS attribute. + @retval EFI_DEVICE_ERROR The attribute is not read/written successf= ully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE) ( + IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This, + IN BOOLEAN Read, + IN UINT8 AttrId, + IN UINT8 Index, + IN UINT8 Selector, + IN OUT UINT8 *Attribute, + IN OUT UINT32 *AttrSize + ); + +/// +/// UFS Device Config Protocol structure. +/// +struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL { + EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR RwUfsDescriptor; + EFI_UFS_DEVICE_CONFIG_RW_FLAG RwUfsFlag; + EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE RwUfsAttribute; +}; + +/// +/// UFS Device Config Protocol GUID variable. +/// +extern EFI_GUID gEfiUfsDeviceConfigProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 7a7504b7a3..1d7fdf= 1630 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1671,6 +1671,9 @@ ## Include/Protocol/BluetoothLeConfig.h gEfiBluetoothLeConfigProtocolGuid =3D { 0x8f76da58, 0x1f99, 0x42= 75, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 } } =20 + ## Include/Protocol/UfsDeviceConfig.h + gEfiUfsDeviceConfigProtocolGuid =3D { 0xb81bfab0, 0xeb3, 0x4cf= 9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }} + # # Protocols defined in Shell2.0 # -- 2.12.0.windows.1