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