]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UfsDeviceConfig.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Protocol / UfsDeviceConfig.h
CommitLineData
ed960a1d
HW
1/** @file\r
2 This file defines the EFI UFS Device Config Protocol.\r
3\r
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
ed960a1d
HW
6\r
7 @par Revision Reference:\r
8 This Protocol is introduced in UEFI Specification 2.7\r
9\r
10**/\r
11\r
12#ifndef __UFS_DEVICE_CONFIG_PROTOCOL_H__\r
13#define __UFS_DEVICE_CONFIG_PROTOCOL_H__\r
14\r
15//\r
16// EFI UFS Device Config Protocol GUID value\r
17//\r
18#define EFI_UFS_DEVICE_CONFIG_GUID \\r
19 { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }};\r
20\r
21//\r
22// Forward reference for pure ANSI compatability\r
23//\r
2f88bd3a 24typedef struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL EFI_UFS_DEVICE_CONFIG_PROTOCOL;\r
ed960a1d
HW
25\r
26/**\r
27 Read or write specified device descriptor of a UFS device.\r
28\r
29 The service is used to read/write UFS device descriptors. The consumer of this API is responsible\r
30 for allocating the data buffer pointed by Descriptor.\r
31\r
32 @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r
33 @param[in] Read The boolean variable to show r/w direction.\r
34 @param[in] DescId The ID of device descriptor.\r
35 @param[in] Index The Index of device descriptor.\r
36 @param[in] Selector The Selector of device descriptor.\r
37 @param[in, out] Descriptor The buffer of device descriptor to be read or written.\r
38 @param[in, out] DescSize The size of device descriptor buffer. On input, the size, in bytes,\r
39 of the data buffer specified by Descriptor. On output, the number\r
40 of bytes that were actually transferred.\r
41\r
42 @retval EFI_SUCCESS The device descriptor is read/written successfully.\r
43 @retval EFI_INVALID_PARAMETER This is NULL or Descriptor is NULL or DescSize is NULL.\r
44 DescId, Index and Selector are invalid combination to point to a\r
45 type of UFS device descriptor.\r
46 @retval EFI_DEVICE_ERROR The device descriptor is not read/written successfully.\r
47\r
48**/\r
49typedef\r
50EFI_STATUS\r
2f88bd3a 51(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR)(\r
ed960a1d
HW
52 IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,\r
53 IN BOOLEAN Read,\r
54 IN UINT8 DescId,\r
55 IN UINT8 Index,\r
56 IN UINT8 Selector,\r
57 IN OUT UINT8 *Descriptor,\r
58 IN OUT UINT32 *DescSize\r
59 );\r
60\r
61/**\r
62 Read or write specified flag of a UFS device.\r
63\r
64 The service is used to read/write UFS flag descriptors. The consumer of this API is responsible\r
65 for allocating the buffer pointed by Flag. The buffer size is 1 byte as UFS flag descriptor is\r
66 just a single Boolean value that represents a TRUE or FALSE, '0' or '1', ON or OFF type of value.\r
67\r
68 @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r
69 @param[in] Read The boolean variable to show r/w direction.\r
70 @param[in] FlagId The ID of flag to be read or written.\r
71 @param[in, out] Flag The buffer to set or clear flag.\r
72\r
73 @retval EFI_SUCCESS The flag descriptor is set/clear successfully.\r
74 @retval EFI_INVALID_PARAMETER This is NULL or Flag is NULL.\r
75 FlagId is an invalid UFS flag ID.\r
76 @retval EFI_DEVICE_ERROR The flag is not set/clear successfully.\r
77\r
78**/\r
79typedef\r
80EFI_STATUS\r
2f88bd3a 81(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_FLAG)(\r
ed960a1d
HW
82 IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,\r
83 IN BOOLEAN Read,\r
84 IN UINT8 FlagId,\r
85 IN OUT UINT8 *Flag\r
86 );\r
87\r
88/**\r
89 Read or write specified attribute of a UFS device.\r
90\r
91 The service is used to read/write UFS attributes. The consumer of this API is responsible for\r
92 allocating the data buffer pointed by Attribute.\r
93\r
94 @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r
95 @param[in] Read The boolean variable to show r/w direction.\r
96 @param[in] AttrId The ID of Attribute.\r
97 @param[in] Index The Index of Attribute.\r
98 @param[in] Selector The Selector of Attribute.\r
99 @param[in, out] Attribute The buffer of Attribute to be read or written.\r
100 @param[in, out] AttrSize The size of Attribute buffer. On input, the size, in bytes, of the\r
101 data buffer specified by Attribute. On output, the number of bytes\r
102 that were actually transferred.\r
103\r
104 @retval EFI_SUCCESS The attribute is read/written successfully.\r
105 @retval EFI_INVALID_PARAMETER This is NULL or Attribute is NULL or AttrSize is NULL.\r
106 AttrId, Index and Selector are invalid combination to point to a\r
107 type of UFS attribute.\r
108 @retval EFI_DEVICE_ERROR The attribute is not read/written successfully.\r
109\r
110**/\r
111typedef\r
112EFI_STATUS\r
2f88bd3a 113(EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE)(\r
ed960a1d
HW
114 IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,\r
115 IN BOOLEAN Read,\r
116 IN UINT8 AttrId,\r
117 IN UINT8 Index,\r
118 IN UINT8 Selector,\r
119 IN OUT UINT8 *Attribute,\r
120 IN OUT UINT32 *AttrSize\r
121 );\r
122\r
123///\r
124/// UFS Device Config Protocol structure.\r
125///\r
126struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL {\r
127 EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR RwUfsDescriptor;\r
128 EFI_UFS_DEVICE_CONFIG_RW_FLAG RwUfsFlag;\r
129 EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE RwUfsAttribute;\r
130};\r
131\r
132///\r
133/// UFS Device Config Protocol GUID variable.\r
134///\r
2f88bd3a 135extern EFI_GUID gEfiUfsDeviceConfigProtocolGuid;\r
ed960a1d
HW
136\r
137#endif\r