]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/ComponentName.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / ComponentName.h
1 /** @file
2 EFI Component Name Protocol as defined in the EFI 1.1 specification.
3 This protocol is used to retrieve user readable names of EFI Drivers
4 and controllers managed by EFI Drivers.
5
6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef __EFI_COMPONENT_NAME_H__
12 #define __EFI_COMPONENT_NAME_H__
13
14 ///
15 /// The global ID for the Component Name Protocol.
16 ///
17 #define EFI_COMPONENT_NAME_PROTOCOL_GUID \
18 { \
19 0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
20 }
21
22 typedef struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL;
23
24
25 /**
26 Retrieves a Unicode string that is the user-readable name of the EFI Driver.
27
28 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
29 @param Language A pointer to a three-character ISO 639-2 language identifier.
30 This is the language of the driver name that that the caller
31 is requesting, and it must match one of the languages specified
32 in SupportedLanguages. The number of languages supported by a
33 driver is up to the driver writer.
34 @param DriverName A pointer to the Unicode string to return. This Unicode string
35 is the name of the driver specified by This in the language
36 specified by Language.
37
38 @retval EFI_SUCCESS The Unicode string for the Driver specified by This
39 and the language specified by Language was returned
40 in DriverName.
41 @retval EFI_INVALID_PARAMETER Language is NULL.
42 @retval EFI_INVALID_PARAMETER DriverName is NULL.
43 @retval EFI_UNSUPPORTED The driver specified by This does not support the
44 language specified by Language.
45
46 **/
47 typedef
48 EFI_STATUS
49 (EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME)(
50 IN EFI_COMPONENT_NAME_PROTOCOL *This,
51 IN CHAR8 *Language,
52 OUT CHAR16 **DriverName
53 );
54
55
56 /**
57 Retrieves a Unicode string that is the user readable name of the controller
58 that is being managed by an EFI Driver.
59
60 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
61 @param ControllerHandle The handle of a controller that the driver specified by
62 This is managing. This handle specifies the controller
63 whose name is to be returned.
64 @param ChildHandle The handle of the child controller to retrieve the name
65 of. This is an optional parameter that may be NULL. It
66 will be NULL for device drivers. It will also be NULL
67 for a bus drivers that wish to retrieve the name of the
68 bus controller. It will not be NULL for a bus driver
69 that wishes to retrieve the name of a child controller.
70 @param Language A pointer to a three character ISO 639-2 language
71 identifier. This is the language of the controller name
72 that the caller is requesting, and it must match one
73 of the languages specified in SupportedLanguages. The
74 number of languages supported by a driver is up to the
75 driver writer.
76 @param ControllerName A pointer to the Unicode string to return. This Unicode
77 string is the name of the controller specified by
78 ControllerHandle and ChildHandle in the language specified
79 by Language, from the point of view of the driver specified
80 by This.
81
82 @retval EFI_SUCCESS The Unicode string for the user-readable name in the
83 language specified by Language for the driver
84 specified by This was returned in DriverName.
85 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
86 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
87 @retval EFI_INVALID_PARAMETER Language is NULL.
88 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
89 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
90 the controller specified by ControllerHandle and
91 ChildHandle.
92 @retval EFI_UNSUPPORTED The driver specified by This does not support the
93 language specified by Language.
94
95 **/
96 typedef
97 EFI_STATUS
98 (EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)(
99 IN EFI_COMPONENT_NAME_PROTOCOL *This,
100 IN EFI_HANDLE ControllerHandle,
101 IN EFI_HANDLE ChildHandle OPTIONAL,
102 IN CHAR8 *Language,
103 OUT CHAR16 **ControllerName
104 );
105
106 ///
107 /// This protocol is used to retrieve user readable names of drivers
108 /// and controllers managed by UEFI Drivers.
109 ///
110 struct _EFI_COMPONENT_NAME_PROTOCOL {
111 EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
112 EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
113 ///
114 /// A Null-terminated ASCII string that contains one or more
115 /// ISO 639-2 language codes. This is the list of language codes
116 /// that this protocol supports.
117 ///
118 CHAR8 *SupportedLanguages;
119 };
120
121 extern EFI_GUID gEfiComponentNameProtocolGuid;
122
123 #endif