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