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