]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/ComponentName.c
IntelFrameworkModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / Console / VgaClassDxe / ComponentName.c
CommitLineData
55a1bb43 1/** @file\r
0a6f4824 2 UEFI Component Name(2) protocol implementation for VGA Class Driver.\r
3db51098 3\r
0a6f4824 4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
c0a00b14 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
3db51098 6\r
7**/\r
e081218d 8\r
9#include "VgaClass.h"\r
10\r
11//\r
12// EFI Component Name Protocol\r
13//\r
1307dcd7 14GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gVgaClassComponentName = {\r
e081218d 15 VgaClassComponentNameGetDriverName,\r
16 VgaClassComponentNameGetControllerName,\r
17 "eng"\r
1307dcd7 18};\r
9d64ff86 19\r
20//\r
21// EFI Component Name 2 Protocol\r
22//\r
1307dcd7 23GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gVgaClassComponentName2 = {\r
9d64ff86 24 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) VgaClassComponentNameGetDriverName,\r
25 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) VgaClassComponentNameGetControllerName,\r
26 "en"\r
1307dcd7 27};\r
9d64ff86 28\r
e081218d 29\r
d1aeb0bd 30GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mVgaClassDriverNameTable[] = {\r
e081218d 31 {\r
9d64ff86 32 "eng;en",\r
e081218d 33 L"VGA Class Driver"\r
34 },\r
35 {\r
36 NULL,\r
37 NULL\r
38 }\r
39};\r
40\r
9d64ff86 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
55a1bb43 51 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
9d64ff86 52 EFI_COMPONENT_NAME_PROTOCOL instance.\r
55a1bb43 53 @param Language A pointer to a Null-terminated ASCII string\r
9d64ff86 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
4bca47e1 60 in RFC 4646 or ISO 639-2 language code format.\r
55a1bb43 61 @param DriverName A pointer to the Unicode string to return.\r
9d64ff86 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
9d64ff86 69 @retval EFI_INVALID_PARAMETER Language is NULL.\r
9d64ff86 70 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
9d64ff86 71 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
72 the language specified by Language.\r
73\r
74**/\r
e081218d 75EFI_STATUS\r
76EFIAPI\r
77VgaClassComponentNameGetDriverName (\r
78 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
79 IN CHAR8 *Language,\r
80 OUT CHAR16 **DriverName\r
81 )\r
e081218d 82{\r
9d64ff86 83 return LookupUnicodeString2 (\r
84 Language,\r
85 This->SupportedLanguages,\r
86 mVgaClassDriverNameTable,\r
87 DriverName,\r
88 (BOOLEAN)(This == &gVgaClassComponentName)\r
89 );\r
e081218d 90}\r
91\r
9d64ff86 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
55a1bb43 105 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
9d64ff86 106 EFI_COMPONENT_NAME_PROTOCOL instance.\r
55a1bb43 107 @param ControllerHandle The handle of a controller that the driver\r
9d64ff86 108 specified by This is managing. This handle\r
109 specifies the controller whose name is to be\r
110 returned.\r
55a1bb43 111 @param ChildHandle The handle of the child controller to retrieve\r
9d64ff86 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
55a1bb43 119 @param Language A pointer to a Null-terminated ASCII string\r
9d64ff86 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
4bca47e1 126 RFC 4646 or ISO 639-2 language code format.\r
55a1bb43 127 @param ControllerName A pointer to the Unicode string to return.\r
9d64ff86 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
c2d9a4d2 138 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
9d64ff86 139 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
140 EFI_HANDLE.\r
9d64ff86 141 @retval EFI_INVALID_PARAMETER Language is NULL.\r
9d64ff86 142 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
9d64ff86 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
9d64ff86 146 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
147 the language specified by Language.\r
148\r
149**/\r
e081218d 150EFI_STATUS\r
151EFIAPI\r
152VgaClassComponentNameGetControllerName (\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
e081218d 159{\r
160 return EFI_UNSUPPORTED;\r
161}\r