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