]>
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 |
3a10d471 | 9 | #include "ScsiBus.h"\r |
10 | \r | |
11 | //\r | |
12 | // EFI Component Name Protocol\r | |
13 | //\r | |
1307dcd7 | 14 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gScsiBusComponentName = {\r |
3a10d471 | 15 | ScsiBusComponentNameGetDriverName,\r |
16 | ScsiBusComponentNameGetControllerName,\r | |
17 | "eng"\r | |
1307dcd7 | 18 | };\r |
70da5bc2 | 19 | \r |
20 | //\r | |
21 | // EFI Component Name 2 Protocol\r | |
22 | //\r | |
1436aea4 MK |
23 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gScsiBusComponentName2 = {\r |
24 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)ScsiBusComponentNameGetDriverName,\r | |
25 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)ScsiBusComponentNameGetControllerName,\r | |
70da5bc2 | 26 | "en"\r |
1307dcd7 | 27 | };\r |
70da5bc2 | 28 | \r |
1436aea4 MK |
29 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mScsiBusDriverNameTable[] = {\r |
30 | { "eng;en", (CHAR16 *)L"SCSI Bus Driver" },\r | |
31 | { NULL, NULL }\r | |
3a10d471 | 32 | };\r |
33 | \r | |
70da5bc2 | 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 | |
9beb888e | 44 | @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
70da5bc2 | 45 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
46 | \r | |
9beb888e | 47 | @param Language A pointer to a Null-terminated ASCII string\r |
70da5bc2 | 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 | |
0254efc0 | 54 | in RFC 4646 or ISO 639-2 language code format.\r |
70da5bc2 | 55 | \r |
9beb888e | 56 | @param DriverName A pointer to the Unicode string to return.\r |
70da5bc2 | 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 | |
3a10d471 | 73 | EFI_STATUS\r |
74 | EFIAPI\r | |
75 | ScsiBusComponentNameGetDriverName (\r | |
76 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
77 | IN CHAR8 *Language,\r | |
78 | OUT CHAR16 **DriverName\r | |
79 | )\r | |
3a10d471 | 80 | {\r |
70da5bc2 | 81 | return LookupUnicodeString2 (\r |
82 | Language,\r | |
83 | This->SupportedLanguages,\r | |
84 | mScsiBusDriverNameTable,\r | |
85 | DriverName,\r | |
86 | (BOOLEAN)(This == &gScsiBusComponentName)\r | |
87 | );\r | |
3a10d471 | 88 | }\r |
89 | \r | |
70da5bc2 | 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 | |
9beb888e | 103 | @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
70da5bc2 | 104 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
105 | \r | |
9beb888e | 106 | @param ControllerHandle The handle of a controller that the driver\r |
70da5bc2 | 107 | specified by This is managing. This handle\r |
108 | specifies the controller whose name is to be\r | |
109 | returned.\r | |
110 | \r | |
9beb888e | 111 | @param ChildHandle The handle of the child controller to retrieve\r |
70da5bc2 | 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 | |
9beb888e | 120 | @param Language A pointer to a Null-terminated ASCII string\r |
70da5bc2 | 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 | |
0254efc0 | 127 | RFC 4646 or ISO 639-2 language code format.\r |
70da5bc2 | 128 | \r |
9beb888e | 129 | @param ControllerName A pointer to the Unicode string to return.\r |
70da5bc2 | 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 | |
284ee2e8 | 141 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
70da5bc2 | 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 | |
3a10d471 | 158 | EFI_STATUS\r |
159 | EFIAPI\r | |
160 | ScsiBusComponentNameGetControllerName (\r | |
1436aea4 MK |
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 | |
3a10d471 | 166 | )\r |
3a10d471 | 167 | {\r |
168 | return EFI_UNSUPPORTED;\r | |
169 | }\r |