]> code.delx.au - refind/blob - filesystems/edk2/ComponentName.h
Properly initialise variable to fix detection of non-Arch kernel versions
[refind] / filesystems / edk2 / 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 - 2011, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available under
8 the terms and conditions of the BSD License that accompanies this distribution.
9 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 /*
18 * rEFInd NOTE: This file is included only when compiling with GNU-EFI,
19 * which has not traditionally provided the definitions supplied here.
20 * Unfortunately, recent (ca. 3.0.4) versions of GNU-EFI have added
21 * SOME of these functions to an existing header file, creating problems
22 * when trying to maintain compatibility with multiple GNU-EFI versions.
23 * I've therefore renamed the relevant defines, types, and functions,
24 * both here and in fsw_efi.c; and included a define to match the only
25 * used name (REFIND_EFI_COMPONENT_NAME_PROTOCOL) to the traditional
26 * name (EFI_COMPONENT_NAME_PROTOCOL) in fsw_efi.c for compiling with
27 * TianoCore.
28 */
29
30 #ifndef __REFIND_EFI_COMPONENT_NAME_H__
31 #define __REFIND_EFI_COMPONENT_NAME_H__
32
33 ///
34 /// The global ID for the Component Name Protocol.
35 ///
36 #define REFIND_EFI_COMPONENT_NAME_PROTOCOL_GUID \
37 { \
38 0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
39 }
40
41 typedef struct _REFIND_EFI_COMPONENT_NAME_PROTOCOL REFIND_EFI_COMPONENT_NAME_PROTOCOL;
42
43
44 /**
45 Retrieves a Unicode string that is the user-readable name of the EFI Driver.
46
47 @param This A pointer to the REFIND_EFI_COMPONENT_NAME_PROTOCOL instance.
48 @param Language A pointer to a three-character ISO 639-2 language identifier.
49 This is the language of the driver name that that the caller
50 is requesting, and it must match one of the languages specified
51 in SupportedLanguages. The number of languages supported by a
52 driver is up to the driver writer.
53 @param DriverName A pointer to the Unicode string to return. This Unicode string
54 is the name of the driver specified by This in the language
55 specified by Language.
56
57 @retval EFI_SUCCESS The Unicode string for the Driver specified by This
58 and the language specified by Language was returned
59 in DriverName.
60 @retval EFI_INVALID_PARAMETER Language is NULL.
61 @retval EFI_INVALID_PARAMETER DriverName is NULL.
62 @retval EFI_UNSUPPORTED The driver specified by This does not support the
63 language specified by Language.
64
65 **/
66 typedef
67 EFI_STATUS
68 (EFI_FUNCTION EFIAPI *REFIND_EFI_COMPONENT_NAME_GET_DRIVER_NAME)(
69 IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
70 IN CHAR8 *Language,
71 OUT CHAR16 **DriverName
72 );
73
74
75 /**
76 Retrieves a Unicode string that is the user readable name of the controller
77 that is being managed by an EFI Driver.
78
79 @param This A pointer to the REFIND_EFI_COMPONENT_NAME_PROTOCOL instance.
80 @param ControllerHandle The handle of a controller that the driver specified by
81 This is managing. This handle specifies the controller
82 whose name is to be returned.
83 @param ChildHandle The handle of the child controller to retrieve the name
84 of. This is an optional parameter that may be NULL. It
85 will be NULL for device drivers. It will also be NULL
86 for a bus drivers that wish to retrieve the name of the
87 bus controller. It will not be NULL for a bus driver
88 that wishes to retrieve the name of a child controller.
89 @param Language A pointer to a three character ISO 639-2 language
90 identifier. This is the language of the controller name
91 that the caller is requesting, and it must match one
92 of the languages specified in SupportedLanguages. The
93 number of languages supported by a driver is up to the
94 driver writer.
95 @param ControllerName A pointer to the Unicode string to return. This Unicode
96 string is the name of the controller specified by
97 ControllerHandle and ChildHandle in the language specified
98 by Language, from the point of view of the driver specified
99 by This.
100
101 @retval EFI_SUCCESS The Unicode string for the user-readable name in the
102 language specified by Language for the driver
103 specified by This was returned in DriverName.
104 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
105 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
106 @retval EFI_INVALID_PARAMETER Language is NULL.
107 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
108 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
109 the controller specified by ControllerHandle and
110 ChildHandle.
111 @retval EFI_UNSUPPORTED The driver specified by This does not support the
112 language specified by Language.
113
114 **/
115 typedef
116 EFI_STATUS
117 (EFI_FUNCTION EFIAPI *REFIND_EFI_COMPONENT_NAME_GET_CONTROLLER_NAME)(
118 IN REFIND_EFI_COMPONENT_NAME_PROTOCOL *This,
119 IN EFI_HANDLE ControllerHandle,
120 IN EFI_HANDLE ChildHandle OPTIONAL,
121 IN CHAR8 *Language,
122 OUT CHAR16 **ControllerName
123 );
124
125 ///
126 /// This protocol is used to retrieve user readable names of drivers
127 /// and controllers managed by UEFI Drivers.
128 ///
129 struct _REFIND_EFI_COMPONENT_NAME_PROTOCOL {
130 REFIND_EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
131 REFIND_EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
132 ///
133 /// A Null-terminated ASCII string that contains one or more
134 /// ISO 639-2 language codes. This is the list of language codes
135 /// that this protocol supports.
136 ///
137 CHAR8 *SupportedLanguages;
138 };
139
140 extern EFI_GUID gEfiComponentNameProtocolGuid;
141
142 #endif