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