7
* Copyright (C) 2009-2010 Oracle Corporation
9
* This file is part of VirtualBox Open Source Edition (OSE), as
10
* available from http://www.virtualbox.org. This file is free software;
11
* you can redistribute it and/or modify it under the terms of the GNU
12
* General Public License (GPL) as published by the Free Software
13
* Foundation, in version 2 as it comes in the "COPYING" file of the
14
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19
This portion is to register the IDE Controller Driver name:
20
"IDE Controller Init Driver"
22
Copyright (c) 2008 Intel Corporation. <BR>
23
All rights reserved. This program and the accompanying materials
24
are licensed and made available under the terms and conditions of the BSD License
25
which accompanies this distribution. The full text of the license may be found at
26
http://opensource.org/licenses/bsd-license.php
28
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
29
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
33
#include "IdeController.h"
36
// EFI Component Name Protocol
38
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIdeControllerComponentName = {
39
IdeControllerComponentNameGetDriverName,
40
IdeControllerComponentNameGetControllerName,
45
// EFI Component Name 2 Protocol
47
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIdeControllerComponentName2 = {
48
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) IdeControllerComponentNameGetDriverName,
49
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) IdeControllerComponentNameGetControllerName,
54
// Driver Name Strings
56
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIdeControllerDriverNameTable[] = {
59
(CHAR16 *)L"IDE Controller Init Driver"
68
// Controller Name Strings
70
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIdeControllerControllerNameTable[] = {
73
(CHAR16 *)L"PCAT IDE Controller"
83
IdeControllerComponentNameGetDriverName (
84
IN EFI_COMPONENT_NAME_PROTOCOL *This,
86
OUT CHAR16 **DriverName
91
Retrieves a Unicode string that is the user readable name of the EFI Driver.
94
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
95
Language - A pointer to a three character ISO 639-2 language identifier.
96
This is the language of the driver name that that the caller
97
is requesting, and it must match one of the languages specified
98
in SupportedLanguages. The number of languages supported by a
99
driver is up to the driver writer.
100
DriverName - A pointer to the Unicode string to return. This Unicode string
101
is the name of the driver specified by This in the language
102
specified by Language.
105
EFI_SUCCESS - The Unicode string for the Driver specified by This
106
and the language specified by Language was returned
108
EFI_INVALID_PARAMETER - Language is NULL.
109
EFI_INVALID_PARAMETER - DriverName is NULL.
110
EFI_UNSUPPORTED - The driver specified by This does not support the
111
language specified by Language.
115
return LookupUnicodeString2 (
117
This->SupportedLanguages,
118
mIdeControllerDriverNameTable,
120
(BOOLEAN)(This == &gIdeControllerComponentName)
126
IdeControllerComponentNameGetControllerName (
127
IN EFI_COMPONENT_NAME_PROTOCOL *This,
128
IN EFI_HANDLE ControllerHandle,
129
IN EFI_HANDLE ChildHandle OPTIONAL,
131
OUT CHAR16 **ControllerName
136
Retrieves a Unicode string that is the user readable name of the controller
137
that is being managed by an EFI Driver.
140
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
141
ControllerHandle - The handle of a controller that the driver specified by
142
This is managing. This handle specifies the controller
143
whose name is to be returned.
144
ChildHandle - The handle of the child controller to retrieve the name
145
of. This is an optional parameter that may be NULL. It
146
will be NULL for device drivers. It will also be NULL
147
for a bus drivers that wish to retrieve the name of the
148
bus controller. It will not be NULL for a bus driver
149
that wishes to retrieve the name of a child controller.
150
Language - A pointer to a three character ISO 639-2 language
151
identifier. This is the language of the controller name
152
that that the caller is requesting, and it must match one
153
of the languages specified in SupportedLanguages. The
154
number of languages supported by a driver is up to the
156
ControllerName - A pointer to the Unicode string to return. This Unicode
157
string is the name of the controller specified by
158
ControllerHandle and ChildHandle in the language
159
specified by Language from the point of view of the
160
driver specified by This.
163
EFI_SUCCESS - The Unicode string for the user readable name in the
164
language specified by Language for the driver
165
specified by This was returned in DriverName.
166
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
167
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
169
EFI_INVALID_PARAMETER - Language is NULL.
170
EFI_INVALID_PARAMETER - ControllerName is NULL.
171
EFI_UNSUPPORTED - The driver specified by This is not currently
172
managing the controller specified by
173
ControllerHandle and ChildHandle.
174
EFI_UNSUPPORTED - The driver specified by This does not support the
175
language specified by Language.
182
// Make sure this driver is currently managing ControllHandle
184
Status = EfiTestManagedDevice (
186
gIdeControllerDriverBinding.DriverBindingHandle,
187
&gEfiPciIoProtocolGuid
189
if (EFI_ERROR (Status)) {
193
if (ChildHandle != NULL) {
194
return EFI_UNSUPPORTED;
197
return LookupUnicodeString2 (
199
This->SupportedLanguages,
200
mIdeControllerControllerNameTable,
202
(BOOLEAN)(This == &gIdeControllerComponentName)