]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/SataControllerDxe/SataController.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / OvmfPkg / SataControllerDxe / SataController.h
CommitLineData
12e92a23
RJ
1/** @file\r
2 Header file for Sata Controller driver.\r
3\r
4 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
b26f0cf9 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
12e92a23
RJ
6\r
7**/\r
8\r
9#ifndef _SATA_CONTROLLER_H_\r
10#define _SATA_CONTROLLER_H_\r
11\r
12#include <Uefi.h>\r
13#include <Protocol/ComponentName.h>\r
14#include <Protocol/DriverBinding.h>\r
15#include <Protocol/PciIo.h>\r
16#include <Protocol/IdeControllerInit.h>\r
17#include <Library/UefiDriverEntryPoint.h>\r
18#include <Library/DebugLib.h>\r
19#include <Library/UefiLib.h>\r
20#include <Library/BaseLib.h>\r
21#include <Library/BaseMemoryLib.h>\r
22#include <Library/MemoryAllocationLib.h>\r
23#include <Library/UefiBootServicesTableLib.h>\r
24#include <IndustryStandard/Pci.h>\r
25\r
26//\r
27// Global Variables definitions\r
28//\r
ac0a286f
MK
29extern EFI_DRIVER_BINDING_PROTOCOL gSataControllerDriverBinding;\r
30extern EFI_COMPONENT_NAME_PROTOCOL gSataControllerComponentName;\r
31extern EFI_COMPONENT_NAME2_PROTOCOL gSataControllerComponentName2;\r
12e92a23 32\r
ac0a286f
MK
33#define AHCI_BAR_INDEX 0x05\r
34#define R_AHCI_CAP 0x0\r
35#define B_AHCI_CAP_NPS (BIT4 | BIT3 | BIT2 | BIT1 | BIT0) // Number of Ports\r
36#define B_AHCI_CAP_SPM BIT17 // Supports Port Multiplier\r
12e92a23
RJ
37\r
38///\r
39/// AHCI each channel can have up to 1 device\r
40///\r
ac0a286f 41#define AHCI_MAX_DEVICES 0x01\r
12e92a23
RJ
42\r
43///\r
44/// AHCI each channel can have 15 devices in the presence of a multiplier\r
45///\r
ac0a286f 46#define AHCI_MULTI_MAX_DEVICES 0x0F\r
12e92a23
RJ
47\r
48///\r
49/// IDE supports 2 channel max\r
50///\r
ac0a286f 51#define IDE_MAX_CHANNEL 0x02\r
12e92a23
RJ
52\r
53///\r
54/// IDE supports 2 devices max\r
55///\r
ac0a286f 56#define IDE_MAX_DEVICES 0x02\r
12e92a23 57\r
ac0a286f 58#define SATA_ENUMER_ALL FALSE\r
12e92a23
RJ
59\r
60//\r
61// Sata Controller driver private data structure\r
62//\r
63\r
ac0a286f 64#define SATA_CONTROLLER_SIGNATURE SIGNATURE_32('S','A','T','A')\r
12e92a23
RJ
65\r
66typedef struct _EFI_SATA_CONTROLLER_PRIVATE_DATA {\r
67 //\r
68 // Standard signature used to identify Sata Controller private data\r
69 //\r
ac0a286f 70 UINT32 Signature;\r
12e92a23
RJ
71\r
72 //\r
73 // Protocol instance of IDE_CONTROLLER_INIT produced by this driver\r
74 //\r
ac0a286f 75 EFI_IDE_CONTROLLER_INIT_PROTOCOL IdeInit;\r
12e92a23
RJ
76\r
77 //\r
78 // Copy of protocol pointers used by this driver\r
79 //\r
ac0a286f 80 EFI_PCI_IO_PROTOCOL *PciIo;\r
12e92a23 81\r
bcab7141
LE
82 //\r
83 // Original PCI attributes\r
84 //\r
ac0a286f 85 UINT64 OriginalPciAttributes;\r
bcab7141 86\r
12e92a23
RJ
87 //\r
88 // The number of devices that are supported by this channel\r
89 //\r
ac0a286f 90 UINT8 DeviceCount;\r
12e92a23
RJ
91\r
92 //\r
93 // The highest disqulified mode for each attached device,\r
94 // From ATA/ATAPI spec, if a mode is not supported,\r
95 // the modes higher than it is also not supported\r
96 //\r
ac0a286f 97 EFI_ATA_COLLECTIVE_MODE *DisqualifiedModes;\r
12e92a23
RJ
98\r
99 //\r
100 // A copy of EFI_IDENTIFY_DATA data for each attached SATA device and its flag\r
101 //\r
ac0a286f
MK
102 EFI_IDENTIFY_DATA *IdentifyData;\r
103 BOOLEAN *IdentifyValid;\r
12e92a23
RJ
104} EFI_SATA_CONTROLLER_PRIVATE_DATA;\r
105\r
ac0a286f 106#define SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS(a) CR(a, EFI_SATA_CONTROLLER_PRIVATE_DATA, IdeInit, SATA_CONTROLLER_SIGNATURE)\r
12e92a23
RJ
107\r
108//\r
109// Driver binding functions declaration\r
110//\r
ac0a286f 111\r
12e92a23
RJ
112/**\r
113 Supported function of Driver Binding protocol for this driver.\r
114 Test to see if this driver supports ControllerHandle.\r
115\r
116 @param This Protocol instance pointer.\r
117 @param Controller Handle of device to test.\r
118 @param RemainingDevicePath A pointer to the device path. Should be ignored by\r
119 device driver.\r
120\r
121 @retval EFI_SUCCESS This driver supports this device.\r
122 @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
123 @retval other This driver does not support this device.\r
124\r
125**/\r
126EFI_STATUS\r
127EFIAPI\r
128SataControllerSupported (\r
ac0a286f
MK
129 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
130 IN EFI_HANDLE Controller,\r
131 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
12e92a23
RJ
132 )\r
133;\r
134\r
135/**\r
4040754d 136 This routine is called right after the .Supported() called and\r
12e92a23
RJ
137 Start this driver on ControllerHandle.\r
138\r
139 @param This Protocol instance pointer.\r
140 @param Controller Handle of device to bind driver to.\r
141 @param RemainingDevicePath A pointer to the device path. Should be ignored by\r
142 device driver.\r
143\r
144 @retval EFI_SUCCESS This driver is added to this device.\r
145 @retval EFI_ALREADY_STARTED This driver is already running on this device.\r
146 @retval other Some error occurs when binding this driver to this device.\r
147\r
148**/\r
149EFI_STATUS\r
150EFIAPI\r
151SataControllerStart (\r
ac0a286f
MK
152 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
153 IN EFI_HANDLE Controller,\r
154 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
12e92a23
RJ
155 )\r
156;\r
157\r
158/**\r
159 Stop this driver on ControllerHandle.\r
160\r
161 @param This Protocol instance pointer.\r
162 @param Controller Handle of device to stop driver on.\r
163 @param NumberOfChildren Not used.\r
164 @param ChildHandleBuffer Not used.\r
165\r
166 @retval EFI_SUCCESS This driver is removed from this device.\r
167 @retval other Some error occurs when removing this driver from this device.\r
168\r
169**/\r
170EFI_STATUS\r
171EFIAPI\r
172SataControllerStop (\r
ac0a286f
MK
173 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
174 IN EFI_HANDLE Controller,\r
175 IN UINTN NumberOfChildren,\r
176 IN EFI_HANDLE *ChildHandleBuffer\r
12e92a23
RJ
177 )\r
178;\r
179\r
180//\r
181// IDE controller init functions declaration\r
182//\r
ac0a286f 183\r
12e92a23
RJ
184/**\r
185 Returns the information about the specified IDE channel.\r
4040754d 186\r
12e92a23 187 This function can be used to obtain information about a particular IDE channel.\r
4040754d
LL
188 The driver entity uses this information during the enumeration process.\r
189\r
190 If Enabled is set to FALSE, the driver entity will not scan the channel. Note\r
12e92a23 191 that it will not prevent an operating system driver from scanning the channel.\r
4040754d
LL
192\r
193 For most of today's controllers, MaxDevices will either be 1 or 2. For SATA\r
194 controllers, this value will always be 1. SATA configurations can contain SATA\r
12e92a23 195 port multipliers. SATA port multipliers behave like SATA bridges and can support\r
4040754d
LL
196 up to 16 devices on the other side. If a SATA port out of the IDE controller\r
197 is connected to a port multiplier, MaxDevices will be set to the number of SATA\r
198 devices that the port multiplier supports. Because today's port multipliers\r
199 support up to fifteen SATA devices, this number can be as large as fifteen. The IDE\r
200 bus driver is required to scan for the presence of port multipliers behind an SATA\r
201 controller and enumerate up to MaxDevices number of devices behind the port\r
202 multiplier.\r
203\r
204 In this context, the devices behind a port multiplier constitute a channel.\r
205\r
12e92a23
RJ
206 @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
207 @param[in] Channel Zero-based channel number.\r
4040754d 208 @param[out] Enabled TRUE if this channel is enabled. Disabled channels\r
12e92a23
RJ
209 are not scanned to see if any devices are present.\r
210 @param[out] MaxDevices The maximum number of IDE devices that the bus driver\r
4040754d
LL
211 can expect on this channel. For the ATA/ATAPI\r
212 specification, version 6, this number will either be\r
213 one or two. For Serial ATA (SATA) configurations with a\r
12e92a23
RJ
214 port multiplier, this number can be as large as fifteen.\r
215\r
216 @retval EFI_SUCCESS Information was returned without any errors.\r
217 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
218\r
219**/\r
220EFI_STATUS\r
221EFIAPI\r
222IdeInitGetChannelInfo (\r
ac0a286f
MK
223 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
224 IN UINT8 Channel,\r
225 OUT BOOLEAN *Enabled,\r
226 OUT UINT8 *MaxDevices\r
12e92a23
RJ
227 )\r
228;\r
229\r
230/**\r
231 The notifications from the driver entity that it is about to enter a certain\r
232 phase of the IDE channel enumeration process.\r
4040754d
LL
233\r
234 This function can be used to notify the IDE controller driver to perform\r
235 specific actions, including any chipset-specific initialization, so that the\r
236 chipset is ready to enter the next phase. Seven notification points are defined\r
237 at this time.\r
238\r
239 More synchronization points may be added as required in the future.\r
12e92a23
RJ
240\r
241 @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
242 @param[in] Phase The phase during enumeration.\r
243 @param[in] Channel Zero-based channel number.\r
244\r
245 @retval EFI_SUCCESS The notification was accepted without any errors.\r
246 @retval EFI_UNSUPPORTED Phase is not supported.\r
247 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
4040754d
LL
248 @retval EFI_NOT_READY This phase cannot be entered at this time; for\r
249 example, an attempt was made to enter a Phase\r
250 without having entered one or more previous\r
12e92a23
RJ
251 Phase.\r
252\r
253**/\r
254EFI_STATUS\r
255EFIAPI\r
256IdeInitNotifyPhase (\r
ac0a286f
MK
257 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
258 IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,\r
259 IN UINT8 Channel\r
12e92a23
RJ
260 )\r
261;\r
262\r
263/**\r
264 Submits the device information to the IDE controller driver.\r
265\r
4040754d
LL
266 This function is used by the driver entity to pass detailed information about\r
267 a particular device to the IDE controller driver. The driver entity obtains\r
12e92a23 268 this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData\r
4040754d
LL
269 is the pointer to the response data buffer. The IdentifyData buffer is owned\r
270 by the driver entity, and the IDE controller driver must make a local copy\r
271 of the entire buffer or parts of the buffer as needed. The original IdentifyData\r
12e92a23 272 buffer pointer may not be valid when\r
4040754d 273\r
12e92a23
RJ
274 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or\r
275 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.\r
4040754d
LL
276\r
277 The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to\r
278 compute the optimum mode for the device. These fields are not limited to the\r
279 timing information. For example, an implementation of the IDE controller driver\r
280 may examine the vendor and type/mode field to match known bad drives.\r
281\r
282 The driver entity may submit drive information in any order, as long as it\r
283 submits information for all the devices belonging to the enumeration group\r
12e92a23
RJ
284 before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device\r
285 in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()\r
4040754d
LL
286 should be called with IdentifyData set to NULL. The IDE controller driver may\r
287 not have any other mechanism to know whether a device is present or not. Therefore,\r
288 setting IdentifyData to NULL does not constitute an error condition.\r
289 EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a\r
290 given (Channel, Device) pair.\r
291\r
12e92a23
RJ
292 @param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
293 @param[in] Channel Zero-based channel number.\r
294 @param[in] Device Zero-based device number on the Channel.\r
295 @param[in] IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.\r
296\r
297 @retval EFI_SUCCESS The information was accepted without any errors.\r
298 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
299 @retval EFI_INVALID_PARAMETER Device is invalid.\r
300\r
301**/\r
302EFI_STATUS\r
303EFIAPI\r
304IdeInitSubmitData (\r
ac0a286f
MK
305 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
306 IN UINT8 Channel,\r
307 IN UINT8 Device,\r
308 IN EFI_IDENTIFY_DATA *IdentifyData\r
12e92a23
RJ
309 )\r
310;\r
311\r
312/**\r
313 Disqualifies specific modes for an IDE device.\r
314\r
4040754d 315 This function allows the driver entity or other drivers (such as platform\r
12e92a23 316 drivers) to reject certain timing modes and request the IDE controller driver\r
4040754d
LL
317 to recalculate modes. This function allows the driver entity and the IDE\r
318 controller driver to negotiate the timings on a per-device basis. This function\r
319 is useful in the case of drives that lie about their capabilities. An example\r
320 is when the IDE device fails to accept the timing modes that are calculated\r
12e92a23
RJ
321 by the IDE controller driver based on the response to the Identify Drive command.\r
322\r
4040754d
LL
323 If the driver entity does not want to limit the ATA timing modes and leave that\r
324 decision to the IDE controller driver, it can either not call this function for\r
325 the given device or call this function and set the Valid flag to FALSE for all\r
12e92a23 326 modes that are listed in EFI_ATA_COLLECTIVE_MODE.\r
4040754d
LL
327\r
328 The driver entity may disqualify modes for a device in any order and any number\r
12e92a23 329 of times.\r
4040754d
LL
330\r
331 This function can be called multiple times to invalidate multiple modes of the\r
332 same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI\r
333 specification for more information on PIO modes.\r
334\r
12e92a23
RJ
335 For Serial ATA (SATA) controllers, this member function can be used to disqualify\r
336 a higher transfer rate mode on a given channel. For example, a platform driver\r
4040754d 337 may inform the IDE controller driver to not use second-generation (Gen2) speeds\r
12e92a23 338 for a certain SATA drive.\r
4040754d 339\r
12e92a23
RJ
340 @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
341 @param[in] Channel The zero-based channel number.\r
342 @param[in] Device The zero-based device number on the Channel.\r
343 @param[in] BadModes The modes that the device does not support and that\r
344 should be disqualified.\r
345\r
346 @retval EFI_SUCCESS The modes were accepted without any errors.\r
347 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
348 @retval EFI_INVALID_PARAMETER Device is invalid.\r
349 @retval EFI_INVALID_PARAMETER IdentifyData is NULL.\r
4040754d 350\r
12e92a23
RJ
351**/\r
352EFI_STATUS\r
353EFIAPI\r
354IdeInitDisqualifyMode (\r
ac0a286f
MK
355 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
356 IN UINT8 Channel,\r
357 IN UINT8 Device,\r
358 IN EFI_ATA_COLLECTIVE_MODE *BadModes\r
12e92a23
RJ
359 )\r
360;\r
361\r
362/**\r
363 Returns the information about the optimum modes for the specified IDE device.\r
364\r
365 This function is used by the driver entity to obtain the optimum ATA modes for\r
4040754d 366 a specific device. The IDE controller driver takes into account the following\r
12e92a23
RJ
367 while calculating the mode:\r
368 - The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()\r
369 - The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()\r
370\r
4040754d
LL
371 The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()\r
372 for all the devices that belong to an enumeration group before calling\r
373 EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.\r
374\r
375 The IDE controller driver will use controller- and possibly platform-specific\r
376 algorithms to arrive at SupportedModes. The IDE controller may base its\r
377 decision on user preferences and other considerations as well. This function\r
378 may be called multiple times because the driver entity may renegotiate the mode\r
12e92a23 379 with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().\r
4040754d
LL
380\r
381 The driver entity may collect timing information for various devices in any\r
12e92a23 382 order. The driver entity is responsible for making sure that all the dependencies\r
4040754d
LL
383 are satisfied. For example, the SupportedModes information for device A that\r
384 was previously returned may become stale after a call to\r
12e92a23 385 EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.\r
4040754d
LL
386\r
387 The buffer SupportedModes is allocated by the callee because the caller does\r
388 not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE\r
389 is defined in a way that allows for future extensibility and can be of variable\r
390 length. This memory pool should be deallocated by the caller when it is no\r
391 longer necessary.\r
392\r
393 The IDE controller driver for a Serial ATA (SATA) controller can use this\r
394 member function to force a lower speed (first-generation [Gen1] speeds on a\r
395 second-generation [Gen2]-capable hardware). The IDE controller driver can\r
396 also allow the driver entity to stay with the speed that has been negotiated\r
12e92a23 397 by the physical layer.\r
4040754d 398\r
12e92a23
RJ
399 @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
400 @param[in] Channel A zero-based channel number.\r
401 @param[in] Device A zero-based device number on the Channel.\r
402 @param[out] SupportedModes The optimum modes for the device.\r
403\r
404 @retval EFI_SUCCESS SupportedModes was returned.\r
405 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
4040754d 406 @retval EFI_INVALID_PARAMETER Device is invalid.\r
12e92a23 407 @retval EFI_INVALID_PARAMETER SupportedModes is NULL.\r
4040754d
LL
408 @retval EFI_NOT_READY Modes cannot be calculated due to a lack of\r
409 data. This error may happen if\r
410 EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()\r
411 and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()\r
412 were not called for at least one drive in the\r
12e92a23
RJ
413 same enumeration group.\r
414\r
415**/\r
416EFI_STATUS\r
417EFIAPI\r
418IdeInitCalculateMode (\r
ac0a286f
MK
419 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
420 IN UINT8 Channel,\r
421 IN UINT8 Device,\r
422 OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes\r
12e92a23
RJ
423 )\r
424;\r
425\r
426/**\r
427 Commands the IDE controller driver to program the IDE controller hardware\r
428 so that the specified device can operate at the specified mode.\r
429\r
4040754d
LL
430 This function is used by the driver entity to instruct the IDE controller\r
431 driver to program the IDE controller hardware to the specified modes. This\r
432 function can be called only once for a particular device. For a Serial ATA\r
12e92a23
RJ
433 (SATA) Advanced Host Controller Interface (AHCI) controller, no controller-\r
434 specific programming may be required.\r
435\r
436 @param[in] This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
437 @param[in] Channel Zero-based channel number.\r
438 @param[in] Device Zero-based device number on the Channel.\r
439 @param[in] Modes The modes to set.\r
440\r
441 @retval EFI_SUCCESS The command was accepted without any errors.\r
442 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
443 @retval EFI_INVALID_PARAMETER Device is invalid.\r
444 @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.\r
445 @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.\r
446 The driver entity should not use this device.\r
447\r
448**/\r
449EFI_STATUS\r
450EFIAPI\r
451IdeInitSetTiming (\r
ac0a286f
MK
452 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
453 IN UINT8 Channel,\r
454 IN UINT8 Device,\r
455 IN EFI_ATA_COLLECTIVE_MODE *Modes\r
12e92a23
RJ
456 )\r
457;\r
458\r
459//\r
460// Forward reference declaration\r
461//\r
ac0a286f 462\r
12e92a23
RJ
463/**\r
464 Retrieves a Unicode string that is the user readable name of the UEFI Driver.\r
465\r
466 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
467 @param Language A pointer to a three character ISO 639-2 language identifier.\r
e87ac5ef 468 This is the language of the driver name that the caller\r
12e92a23
RJ
469 is requesting, and it must match one of the languages specified\r
470 in SupportedLanguages. The number of languages supported by a\r
471 driver is up to the driver writer.\r
472 @param DriverName A pointer to the Unicode string to return. This Unicode string\r
473 is the name of the driver specified by This in the language\r
474 specified by Language.\r
475\r
476 @retval EFI_SUCCESS The Unicode string for the Driver specified by This\r
477 and the language specified by Language was returned\r
478 in DriverName.\r
479 @retval EFI_INVALID_PARAMETER Language is NULL.\r
480 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
481 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
482 language specified by Language.\r
483**/\r
484EFI_STATUS\r
485EFIAPI\r
486SataControllerComponentNameGetDriverName (\r
ac0a286f
MK
487 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
488 IN CHAR8 *Language,\r
489 OUT CHAR16 **DriverName\r
12e92a23
RJ
490 )\r
491;\r
492\r
493/**\r
494 Retrieves a Unicode string that is the user readable name of the controller\r
495 that is being managed by an UEFI Driver.\r
496\r
497 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
498 @param ControllerHandle The handle of a controller that the driver specified by\r
499 This is managing. This handle specifies the controller\r
500 whose name is to be returned.\r
501 @param OPTIONAL ChildHandle The handle of the child controller to retrieve the name\r
502 of. This is an optional parameter that may be NULL. It\r
503 will be NULL for device drivers. It will also be NULL\r
504 for a bus drivers that wish to retrieve the name of the\r
505 bus controller. It will not be NULL for a bus driver\r
506 that wishes to retrieve the name of a child controller.\r
507 @param Language A pointer to a three character ISO 639-2 language\r
508 identifier. This is the language of the controller name\r
e87ac5ef 509 that the caller is requesting, and it must match one\r
12e92a23
RJ
510 of the languages specified in SupportedLanguages. The\r
511 number of languages supported by a driver is up to the\r
512 driver writer.\r
513 @param ControllerName A pointer to the Unicode string to return. This Unicode\r
514 string is the name of the controller specified by\r
515 ControllerHandle and ChildHandle in the language\r
516 specified by Language from the point of view of the\r
517 driver specified by This.\r
518\r
519 @retval EFI_SUCCESS The Unicode string for the user readable name in the\r
520 language specified by Language for the driver\r
521 specified by This was returned in DriverName.\r
522 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
523 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
524 EFI_HANDLE.\r
525 @retval EFI_INVALID_PARAMETER Language is NULL.\r
526 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
527 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
528 managing the controller specified by\r
529 ControllerHandle and ChildHandle.\r
530 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
531 language specified by Language.\r
532**/\r
533EFI_STATUS\r
534EFIAPI\r
535SataControllerComponentNameGetControllerName (\r
ac0a286f
MK
536 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
537 IN EFI_HANDLE ControllerHandle,\r
538 IN EFI_HANDLE ChildHandle OPTIONAL,\r
539 IN CHAR8 *Language,\r
540 OUT CHAR16 **ControllerName\r
12e92a23
RJ
541 )\r
542;\r
543\r
544#endif\r