2 UEFI Component Name(2) protocol implementation for MnpDxe driver.
4 Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions
7 of the BSD License which accompanies this distribution. The full
8 text of the license may be found at<BR>
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "MnpDriver.h"
19 // EFI Component Name Protocol
21 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gMnpComponentName
= {
22 MnpComponentNameGetDriverName
,
23 MnpComponentNameGetControllerName
,
28 // EFI Component Name 2 Protocol
30 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gMnpComponentName2
= {
31 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) MnpComponentNameGetDriverName
,
32 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) MnpComponentNameGetControllerName
,
36 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mMnpDriverNameTable
[] = {
39 L
"MNP Network Service Driver"
48 Retrieves a Unicode string that is the user readable name of the driver.
50 This function retrieves the user readable name of a driver in the form of a
51 Unicode string. If the driver specified by This has a user readable name in
52 the language specified by Language, then a pointer to the driver name is
53 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
54 by This does not support the language specified by Language,
55 then EFI_UNSUPPORTED is returned.
57 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
58 EFI_COMPONENT_NAME_PROTOCOL instance.
60 @param[in] Language A pointer to a Null-terminated ASCII string
61 array indicating the language. This is the
62 language of the driver name that the caller is
63 requesting, and it must match one of the
64 languages specified in SupportedLanguages. The
65 number of languages supported by a driver is up
66 to the driver writer. Language is specified
67 in RFC 4646 or ISO 639-2 language code format.
69 @param[out] DriverName A pointer to the Unicode string to return.
70 This Unicode string is the name of the
71 driver specified by This in the language
72 specified by Language.
74 @retval EFI_SUCCESS The Unicode string for the Driver specified by
75 This and the language specified by Language was
76 returned in DriverName.
78 @retval EFI_INVALID_PARAMETER Language is NULL.
80 @retval EFI_INVALID_PARAMETER DriverName is NULL.
82 @retval EFI_UNSUPPORTED The driver specified by This does not support
83 the language specified by Language.
88 MnpComponentNameGetDriverName (
89 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
91 OUT CHAR16
**DriverName
94 return LookupUnicodeString2 (
96 This
->SupportedLanguages
,
99 (BOOLEAN
) (This
== &gMnpComponentName
)
104 Retrieves a Unicode string that is the user readable name of the controller
105 that is being managed by a driver.
107 This function retrieves the user readable name of the controller specified by
108 ControllerHandle and ChildHandle in the form of a Unicode string. If the
109 driver specified by This has a user readable name in the language specified by
110 Language, then a pointer to the controller name is returned in ControllerName,
111 and EFI_SUCCESS is returned. If the driver specified by This is not currently
112 managing the controller specified by ControllerHandle and ChildHandle,
113 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
114 support the language specified by Language, then EFI_UNSUPPORTED is returned.
115 Currently not implemented.
117 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
118 EFI_COMPONENT_NAME_PROTOCOL instance.
120 @param[in] ControllerHandle The handle of a controller that the driver
121 specified by This is managing. This handle
122 specifies the controller whose name is to be
125 @param[in] ChildHandle The handle of the child controller to retrieve
126 the name of. This is an optional parameter that
127 may be NULL. It will be NULL for device
128 drivers. It will also be NULL for a bus drivers
129 that wish to retrieve the name of the bus
130 controller. It will not be NULL for a bus
131 driver that wishes to retrieve the name of a
134 @param[in] Language A pointer to a Null-terminated ASCII string
135 array indicating the language. This is the
136 language of the driver name that the caller is
137 requesting, and it must match one of the
138 languages specified in SupportedLanguages. The
139 number of languages supported by a driver is up
140 to the driver writer. Language is specified in
141 RFC 4646 or ISO 639-2 language code format.
143 @param[out] ControllerName A pointer to the Unicode string to return.
144 This Unicode string is the name of the
145 controller specified by ControllerHandle and
146 ChildHandle in the language specified by
147 Language from the point of view of the driver
150 @retval EFI_SUCCESS The Unicode string for the user readable name
151 specified by This, ControllerHandle, ChildHandle,
152 and Language was returned in ControllerName.
154 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
156 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
159 @retval EFI_INVALID_PARAMETER Language is NULL.
161 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
163 @retval EFI_UNSUPPORTED The driver specified by This is not currently
164 managing the controller specified by
165 ControllerHandle and ChildHandle.
167 @retval EFI_UNSUPPORTED The driver specified by This does not support
168 the language specified by Language.
173 MnpComponentNameGetControllerName (
174 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
175 IN EFI_HANDLE ControllerHandle
,
176 IN EFI_HANDLE ChildHandle OPTIONAL
,
178 OUT CHAR16
**ControllerName
181 return EFI_UNSUPPORTED
;