]>
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 |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
779ae357 | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #include "VlanConfigImpl.h"\r | |
10 | \r | |
11 | //\r | |
12 | // EFI Component Name Protocol\r | |
13 | //\r | |
14 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gVlanConfigComponentName = {\r | |
15 | VlanConfigComponentNameGetDriverName,\r | |
16 | VlanConfigComponentNameGetControllerName,\r | |
17 | "eng"\r | |
18 | };\r | |
19 | \r | |
20 | //\r | |
21 | // EFI Component Name 2 Protocol\r | |
22 | //\r | |
23 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gVlanConfigComponentName2 = {\r | |
24 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) VlanConfigComponentNameGetDriverName,\r | |
25 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) VlanConfigComponentNameGetControllerName,\r | |
26 | "en"\r | |
27 | };\r | |
28 | \r | |
29 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mVlanConfigDriverNameTable[] = {\r | |
30 | {\r | |
31 | "eng;en",\r | |
32 | L"VLAN Configuration Driver"\r | |
33 | },\r | |
34 | {\r | |
35 | NULL,\r | |
36 | NULL\r | |
37 | }\r | |
38 | };\r | |
39 | \r | |
40 | //\r | |
41 | // EFI Component Name Functions\r | |
42 | //\r | |
43 | \r | |
44 | /**\r | |
45 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
46 | \r | |
47 | This function retrieves the user readable name of a driver in the form of a\r | |
48 | Unicode string. If the driver specified by This has a user readable name in\r | |
49 | the language specified by Language, then a pointer to the driver name is\r | |
50 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
51 | by This does not support the language specified by Language,\r | |
52 | then EFI_UNSUPPORTED is returned.\r | |
53 | \r | |
54 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
55 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
56 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
57 | array indicating the language. This is the\r | |
58 | language of the driver name that the caller is\r | |
59 | requesting, and it must match one of the\r | |
60 | languages specified in SupportedLanguages. The\r | |
61 | number of languages supported by a driver is up\r | |
62 | to the driver writer. Language is specified\r | |
63 | in RFC 4646 or ISO 639-2 language code format.\r | |
64 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
65 | This Unicode string is the name of the\r | |
66 | driver specified by This in the language\r | |
67 | specified by Language.\r | |
68 | \r | |
69 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
70 | This and the language specified by Language was\r | |
71 | returned in DriverName.\r | |
72 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
73 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
74 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
75 | the language specified by Language.\r | |
76 | \r | |
77 | **/\r | |
78 | EFI_STATUS\r | |
79 | EFIAPI\r | |
80 | VlanConfigComponentNameGetDriverName (\r | |
81 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
82 | IN CHAR8 *Language,\r | |
83 | OUT CHAR16 **DriverName\r | |
84 | )\r | |
85 | {\r | |
86 | return LookupUnicodeString2 (\r | |
87 | Language,\r | |
88 | This->SupportedLanguages,\r | |
89 | mVlanConfigDriverNameTable,\r | |
90 | DriverName,\r | |
91 | (BOOLEAN)(This == &gVlanConfigComponentName)\r | |
92 | );\r | |
93 | }\r | |
94 | \r | |
95 | /**\r | |
96 | Retrieves a Unicode string that is the user readable name of the controller\r | |
97 | that is being managed by a driver.\r | |
98 | \r | |
99 | This function retrieves the user readable name of the controller specified by\r | |
100 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
101 | driver specified by This has a user readable name in the language specified by\r | |
102 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
103 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
104 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
105 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
106 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
107 | \r | |
108 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
109 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
110 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
111 | specified by This is managing. This handle\r | |
112 | specifies the controller whose name is to be\r | |
113 | returned.\r | |
114 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
115 | the name of. This is an optional parameter that\r | |
116 | may be NULL. It will be NULL for device\r | |
117 | drivers. It will also be NULL for a bus drivers\r | |
118 | that wish to retrieve the name of the bus\r | |
119 | controller. It will not be NULL for a bus\r | |
120 | driver that wishes to retrieve the name of a\r | |
121 | child controller.\r | |
122 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
123 | array indicating the language. This is the\r | |
124 | language of the driver name that the caller is\r | |
125 | requesting, and it must match one of the\r | |
126 | languages specified in SupportedLanguages. The\r | |
127 | number of languages supported by a driver is up\r | |
128 | to the driver writer. Language is specified in\r | |
129 | RFC 4646 or ISO 639-2 language code format.\r | |
130 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
131 | This Unicode string is the name of the\r | |
132 | controller specified by ControllerHandle and\r | |
133 | ChildHandle in the language specified by\r | |
134 | Language from the point of view of the driver\r | |
135 | specified by This.\r | |
136 | \r | |
137 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
138 | the language specified by Language for the\r | |
139 | driver specified by This was returned in\r | |
140 | DriverName.\r | |
284ee2e8 | 141 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
779ae357 | 142 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r |
143 | EFI_HANDLE.\r | |
144 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
145 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
146 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
147 | managing the controller specified by\r | |
148 | ControllerHandle and ChildHandle.\r | |
149 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
150 | the language specified by Language.\r | |
151 | \r | |
152 | **/\r | |
153 | EFI_STATUS\r | |
154 | EFIAPI\r | |
155 | VlanConfigComponentNameGetControllerName (\r | |
156 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
157 | IN EFI_HANDLE ControllerHandle,\r | |
158 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
159 | IN CHAR8 *Language,\r | |
160 | OUT CHAR16 **ControllerName\r | |
161 | )\r | |
162 | {\r | |
163 | return EFI_UNSUPPORTED;\r | |
164 | }\r |