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