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