]>
Commit | Line | Data |
---|---|---|
dc361cc5 | 1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2007, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
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 | \r | |
20 | \r | |
21 | #include "PxeBcImpl.h"\r | |
22 | \r | |
23 | //\r | |
24 | // EFI Component Name Functions\r | |
25 | //\r | |
26 | EFI_STATUS\r | |
27 | EFIAPI\r | |
28 | PxeBcComponentNameGetDriverName (\r | |
29 | IN EFI_COMPONENT_NAME_PROTOCOL * This,\r | |
30 | IN CHAR8 *Language,\r | |
31 | OUT CHAR16 **DriverName\r | |
32 | );\r | |
33 | \r | |
34 | EFI_STATUS\r | |
35 | EFIAPI\r | |
36 | PxeBcComponentNameGetControllerName (\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 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName = {\r | |
48 | PxeBcComponentNameGetDriverName,\r | |
49 | PxeBcComponentNameGetControllerName,\r | |
50 | "eng"\r | |
51 | };\r | |
52 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2 = {\r | |
53 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PxeBcComponentNameGetDriverName,\r | |
54 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PxeBcComponentNameGetControllerName,\r | |
55 | "en"\r | |
56 | };\r | |
57 | \r | |
58 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTable[] = {\r | |
59 | {\r | |
60 | "eng;en",\r | |
61 | L"UEFI PXE Base Code Driver"\r | |
62 | },\r | |
63 | {\r | |
64 | NULL,\r | |
65 | NULL\r | |
66 | }\r | |
67 | };\r | |
68 | \r | |
69 | EFI_STATUS\r | |
70 | EFIAPI\r | |
71 | PxeBcComponentNameGetDriverName (\r | |
72 | IN EFI_COMPONENT_NAME_PROTOCOL * This,\r | |
73 | IN CHAR8 *Language,\r | |
74 | OUT CHAR16 **DriverName\r | |
75 | )\r | |
76 | /*++\r | |
77 | \r | |
78 | Routine Description:\r | |
79 | Retrieves a Unicode string that is the user readable name of the EFI Driver.\r | |
80 | \r | |
81 | Arguments:\r | |
82 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
83 | Language - A pointer to a three character ISO 639-2 language identifier.\r | |
84 | This is the language of the driver name that that the caller\r | |
85 | is requesting, and it must match one of the languages specified\r | |
86 | in SupportedLanguages. The number of languages supported by a\r | |
87 | driver is up to the driver writer.\r | |
88 | DriverName - A pointer to the Unicode string to return. This Unicode string\r | |
89 | is the name of the driver specified by This in the language\r | |
90 | specified by Language.\r | |
91 | \r | |
92 | Returns:\r | |
93 | EFI_SUCCESS - The Unicode string for the Driver specified by This\r | |
94 | and the language specified by Language was returned\r | |
95 | in DriverName.\r | |
96 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
97 | EFI_INVALID_PARAMETER - DriverName is NULL.\r | |
98 | EFI_UNSUPPORTED - The driver specified by This does not support the\r | |
99 | language specified by Language.\r | |
100 | \r | |
101 | --*/\r | |
102 | {\r | |
103 | return LookupUnicodeString2 (\r | |
104 | Language,\r | |
105 | This->SupportedLanguages,\r | |
106 | mPxeBcDriverNameTable,\r | |
107 | DriverName,\r | |
108 | (BOOLEAN)(This == &gPxeBcComponentName)\r | |
109 | );\r | |
110 | }\r | |
111 | \r | |
112 | EFI_STATUS\r | |
113 | EFIAPI\r | |
114 | PxeBcComponentNameGetControllerName (\r | |
115 | IN EFI_COMPONENT_NAME_PROTOCOL * This,\r | |
116 | IN EFI_HANDLE ControllerHandle,\r | |
117 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
118 | IN CHAR8 *Language,\r | |
119 | OUT CHAR16 **ControllerNameString\r | |
120 | )\r | |
121 | /*++\r | |
122 | \r | |
123 | Routine Description:\r | |
124 | Retrieves a Unicode string that is the user readable name of the controller\r | |
125 | that is being managed by an EFI Driver.\r | |
126 | \r | |
127 | Arguments:\r | |
128 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
129 | ControllerHandle - The handle of a controller that the driver specified by\r | |
130 | This is managing. This handle specifies the controller\r | |
131 | whose name is to be returned.\r | |
132 | ChildHandle - The handle of the child controller to retrieve the name\r | |
133 | of. This is an optional parameter that may be NULL. It\r | |
134 | will be NULL for device drivers. It will also be NULL\r | |
135 | for a bus drivers that wish to retrieve the name of the\r | |
136 | bus controller. It will not be NULL for a bus driver\r | |
137 | that wishes to retrieve the name of a child controller.\r | |
138 | Language - A pointer to a three character ISO 639-2 language\r | |
139 | identifier. This is the language of the controller name\r | |
140 | that that the caller is requesting, and it must match one\r | |
141 | of the languages specified in SupportedLanguages. The\r | |
142 | number of languages supported by a driver is up to the\r | |
143 | driver writer.\r | |
144 | ControllerName - A pointer to the Unicode string to return. This Unicode\r | |
145 | string is the name of the controller specified by\r | |
146 | ControllerHandle and ChildHandle in the language specified\r | |
147 | by Language from the point of view of the driver specified\r | |
148 | by This.\r | |
149 | \r | |
150 | Returns:\r | |
151 | EFI_SUCCESS - The Unicode string for the user readable name in the\r | |
152 | language specified by Language for the driver\r | |
153 | specified by This was returned in DriverName.\r | |
154 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r | |
155 | EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r | |
156 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
157 | EFI_INVALID_PARAMETER - ControllerName is NULL.\r | |
158 | EFI_UNSUPPORTED - The driver specified by This is not currently managing\r | |
159 | the controller specified by ControllerHandle and\r | |
160 | ChildHandle.\r | |
161 | EFI_UNSUPPORTED - The driver specified by This does not support the\r | |
162 | language specified by Language.\r | |
163 | \r | |
164 | --*/\r | |
165 | {\r | |
166 | return EFI_UNSUPPORTED;\r | |
167 | }\r | |
168 | \r |