]>
Commit | Line | Data |
---|---|---|
733f03aa | 1 | /** @file\r |
269e4559 | 2 | Implements EFI Component Name Protocol for VGA Mini Port Driver.\r |
fcf03596 | 3 | \r |
180a5a35 | 4 | Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r |
733f03aa | 5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include "VgaMiniPort.h"\r | |
16 | \r | |
733f03aa | 17 | \r |
18 | //\r | |
19 | // EFI Component Name Protocol\r | |
20 | //\r | |
1307dcd7 | 21 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPciVgaMiniPortComponentName = {\r |
733f03aa | 22 | PciVgaMiniPortComponentNameGetDriverName,\r |
23 | PciVgaMiniPortComponentNameGetControllerName,\r | |
24 | "eng"\r | |
1307dcd7 | 25 | };\r |
733f03aa | 26 | \r |
27 | //\r | |
28 | // EFI Component Name 2 Protocol\r | |
29 | //\r | |
1307dcd7 | 30 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPciVgaMiniPortComponentName2 = {\r |
733f03aa | 31 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PciVgaMiniPortComponentNameGetDriverName,\r |
32 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PciVgaMiniPortComponentNameGetControllerName,\r | |
33 | "en"\r | |
1307dcd7 | 34 | };\r |
733f03aa | 35 | \r |
36 | \r | |
d1aeb0bd | 37 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPciVgaMiniPortDriverNameTable[] = {\r |
733f03aa | 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 | |
269e4559 | 58 | @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
733f03aa | 59 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
269e4559 | 60 | @param Language A pointer to a Null-terminated ASCII string\r |
733f03aa | 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 | |
4bca47e1 | 67 | in RFC 4646 or ISO 639-2 language code format.\r |
269e4559 | 68 | @param DriverName A pointer to the Unicode string to return.\r |
733f03aa | 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 | |
733f03aa | 76 | @retval EFI_INVALID_PARAMETER Language is NULL.\r |
733f03aa | 77 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r |
733f03aa | 78 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r |
79 | the language specified by Language.\r | |
80 | \r | |
81 | **/\r | |
82 | EFI_STATUS\r | |
83 | EFIAPI\r | |
84 | PciVgaMiniPortComponentNameGetDriverName (\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 | |
269e4559 | 112 | @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r |
733f03aa | 113 | EFI_COMPONENT_NAME_PROTOCOL instance.\r |
269e4559 | 114 | @param ControllerHandle The handle of a controller that the driver\r |
733f03aa | 115 | specified by This is managing. This handle\r |
116 | specifies the controller whose name is to be\r | |
117 | returned.\r | |
269e4559 | 118 | @param ChildHandle The handle of the child controller to retrieve\r |
733f03aa | 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 | |
269e4559 | 126 | @param Language A pointer to a Null-terminated ASCII string\r |
733f03aa | 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 | |
4bca47e1 | 133 | RFC 4646 or ISO 639-2 language code format.\r |
269e4559 | 134 | @param ControllerName A pointer to the Unicode string to return.\r |
733f03aa | 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 | |
733f03aa | 145 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r |
733f03aa | 146 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r |
147 | EFI_HANDLE.\r | |
733f03aa | 148 | @retval EFI_INVALID_PARAMETER Language is NULL.\r |
733f03aa | 149 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r |
733f03aa | 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 | |
733f03aa | 153 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r |
154 | the language specified by Language.\r | |
155 | \r | |
156 | **/\r | |
157 | EFI_STATUS\r | |
158 | EFIAPI\r | |
159 | PciVgaMiniPortComponentNameGetControllerName (\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 |