]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | \r | |
3 | Copyright (c) 2006 - 2007, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | ComponentName.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #include "SnpNt32.h"\r | |
22 | \r | |
23 | //\r | |
24 | // EFI Component Name Functions\r | |
25 | //\r | |
26 | EFI_STATUS\r | |
27 | EFIAPI\r | |
28 | SnpNt32DriverComponentNameGetDriverName (\r | |
29 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
30 | IN CHAR8 *Language,\r | |
31 | OUT CHAR16 **DriverName\r | |
32 | );\r | |
33 | \r | |
34 | EFI_STATUS\r | |
35 | EFIAPI\r | |
36 | SnpNt32DriverComponentNameGetControllerName (\r | |
37 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
38 | IN EFI_HANDLE ControllerHandle,\r | |
39 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
40 | IN CHAR8 *Language,\r | |
41 | OUT CHAR16 **ControllerName\r | |
42 | );\r | |
43 | \r | |
44 | //\r | |
45 | // EFI Component Name Protocol\r | |
46 | //\r | |
47 | EFI_COMPONENT_NAME_PROTOCOL gSnpNt32DriverComponentName = {\r | |
48 | SnpNt32DriverComponentNameGetDriverName,\r | |
49 | SnpNt32DriverComponentNameGetControllerName,\r | |
50 | "eng"\r | |
51 | };\r | |
52 | \r | |
53 | static EFI_UNICODE_STRING_TABLE mSnpNt32DriverNameTable[] = {\r | |
54 | {\r | |
55 | "eng",\r | |
56 | L"SNP NT32 Driver"\r | |
57 | },\r | |
58 | {\r | |
59 | NULL,\r | |
60 | NULL\r | |
61 | }\r | |
62 | };\r | |
63 | \r | |
64 | EFI_STATUS\r | |
65 | EFIAPI\r | |
66 | SnpNt32DriverComponentNameGetDriverName (\r | |
67 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
68 | IN CHAR8 *Language,\r | |
69 | OUT CHAR16 **DriverName\r | |
70 | )\r | |
71 | /*++\r | |
72 | \r | |
73 | Routine Description:\r | |
74 | Retrieves a Unicode string that is the user readable name of the EFI Driver.\r | |
75 | \r | |
76 | Arguments:\r | |
77 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
78 | Language - A pointer to a three character ISO 639-2 language identifier.\r | |
79 | This is the language of the driver name that that the caller\r | |
80 | is requesting, and it must match one of the languages specified\r | |
81 | in SupportedLanguages. The number of languages supported by a\r | |
82 | driver is up to the driver writer.\r | |
83 | DriverName - A pointer to the Unicode string to return. This Unicode string\r | |
84 | is the name of the driver specified by This in the language\r | |
85 | specified by Language.\r | |
86 | \r | |
87 | Returns:\r | |
88 | EFI_SUCCESS - The Unicode string for the Driver specified by This\r | |
89 | and the language specified by Language was returned\r | |
90 | in DriverName.\r | |
91 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
92 | EFI_INVALID_PARAMETER - DriverName is NULL.\r | |
93 | EFI_UNSUPPORTED - The driver specified by This does not support the\r | |
94 | language specified by Language.\r | |
95 | \r | |
96 | --*/\r | |
97 | {\r | |
98 | return LookupUnicodeString (\r | |
99 | Language,\r | |
100 | gSnpNt32DriverComponentName.SupportedLanguages,\r | |
101 | mSnpNt32DriverNameTable,\r | |
102 | DriverName\r | |
103 | );\r | |
104 | }\r | |
105 | \r | |
106 | EFI_STATUS\r | |
107 | EFIAPI\r | |
108 | SnpNt32DriverComponentNameGetControllerName (\r | |
109 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
110 | IN EFI_HANDLE ControllerHandle,\r | |
111 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
112 | IN CHAR8 *Language,\r | |
113 | OUT CHAR16 **ControllerName\r | |
114 | )\r | |
115 | /*++\r | |
116 | \r | |
117 | Routine Description:\r | |
118 | Retrieves a Unicode string that is the user readable name of the controller\r | |
119 | that is being managed by an EFI Driver.\r | |
120 | \r | |
121 | Arguments:\r | |
122 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
123 | ControllerHandle - The handle of a controller that the driver specified by\r | |
124 | This is managing. This handle specifies the controller\r | |
125 | whose name is to be returned.\r | |
126 | ChildHandle - The handle of the child controller to retrieve the name\r | |
127 | of. This is an optional parameter that may be NULL. It\r | |
128 | will be NULL for device drivers. It will also be NULL\r | |
129 | for a bus drivers that wish to retrieve the name of the\r | |
130 | bus controller. It will not be NULL for a bus driver\r | |
131 | that wishes to retrieve the name of a child controller.\r | |
132 | Language - A pointer to a three character ISO 639-2 language\r | |
133 | identifier. This is the language of the controller name\r | |
134 | that that the caller is requesting, and it must match one\r | |
135 | of the languages specified in SupportedLanguages. The\r | |
136 | number of languages supported by a driver is up to the\r | |
137 | driver writer.\r | |
138 | ControllerName - A pointer to the Unicode string to return. This Unicode\r | |
139 | string is the name of the controller specified by\r | |
140 | ControllerHandle and ChildHandle in the language specified\r | |
141 | by Language from the point of view of the driver specified\r | |
142 | by This.\r | |
143 | \r | |
144 | Returns:\r | |
145 | EFI_SUCCESS - The Unicode string for the user readable name in the\r | |
146 | language specified by Language for the driver\r | |
147 | specified by This was returned in DriverName.\r | |
148 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r | |
149 | EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r | |
150 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
151 | EFI_INVALID_PARAMETER - ControllerName is NULL.\r | |
152 | EFI_UNSUPPORTED - The driver specified by This is not currently managing\r | |
153 | the controller specified by ControllerHandle and\r | |
154 | ChildHandle.\r | |
155 | EFI_UNSUPPORTED - The driver specified by This does not support the\r | |
156 | language specified by Language.\r | |
157 | \r | |
158 | --*/\r | |
159 | {\r | |
160 | return EFI_UNSUPPORTED;\r | |
161 | }\r |