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