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