8254TimerDxe: DuetPkg => PcAtChipsetPkg
[mirror_edk2.git] / DuetPkg / IsaAcpiDxe / ComponentName.c
CommitLineData
c69dd9df 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
12\r
13Module Name:\r
14\r
15 ComponentName.c\r
16\r
17Abstract:\r
18\r
19--*/\r
20\r
21#include "PcatIsaAcpi.h"\r
22\r
23//\r
24// EFI Component Name Functions\r
25//\r
26EFI_STATUS\r
27EFIAPI\r
28PcatIsaAcpiComponentNameGetDriverName (\r
29 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
30 IN CHAR8 *Language,\r
31 OUT CHAR16 **DriverName\r
32 );\r
33\r
34EFI_STATUS\r
35EFIAPI\r
36PcatIsaAcpiComponentNameGetControllerName (\r
37 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
38 IN EFI_HANDLE ControllerHandle,\r
39 IN EFI_HANDLE ChildHandle OPTIONAL,\r
40 IN CHAR8 *Language,\r
41 OUT CHAR16 **ControllerName\r
42 );\r
43\r
44//\r
45// EFI Component Name Protocol\r
46//\r
47\r
48EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2 = {\r
49 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PcatIsaAcpiComponentNameGetDriverName,\r
50 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PcatIsaAcpiComponentNameGetControllerName,\r
51 "en"\r
52};\r
53\r
54EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName = {\r
55 PcatIsaAcpiComponentNameGetDriverName,\r
56 PcatIsaAcpiComponentNameGetControllerName,\r
57 "eng"\r
58};\r
59\r
60\r
e56dd2ce 61EFI_UNICODE_STRING_TABLE mPcatIsaAcpiDriverNameTable[] = {\r
c69dd9df 62 {\r
63 "eng;en",\r
64 L"PC-AT ISA Device Enumeration Driver"\r
65 },\r
66 {\r
67 NULL,\r
68 NULL\r
69 }\r
70};\r
71\r
72EFI_STATUS\r
73EFIAPI\r
74PcatIsaAcpiComponentNameGetDriverName (\r
75 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
76 IN CHAR8 *Language,\r
77 OUT CHAR16 **DriverName\r
78 )\r
79/*++\r
80\r
81 Routine Description:\r
82 Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
83\r
84 Arguments:\r
85 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
86 Language - A pointer to a three character ISO 639-2 language identifier.\r
87 This is the language of the driver name that that the caller \r
88 is requesting, and it must match one of the languages specified\r
89 in SupportedLanguages. The number of languages supported by a \r
90 driver is up to the driver writer.\r
91 DriverName - A pointer to the Unicode string to return. This Unicode string\r
92 is the name of the driver specified by This in the language \r
93 specified by Language.\r
94\r
95 Returns:\r
96 EFI_SUCCES - The Unicode string for the Driver specified by This\r
97 and the language specified by Language was returned \r
98 in DriverName.\r
99 EFI_INVALID_PARAMETER - Language is NULL.\r
100 EFI_INVALID_PARAMETER - DriverName is NULL.\r
101 EFI_UNSUPPORTED - The driver specified by This does not support the \r
102 language specified by Language.\r
103\r
104--*/\r
105{\r
106 return LookupUnicodeString2 (\r
107 Language,\r
108 This->SupportedLanguages,\r
109 mPcatIsaAcpiDriverNameTable, \r
110 DriverName,\r
111 (BOOLEAN)(This == &gPcatIsaAcpiComponentName)\r
112 );\r
113}\r
114\r
115EFI_STATUS\r
116EFIAPI\r
117PcatIsaAcpiComponentNameGetControllerName (\r
118 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
119 IN EFI_HANDLE ControllerHandle,\r
120 IN EFI_HANDLE ChildHandle OPTIONAL,\r
121 IN CHAR8 *Language,\r
122 OUT CHAR16 **ControllerName\r
123 )\r
124/*++\r
125\r
126 Routine Description:\r
127 Retrieves a Unicode string that is the user readable name of the controller\r
128 that is being managed by an EFI Driver.\r
129\r
130 Arguments:\r
131 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
132 ControllerHandle - The handle of a controller that the driver specified by \r
133 This is managing. This handle specifies the controller \r
134 whose name is to be returned.\r
135 ChildHandle - The handle of the child controller to retrieve the name \r
136 of. This is an optional parameter that may be NULL. It \r
137 will be NULL for device drivers. It will also be NULL \r
138 for a bus drivers that wish to retrieve the name of the \r
139 bus controller. It will not be NULL for a bus driver \r
140 that wishes to retrieve the name of a child controller.\r
141 Language - A pointer to a three character ISO 639-2 language \r
142 identifier. This is the language of the controller name \r
143 that that the caller is requesting, and it must match one\r
144 of the languages specified in SupportedLanguages. The \r
145 number of languages supported by a driver is up to the \r
146 driver writer.\r
147 ControllerName - A pointer to the Unicode string to return. This Unicode\r
148 string is the name of the controller specified by \r
149 ControllerHandle and ChildHandle in the language specified\r
150 by Language from the point of view of the driver specified\r
151 by This. \r
152\r
153 Returns:\r
154 EFI_SUCCESS - The Unicode string for the user readable name in the \r
155 language specified by Language for the driver \r
156 specified by This was returned in DriverName.\r
157 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
158 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
159 EFI_INVALID_PARAMETER - Language is NULL.\r
160 EFI_INVALID_PARAMETER - ControllerName is NULL.\r
161 EFI_UNSUPPORTED - The driver specified by This is not currently managing \r
162 the controller specified by ControllerHandle and \r
163 ChildHandle.\r
164 EFI_UNSUPPORTED - The driver specified by This does not support the \r
165 language specified by Language.\r
166\r
167--*/\r
168{\r
169 return EFI_UNSUPPORTED;\r
170}\r