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