]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/ComponentName.c
IntelFrameworkModulePkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / VgaMiniPortDxe / ComponentName.c
... / ...
CommitLineData
1/** @file\r
2 Implements EFI Component Name Protocol for VGA Mini Port Driver.\r
3\r
4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "VgaMiniPort.h"\r
16\r
17\r
18//\r
19// EFI Component Name Protocol\r
20//\r
21GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPciVgaMiniPortComponentName = {\r
22 PciVgaMiniPortComponentNameGetDriverName,\r
23 PciVgaMiniPortComponentNameGetControllerName,\r
24 "eng"\r
25};\r
26\r
27//\r
28// EFI Component Name 2 Protocol\r
29//\r
30GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPciVgaMiniPortComponentName2 = {\r
31 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PciVgaMiniPortComponentNameGetDriverName,\r
32 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PciVgaMiniPortComponentNameGetControllerName,\r
33 "en"\r
34};\r
35\r
36\r
37GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPciVgaMiniPortDriverNameTable[] = {\r
38 {\r
39 "eng;en",\r
40 L"PCI VGA Mini Port Driver"\r
41 },\r
42 {\r
43 NULL,\r
44 NULL\r
45 }\r
46};\r
47\r
48/**\r
49 Retrieves a Unicode string that is the user readable name of the driver.\r
50\r
51 This function retrieves the user readable name of a driver in the form of a\r
52 Unicode string. If the driver specified by This has a user readable name in\r
53 the language specified by Language, then a pointer to the driver name is\r
54 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
55 by This does not support the language specified by Language,\r
56 then EFI_UNSUPPORTED is returned.\r
57\r
58 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
59 EFI_COMPONENT_NAME_PROTOCOL instance.\r
60 @param Language A pointer to a Null-terminated ASCII string\r
61 array indicating the language. This is the\r
62 language of the driver name that the caller is\r
63 requesting, and it must match one of the\r
64 languages specified in SupportedLanguages. The\r
65 number of languages supported by a driver is up\r
66 to the driver writer. Language is specified\r
67 in RFC 4646 or ISO 639-2 language code format.\r
68 @param DriverName A pointer to the Unicode string to return.\r
69 This Unicode string is the name of the\r
70 driver specified by This in the language\r
71 specified by Language.\r
72\r
73 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
74 This and the language specified by Language was\r
75 returned in DriverName.\r
76 @retval EFI_INVALID_PARAMETER Language is NULL.\r
77 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
78 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
79 the language specified by Language.\r
80\r
81**/\r
82EFI_STATUS\r
83EFIAPI\r
84PciVgaMiniPortComponentNameGetDriverName (\r
85 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
86 IN CHAR8 *Language,\r
87 OUT CHAR16 **DriverName\r
88 )\r
89{\r
90 return LookupUnicodeString2 (\r
91 Language,\r
92 This->SupportedLanguages,\r
93 mPciVgaMiniPortDriverNameTable,\r
94 DriverName,\r
95 (BOOLEAN)(This == &gPciVgaMiniPortComponentName)\r
96 );\r
97}\r
98\r
99/**\r
100 Retrieves a Unicode string that is the user readable name of the controller\r
101 that is being managed by a driver.\r
102\r
103 This function retrieves the user readable name of the controller specified by\r
104 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
105 driver specified by This has a user readable name in the language specified by\r
106 Language, then a pointer to the controller name is returned in ControllerName,\r
107 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
108 managing the controller specified by ControllerHandle and ChildHandle,\r
109 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
110 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
111\r
112 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
113 EFI_COMPONENT_NAME_PROTOCOL instance.\r
114 @param ControllerHandle The handle of a controller that the driver\r
115 specified by This is managing. This handle\r
116 specifies the controller whose name is to be\r
117 returned.\r
118 @param ChildHandle The handle of the child controller to retrieve\r
119 the name of. This is an optional parameter that\r
120 may be NULL. It will be NULL for device\r
121 drivers. It will also be NULL for a bus drivers\r
122 that wish to retrieve the name of the bus\r
123 controller. It will not be NULL for a bus\r
124 driver that wishes to retrieve the name of a\r
125 child controller.\r
126 @param Language A pointer to a Null-terminated ASCII string\r
127 array indicating the language. This is the\r
128 language of the driver name that the caller is\r
129 requesting, and it must match one of the\r
130 languages specified in SupportedLanguages. The\r
131 number of languages supported by a driver is up\r
132 to the driver writer. Language is specified in\r
133 RFC 4646 or ISO 639-2 language code format.\r
134 @param ControllerName A pointer to the Unicode string to return.\r
135 This Unicode string is the name of the\r
136 controller specified by ControllerHandle and\r
137 ChildHandle in the language specified by\r
138 Language from the point of view of the driver\r
139 specified by This.\r
140\r
141 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
142 the language specified by Language for the\r
143 driver specified by This was returned in\r
144 DriverName.\r
145 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
146 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
147 EFI_HANDLE.\r
148 @retval EFI_INVALID_PARAMETER Language is NULL.\r
149 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
150 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
151 managing the controller specified by\r
152 ControllerHandle and ChildHandle.\r
153 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
154 the language specified by Language.\r
155\r
156**/\r
157EFI_STATUS\r
158EFIAPI\r
159PciVgaMiniPortComponentNameGetControllerName (\r
160 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
161 IN EFI_HANDLE ControllerHandle,\r
162 IN EFI_HANDLE ChildHandle OPTIONAL,\r
163 IN CHAR8 *Language,\r
164 OUT CHAR16 **ControllerName\r
165 )\r
166{\r
167 return EFI_UNSUPPORTED;\r
168}\r