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