]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Usb/UsbBusDxe/ComponentName.c
fixed memcpy link issue.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / ComponentName.c
CommitLineData
e237e7ae 1/** @file\r
2\r
3Copyright (c) 2004 - 2007, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 ComponentName.c\r
15\r
16Abstract:\r
17\r
18\r
19**/\r
20\r
21//\r
22// The package level header files this module uses\r
23//\r
24#include <PiDxe.h>\r
25\r
26//\r
27// The Library classes this module consumes\r
28//\r
29#include <Library/UefiLib.h>\r
30\r
31\r
32//\r
33// EFI Component Name Functions\r
34//\r
35EFI_STATUS\r
36EFIAPI\r
37UsbBusComponentNameGetDriverName (\r
38 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
39 IN CHAR8 *Language,\r
40 OUT CHAR16 **DriverName\r
41 );\r
42\r
43EFI_STATUS\r
44EFIAPI\r
45UsbBusComponentNameGetControllerName (\r
46 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
47 IN EFI_HANDLE ControllerHandle,\r
48 IN EFI_HANDLE ChildHandle, OPTIONAL\r
49 IN CHAR8 *Language,\r
50 OUT CHAR16 **ControllerName\r
51 );\r
52\r
53//\r
54// EFI Component Name Protocol\r
55//\r
56EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName = {\r
57 UsbBusComponentNameGetDriverName,\r
58 UsbBusComponentNameGetControllerName,\r
59 "eng"\r
60};\r
61\r
62STATIC EFI_UNICODE_STRING_TABLE mUsbBusDriverNameTable[] = {\r
63 { "eng", L"Usb Bus Driver" },\r
64 { NULL , NULL }\r
65};\r
66\r
67EFI_STATUS\r
68EFIAPI\r
69UsbBusComponentNameGetDriverName (\r
70 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
71 IN CHAR8 *Language,\r
72 OUT CHAR16 **DriverName\r
73 )\r
74/*++\r
75\r
76 Routine Description:\r
77 Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
78\r
79 Arguments:\r
80 This - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.\r
81 Language - A pointer to a three character ISO 639-2 language identifier.\r
82 This is the language of the driver name that that the caller\r
83 is requesting, and it must match one of the languages specified\r
84 in SupportedLanguages. The number of languages supported by a\r
85 driver is up to the driver writer.\r
86 DriverName - A pointer to the Unicode string to return. This Unicode string\r
87 is the name of the driver specified by This in the language\r
88 specified by Language.\r
89\r
90 Returns:\r
91 EFI_SUCCESS - The Unicode string for the Driver specified by This\r
92 and the language specified by Language was returned\r
93 in DriverName.\r
94 EFI_INVALID_PARAMETER - Language is NULL.\r
95 EFI_INVALID_PARAMETER - DriverName is NULL.\r
96 EFI_UNSUPPORTED - The driver specified by This does not support the\r
97 language specified by Language.\r
98\r
99--*/\r
100{\r
101 return LookupUnicodeString (\r
102 Language,\r
103 mUsbBusComponentName.SupportedLanguages,\r
104 mUsbBusDriverNameTable,\r
105 DriverName\r
106 );\r
107}\r
108\r
109EFI_STATUS\r
110EFIAPI\r
111UsbBusComponentNameGetControllerName (\r
112 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
113 IN EFI_HANDLE ControllerHandle,\r
114 IN EFI_HANDLE ChildHandle, OPTIONAL\r
115 IN CHAR8 *Language,\r
116 OUT CHAR16 **ControllerName\r
117 )\r
118/*++\r
119\r
120 Routine Description:\r
121 Retrieves a Unicode string that is the user readable name of the controller\r
122 that is being managed by an EFI Driver.\r
123\r
124 Arguments:\r
125 This - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.\r
126 ControllerHandle - The handle of a controller that the driver specified by\r
127 This is managing. This handle specifies the controller\r
128 whose name is to be returned.\r
129 ChildHandle - The handle of the child controller to retrieve the name\r
130 of. This is an optional parameter that may be NULL. It\r
131 will be NULL for device drivers. It will also be NULL\r
132 for a bus drivers that wish to retrieve the name of the\r
133 bus controller. It will not be NULL for a bus driver\r
134 that wishes to retrieve the name of a child controller.\r
135 Language - A pointer to a three character ISO 639-2 language\r
136 identifier. This is the language of the controller name\r
137 that that the caller is requesting, and it must match one\r
138 of the languages specified in SupportedLanguages. The\r
139 number of languages supported by a driver is up to the\r
140 driver writer.\r
141 ControllerName - A pointer to the Unicode string to return. This Unicode\r
142 string is the name of the controller specified by\r
143 ControllerHandle and ChildHandle in the language specified\r
144 by Language from the point of view of the driver specified\r
145 by This.\r
146\r
147 Returns:\r
148 EFI_SUCCESS - The Unicode string for the user readable name in the\r
149 language specified by Language for the driver\r
150 specified by This was returned in DriverName.\r
151 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
152 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
153 EFI_INVALID_PARAMETER - Language is NULL.\r
154 EFI_INVALID_PARAMETER - ControllerName is NULL.\r
155 EFI_UNSUPPORTED - The driver specified by This is not currently managing\r
156 the controller specified by ControllerHandle and\r
157 ChildHandle.\r
158 EFI_UNSUPPORTED - The driver specified by This does not support the\r
159 language specified by Language.\r
160\r
161--*/\r
162{\r
163 return EFI_UNSUPPORTED;\r
164}\r