]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Drivers/SataSiI3132Dxe/ComponentName.c
EmbeddedPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / EmbeddedPkg / Drivers / SataSiI3132Dxe / ComponentName.c
1 /** @file
2 UEFI Component Name(2) protocol implementation for Silicon Image I3132 SATA controller
3
4 * Copyright (c) 2011-2015, ARM Limited. All rights reserved.
5 *
6 * SPDX-License-Identifier: BSD-2-Clause-Patent
7 *
8 **/
9
10 #include "SataSiI3132.h"
11
12 //
13 // EFI Component Name Protocol
14 //
15 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gSataSiI3132ComponentName = {
16 SataSiI3132ComponentNameGetDriverName,
17 SataSiI3132ComponentNameGetControllerName,
18 "eng"
19 };
20
21 //
22 // EFI Component Name 2 Protocol
23 //
24 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gSataSiI3132ComponentName2 = {
25 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SataSiI3132ComponentNameGetDriverName,
26 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) SataSiI3132ComponentNameGetControllerName,
27 "en"
28 };
29
30
31 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSataSiI3132DriverNameTable[] = {
32 { "eng;en", L"Pci SATA Silicon Image 3132 Driver" },
33 { NULL , NULL }
34 };
35
36
37 /**
38 Retrieves a Unicode string that is the user readable name of the driver.
39
40 This function retrieves the user readable name of a driver in the form of a
41 Unicode string. If the driver specified by This has a user readable name in
42 the language specified by Language, then a pointer to the driver name is
43 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
44 by This does not support the language specified by Language,
45 then EFI_UNSUPPORTED is returned.
46
47 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
48 EFI_COMPONENT_NAME_PROTOCOL instance.
49
50 @param Language[in] A pointer to a Null-terminated ASCII string
51 array indicating the language. This is the
52 language of the driver name that the caller is
53 requesting, and it must match one of the
54 languages specified in SupportedLanguages. The
55 number of languages supported by a driver is up
56 to the driver writer. Language is specified
57 in RFC 4646 or ISO 639-2 language code format.
58
59 @param DriverName[out] A pointer to the Unicode string to return.
60 This Unicode string is the name of the
61 driver specified by This in the language
62 specified by Language.
63
64 @retval EFI_SUCCESS The Unicode string for the Driver specified by
65 This and the language specified by Language was
66 returned in DriverName.
67
68 @retval EFI_INVALID_PARAMETER Language is NULL.
69
70 @retval EFI_INVALID_PARAMETER DriverName is NULL.
71
72 @retval EFI_UNSUPPORTED The driver specified by This does not support
73 the language specified by Language.
74
75 **/
76 EFI_STATUS
77 EFIAPI
78 SataSiI3132ComponentNameGetDriverName (
79 IN EFI_COMPONENT_NAME_PROTOCOL *This,
80 IN CHAR8 *Language,
81 OUT CHAR16 **DriverName
82 )
83 {
84 return LookupUnicodeString2 (
85 Language,
86 This->SupportedLanguages,
87 mSataSiI3132DriverNameTable,
88 DriverName,
89 (BOOLEAN)(This == &gSataSiI3132ComponentName)
90 );
91 }
92
93 /**
94 Retrieves a Unicode string that is the user readable name of the controller
95 that is being managed by a driver.
96
97 This function retrieves the user readable name of the controller specified by
98 ControllerHandle and ChildHandle in the form of a Unicode string. If the
99 driver specified by This has a user readable name in the language specified by
100 Language, then a pointer to the controller name is returned in ControllerName,
101 and EFI_SUCCESS is returned. If the driver specified by This is not currently
102 managing the controller specified by ControllerHandle and ChildHandle,
103 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
104 support the language specified by Language, then EFI_UNSUPPORTED is returned.
105
106 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
107 EFI_COMPONENT_NAME_PROTOCOL instance.
108
109 @param ControllerHandle[in] The handle of a controller that the driver
110 specified by This is managing. This handle
111 specifies the controller whose name is to be
112 returned.
113
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
123 @param Language[in] A pointer to a Null-terminated ASCII string
124 array indicating the language. This is the
125 language of the driver name that the caller is
126 requesting, and it must match one of the
127 languages specified in SupportedLanguages. The
128 number of languages supported by a driver is up
129 to the driver writer. Language is specified in
130 RFC 4646 or ISO 639-2 language code format.
131
132 @param ControllerName[out] A pointer to the Unicode string to return.
133 This Unicode string is the name of the
134 controller specified by ControllerHandle and
135 ChildHandle in the language specified by
136 Language from the point of view of the driver
137 specified by This.
138
139 @retval EFI_SUCCESS The Unicode string for the user readable name in
140 the language specified by Language for the
141 driver specified by This was returned in
142 DriverName.
143
144 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
145
146 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
147 EFI_HANDLE.
148
149 @retval EFI_INVALID_PARAMETER Language is NULL.
150
151 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
152
153 @retval EFI_UNSUPPORTED The driver specified by This is not currently
154 managing the controller specified by
155 ControllerHandle and ChildHandle.
156
157 @retval EFI_UNSUPPORTED The driver specified by This does not support
158 the language specified by Language.
159
160 **/
161 EFI_STATUS
162 EFIAPI
163 SataSiI3132ComponentNameGetControllerName (
164 IN EFI_COMPONENT_NAME_PROTOCOL *This,
165 IN EFI_HANDLE ControllerHandle,
166 IN EFI_HANDLE ChildHandle OPTIONAL,
167 IN CHAR8 *Language,
168 OUT CHAR16 **ControllerName
169 )
170 {
171 return EFI_UNSUPPORTED;
172 }