]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/BiosVideoThunkDxe/ComponentName.c
1, Port BiosVideoThunkDxe driver from edk to edk2;
[mirror_edk2.git] / DuetPkg / BiosVideoThunkDxe / ComponentName.c
CommitLineData
7da78b1f 1/*++\r
2\r
3Copyright (c) 2006 - 2007, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 ComponentName.c\r
15\r
16Abstract:\r
17\r
18--*/\r
19\r
20#include "BiosVideo.h"\r
21\r
22EFI_STATUS\r
23EFIAPI\r
24BiosVideoComponentNameGetDriverName (\r
25 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
26 IN CHAR8 *Language,\r
27 OUT CHAR16 **DriverName\r
28 );\r
29 \r
30EFI_STATUS\r
31EFIAPI\r
32BiosVideoComponentNameGetControllerName (\r
33 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
34 IN EFI_HANDLE ControllerHandle,\r
35 IN EFI_HANDLE ChildHandle OPTIONAL,\r
36 IN CHAR8 *Language,\r
37 OUT CHAR16 **ControllerName\r
38 );\r
39 \r
40//\r
41// EFI Component Name Protocol\r
42//\r
43\r
44GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gBiosVideoComponentName = {\r
45 BiosVideoComponentNameGetDriverName,\r
46 BiosVideoComponentNameGetControllerName,\r
47 "eng"\r
48};\r
49\r
50GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gBiosVideoComponentName2 = {\r
51 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) BiosVideoComponentNameGetDriverName,\r
52 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) BiosVideoComponentNameGetControllerName,\r
53 "en"\r
54};\r
55\r
56\r
57static EFI_UNICODE_STRING_TABLE mBiosVideoDriverNameTable[] = {\r
58 {\r
59 "eng;en",\r
60 L"BIOS[INT10] Video Driver"\r
61 },\r
62 {\r
63 NULL,\r
64 NULL\r
65 }\r
66};\r
67\r
68EFI_STATUS\r
69EFIAPI\r
70BiosVideoComponentNameGetDriverName (\r
71 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
72 IN CHAR8 *Language,\r
73 OUT CHAR16 **DriverName\r
74 )\r
75/*++\r
76\r
77 Routine Description:\r
78 Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
79\r
80 Arguments:\r
81 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
82 Language - A pointer to a three character ISO 639-2 language identifier.\r
83 This is the language of the driver name that that the caller \r
84 is requesting, and it must match one of the languages specified\r
85 in SupportedLanguages. The number of languages supported by a \r
86 driver is up to the driver writer.\r
87 DriverName - A pointer to the Unicode string to return. This Unicode string\r
88 is the name of the driver specified by This in the language \r
89 specified by Language.\r
90\r
91 Returns:\r
92 EFI_SUCCESS - The Unicode string for the Driver specified by This\r
93 and the language specified by Language was returned \r
94 in DriverName.\r
95 EFI_INVALID_PARAMETER - Language is NULL.\r
96 EFI_INVALID_PARAMETER - DriverName is NULL.\r
97 EFI_UNSUPPORTED - The driver specified by This does not support the \r
98 language specified by Language.\r
99\r
100--*/\r
101{\r
102 return LookupUnicodeString2 (\r
103 Language,\r
104 This->SupportedLanguages,\r
105 mBiosVideoDriverNameTable,\r
106 DriverName,\r
107 (BOOLEAN)(This == &gBiosVideoComponentName)\r
108 ); \r
109}\r
110\r
111EFI_STATUS\r
112EFIAPI\r
113BiosVideoComponentNameGetControllerName (\r
114 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
115 IN EFI_HANDLE ControllerHandle,\r
116 IN EFI_HANDLE ChildHandle OPTIONAL,\r
117 IN CHAR8 *Language,\r
118 OUT CHAR16 **ControllerName\r
119 )\r
120/*++\r
121\r
122 Routine Description:\r
123 Retrieves a Unicode string that is the user readable name of the controller\r
124 that is being managed by an EFI Driver.\r
125\r
126 Arguments:\r
127 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
128 ControllerHandle - The handle of a controller that the driver specified by \r
129 This is managing. This handle specifies the controller \r
130 whose name is to be returned.\r
131 ChildHandle - The handle of the child controller to retrieve the name \r
132 of. This is an optional parameter that may be NULL. It \r
133 will be NULL for device drivers. It will also be NULL \r
134 for a bus drivers that wish to retrieve the name of the \r
135 bus controller. It will not be NULL for a bus driver \r
136 that wishes to retrieve the name of a child controller.\r
137 Language - A pointer to a three character ISO 639-2 language \r
138 identifier. This is the language of the controller name \r
139 that that the caller is requesting, and it must match one\r
140 of the languages specified in SupportedLanguages. The \r
141 number of languages supported by a driver is up to the \r
142 driver writer.\r
143 ControllerName - A pointer to the Unicode string to return. This Unicode\r
144 string is the name of the controller specified by \r
145 ControllerHandle and ChildHandle in the language specified\r
146 by Language from the point of view of the driver specified\r
147 by This. \r
148\r
149 Returns:\r
150 EFI_SUCCESS - The Unicode string for the user readable name in the \r
151 language specified by Language for the driver \r
152 specified by This was returned in DriverName.\r
153 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
154 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
155 EFI_INVALID_PARAMETER - Language is NULL.\r
156 EFI_INVALID_PARAMETER - ControllerName is NULL.\r
157 EFI_UNSUPPORTED - The driver specified by This is not currently managing \r
158 the controller specified by ControllerHandle and \r
159 ChildHandle.\r
160 EFI_UNSUPPORTED - The driver specified by This does not support the \r
161 language specified by Language.\r
162\r
163--*/\r
164{\r
165 return EFI_UNSUPPORTED;\r
166}\r