]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Disk/UdfDxe/ComponentName.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / UdfDxe / ComponentName.c
CommitLineData
99c9b949
PA
1/** @file\r
2 UEFI Component Name protocol for UDF/ECMA-167 file system driver.\r
3\r
4 Copyright (C) 2014-2017 Paulo Alcantara <pcacjr@zytor.com>\r
5\r
9d510e61 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
99c9b949
PA
7**/\r
8\r
9#include "Udf.h"\r
10\r
11//\r
12// EFI Component Name Protocol\r
13//\r
14GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gUdfComponentName = {\r
15 UdfComponentNameGetDriverName,\r
16 UdfComponentNameGetControllerName,\r
17 "eng"\r
18};\r
19\r
20//\r
21// EFI Component Name 2 Protocol\r
22//\r
1436aea4
MK
23GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUdfComponentName2 = {\r
24 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)UdfComponentNameGetDriverName,\r
25 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)UdfComponentNameGetControllerName,\r
99c9b949
PA
26 "en"\r
27};\r
28\r
29//\r
30// Driver name table for Udf module.\r
31// It is shared by the implementation of ComponentName & ComponentName2 Protocol.\r
32//\r
1436aea4 33GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUdfDriverNameTable[] = {\r
99c9b949
PA
34 {\r
35 "eng;en",\r
36 L"UDF File System Driver"\r
37 },\r
38 {\r
39 NULL,\r
40 NULL\r
41 }\r
42};\r
43\r
44/**\r
45 Retrieves a Unicode string that is the user readable name of the driver.\r
46\r
47 This function retrieves the user readable name of a driver in the form of a\r
48 Unicode string. If the driver specified by This has a user readable name in\r
49 the language specified by Language, then a pointer to the driver name is\r
50 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
51 by This does not support the language specified by Language,\r
52 then EFI_UNSUPPORTED is returned.\r
53\r
54 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
55 EFI_COMPONENT_NAME_PROTOCOL instance.\r
56\r
57 @param Language[in] A pointer to a Null-terminated ASCII string\r
58 array indicating the language. This is the\r
59 language of the driver name that the caller is\r
60 requesting, and it must match one of the\r
61 languages specified in SupportedLanguages. The\r
62 number of languages supported by a driver is up\r
63 to the driver writer. Language is specified\r
64 in RFC 4646 or ISO 639-2 language code format.\r
65\r
66 @param DriverName[out] A pointer to the Unicode string to return.\r
67 This Unicode string is the name of the\r
68 driver specified by This in the language\r
69 specified by Language.\r
70\r
71 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
72 This and the language specified by Language was\r
73 returned in DriverName.\r
74\r
75 @retval EFI_INVALID_PARAMETER Language is NULL.\r
76\r
77 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
78\r
79 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
80 the language specified by Language.\r
81\r
82**/\r
83EFI_STATUS\r
84EFIAPI\r
85UdfComponentNameGetDriverName (\r
86 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
87 IN CHAR8 *Language,\r
88 OUT CHAR16 **DriverName\r
89 )\r
90{\r
91 return LookupUnicodeString2 (\r
1436aea4
MK
92 Language,\r
93 This->SupportedLanguages,\r
94 mUdfDriverNameTable,\r
95 DriverName,\r
96 (BOOLEAN)(This == &gUdfComponentName)\r
97 );\r
99c9b949
PA
98}\r
99\r
100/**\r
101 Retrieves a Unicode string that is the user readable name of the controller\r
102 that is being managed by a driver.\r
103\r
104 This function retrieves the user readable name of the controller specified by\r
105 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
106 driver specified by This has a user readable name in the language specified by\r
107 Language, then a pointer to the controller name is returned in ControllerName,\r
108 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
109 managing the controller specified by ControllerHandle and ChildHandle,\r
110 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
111 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
112\r
113 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
114 EFI_COMPONENT_NAME_PROTOCOL instance.\r
115\r
116 @param ControllerHandle[in] The handle of a controller that the driver\r
117 specified by This is managing. This handle\r
118 specifies the controller whose name is to be\r
119 returned.\r
120\r
121 @param ChildHandle[in] The handle of the child controller to retrieve\r
122 the name of. This is an optional parameter that\r
123 may be NULL. It will be NULL for device\r
124 drivers. It will also be NULL for a bus drivers\r
125 that wish to retrieve the name of the bus\r
126 controller. It will not be NULL for a bus\r
127 driver that wishes to retrieve the name of a\r
128 child controller.\r
129\r
130 @param Language[in] A pointer to a Null-terminated ASCII string\r
131 array indicating the language. This is the\r
132 language of the driver name that the caller is\r
133 requesting, and it must match one of the\r
134 languages specified in SupportedLanguages. The\r
135 number of languages supported by a driver is up\r
136 to the driver writer. Language is specified in\r
137 RFC 4646 or ISO 639-2 language code format.\r
138\r
139 @param ControllerName[out] A pointer to the Unicode string to return.\r
140 This Unicode string is the name of the\r
141 controller specified by ControllerHandle and\r
142 ChildHandle in the language specified by\r
143 Language from the point of view of the driver\r
144 specified by This.\r
145\r
146 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
147 the language specified by Language for the\r
148 driver specified by This was returned in\r
149 DriverName.\r
150\r
151 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
152\r
153 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
154 EFI_HANDLE.\r
155\r
156 @retval EFI_INVALID_PARAMETER Language is NULL.\r
157\r
158 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
159\r
160 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
161 managing the controller specified by\r
162 ControllerHandle and ChildHandle.\r
163\r
164 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
165 the language specified by Language.\r
166\r
167**/\r
168EFI_STATUS\r
169EFIAPI\r
170UdfComponentNameGetControllerName (\r
171 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
172 IN EFI_HANDLE ControllerHandle,\r
173 IN EFI_HANDLE ChildHandle OPTIONAL,\r
174 IN CHAR8 *Language,\r
175 OUT CHAR16 **ControllerName\r
176 )\r
177{\r
178 return EFI_UNSUPPORTED;\r
179}\r