]>
Commit | Line | Data |
---|---|---|
9060e3ec | 1 | /** @file\r |
2 | EFI Component Name functions implementation for PCI Bus module.\r | |
3 | \r | |
284ee2e8 | 4 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
9060e3ec | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #include "PciBus.h"\r | |
10 | \r | |
11 | //\r | |
12 | // EFI Component Name Protocol\r | |
13 | //\r | |
14 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPciBusComponentName = {\r | |
15 | PciBusComponentNameGetDriverName,\r | |
16 | PciBusComponentNameGetControllerName,\r | |
17 | "eng"\r | |
18 | };\r | |
19 | \r | |
20 | //\r | |
21 | // EFI Component Name 2 Protocol\r | |
22 | //\r | |
23 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPciBusComponentName2 = {\r | |
24 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PciBusComponentNameGetDriverName,\r | |
25 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PciBusComponentNameGetControllerName,\r | |
26 | "en"\r | |
27 | };\r | |
28 | \r | |
29 | \r | |
30 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPciBusDriverNameTable[] = {\r | |
31 | { "eng;en", (CHAR16 *) L"PCI Bus Driver" },\r | |
32 | { NULL , NULL }\r | |
33 | };\r | |
34 | \r | |
35 | /**\r | |
36 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
37 | \r | |
38 | This function retrieves the user readable name of a driver in the form of a\r | |
39 | Unicode string. If the driver specified by This has a user readable name in\r | |
40 | the language specified by Language, then a pointer to the driver name is\r | |
41 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
42 | by This does not support the language specified by Language,\r | |
43 | then EFI_UNSUPPORTED is returned.\r | |
44 | \r | |
45 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
46 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
47 | \r | |
48 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
49 | array indicating the language. This is the\r | |
50 | language of the driver name that the caller is\r | |
51 | requesting, and it must match one of the\r | |
52 | languages specified in SupportedLanguages. The\r | |
53 | number of languages supported by a driver is up\r | |
54 | to the driver writer. Language is specified\r | |
55 | in RFC 4646 or ISO 639-2 language code format.\r | |
56 | \r | |
57 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
58 | This Unicode string is the name of the\r | |
59 | driver specified by This in the language\r | |
60 | specified by Language.\r | |
61 | \r | |
62 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
63 | This and the language specified by Language was\r | |
64 | returned in DriverName.\r | |
65 | \r | |
66 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
67 | \r | |
68 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
69 | \r | |
70 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
71 | the language specified by Language.\r | |
72 | \r | |
73 | **/\r | |
74 | EFI_STATUS\r | |
75 | EFIAPI\r | |
76 | PciBusComponentNameGetDriverName (\r | |
77 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
78 | IN CHAR8 *Language,\r | |
79 | OUT CHAR16 **DriverName\r | |
80 | )\r | |
81 | {\r | |
82 | return LookupUnicodeString2 (\r | |
83 | Language,\r | |
84 | This->SupportedLanguages,\r | |
85 | mPciBusDriverNameTable,\r | |
86 | DriverName,\r | |
87 | (BOOLEAN)(This == &gPciBusComponentName)\r | |
88 | );\r | |
89 | }\r | |
90 | \r | |
91 | /**\r | |
92 | Retrieves a Unicode string that is the user readable name of the controller\r | |
93 | that is being managed by a driver.\r | |
94 | \r | |
95 | This function retrieves the user readable name of the controller specified by\r | |
96 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
97 | driver specified by This has a user readable name in the language specified by\r | |
98 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
99 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
100 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
101 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
102 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
103 | \r | |
104 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
105 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
106 | \r | |
107 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
108 | specified by This is managing. This handle\r | |
109 | specifies the controller whose name is to be\r | |
110 | returned.\r | |
111 | \r | |
112 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
113 | the name of. This is an optional parameter that\r | |
114 | may be NULL. It will be NULL for device\r | |
115 | drivers. It will also be NULL for a bus drivers\r | |
116 | that wish to retrieve the name of the bus\r | |
117 | controller. It will not be NULL for a bus\r | |
118 | driver that wishes to retrieve the name of a\r | |
119 | child controller.\r | |
120 | \r | |
121 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
122 | array indicating the language. This is the\r | |
123 | language of the driver name that the caller is\r | |
124 | requesting, and it must match one of the\r | |
125 | languages specified in SupportedLanguages. The\r | |
126 | number of languages supported by a driver is up\r | |
127 | to the driver writer. Language is specified in\r | |
128 | RFC 4646 or ISO 639-2 language code format.\r | |
129 | \r | |
130 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
131 | This Unicode string is the name of the\r | |
132 | controller specified by ControllerHandle and\r | |
133 | ChildHandle in the language specified by\r | |
134 | Language from the point of view of the driver\r | |
135 | specified by This.\r | |
136 | \r | |
137 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
138 | the language specified by Language for the\r | |
139 | driver specified by This was returned in\r | |
140 | DriverName.\r | |
141 | \r | |
284ee2e8 | 142 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
9060e3ec | 143 | \r |
144 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
145 | EFI_HANDLE.\r | |
146 | \r | |
147 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
148 | \r | |
149 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
150 | \r | |
151 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
152 | managing the controller specified by\r | |
153 | ControllerHandle and ChildHandle.\r | |
154 | \r | |
155 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
156 | the language specified by Language.\r | |
157 | \r | |
158 | **/\r | |
159 | EFI_STATUS\r | |
160 | EFIAPI\r | |
161 | PciBusComponentNameGetControllerName (\r | |
162 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
163 | IN EFI_HANDLE ControllerHandle,\r | |
164 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
165 | IN CHAR8 *Language,\r | |
166 | OUT CHAR16 **ControllerName\r | |
167 | )\r | |
168 | {\r | |
169 | return EFI_UNSUPPORTED;\r | |
170 | }\r |