]>
Commit | Line | Data |
---|---|---|
f6342447 OM |
1 | /** @file\r |
2 | UEFI Component Name(2) protocol implementation for Silicon Image I3132 SATA controller\r | |
3 | \r | |
4 | * Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r | |
5 | *\r | |
6 | * This program and the accompanying materials\r | |
7 | * are licensed and made available under the terms and conditions of the BSD License\r | |
8 | * which accompanies this distribution. The full text of the license may be found at\r | |
9 | * http://opensource.org/licenses/bsd-license.php\r | |
10 | *\r | |
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | *\r | |
14 | **/\r | |
15 | \r | |
16 | #include "SataSiI3132.h"\r | |
17 | \r | |
18 | //\r | |
19 | // EFI Component Name Protocol\r | |
20 | //\r | |
21 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gSataSiI3132ComponentName = {\r | |
22 | SataSiI3132ComponentNameGetDriverName,\r | |
23 | SataSiI3132ComponentNameGetControllerName,\r | |
24 | "eng"\r | |
25 | };\r | |
26 | \r | |
27 | //\r | |
28 | // EFI Component Name 2 Protocol\r | |
29 | //\r | |
30 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gSataSiI3132ComponentName2 = {\r | |
31 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SataSiI3132ComponentNameGetDriverName,\r | |
32 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) SataSiI3132ComponentNameGetControllerName,\r | |
33 | "en"\r | |
34 | };\r | |
35 | \r | |
36 | \r | |
37 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSataSiI3132DriverNameTable[] = {\r | |
38 | { "eng;en", L"Pci SATA Silicon Image 3132 Driver" },\r | |
39 | { NULL , NULL }\r | |
40 | };\r | |
41 | \r | |
42 | \r | |
43 | /**\r | |
44 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
45 | \r | |
46 | This function retrieves the user readable name of a driver in the form of a\r | |
47 | Unicode string. If the driver specified by This has a user readable name in\r | |
48 | the language specified by Language, then a pointer to the driver name is\r | |
49 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
50 | by This does not support the language specified by Language,\r | |
51 | then EFI_UNSUPPORTED is returned.\r | |
52 | \r | |
53 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
54 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
55 | \r | |
56 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
57 | array indicating the language. This is the\r | |
58 | language of the driver name that the caller is\r | |
59 | requesting, and it must match one of the\r | |
60 | languages specified in SupportedLanguages. The\r | |
61 | number of languages supported by a driver is up\r | |
62 | to the driver writer. Language is specified\r | |
63 | in RFC 4646 or ISO 639-2 language code format.\r | |
64 | \r | |
65 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
66 | This Unicode string is the name of the\r | |
67 | driver specified by This in the language\r | |
68 | specified by Language.\r | |
69 | \r | |
70 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
71 | This and the language specified by Language was\r | |
72 | returned in DriverName.\r | |
73 | \r | |
74 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
75 | \r | |
76 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
77 | \r | |
78 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
79 | the language specified by Language.\r | |
80 | \r | |
81 | **/\r | |
82 | EFI_STATUS\r | |
83 | EFIAPI\r | |
84 | SataSiI3132ComponentNameGetDriverName (\r | |
85 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
86 | IN CHAR8 *Language,\r | |
87 | OUT CHAR16 **DriverName\r | |
88 | )\r | |
89 | {\r | |
90 | return LookupUnicodeString2 (\r | |
91 | Language,\r | |
92 | This->SupportedLanguages,\r | |
93 | mSataSiI3132DriverNameTable,\r | |
94 | DriverName,\r | |
95 | (BOOLEAN)(This == &gSataSiI3132ComponentName)\r | |
96 | );\r | |
97 | }\r | |
98 | \r | |
99 | /**\r | |
100 | Retrieves a Unicode string that is the user readable name of the controller\r | |
101 | that is being managed by a driver.\r | |
102 | \r | |
103 | This function retrieves the user readable name of the controller specified by\r | |
104 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
105 | driver specified by This has a user readable name in the language specified by\r | |
106 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
107 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
108 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
109 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
110 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
111 | \r | |
112 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
113 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
114 | \r | |
115 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
116 | specified by This is managing. This handle\r | |
117 | specifies the controller whose name is to be\r | |
118 | returned.\r | |
119 | \r | |
120 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
121 | the name of. This is an optional parameter that\r | |
122 | may be NULL. It will be NULL for device\r | |
123 | drivers. It will also be NULL for a bus drivers\r | |
124 | that wish to retrieve the name of the bus\r | |
125 | controller. It will not be NULL for a bus\r | |
126 | driver that wishes to retrieve the name of a\r | |
127 | child controller.\r | |
128 | \r | |
129 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
130 | array indicating the language. This is the\r | |
131 | language of the driver name that the caller is\r | |
132 | requesting, and it must match one of the\r | |
133 | languages specified in SupportedLanguages. The\r | |
134 | number of languages supported by a driver is up\r | |
135 | to the driver writer. Language is specified in\r | |
136 | RFC 4646 or ISO 639-2 language code format.\r | |
137 | \r | |
138 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
139 | This Unicode string is the name of the\r | |
140 | controller specified by ControllerHandle and\r | |
141 | ChildHandle in the language specified by\r | |
142 | Language from the point of view of the driver\r | |
143 | specified by This.\r | |
144 | \r | |
145 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
146 | the language specified by Language for the\r | |
147 | driver specified by This was returned in\r | |
148 | DriverName.\r | |
149 | \r | |
150 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
151 | \r | |
152 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
153 | EFI_HANDLE.\r | |
154 | \r | |
155 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
156 | \r | |
157 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
158 | \r | |
159 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
160 | managing the controller specified by\r | |
161 | ControllerHandle and ChildHandle.\r | |
162 | \r | |
163 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
164 | the language specified by Language.\r | |
165 | \r | |
166 | **/\r | |
167 | EFI_STATUS\r | |
168 | EFIAPI\r | |
169 | SataSiI3132ComponentNameGetControllerName (\r | |
170 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
171 | IN EFI_HANDLE ControllerHandle,\r | |
172 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
173 | IN CHAR8 *Language,\r | |
174 | OUT CHAR16 **ControllerName\r | |
175 | )\r | |
176 | {\r | |
177 | return EFI_UNSUPPORTED;\r | |
178 | }\r |