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