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