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