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