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