]>
Commit | Line | Data |
---|---|---|
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 | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | @par Revision Reference:\r | |
14 | This Protocol is introduced in UEFI Specification 2.7\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __UFS_DEVICE_CONFIG_PROTOCOL_H__\r | |
19 | #define __UFS_DEVICE_CONFIG_PROTOCOL_H__\r | |
20 | \r | |
21 | //\r | |
22 | // EFI UFS Device Config Protocol GUID value\r | |
23 | //\r | |
24 | #define EFI_UFS_DEVICE_CONFIG_GUID \\r | |
25 | { 0xb81bfab0, 0xeb3, 0x4cf9, { 0x84, 0x65, 0x7f, 0xa9, 0x86, 0x36, 0x16, 0x64 }};\r | |
26 | \r | |
27 | //\r | |
28 | // Forward reference for pure ANSI compatability\r | |
29 | //\r | |
30 | typedef struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL EFI_UFS_DEVICE_CONFIG_PROTOCOL;\r | |
31 | \r | |
32 | /**\r | |
33 | Read or write specified device descriptor of a UFS device.\r | |
34 | \r | |
35 | The service is used to read/write UFS device descriptors. The consumer of this API is responsible\r | |
36 | for allocating the data buffer pointed by Descriptor.\r | |
37 | \r | |
38 | @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r | |
39 | @param[in] Read The boolean variable to show r/w direction.\r | |
40 | @param[in] DescId The ID of device descriptor.\r | |
41 | @param[in] Index The Index of device descriptor.\r | |
42 | @param[in] Selector The Selector of device descriptor.\r | |
43 | @param[in, out] Descriptor The buffer of device descriptor to be read or written.\r | |
44 | @param[in, out] DescSize The size of device descriptor buffer. On input, the size, in bytes,\r | |
45 | of the data buffer specified by Descriptor. On output, the number\r | |
46 | of bytes that were actually transferred.\r | |
47 | \r | |
48 | @retval EFI_SUCCESS The device descriptor is read/written successfully.\r | |
49 | @retval EFI_INVALID_PARAMETER This is NULL or Descriptor is NULL or DescSize is NULL.\r | |
50 | DescId, Index and Selector are invalid combination to point to a\r | |
51 | type of UFS device descriptor.\r | |
52 | @retval EFI_DEVICE_ERROR The device descriptor is not read/written successfully.\r | |
53 | \r | |
54 | **/\r | |
55 | typedef\r | |
56 | EFI_STATUS\r | |
57 | (EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR) (\r | |
58 | IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,\r | |
59 | IN BOOLEAN Read,\r | |
60 | IN UINT8 DescId,\r | |
61 | IN UINT8 Index,\r | |
62 | IN UINT8 Selector,\r | |
63 | IN OUT UINT8 *Descriptor,\r | |
64 | IN OUT UINT32 *DescSize\r | |
65 | );\r | |
66 | \r | |
67 | /**\r | |
68 | Read or write specified flag of a UFS device.\r | |
69 | \r | |
70 | The service is used to read/write UFS flag descriptors. The consumer of this API is responsible\r | |
71 | for allocating the buffer pointed by Flag. The buffer size is 1 byte as UFS flag descriptor is\r | |
72 | just a single Boolean value that represents a TRUE or FALSE, '0' or '1', ON or OFF type of value.\r | |
73 | \r | |
74 | @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r | |
75 | @param[in] Read The boolean variable to show r/w direction.\r | |
76 | @param[in] FlagId The ID of flag to be read or written.\r | |
77 | @param[in, out] Flag The buffer to set or clear flag.\r | |
78 | \r | |
79 | @retval EFI_SUCCESS The flag descriptor is set/clear successfully.\r | |
80 | @retval EFI_INVALID_PARAMETER This is NULL or Flag is NULL.\r | |
81 | FlagId is an invalid UFS flag ID.\r | |
82 | @retval EFI_DEVICE_ERROR The flag is not set/clear successfully.\r | |
83 | \r | |
84 | **/\r | |
85 | typedef\r | |
86 | EFI_STATUS\r | |
87 | (EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_FLAG) (\r | |
88 | IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,\r | |
89 | IN BOOLEAN Read,\r | |
90 | IN UINT8 FlagId,\r | |
91 | IN OUT UINT8 *Flag\r | |
92 | );\r | |
93 | \r | |
94 | /**\r | |
95 | Read or write specified attribute of a UFS device.\r | |
96 | \r | |
97 | The service is used to read/write UFS attributes. The consumer of this API is responsible for\r | |
98 | allocating the data buffer pointed by Attribute.\r | |
99 | \r | |
100 | @param[in] This The pointer to the EFI_UFS_DEVICE_CONFIG_PROTOCOL instance.\r | |
101 | @param[in] Read The boolean variable to show r/w direction.\r | |
102 | @param[in] AttrId The ID of Attribute.\r | |
103 | @param[in] Index The Index of Attribute.\r | |
104 | @param[in] Selector The Selector of Attribute.\r | |
105 | @param[in, out] Attribute The buffer of Attribute to be read or written.\r | |
106 | @param[in, out] AttrSize The size of Attribute buffer. On input, the size, in bytes, of the\r | |
107 | data buffer specified by Attribute. On output, the number of bytes\r | |
108 | that were actually transferred.\r | |
109 | \r | |
110 | @retval EFI_SUCCESS The attribute is read/written successfully.\r | |
111 | @retval EFI_INVALID_PARAMETER This is NULL or Attribute is NULL or AttrSize is NULL.\r | |
112 | AttrId, Index and Selector are invalid combination to point to a\r | |
113 | type of UFS attribute.\r | |
114 | @retval EFI_DEVICE_ERROR The attribute is not read/written successfully.\r | |
115 | \r | |
116 | **/\r | |
117 | typedef\r | |
118 | EFI_STATUS\r | |
119 | (EFIAPI *EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE) (\r | |
120 | IN EFI_UFS_DEVICE_CONFIG_PROTOCOL *This,\r | |
121 | IN BOOLEAN Read,\r | |
122 | IN UINT8 AttrId,\r | |
123 | IN UINT8 Index,\r | |
124 | IN UINT8 Selector,\r | |
125 | IN OUT UINT8 *Attribute,\r | |
126 | IN OUT UINT32 *AttrSize\r | |
127 | );\r | |
128 | \r | |
129 | ///\r | |
130 | /// UFS Device Config Protocol structure.\r | |
131 | ///\r | |
132 | struct _EFI_UFS_DEVICE_CONFIG_PROTOCOL {\r | |
133 | EFI_UFS_DEVICE_CONFIG_RW_DESCRIPTOR RwUfsDescriptor;\r | |
134 | EFI_UFS_DEVICE_CONFIG_RW_FLAG RwUfsFlag;\r | |
135 | EFI_UFS_DEVICE_CONFIG_RW_ATTRIBUTE RwUfsAttribute;\r | |
136 | };\r | |
137 | \r | |
138 | ///\r | |
139 | /// UFS Device Config Protocol GUID variable.\r | |
140 | ///\r | |
141 | extern EFI_GUID gEfiUfsDeviceConfigProtocolGuid;\r | |
142 | \r | |
143 | #endif\r |