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