]>
Commit | Line | Data |
---|---|---|
4b738c76 HT |
1 | /** @file\r |
2 | Header file for ATA/ATAPI PASS THRU driver.\r | |
3 | \r | |
8d3c4b55 | 4 | Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r |
4b738c76 HT |
5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | #ifndef __ATA_ATAPI_PASS_THRU_H__\r | |
15 | #define __ATA_ATAPI_PASS_THRU_H__\r | |
16 | \r | |
17 | #include <Uefi.h>\r | |
18 | \r | |
19 | #include <IndustryStandard/Pci.h>\r | |
20 | #include <IndustryStandard/Atapi.h>\r | |
21 | #include <IndustryStandard/Scsi.h>\r | |
22 | \r | |
23 | #include <Protocol/PciIo.h>\r | |
24 | #include <Protocol/IdeControllerInit.h>\r | |
25 | #include <Protocol/AtaPassThru.h>\r | |
26 | #include <Protocol/ScsiPassThruExt.h>\r | |
27 | \r | |
28 | #include <Library/DebugLib.h>\r | |
29 | #include <Library/BaseLib.h>\r | |
30 | #include <Library/BaseMemoryLib.h>\r | |
31 | #include <Library/UefiDriverEntryPoint.h>\r | |
32 | #include <Library/UefiBootServicesTableLib.h>\r | |
33 | #include <Library/UefiLib.h>\r | |
34 | #include <Library/PciLib.h>\r | |
35 | #include <Library/PcdLib.h>\r | |
36 | #include <Library/TimerLib.h>\r | |
37 | #include <Library/MemoryAllocationLib.h>\r | |
38 | #include <Library/ReportStatusCodeLib.h>\r | |
39 | #include <Library/DevicePathLib.h>\r | |
40 | \r | |
41 | #include "IdeMode.h"\r | |
42 | #include "AhciMode.h"\r | |
43 | \r | |
44 | extern EFI_DRIVER_BINDING_PROTOCOL gAtaAtapiPassThruDriverBinding;\r | |
45 | extern EFI_COMPONENT_NAME_PROTOCOL gAtaAtapiPassThruComponentName;\r | |
46 | extern EFI_COMPONENT_NAME2_PROTOCOL gAtaAtapiPassThruComponentName2;\r | |
47 | \r | |
48 | #define ATA_ATAPI_PASS_THRU_SIGNATURE SIGNATURE_32 ('a', 'a', 'p', 't')\r | |
49 | #define ATA_ATAPI_DEVICE_SIGNATURE SIGNATURE_32 ('a', 'd', 'e', 'v')\r | |
50 | #define ATA_NONBLOCKING_TASK_SIGNATURE SIGNATURE_32 ('a', 't', 's', 'k')\r | |
51 | \r | |
52 | typedef struct _ATA_NONBLOCK_TASK ATA_NONBLOCK_TASK;\r | |
53 | \r | |
54 | typedef enum {\r | |
55 | EfiAtaIdeMode,\r | |
56 | EfiAtaAhciMode,\r | |
57 | EfiAtaRaidMode,\r | |
58 | EfiAtaUnknownMode\r | |
59 | } EFI_ATA_HC_WORK_MODE;\r | |
60 | \r | |
61 | typedef enum {\r | |
62 | EfiIdeCdrom, /* ATAPI CDROM */\r | |
63 | EfiIdeHarddisk, /* Hard Disk */\r | |
64 | EfiPortMultiplier, /* Port Multiplier */\r | |
65 | EfiIdeUnknown\r | |
66 | } EFI_ATA_DEVICE_TYPE;\r | |
67 | \r | |
68 | //\r | |
69 | // Ahci mode device info\r | |
70 | //\r | |
71 | typedef struct {\r | |
72 | UINT32 Signature;\r | |
73 | LIST_ENTRY Link;\r | |
74 | \r | |
75 | UINT16 Port;\r | |
76 | UINT16 PortMultiplier;\r | |
77 | EFI_ATA_DEVICE_TYPE Type;\r | |
78 | \r | |
79 | EFI_IDENTIFY_DATA *IdentifyData;\r | |
80 | } EFI_ATA_DEVICE_INFO;\r | |
81 | \r | |
82 | typedef struct {\r | |
83 | UINT32 Signature;\r | |
84 | \r | |
85 | EFI_HANDLE ControllerHandle;\r | |
86 | EFI_PCI_IO_PROTOCOL *PciIo;\r | |
87 | EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInit;\r | |
88 | \r | |
89 | EFI_ATA_PASS_THRU_MODE AtaPassThruMode;\r | |
90 | EFI_ATA_PASS_THRU_PROTOCOL AtaPassThru;\r | |
91 | EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode;\r | |
92 | EFI_EXT_SCSI_PASS_THRU_PROTOCOL ExtScsiPassThru;\r | |
93 | \r | |
94 | EFI_ATA_HC_WORK_MODE Mode;\r | |
95 | \r | |
96 | EFI_IDE_REGISTERS IdeRegisters[EfiIdeMaxChannel];\r | |
97 | EFI_AHCI_REGISTERS AhciRegisters;\r | |
98 | \r | |
99 | //\r | |
100 | // The attached device list\r | |
101 | //\r | |
102 | LIST_ENTRY DeviceList;\r | |
eed3f713 | 103 | UINT64 EnabledPciAttributes;\r |
4b738c76 HT |
104 | UINT64 OriginalPciAttributes;\r |
105 | \r | |
106 | //\r | |
107 | // For AtaPassThru protocol, using the following bytes to record the previous call in\r | |
108 | // GetNextPort()/GetNextDevice().\r | |
109 | //\r | |
110 | UINT16 PreviousPort;\r | |
111 | UINT16 PreviousPortMultiplier;\r | |
112 | //\r | |
113 | // For ExtScsiPassThru protocol, using the following bytes to record the previous call in\r | |
114 | // GetNextTarget()/GetNextTargetLun().\r | |
115 | //\r | |
116 | UINT16 PreviousTargetId;\r | |
117 | UINT64 PreviousLun;\r | |
118 | \r | |
119 | //\r | |
120 | // For Non-blocking.\r | |
121 | //\r | |
122 | EFI_EVENT TimerEvent;\r | |
123 | LIST_ENTRY NonBlockingTaskList;\r | |
124 | } ATA_ATAPI_PASS_THRU_INSTANCE;\r | |
125 | \r | |
126 | //\r | |
127 | // Task for Non-blocking mode.\r | |
128 | //\r | |
129 | struct _ATA_NONBLOCK_TASK {\r | |
130 | UINT32 Signature;\r | |
131 | LIST_ENTRY Link;\r | |
132 | \r | |
133 | UINT16 Port;\r | |
134 | UINT16 PortMultiplier;\r | |
135 | EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet;\r | |
136 | BOOLEAN IsStart;\r | |
137 | EFI_EVENT Event;\r | |
138 | UINT64 RetryTimes;\r | |
ab82122d TF |
139 | BOOLEAN InfiniteWait;\r |
140 | VOID *Map; // Pointer to map.\r | |
141 | VOID *TableMap; // Pointer to PRD table map.\r | |
4b738c76 | 142 | EFI_ATA_DMA_PRD *MapBaseAddress; // Pointer to range Base address for Map.\r |
ab82122d | 143 | UINTN PageCount; // The page numbers used by PCIO freebuffer.\r |
4b738c76 HT |
144 | };\r |
145 | \r | |
146 | //\r | |
147 | // Timeout value which uses 100ns as a unit.\r | |
148 | // It means 3 second span.\r | |
149 | //\r | |
150 | #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3)\r | |
8d3c4b55 | 151 | #define ATA_SPINUP_TIMEOUT EFI_TIMER_PERIOD_SECONDS(10)\r |
4b738c76 HT |
152 | \r |
153 | #define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)\r | |
154 | \r | |
155 | #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \\r | |
156 | CR (a, \\r | |
157 | ATA_ATAPI_PASS_THRU_INSTANCE, \\r | |
158 | AtaPassThru, \\r | |
159 | ATA_ATAPI_PASS_THRU_SIGNATURE \\r | |
160 | )\r | |
161 | \r | |
162 | #define EXT_SCSI_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \\r | |
163 | CR (a, \\r | |
164 | ATA_ATAPI_PASS_THRU_INSTANCE, \\r | |
165 | ExtScsiPassThru, \\r | |
166 | ATA_ATAPI_PASS_THRU_SIGNATURE \\r | |
167 | )\r | |
168 | \r | |
169 | #define ATA_ATAPI_DEVICE_INFO_FROM_THIS(a) \\r | |
170 | CR (a, \\r | |
171 | EFI_ATA_DEVICE_INFO, \\r | |
172 | Link, \\r | |
173 | ATA_ATAPI_DEVICE_SIGNATURE \\r | |
174 | );\r | |
175 | \r | |
176 | #define ATA_NON_BLOCK_TASK_FROM_ENTRY(a) \\r | |
177 | CR (a, \\r | |
178 | ATA_NONBLOCK_TASK, \\r | |
179 | Link, \\r | |
180 | ATA_NONBLOCKING_TASK_SIGNATURE \\r | |
181 | );\r | |
182 | \r | |
183 | /**\r | |
184 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
185 | \r | |
186 | This function retrieves the user readable name of a driver in the form of a\r | |
187 | Unicode string. If the driver specified by This has a user readable name in\r | |
188 | the language specified by Language, then a pointer to the driver name is\r | |
189 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
190 | by This does not support the language specified by Language,\r | |
191 | then EFI_UNSUPPORTED is returned.\r | |
192 | \r | |
193 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
194 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
195 | \r | |
196 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
197 | array indicating the language. This is the\r | |
198 | language of the driver name that the caller is\r | |
199 | requesting, and it must match one of the\r | |
200 | languages specified in SupportedLanguages. The\r | |
201 | number of languages supported by a driver is up\r | |
202 | to the driver writer. Language is specified\r | |
203 | in RFC 4646 or ISO 639-2 language code format.\r | |
204 | \r | |
205 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
206 | This Unicode string is the name of the\r | |
207 | driver specified by This in the language\r | |
208 | specified by Language.\r | |
209 | \r | |
210 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
211 | This and the language specified by Language was\r | |
212 | returned in DriverName.\r | |
213 | \r | |
214 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
215 | \r | |
216 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
217 | \r | |
218 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
219 | the language specified by Language.\r | |
220 | \r | |
221 | **/\r | |
222 | EFI_STATUS\r | |
223 | EFIAPI\r | |
224 | AtaAtapiPassThruComponentNameGetDriverName (\r | |
225 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
226 | IN CHAR8 *Language,\r | |
227 | OUT CHAR16 **DriverName\r | |
228 | );\r | |
229 | \r | |
230 | /**\r | |
231 | Retrieves a Unicode string that is the user readable name of the controller\r | |
232 | that is being managed by a driver.\r | |
233 | \r | |
234 | This function retrieves the user readable name of the controller specified by\r | |
235 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
236 | driver specified by This has a user readable name in the language specified by\r | |
237 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
238 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
239 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
240 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
241 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
242 | \r | |
243 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
244 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
245 | \r | |
246 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
247 | specified by This is managing. This handle\r | |
248 | specifies the controller whose name is to be\r | |
249 | returned.\r | |
250 | \r | |
251 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
252 | the name of. This is an optional parameter that\r | |
253 | may be NULL. It will be NULL for device\r | |
254 | drivers. It will also be NULL for a bus drivers\r | |
255 | that wish to retrieve the name of the bus\r | |
256 | controller. It will not be NULL for a bus\r | |
257 | driver that wishes to retrieve the name of a\r | |
258 | child controller.\r | |
259 | \r | |
260 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
261 | array indicating the language. This is the\r | |
262 | language of the driver name that the caller is\r | |
263 | requesting, and it must match one of the\r | |
264 | languages specified in SupportedLanguages. The\r | |
265 | number of languages supported by a driver is up\r | |
266 | to the driver writer. Language is specified in\r | |
267 | RFC 4646 or ISO 639-2 language code format.\r | |
268 | \r | |
269 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
270 | This Unicode string is the name of the\r | |
271 | controller specified by ControllerHandle and\r | |
272 | ChildHandle in the language specified by\r | |
273 | Language from the point of view of the driver\r | |
274 | specified by This.\r | |
275 | \r | |
276 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
277 | the language specified by Language for the\r | |
278 | driver specified by This was returned in\r | |
279 | DriverName.\r | |
280 | \r | |
281 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r | |
282 | \r | |
283 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
284 | EFI_HANDLE.\r | |
285 | \r | |
286 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
287 | \r | |
288 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
289 | \r | |
290 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
291 | managing the controller specified by\r | |
292 | ControllerHandle and ChildHandle.\r | |
293 | \r | |
294 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
295 | the language specified by Language.\r | |
296 | \r | |
297 | **/\r | |
298 | EFI_STATUS\r | |
299 | EFIAPI\r | |
300 | AtaAtapiPassThruComponentNameGetControllerName (\r | |
301 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
302 | IN EFI_HANDLE ControllerHandle,\r | |
303 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
304 | IN CHAR8 *Language,\r | |
305 | OUT CHAR16 **ControllerName\r | |
306 | );\r | |
307 | \r | |
308 | /**\r | |
309 | Tests to see if this driver supports a given controller. If a child device is provided,\r | |
310 | it further tests to see if this driver supports creating a handle for the specified child device.\r | |
311 | \r | |
312 | This function checks to see if the driver specified by This supports the device specified by\r | |
313 | ControllerHandle. Drivers will typically use the device path attached to\r | |
314 | ControllerHandle and/or the services from the bus I/O abstraction attached to\r | |
315 | ControllerHandle to determine if the driver supports ControllerHandle. This function\r | |
316 | may be called many times during platform initialization. In order to reduce boot times, the tests\r | |
317 | performed by this function must be very small, and take as little time as possible to execute. This\r | |
318 | function must not change the state of any hardware devices, and this function must be aware that the\r | |
319 | device specified by ControllerHandle may already be managed by the same driver or a\r | |
320 | different driver. This function must match its calls to AllocatePages() with FreePages(),\r | |
321 | AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().\r | |
322 | Because ControllerHandle may have been previously started by the same driver, if a protocol is\r | |
323 | already in the opened state, then it must not be closed with CloseProtocol(). This is required\r | |
324 | to guarantee the state of ControllerHandle is not modified by this function.\r | |
325 | \r | |
326 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
327 | @param[in] ControllerHandle The handle of the controller to test. This handle\r | |
328 | must support a protocol interface that supplies\r | |
329 | an I/O abstraction to the driver.\r | |
330 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r | |
331 | parameter is ignored by device drivers, and is optional for bus\r | |
332 | drivers. For bus drivers, if this parameter is not NULL, then\r | |
333 | the bus driver must determine if the bus controller specified\r | |
334 | by ControllerHandle and the child controller specified\r | |
335 | by RemainingDevicePath are both supported by this\r | |
336 | bus driver.\r | |
337 | \r | |
338 | @retval EFI_SUCCESS The device specified by ControllerHandle and\r | |
339 | RemainingDevicePath is supported by the driver specified by This.\r | |
340 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r | |
341 | RemainingDevicePath is already being managed by the driver\r | |
342 | specified by This.\r | |
343 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r | |
344 | RemainingDevicePath is already being managed by a different\r | |
345 | driver or an application that requires exclusive access.\r | |
346 | Currently not implemented.\r | |
347 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r | |
348 | RemainingDevicePath is not supported by the driver specified by This.\r | |
349 | **/\r | |
350 | EFI_STATUS\r | |
351 | EFIAPI\r | |
352 | AtaAtapiPassThruSupported (\r | |
353 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
354 | IN EFI_HANDLE Controller,\r | |
355 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
356 | );\r | |
357 | \r | |
358 | /**\r | |
359 | Starts a device controller or a bus controller.\r | |
360 | \r | |
361 | The Start() function is designed to be invoked from the EFI boot service ConnectController().\r | |
362 | As a result, much of the error checking on the parameters to Start() has been moved into this\r | |
363 | common boot service. It is legal to call Start() from other locations,\r | |
364 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r | |
365 | 1. ControllerHandle must be a valid EFI_HANDLE.\r | |
366 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r | |
367 | EFI_DEVICE_PATH_PROTOCOL.\r | |
368 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r | |
369 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r | |
370 | \r | |
371 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
372 | @param[in] ControllerHandle The handle of the controller to start. This handle\r | |
373 | must support a protocol interface that supplies\r | |
374 | an I/O abstraction to the driver.\r | |
375 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r | |
376 | parameter is ignored by device drivers, and is optional for bus\r | |
377 | drivers. For a bus driver, if this parameter is NULL, then handles\r | |
378 | for all the children of Controller are created by this driver.\r | |
379 | If this parameter is not NULL and the first Device Path Node is\r | |
380 | not the End of Device Path Node, then only the handle for the\r | |
381 | child device specified by the first Device Path Node of\r | |
382 | RemainingDevicePath is created by this driver.\r | |
383 | If the first Device Path Node of RemainingDevicePath is\r | |
384 | the End of Device Path Node, no child handle is created by this\r | |
385 | driver.\r | |
386 | \r | |
387 | @retval EFI_SUCCESS The device was started.\r | |
388 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r | |
389 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
390 | @retval Others The driver failded to start the device.\r | |
391 | \r | |
392 | **/\r | |
393 | EFI_STATUS\r | |
394 | EFIAPI\r | |
395 | AtaAtapiPassThruStart (\r | |
396 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
397 | IN EFI_HANDLE Controller,\r | |
398 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
399 | );\r | |
400 | \r | |
401 | /**\r | |
402 | Stops a device controller or a bus controller.\r | |
403 | \r | |
404 | The Stop() function is designed to be invoked from the EFI boot service DisconnectController().\r | |
405 | As a result, much of the error checking on the parameters to Stop() has been moved\r | |
406 | into this common boot service. It is legal to call Stop() from other locations,\r | |
407 | but the following calling restrictions must be followed, or the system behavior will not be deterministic.\r | |
408 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r | |
409 | same driver's Start() function.\r | |
410 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r | |
411 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r | |
412 | Start() function, and the Start() function must have called OpenProtocol() on\r | |
413 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r | |
414 | \r | |
415 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
416 | @param[in] ControllerHandle A handle to the device being stopped. The handle must\r | |
417 | support a bus specific I/O protocol for the driver\r | |
418 | to use to stop the device.\r | |
419 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.\r | |
420 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r | |
421 | if NumberOfChildren is 0.\r | |
422 | \r | |
423 | @retval EFI_SUCCESS The device was stopped.\r | |
424 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
425 | \r | |
426 | **/\r | |
427 | EFI_STATUS\r | |
428 | EFIAPI\r | |
429 | AtaAtapiPassThruStop (\r | |
430 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
431 | IN EFI_HANDLE Controller,\r | |
432 | IN UINTN NumberOfChildren,\r | |
433 | IN EFI_HANDLE *ChildHandleBuffer\r | |
434 | );\r | |
435 | \r | |
436 | /**\r | |
437 | Traverse the attached ATA devices list to find out the device to access.\r | |
438 | \r | |
439 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.\r | |
440 | @param[in] Port The port number of the ATA device to send the command.\r | |
441 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.\r | |
23a596db | 442 | If there is no port multiplier, then specify 0xFFFF.\r |
4b738c76 HT |
443 | @param[in] DeviceType The device type of the ATA device.\r |
444 | \r | |
445 | @retval The pointer to the data structure of the device info to access.\r | |
446 | \r | |
447 | **/\r | |
448 | LIST_ENTRY *\r | |
449 | EFIAPI\r | |
450 | SearchDeviceInfoList (\r | |
451 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance,\r | |
452 | IN UINT16 Port,\r | |
453 | IN UINT16 PortMultiplier,\r | |
454 | IN EFI_ATA_DEVICE_TYPE DeviceType\r | |
455 | );\r | |
456 | \r | |
457 | /**\r | |
458 | Allocate device info data structure to contain device info.\r | |
459 | And insert the data structure to the tail of device list for tracing.\r | |
460 | \r | |
461 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.\r | |
462 | @param[in] Port The port number of the ATA device to send the command.\r | |
463 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.\r | |
23a596db | 464 | If there is no port multiplier, then specify 0xFFFF.\r |
4b738c76 HT |
465 | @param[in] DeviceType The device type of the ATA device.\r |
466 | @param[in] IdentifyData The data buffer to store the output of the IDENTIFY cmd.\r | |
467 | \r | |
468 | @retval EFI_SUCCESS Successfully insert the ata device to the tail of device list.\r | |
469 | @retval EFI_OUT_OF_RESOURCES Can not allocate enough resource for use.\r | |
470 | \r | |
471 | **/\r | |
472 | EFI_STATUS\r | |
473 | EFIAPI\r | |
474 | CreateNewDeviceInfo (\r | |
475 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance,\r | |
476 | IN UINT16 Port,\r | |
477 | IN UINT16 PortMultiplier,\r | |
478 | IN EFI_ATA_DEVICE_TYPE DeviceType,\r | |
479 | IN EFI_IDENTIFY_DATA *IdentifyData\r | |
480 | );\r | |
481 | \r | |
482 | /**\r | |
483 | Destroy all attached ATA devices info.\r | |
484 | \r | |
485 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.\r | |
486 | \r | |
487 | **/\r | |
488 | VOID\r | |
489 | EFIAPI\r | |
490 | DestroyDeviceInfoList (\r | |
491 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance\r | |
492 | );\r | |
493 | \r | |
494 | /**\r | |
495 | Destroy all pending non blocking tasks.\r | |
496 | \r | |
497 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.\r | |
498 | @param[in] IsSigEvent Indicate whether signal the task event when remove the\r | |
499 | task.\r | |
500 | \r | |
501 | **/\r | |
502 | VOID\r | |
503 | EFIAPI\r | |
504 | DestroyAsynTaskList (\r | |
505 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance,\r | |
506 | IN BOOLEAN IsSigEvent\r | |
507 | );\r | |
508 | \r | |
509 | /**\r | |
510 | Enumerate all attached ATA devices at IDE mode or AHCI mode separately.\r | |
511 | \r | |
512 | The function is designed to enumerate all attached ATA devices.\r | |
513 | \r | |
514 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.\r | |
515 | \r | |
516 | @retval EFI_SUCCESS Successfully enumerate attached ATA devices.\r | |
517 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
518 | \r | |
519 | **/\r | |
520 | EFI_STATUS\r | |
521 | EFIAPI\r | |
522 | EnumerateAttachedDevice (\r | |
523 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance\r | |
524 | );\r | |
525 | \r | |
526 | /**\r | |
527 | Call back funtion when the timer event is signaled.\r | |
528 | \r | |
529 | @param[in] Event The Event this notify function registered to.\r | |
530 | @param[in] Context Pointer to the context data registered to the\r | |
531 | Event.\r | |
532 | \r | |
533 | **/\r | |
534 | VOID\r | |
535 | EFIAPI\r | |
536 | AsyncNonBlockingTransferRoutine (\r | |
537 | EFI_EVENT Event,\r | |
538 | VOID* Context\r | |
539 | );\r | |
540 | \r | |
541 | /**\r | |
542 | Sends an ATA command to an ATA device that is attached to the ATA controller. This function\r | |
543 | supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,\r | |
544 | and the non-blocking I/O functionality is optional.\r | |
545 | \r | |
546 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
547 | @param[in] Port The port number of the ATA device to send the command.\r | |
548 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.\r | |
23a596db | 549 | If there is no port multiplier, then specify 0xFFFF.\r |
4b738c76 HT |
550 | @param[in, out] Packet A pointer to the ATA command to send to the ATA device specified by Port\r |
551 | and PortMultiplierPort.\r | |
552 | @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking\r | |
553 | I/O is performed. If Event is NULL, then blocking I/O is performed. If\r | |
554 | Event is not NULL and non blocking I/O is supported, then non-blocking\r | |
555 | I/O is performed, and Event will be signaled when the ATA command completes.\r | |
556 | \r | |
557 | @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands,\r | |
558 | InTransferLength bytes were transferred from InDataBuffer. For write and\r | |
559 | bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.\r | |
560 | @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred\r | |
561 | is returned in InTransferLength. For write and bi-directional commands,\r | |
562 | OutTransferLength bytes were transferred by OutDataBuffer.\r | |
563 | @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands\r | |
564 | already queued. The caller may retry again later.\r | |
565 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.\r | |
566 | @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA\r | |
567 | command was not sent, so no additional status information is available.\r | |
568 | \r | |
569 | **/\r | |
570 | EFI_STATUS\r | |
571 | EFIAPI\r | |
572 | AtaPassThruPassThru (\r | |
573 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
574 | IN UINT16 Port,\r | |
575 | IN UINT16 PortMultiplierPort,\r | |
576 | IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet,\r | |
577 | IN EFI_EVENT Event OPTIONAL\r | |
578 | );\r | |
579 | \r | |
580 | /**\r | |
581 | Used to retrieve the list of legal port numbers for ATA devices on an ATA controller.\r | |
582 | These can either be the list of ports where ATA devices are actually present or the\r | |
583 | list of legal port numbers for the ATA controller. Regardless, the caller of this\r | |
584 | function must probe the port number returned to see if an ATA device is actually\r | |
585 | present at that location on the ATA controller.\r | |
586 | \r | |
587 | The GetNextPort() function retrieves the port number on an ATA controller. If on input\r | |
588 | Port is 0xFFFF, then the port number of the first port on the ATA controller is returned\r | |
589 | in Port and EFI_SUCCESS is returned.\r | |
590 | \r | |
591 | If Port is a port number that was returned on a previous call to GetNextPort(), then the\r | |
592 | port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS\r | |
593 | is returned. If Port is not 0xFFFF and Port was not returned on a previous call to\r | |
594 | GetNextPort(), then EFI_INVALID_PARAMETER is returned.\r | |
595 | \r | |
596 | If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is\r | |
597 | returned.\r | |
598 | \r | |
599 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
600 | @param[in, out] Port On input, a pointer to the port number on the ATA controller.\r | |
601 | On output, a pointer to the next port number on the ATA\r | |
602 | controller. An input value of 0xFFFF retrieves the first port\r | |
603 | number on the ATA controller.\r | |
604 | \r | |
605 | @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port.\r | |
606 | @retval EFI_NOT_FOUND There are no more ports on this ATA controller.\r | |
607 | @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call\r | |
608 | to GetNextPort().\r | |
609 | \r | |
610 | **/\r | |
611 | EFI_STATUS\r | |
612 | EFIAPI\r | |
613 | AtaPassThruGetNextPort (\r | |
614 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
615 | IN OUT UINT16 *Port\r | |
616 | );\r | |
617 | \r | |
618 | /**\r | |
619 | Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA\r | |
620 | controller. These can either be the list of port multiplier ports where ATA devices are actually\r | |
621 | present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this\r | |
622 | function must probe the port number and port multiplier port number returned to see if an ATA\r | |
623 | device is actually present.\r | |
624 | \r | |
625 | The GetNextDevice() function retrieves the port multiplier port number of an ATA device\r | |
626 | present on a port of an ATA controller.\r | |
627 | \r | |
628 | If PortMultiplierPort points to a port multiplier port number value that was returned on a\r | |
629 | previous call to GetNextDevice(), then the port multiplier port number of the next ATA device\r | |
630 | on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is\r | |
631 | returned.\r | |
632 | \r | |
633 | If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first\r | |
634 | ATA device on port of the ATA controller is returned in PortMultiplierPort and\r | |
635 | EFI_SUCCESS is returned.\r | |
636 | \r | |
637 | If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort\r | |
638 | was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER\r | |
639 | is returned.\r | |
640 | \r | |
641 | If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of\r | |
642 | the ATA controller, then EFI_NOT_FOUND is returned.\r | |
643 | \r | |
644 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
645 | @param[in] Port The port number present on the ATA controller.\r | |
646 | @param[in, out] PortMultiplierPort On input, a pointer to the port multiplier port number of an\r | |
647 | ATA device present on the ATA controller.\r | |
648 | If on input a PortMultiplierPort of 0xFFFF is specified,\r | |
649 | then the port multiplier port number of the first ATA device\r | |
650 | is returned. On output, a pointer to the port multiplier port\r | |
651 | number of the next ATA device present on an ATA controller.\r | |
652 | \r | |
653 | @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port\r | |
654 | of the ATA controller was returned in PortMultiplierPort.\r | |
655 | @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller.\r | |
656 | @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not\r | |
657 | returned on a previous call to GetNextDevice().\r | |
658 | \r | |
659 | **/\r | |
660 | EFI_STATUS\r | |
661 | EFIAPI\r | |
662 | AtaPassThruGetNextDevice (\r | |
663 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
664 | IN UINT16 Port,\r | |
665 | IN OUT UINT16 *PortMultiplierPort\r | |
666 | );\r | |
667 | \r | |
668 | /**\r | |
669 | Used to allocate and build a device path node for an ATA device on an ATA controller.\r | |
670 | \r | |
671 | The BuildDevicePath() function allocates and builds a single device node for the ATA\r | |
672 | device specified by Port and PortMultiplierPort. If the ATA device specified by Port and\r | |
673 | PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.\r | |
674 | If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough\r | |
675 | resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.\r | |
676 | \r | |
677 | Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of\r | |
678 | DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,\r | |
679 | and EFI_SUCCESS is returned.\r | |
680 | \r | |
681 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
682 | @param[in] Port Port specifies the port number of the ATA device for which a\r | |
683 | device path node is to be allocated and built.\r | |
684 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a\r | |
685 | device path node is to be allocated and built. If there is no\r | |
23a596db | 686 | port multiplier, then specify 0xFFFF.\r |
4b738c76 HT |
687 | @param[in, out] DevicePath A pointer to a single device path node that describes the ATA\r |
688 | device specified by Port and PortMultiplierPort. This function\r | |
689 | is responsible for allocating the buffer DevicePath with the\r | |
690 | boot service AllocatePool(). It is the caller's responsibility\r | |
691 | to free DevicePath when the caller is finished with DevicePath.\r | |
692 | @retval EFI_SUCCESS The device path node that describes the ATA device specified by\r | |
693 | Port and PortMultiplierPort was allocated and returned in DevicePath.\r | |
694 | @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not\r | |
695 | exist on the ATA controller.\r | |
696 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
697 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.\r | |
698 | \r | |
699 | **/\r | |
700 | EFI_STATUS\r | |
701 | EFIAPI\r | |
702 | AtaPassThruBuildDevicePath (\r | |
703 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
704 | IN UINT16 Port,\r | |
705 | IN UINT16 PortMultiplierPort,\r | |
706 | IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r | |
707 | );\r | |
708 | \r | |
709 | /**\r | |
710 | Used to translate a device path node to a port number and port multiplier port number.\r | |
711 | \r | |
712 | The GetDevice() function determines the port and port multiplier port number associated with\r | |
713 | the ATA device described by DevicePath. If DevicePath is a device path node type that the\r | |
714 | ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents\r | |
715 | DevicePath into a port number and port multiplier port number.\r | |
716 | \r | |
717 | If this translation is successful, then that port number and port multiplier port number are returned\r | |
718 | in Port and PortMultiplierPort, and EFI_SUCCESS is returned.\r | |
719 | \r | |
720 | If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.\r | |
721 | \r | |
722 | If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then\r | |
723 | EFI_UNSUPPORTED is returned.\r | |
724 | \r | |
725 | If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not\r | |
726 | a valid translation from DevicePath to a port number and port multiplier port number, then\r | |
727 | EFI_NOT_FOUND is returned.\r | |
728 | \r | |
729 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
730 | @param[in] DevicePath A pointer to the device path node that describes an ATA device on the\r | |
731 | ATA controller.\r | |
732 | @param[out] Port On return, points to the port number of an ATA device on the ATA controller.\r | |
733 | @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device\r | |
734 | on the ATA controller.\r | |
735 | \r | |
736 | @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier\r | |
737 | port number, and they were returned in Port and PortMultiplierPort.\r | |
738 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
739 | @retval EFI_INVALID_PARAMETER Port is NULL.\r | |
740 | @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL.\r | |
741 | @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath.\r | |
742 | @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier\r | |
743 | port number does not exist.\r | |
744 | \r | |
745 | **/\r | |
746 | EFI_STATUS\r | |
747 | EFIAPI\r | |
748 | AtaPassThruGetDevice (\r | |
749 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
750 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
751 | OUT UINT16 *Port,\r | |
752 | OUT UINT16 *PortMultiplierPort\r | |
753 | );\r | |
754 | \r | |
755 | /**\r | |
756 | Resets a specific port on the ATA controller. This operation also resets all the ATA devices\r | |
757 | connected to the port.\r | |
758 | \r | |
759 | The ResetChannel() function resets an a specific port on an ATA controller. This operation\r | |
760 | resets all the ATA devices connected to that port. If this ATA controller does not support\r | |
761 | a reset port operation, then EFI_UNSUPPORTED is returned.\r | |
762 | \r | |
763 | If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is\r | |
764 | returned.\r | |
765 | \r | |
766 | If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.\r | |
767 | \r | |
768 | If the port reset operation is completed, then EFI_SUCCESS is returned.\r | |
769 | \r | |
770 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
771 | @param[in] Port The port number on the ATA controller.\r | |
772 | \r | |
773 | @retval EFI_SUCCESS The ATA controller port was reset.\r | |
774 | @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation.\r | |
775 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port.\r | |
776 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port.\r | |
777 | \r | |
778 | **/\r | |
779 | EFI_STATUS\r | |
780 | EFIAPI\r | |
781 | AtaPassThruResetPort (\r | |
782 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
783 | IN UINT16 Port\r | |
784 | );\r | |
785 | \r | |
786 | /**\r | |
787 | Resets an ATA device that is connected to an ATA controller.\r | |
788 | \r | |
789 | The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.\r | |
790 | If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is\r | |
791 | returned.\r | |
792 | \r | |
793 | If Port or PortMultiplierPort are not in a valid range for this ATA controller, then\r | |
794 | EFI_INVALID_PARAMETER is returned.\r | |
795 | \r | |
796 | If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR\r | |
797 | is returned.\r | |
798 | \r | |
799 | If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is\r | |
800 | returned.\r | |
801 | \r | |
802 | If the device reset operation is completed, then EFI_SUCCESS is returned.\r | |
803 | \r | |
804 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r | |
805 | @param[in] Port Port represents the port number of the ATA device to be reset.\r | |
806 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset.\r | |
23a596db | 807 | If there is no port multiplier, then specify 0xFFFF.\r |
4b738c76 HT |
808 | @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset.\r |
809 | @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation.\r | |
810 | @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid.\r | |
811 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device\r | |
812 | specified by Port and PortMultiplierPort.\r | |
813 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device\r | |
814 | specified by Port and PortMultiplierPort.\r | |
815 | \r | |
816 | **/\r | |
817 | EFI_STATUS\r | |
818 | EFIAPI\r | |
819 | AtaPassThruResetDevice (\r | |
820 | IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r | |
821 | IN UINT16 Port,\r | |
822 | IN UINT16 PortMultiplierPort\r | |
823 | );\r | |
824 | \r | |
825 | /**\r | |
826 | Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function\r | |
827 | supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the\r | |
828 | nonblocking I/O functionality is optional.\r | |
829 | \r | |
830 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r | |
831 | @param Target The Target is an array of size TARGET_MAX_BYTES and it represents\r | |
832 | the id of the SCSI device to send the SCSI Request Packet. Each\r | |
833 | transport driver may choose to utilize a subset of this size to suit the needs\r | |
834 | of transport target representation. For example, a Fibre Channel driver\r | |
835 | may use only 8 bytes (WWN) to represent an FC target.\r | |
836 | @param Lun The LUN of the SCSI device to send the SCSI Request Packet.\r | |
837 | @param Packet A pointer to the SCSI Request Packet to send to the SCSI device\r | |
838 | specified by Target and Lun.\r | |
839 | @param Event If nonblocking I/O is not supported then Event is ignored, and blocking\r | |
840 | I/O is performed. If Event is NULL, then blocking I/O is performed. If\r | |
841 | Event is not NULL and non blocking I/O is supported, then\r | |
842 | nonblocking I/O is performed, and Event will be signaled when the\r | |
843 | SCSI Request Packet completes.\r | |
844 | \r | |
845 | @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional\r | |
846 | commands, InTransferLength bytes were transferred from\r | |
847 | InDataBuffer. For write and bi-directional commands,\r | |
848 | OutTransferLength bytes were transferred by\r | |
849 | OutDataBuffer.\r | |
850 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that\r | |
851 | could be transferred is returned in InTransferLength. For write\r | |
852 | and bi-directional commands, OutTransferLength bytes were\r | |
853 | transferred by OutDataBuffer.\r | |
854 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r | |
855 | SCSI Request Packets already queued. The caller may retry again later.\r | |
856 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request\r | |
857 | Packet.\r | |
858 | @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.\r | |
859 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported\r | |
860 | by the host adapter. This includes the case of Bi-directional SCSI\r | |
861 | commands not supported by the implementation. The SCSI Request\r | |
862 | Packet was not sent, so no additional status information is available.\r | |
863 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
864 | \r | |
865 | **/\r | |
866 | EFI_STATUS\r | |
867 | EFIAPI\r | |
868 | ExtScsiPassThruPassThru (\r | |
869 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r | |
870 | IN UINT8 *Target,\r | |
871 | IN UINT64 Lun,\r | |
872 | IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,\r | |
873 | IN EFI_EVENT Event OPTIONAL\r | |
874 | );\r | |
875 | \r | |
876 | /**\r | |
877 | Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These\r | |
878 | can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal\r | |
879 | Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the\r | |
880 | Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI\r | |
881 | channel.\r | |
882 | \r | |
883 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r | |
884 | @param Target On input, a pointer to the Target ID (an array of size\r | |
885 | TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.\r | |
886 | On output, a pointer to the Target ID (an array of\r | |
887 | TARGET_MAX_BYTES) of the next SCSI device present on a SCSI\r | |
888 | channel. An input value of 0xF(all bytes in the array are 0xF) in the\r | |
889 | Target array retrieves the Target ID of the first SCSI device present on a\r | |
890 | SCSI channel.\r | |
891 | @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI\r | |
892 | channel. On output, a pointer to the LUN of the next SCSI device present\r | |
893 | on a SCSI channel.\r | |
894 | \r | |
895 | @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI\r | |
896 | channel was returned in Target and Lun.\r | |
897 | @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were\r | |
898 | not returned on a previous call to GetNextTargetLun().\r | |
899 | @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r | |
900 | \r | |
901 | **/\r | |
902 | EFI_STATUS\r | |
903 | EFIAPI\r | |
904 | ExtScsiPassThruGetNextTargetLun (\r | |
905 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r | |
906 | IN OUT UINT8 **Target,\r | |
907 | IN OUT UINT64 *Lun\r | |
908 | );\r | |
909 | \r | |
910 | /**\r | |
911 | Used to allocate and build a device path node for a SCSI device on a SCSI channel.\r | |
912 | \r | |
913 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r | |
914 | @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the\r | |
915 | Target ID of the SCSI device for which a device path node is to be\r | |
916 | allocated and built. Transport drivers may chose to utilize a subset of\r | |
917 | this size to suit the representation of targets. For example, a Fibre\r | |
918 | Channel driver may use only 8 bytes (WWN) in the array to represent a\r | |
919 | FC target.\r | |
920 | @param Lun The LUN of the SCSI device for which a device path node is to be\r | |
921 | allocated and built.\r | |
922 | @param DevicePath A pointer to a single device path node that describes the SCSI device\r | |
923 | specified by Target and Lun. This function is responsible for\r | |
924 | allocating the buffer DevicePath with the boot service\r | |
925 | AllocatePool(). It is the caller's responsibility to free\r | |
926 | DevicePath when the caller is finished with DevicePath.\r | |
927 | \r | |
928 | @retval EFI_SUCCESS The device path node that describes the SCSI device specified by\r | |
929 | Target and Lun was allocated and returned in\r | |
930 | DevicePath.\r | |
931 | @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r | |
932 | @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist\r | |
933 | on the SCSI channel.\r | |
934 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.\r | |
935 | \r | |
936 | **/\r | |
937 | EFI_STATUS\r | |
938 | EFIAPI\r | |
939 | ExtScsiPassThruBuildDevicePath (\r | |
940 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r | |
941 | IN UINT8 *Target,\r | |
942 | IN UINT64 Lun,\r | |
943 | IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r | |
944 | );\r | |
945 | \r | |
946 | /**\r | |
947 | Used to translate a device path node to a Target ID and LUN.\r | |
948 | \r | |
949 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r | |
950 | @param DevicePath A pointer to a single device path node that describes the SCSI device\r | |
951 | on the SCSI channel.\r | |
952 | @param Target A pointer to the Target Array which represents the ID of a SCSI device\r | |
953 | on the SCSI channel.\r | |
954 | @param Lun A pointer to the LUN of a SCSI device on the SCSI channel.\r | |
955 | \r | |
956 | @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and\r | |
957 | LUN, and they were returned in Target and Lun.\r | |
958 | @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.\r | |
959 | @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN\r | |
960 | does not exist.\r | |
961 | @retval EFI_UNSUPPORTED This driver does not support the device path node type in\r | |
962 | DevicePath.\r | |
963 | \r | |
964 | **/\r | |
965 | EFI_STATUS\r | |
966 | EFIAPI\r | |
967 | ExtScsiPassThruGetTargetLun (\r | |
968 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r | |
969 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
970 | OUT UINT8 **Target,\r | |
971 | OUT UINT64 *Lun\r | |
972 | );\r | |
973 | \r | |
974 | /**\r | |
975 | Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.\r | |
976 | \r | |
977 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r | |
978 | \r | |
979 | @retval EFI_SUCCESS The SCSI channel was reset.\r | |
980 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.\r | |
981 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.\r | |
982 | @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.\r | |
983 | \r | |
984 | **/\r | |
985 | EFI_STATUS\r | |
986 | EFIAPI\r | |
987 | ExtScsiPassThruResetChannel (\r | |
988 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This\r | |
989 | );\r | |
990 | \r | |
991 | /**\r | |
992 | Resets a SCSI logical unit that is connected to a SCSI channel.\r | |
993 | \r | |
994 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r | |
995 | @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the\r | |
996 | target port ID of the SCSI device containing the SCSI logical unit to\r | |
997 | reset. Transport drivers may chose to utilize a subset of this array to suit\r | |
998 | the representation of their targets.\r | |
999 | @param Lun The LUN of the SCSI device to reset.\r | |
1000 | \r | |
1001 | @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.\r | |
1002 | @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r | |
1003 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device\r | |
1004 | specified by Target and Lun.\r | |
1005 | @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.\r | |
1006 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device\r | |
1007 | specified by Target and Lun.\r | |
1008 | \r | |
1009 | **/\r | |
1010 | EFI_STATUS\r | |
1011 | EFIAPI\r | |
1012 | ExtScsiPassThruResetTargetLun (\r | |
1013 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r | |
1014 | IN UINT8 *Target,\r | |
1015 | IN UINT64 Lun\r | |
1016 | );\r | |
1017 | \r | |
1018 | /**\r | |
1019 | Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either\r | |
1020 | be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs\r | |
1021 | for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to\r | |
1022 | see if a SCSI device is actually present at that location on the SCSI channel.\r | |
1023 | \r | |
1024 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r | |
1025 | @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.\r | |
1026 | On output, a pointer to the Target ID (an array of\r | |
1027 | TARGET_MAX_BYTES) of the next SCSI device present on a SCSI\r | |
1028 | channel. An input value of 0xF(all bytes in the array are 0xF) in the\r | |
1029 | Target array retrieves the Target ID of the first SCSI device present on a\r | |
1030 | SCSI channel.\r | |
1031 | \r | |
1032 | @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI\r | |
1033 | channel was returned in Target.\r | |
1034 | @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r | |
1035 | @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not\r | |
1036 | returned on a previous call to GetNextTarget().\r | |
1037 | @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r | |
1038 | \r | |
1039 | **/\r | |
1040 | EFI_STATUS\r | |
1041 | EFIAPI\r | |
1042 | ExtScsiPassThruGetNextTarget (\r | |
1043 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r | |
1044 | IN OUT UINT8 **Target\r | |
1045 | );\r | |
1046 | \r | |
1047 | /**\r | |
1048 | Initialize ATA host controller at IDE mode.\r | |
1049 | \r | |
1050 | The function is designed to initialize ATA host controller.\r | |
1051 | \r | |
1052 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.\r | |
1053 | \r | |
1054 | **/\r | |
1055 | EFI_STATUS\r | |
1056 | EFIAPI\r | |
1057 | IdeModeInitialization (\r | |
1058 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance\r | |
1059 | );\r | |
1060 | \r | |
1061 | /**\r | |
1062 | Initialize ATA host controller at AHCI mode.\r | |
1063 | \r | |
1064 | The function is designed to initialize ATA host controller.\r | |
1065 | \r | |
1066 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.\r | |
1067 | \r | |
1068 | **/\r | |
1069 | EFI_STATUS\r | |
1070 | EFIAPI\r | |
1071 | AhciModeInitialization (\r | |
1072 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance\r | |
1073 | );\r | |
1074 | \r | |
1075 | /**\r | |
1076 | Start a non data transfer on specific port.\r | |
1077 | \r | |
1078 | @param[in] PciIo The PCI IO protocol instance.\r | |
1079 | @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r | |
1080 | @param[in] Port The number of port.\r | |
1081 | @param[in] PortMultiplier The timeout value of stop.\r | |
1082 | @param[in] AtapiCommand The atapi command will be used for the\r | |
1083 | transfer.\r | |
1084 | @param[in] AtapiCommandLength The length of the atapi command.\r | |
1085 | @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r | |
1086 | @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.\r | |
1087 | @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.\r | |
1088 | @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK\r | |
1089 | used by non-blocking mode.\r | |
1090 | \r | |
1091 | @retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.\r | |
1092 | @retval EFI_TIMEOUT The operation is time out.\r | |
1093 | @retval EFI_UNSUPPORTED The device is not ready for transfer.\r | |
1094 | @retval EFI_SUCCESS The non data transfer executes successfully.\r | |
1095 | \r | |
1096 | **/\r | |
1097 | EFI_STATUS\r | |
1098 | EFIAPI\r | |
1099 | AhciNonDataTransfer (\r | |
1100 | IN EFI_PCI_IO_PROTOCOL *PciIo,\r | |
1101 | IN EFI_AHCI_REGISTERS *AhciRegisters,\r | |
1102 | IN UINT8 Port,\r | |
1103 | IN UINT8 PortMultiplier,\r | |
1104 | IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL,\r | |
1105 | IN UINT8 AtapiCommandLength,\r | |
1106 | IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock,\r | |
1107 | IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock,\r | |
1108 | IN UINT64 Timeout,\r | |
1109 | IN ATA_NONBLOCK_TASK *Task\r | |
1110 | );\r | |
1111 | \r | |
1112 | /**\r | |
1113 | Start a DMA data transfer on specific port\r | |
1114 | \r | |
1115 | @param[in] Instance The ATA_ATAPI_PASS_THRU_INSTANCE protocol instance.\r | |
1116 | @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r | |
1117 | @param[in] Port The number of port.\r | |
1118 | @param[in] PortMultiplier The timeout value of stop.\r | |
1119 | @param[in] AtapiCommand The atapi command will be used for the\r | |
1120 | transfer.\r | |
1121 | @param[in] AtapiCommandLength The length of the atapi command.\r | |
1122 | @param[in] Read The transfer direction.\r | |
1123 | @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r | |
1124 | @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.\r | |
1125 | @param[in, out] MemoryAddr The pointer to the data buffer.\r | |
1126 | @param[in] DataCount The data count to be transferred.\r | |
1127 | @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.\r | |
1128 | @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK\r | |
1129 | used by non-blocking mode.\r | |
1130 | \r | |
1131 | @retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.\r | |
1132 | @retval EFI_TIMEOUT The operation is time out.\r | |
1133 | @retval EFI_UNSUPPORTED The device is not ready for transfer.\r | |
1134 | @retval EFI_SUCCESS The DMA data transfer executes successfully.\r | |
1135 | \r | |
1136 | **/\r | |
1137 | EFI_STATUS\r | |
1138 | EFIAPI\r | |
1139 | AhciDmaTransfer (\r | |
1140 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance,\r | |
1141 | IN EFI_AHCI_REGISTERS *AhciRegisters,\r | |
1142 | IN UINT8 Port,\r | |
1143 | IN UINT8 PortMultiplier,\r | |
1144 | IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL,\r | |
1145 | IN UINT8 AtapiCommandLength,\r | |
1146 | IN BOOLEAN Read,\r | |
1147 | IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock,\r | |
1148 | IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock,\r | |
1149 | IN OUT VOID *MemoryAddr,\r | |
1150 | IN UINT32 DataCount,\r | |
1151 | IN UINT64 Timeout,\r | |
1152 | IN ATA_NONBLOCK_TASK *Task\r | |
1153 | );\r | |
1154 | \r | |
1155 | /**\r | |
1156 | Start a PIO data transfer on specific port.\r | |
1157 | \r | |
1158 | @param[in] PciIo The PCI IO protocol instance.\r | |
1159 | @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.\r | |
1160 | @param[in] Port The number of port.\r | |
1161 | @param[in] PortMultiplier The timeout value of stop.\r | |
1162 | @param[in] AtapiCommand The atapi command will be used for the\r | |
1163 | transfer.\r | |
1164 | @param[in] AtapiCommandLength The length of the atapi command.\r | |
1165 | @param[in] Read The transfer direction.\r | |
1166 | @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.\r | |
1167 | @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.\r | |
1168 | @param[in, out] MemoryAddr The pointer to the data buffer.\r | |
1169 | @param[in] DataCount The data count to be transferred.\r | |
1170 | @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.\r | |
1171 | @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK\r | |
1172 | used by non-blocking mode.\r | |
1173 | \r | |
1174 | @retval EFI_DEVICE_ERROR The PIO data transfer abort with error occurs.\r | |
1175 | @retval EFI_TIMEOUT The operation is time out.\r | |
1176 | @retval EFI_UNSUPPORTED The device is not ready for transfer.\r | |
1177 | @retval EFI_SUCCESS The PIO data transfer executes successfully.\r | |
1178 | \r | |
1179 | **/\r | |
1180 | EFI_STATUS\r | |
1181 | EFIAPI\r | |
1182 | AhciPioTransfer (\r | |
1183 | IN EFI_PCI_IO_PROTOCOL *PciIo,\r | |
1184 | IN EFI_AHCI_REGISTERS *AhciRegisters,\r | |
1185 | IN UINT8 Port,\r | |
1186 | IN UINT8 PortMultiplier,\r | |
1187 | IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL,\r | |
1188 | IN UINT8 AtapiCommandLength,\r | |
1189 | IN BOOLEAN Read,\r | |
1190 | IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock,\r | |
1191 | IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock,\r | |
1192 | IN OUT VOID *MemoryAddr,\r | |
1193 | IN UINT32 DataCount,\r | |
1194 | IN UINT64 Timeout,\r | |
1195 | IN ATA_NONBLOCK_TASK *Task\r | |
1196 | );\r | |
1197 | \r | |
1198 | /**\r | |
1199 | Send ATA command into device with NON_DATA protocol\r | |
1200 | \r | |
1201 | @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE\r | |
1202 | data structure.\r | |
1203 | @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.\r | |
1204 | @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data\r | |
1205 | structure.\r | |
1206 | @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.\r | |
1207 | @param[in] Timeout The time to complete the command, uses 100ns as a unit.\r | |
1208 | @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK\r | |
1209 | used by non-blocking mode.\r | |
1210 | \r | |
1211 | @retval EFI_SUCCESS Reading succeed\r | |
1212 | @retval EFI_ABORTED Command failed\r | |
1213 | @retval EFI_DEVICE_ERROR Device status error.\r | |
1214 | \r | |
1215 | **/\r | |
1216 | EFI_STATUS\r | |
1217 | EFIAPI\r | |
1218 | AtaNonDataCommandIn (\r | |
1219 | IN EFI_PCI_IO_PROTOCOL *PciIo,\r | |
1220 | IN EFI_IDE_REGISTERS *IdeRegisters,\r | |
1221 | IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock,\r | |
1222 | IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock,\r | |
1223 | IN UINT64 Timeout,\r | |
1224 | IN ATA_NONBLOCK_TASK *Task\r | |
1225 | );\r | |
1226 | \r | |
1227 | /**\r | |
1228 | Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).\r | |
1229 | \r | |
1230 | @param[in] Instance A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data\r | |
1231 | structure.\r | |
1232 | @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.\r | |
1233 | @param[in] Read Flag used to determine the data transfer\r | |
1234 | direction. Read equals 1, means data transferred\r | |
1235 | from device to host;Read equals 0, means data\r | |
1236 | transferred from host to device.\r | |
1237 | @param[in] DataBuffer A pointer to the source buffer for the data.\r | |
1238 | @param[in] DataLength The length of the data.\r | |
1239 | @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.\r | |
1240 | @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.\r | |
1241 | @param[in] Timeout The time to complete the command, uses 100ns as a unit.\r | |
1242 | @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK\r | |
1243 | used by non-blocking mode.\r | |
1244 | \r | |
1245 | @retval EFI_SUCCESS the operation is successful.\r | |
1246 | @retval EFI_OUT_OF_RESOURCES Build PRD table failed\r | |
1247 | @retval EFI_UNSUPPORTED Unknown channel or operations command\r | |
1248 | @retval EFI_DEVICE_ERROR Ata command execute failed\r | |
1249 | \r | |
1250 | **/\r | |
1251 | EFI_STATUS\r | |
1252 | EFIAPI\r | |
1253 | AtaUdmaInOut (\r | |
1254 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance,\r | |
1255 | IN EFI_IDE_REGISTERS *IdeRegisters,\r | |
1256 | IN BOOLEAN Read,\r | |
1257 | IN VOID *DataBuffer,\r | |
1258 | IN UINT64 DataLength,\r | |
1259 | IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock,\r | |
1260 | IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock,\r | |
1261 | IN UINT64 Timeout,\r | |
1262 | IN ATA_NONBLOCK_TASK *Task\r | |
1263 | );\r | |
1264 | \r | |
1265 | /**\r | |
1266 | This function is used to send out ATA commands conforms to the PIO Data In Protocol.\r | |
1267 | \r | |
1268 | @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data\r | |
1269 | structure.\r | |
1270 | @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.\r | |
1271 | @param[in, out] Buffer A pointer to the source buffer for the data.\r | |
1272 | @param[in] ByteCount The length of the data.\r | |
1273 | @param[in] Read Flag used to determine the data transfer direction.\r | |
1274 | Read equals 1, means data transferred from device\r | |
1275 | to host;Read equals 0, means data transferred\r | |
1276 | from host to device.\r | |
1277 | @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.\r | |
1278 | @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.\r | |
1279 | @param[in] Timeout The time to complete the command, uses 100ns as a unit.\r | |
1280 | @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK\r | |
1281 | used by non-blocking mode.\r | |
1282 | \r | |
1283 | @retval EFI_SUCCESS send out the ATA command and device send required data successfully.\r | |
1284 | @retval EFI_DEVICE_ERROR command sent failed.\r | |
1285 | \r | |
1286 | **/\r | |
1287 | EFI_STATUS\r | |
1288 | EFIAPI\r | |
1289 | AtaPioDataInOut (\r | |
1290 | IN EFI_PCI_IO_PROTOCOL *PciIo,\r | |
1291 | IN EFI_IDE_REGISTERS *IdeRegisters,\r | |
1292 | IN OUT VOID *Buffer,\r | |
1293 | IN UINT64 ByteCount,\r | |
1294 | IN BOOLEAN Read,\r | |
1295 | IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock,\r | |
1296 | IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock,\r | |
1297 | IN UINT64 Timeout,\r | |
1298 | IN ATA_NONBLOCK_TASK *Task\r | |
1299 | );\r | |
1300 | \r | |
1301 | #endif\r | |
1302 | \r |