]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/ComponentName.c
fixed memcpy link issue.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMassStorageDxe / ComponentName.c
CommitLineData
e237e7ae 1 /*++\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// The package level header files this module uses\r
22//\r
23#include <PiDxe.h>\r
24\r
25//\r
26// The Library classes this module consumes\r
27//\r
28#include <Library/UefiLib.h>\r
29\r
30//\r
31// EFI Component Name Functions\r
32//\r
33EFI_STATUS\r
34EFIAPI\r
35UsbMassStorageGetDriverName (\r
36 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
37 IN CHAR8 *Language,\r
38 OUT CHAR16 **DriverName\r
39 );\r
40\r
41EFI_STATUS\r
42EFIAPI\r
43UsbMassStorageGetControllerName (\r
44 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
45 IN EFI_HANDLE ControllerHandle,\r
46 IN EFI_HANDLE ChildHandle OPTIONAL,\r
47 IN CHAR8 *Language,\r
48 OUT CHAR16 **ControllerName\r
49 );\r
50\r
51//\r
52// EFI Component Name Protocol\r
53//\r
54EFI_COMPONENT_NAME_PROTOCOL gUsbMassStorageComponentName = {\r
55 UsbMassStorageGetDriverName,\r
56 UsbMassStorageGetControllerName,\r
57 "eng"\r
58};\r
59\r
60STATIC EFI_UNICODE_STRING_TABLE\r
61mUsbMassStorageDriverNameTable[] = {\r
62 {"eng", L"Usb Mass Storage Driver"},\r
63 {NULL, NULL}\r
64};\r
65\r
66EFI_STATUS\r
67EFIAPI\r
68UsbMassStorageGetDriverName (\r
69 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
70 IN CHAR8 *Language,\r
71 OUT CHAR16 **DriverName\r
72 )\r
73/*++\r
74\r
75 Routine Description:\r
76 Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
77\r
78 Arguments:\r
79 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
80 Language - A pointer to a three character ISO 639-2 language identifier.\r
81 This is the language of the driver name that that the caller\r
82 is requesting, and it must match one of the languages specified\r
83 in SupportedLanguages. The number of languages supported by a\r
84 driver is up to the driver writer.\r
85 DriverName - A pointer to the Unicode string to return. This Unicode string\r
86 is the name of the driver specified by This in the language\r
87 specified by Language.\r
88\r
89 Returns:\r
90 EFI_SUCCESS - The Unicode string for the Driver specified by This\r
91 and the language specified by Language was returned\r
92 in DriverName.\r
93 EFI_INVALID_PARAMETER - Language is NULL.\r
94 EFI_INVALID_PARAMETER - DriverName is NULL.\r
95 EFI_UNSUPPORTED - The driver specified by This does not support the\r
96 language specified by Language.\r
97\r
98--*/\r
99{\r
100 return LookupUnicodeString (\r
101 Language,\r
102 gUsbMassStorageComponentName.SupportedLanguages,\r
103 mUsbMassStorageDriverNameTable,\r
104 DriverName\r
105 );\r
106}\r
107\r
108EFI_STATUS\r
109EFIAPI\r
110UsbMassStorageGetControllerName (\r
111 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
112 IN EFI_HANDLE ControllerHandle,\r
113 IN EFI_HANDLE ChildHandle OPTIONAL,\r
114 IN CHAR8 *Language,\r
115 OUT CHAR16 **ControllerName\r
116 )\r
117/*++\r
118\r
119 Routine Description:\r
120 Retrieves a Unicode string that is the user readable name of the controller\r
121 that is being managed by an EFI Driver.\r
122\r
123 Arguments:\r
124 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
125 ControllerHandle - The handle of a controller that the driver specified by\r
126 This is managing. This handle specifies the controller\r
127 whose name is to be returned.\r
128 ChildHandle - The handle of the child controller to retrieve the name\r
129 of. This is an optional parameter that may be NULL. It\r
130 will be NULL for device drivers. It will also be NULL\r
131 for a bus drivers that wish to retrieve the name of the\r
132 bus controller. It will not be NULL for a bus driver\r
133 that wishes to retrieve the name of a child controller.\r
134 Language - A pointer to a three character ISO 639-2 language\r
135 identifier. This is the language of the controller name\r
136 that that the caller is requesting, and it must match one\r
137 of the languages specified in SupportedLanguages. The\r
138 number of languages supported by a driver is up to the\r
139 driver writer.\r
140 ControllerName - A pointer to the Unicode string to return. This Unicode\r
141 string is the name of the controller specified by\r
142 ControllerHandle and ChildHandle in the language specified\r
143 by Language from the point of view of the driver specified\r
144 by This.\r
145\r
146 Returns:\r
147 EFI_UNSUPPORTED - The driver specified by This does not support the\r
148 language specified by Language.\r
149\r
150--*/\r
151{\r
152 return EFI_UNSUPPORTED;\r
153}\r