]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/ComponentName2.h
Code Scrub for Protocol and Ppi Definition
[mirror_edk2.git] / MdePkg / Include / Protocol / ComponentName2.h
1 /** @file
2 UEFI Component Name 2 Protocol as defined in the UEFI 2.1 specification.
3 This protocol is used to retrieve user readable names of drivers
4 and controllers managed by UEFI Drivers.
5
6 Copyright (c) 2006 - 2008, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef __EFI_COMPONENT_NAME2_H__
18 #define __EFI_COMPONENT_NAME2_H__
19
20 #include <PiDxe.h>
21
22 //
23 // Global ID for the Component Name Protocol
24 //
25 #define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
26 {0x6a7a5cff, 0xe8d9, 0x4f70, { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } }
27
28 typedef struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL;
29
30
31 /**
32 Retrieves a Unicode string that is the user readable name of
33 the EFI Driver.
34
35 @param This A pointer to the
36 EFI_COMPONENT_NAME2_PROTOCOL instance.
37
38 @param Language A pointer to a Null-terminated ASCII string
39 array indicating the language. This is the
40 language of the driver name that the caller
41 is requesting, and it must match one of the
42 languages specified in SupportedLanguages.
43 The number of languages supported by a
44 driver is up to the driver writer. Language
45 is specified in RFC 3066 language code
46 format.
47
48 @param DriverName A pointer to the Unicode string to return.
49 This Unicode string is the name of the
50 driver specified by This in the language
51 specified by Language.
52
53 @retval EFI_SUCCESS The Unicode string for the
54 Driver specified by This and the
55 language specified by Language
56 was returned in DriverName.
57
58 @retval EFI_INVALID_PARAMETER Language is NULL.
59
60 @retval EFI_INVALID_PARAMETER DriverName is NULL.
61
62 @retval EFI_UNSUPPORTED The driver specified by This
63 does not support the language
64 specified by Language.
65
66 **/
67 typedef
68 EFI_STATUS
69 (EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME)(
70 IN EFI_COMPONENT_NAME2_PROTOCOL *This,
71 IN CHAR8 *Language,
72 OUT CHAR16 **DriverName
73 );
74
75
76 /**
77 Retrieves a Unicode string that is the user readable name of
78 the controller that is being managed by an EFI Driver.
79
80 @param This A pointer to the
81 EFI_COMPONENT_NAME2_PROTOCOL instance.
82
83 @param ControllerHandle The handle of a controller that the
84 driver specified by This is managing.
85 This handle specifies the controller
86 whose name is to be returned.
87
88 @param ChildHandle The handle of the child controller to
89 retrieve the name of. This is an
90 optional parameter that may be NULL.
91 It will be NULL for device drivers.
92 It will also be NULL for a bus
93 drivers that wish to retrieve the
94 name of the bus controller. It will
95 not be NULL for a bus driver that
96 wishes to retrieve the name of a
97 child controller.
98
99 @param Language A pointer to a Null-terminated ASCII
100 string array indicating the language.
101 This is the language of the driver
102 name that the caller is requesting,
103 and it must match one of the
104 languages specified in
105 SupportedLanguages. The number of
106 languages supported by a driver is up
107 to the driver writer. Language is
108 specified in RFC 3066 language code
109 format.
110
111 @param ControllerName A pointer to the Unicode string to
112 return. This Unicode string is the
113 name of the controller specified by
114 ControllerHandle and ChildHandle in
115 the language specified by Language
116 from the point of view of the driver
117 specified by This.
118
119 @retval EFI_SUCCESS The Unicode string for the user
120 readable name in the language
121 specified by Language for the
122 driver specified by This was
123 returned in DriverName.
124
125 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid
126 EFI_HANDLE.
127
128 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it
129 is not a valid EFI_HANDLE.
130
131 @retval EFI_INVALID_PARAMETER Language is NULL.
132
133 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
134
135 @retval EFI_UNSUPPORTED The driver specified by This is
136 not currently managing the
137 controller specified by
138 ControllerHandle and
139 ChildHandle.
140
141 @retval EFI_UNSUPPORTED The driver specified by This
142 does not support the language
143 specified by Language.
144
145 **/
146 typedef
147 EFI_STATUS
148 (EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)(
149 IN EFI_COMPONENT_NAME2_PROTOCOL *This,
150 IN EFI_HANDLE ControllerHandle,
151 IN EFI_HANDLE ChildHandle OPTIONAL,
152 IN CHAR8 *Language,
153 OUT CHAR16 **ControllerName
154 );
155
156 //
157 // Interface structure for the Component Name2 Protocol
158 //
159 /**
160 @par Protocol Description:
161 This protocol is used to retrieve user readable names of drivers
162 and controllers managed by UEFI Drivers.
163
164 @param GetDriverName
165 Retrieves a Unicode string that is the user readable name of the driver.
166
167 @param GetControllerName
168 Retrieves a Unicode string that is the user readable name of a
169 controller that is being managed by a driver.
170
171 @param SupportedLanguages
172 A Null-terminated ASCII string array that contains one or more
173 supported language codes. This is the list of language codes that
174 this protocol supports. The number of languages supported by a
175 driver is up to the driver writer. SupportedLanguages is
176 specified in RFC 3066 format.
177
178 **/
179 struct _EFI_COMPONENT_NAME2_PROTOCOL {
180 EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName;
181 EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName;
182 CHAR8 *SupportedLanguages;
183 };
184
185 extern EFI_GUID gEfiComponentName2ProtocolGuid;
186
187 #endif