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