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