2 Header file for ATA/ATAPI PASS THRU driver.
4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 #ifndef __ATA_ATAPI_PASS_THRU_H__
15 #define __ATA_ATAPI_PASS_THRU_H__
19 #include <IndustryStandard/Pci.h>
20 #include <IndustryStandard/Atapi.h>
21 #include <IndustryStandard/Scsi.h>
23 #include <Protocol/PciIo.h>
24 #include <Protocol/IdeControllerInit.h>
25 #include <Protocol/AtaPassThru.h>
26 #include <Protocol/ScsiPassThruExt.h>
28 #include <Library/DebugLib.h>
29 #include <Library/BaseLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/UefiDriverEntryPoint.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/UefiLib.h>
34 #include <Library/PciLib.h>
35 #include <Library/PcdLib.h>
36 #include <Library/TimerLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/ReportStatusCodeLib.h>
39 #include <Library/DevicePathLib.h>
44 extern EFI_DRIVER_BINDING_PROTOCOL gAtaAtapiPassThruDriverBinding
;
45 extern EFI_COMPONENT_NAME_PROTOCOL gAtaAtapiPassThruComponentName
;
46 extern EFI_COMPONENT_NAME2_PROTOCOL gAtaAtapiPassThruComponentName2
;
48 #define ATA_ATAPI_PASS_THRU_SIGNATURE SIGNATURE_32 ('a', 'a', 'p', 't')
49 #define ATA_ATAPI_DEVICE_SIGNATURE SIGNATURE_32 ('a', 'd', 'e', 'v')
50 #define ATA_NONBLOCKING_TASK_SIGNATURE SIGNATURE_32 ('a', 't', 's', 'k')
52 typedef struct _ATA_NONBLOCK_TASK ATA_NONBLOCK_TASK
;
59 } EFI_ATA_HC_WORK_MODE
;
62 EfiIdeCdrom
, /* ATAPI CDROM */
63 EfiIdeHarddisk
, /* Hard Disk */
64 EfiPortMultiplier
, /* Port Multiplier */
66 } EFI_ATA_DEVICE_TYPE
;
69 // Ahci mode device info
76 UINT16 PortMultiplier
;
77 EFI_ATA_DEVICE_TYPE Type
;
79 EFI_IDENTIFY_DATA
*IdentifyData
;
80 } EFI_ATA_DEVICE_INFO
;
85 EFI_HANDLE ControllerHandle
;
86 EFI_PCI_IO_PROTOCOL
*PciIo
;
87 EFI_IDE_CONTROLLER_INIT_PROTOCOL
*IdeControllerInit
;
89 EFI_ATA_PASS_THRU_MODE AtaPassThruMode
;
90 EFI_ATA_PASS_THRU_PROTOCOL AtaPassThru
;
91 EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode
;
92 EFI_EXT_SCSI_PASS_THRU_PROTOCOL ExtScsiPassThru
;
94 EFI_ATA_HC_WORK_MODE Mode
;
96 EFI_IDE_REGISTERS IdeRegisters
[EfiIdeMaxChannel
];
97 EFI_AHCI_REGISTERS AhciRegisters
;
100 // The attached device list
102 LIST_ENTRY DeviceList
;
103 UINT64 EnabledPciAttributes
;
104 UINT64 OriginalPciAttributes
;
107 // For AtaPassThru protocol, using the following bytes to record the previous call in
108 // GetNextPort()/GetNextDevice().
111 UINT16 PreviousPortMultiplier
;
113 // For ExtScsiPassThru protocol, using the following bytes to record the previous call in
114 // GetNextTarget()/GetNextTargetLun().
116 UINT16 PreviousTargetId
;
122 EFI_EVENT TimerEvent
;
123 LIST_ENTRY NonBlockingTaskList
;
124 } ATA_ATAPI_PASS_THRU_INSTANCE
;
127 // Task for Non-blocking mode.
129 struct _ATA_NONBLOCK_TASK
{
134 UINT16 PortMultiplier
;
135 EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
;
139 BOOLEAN InfiniteWait
;
140 VOID
*Map
; // Pointer to map.
141 VOID
*TableMap
; // Pointer to PRD table map.
142 EFI_ATA_DMA_PRD
*MapBaseAddress
; // Pointer to range Base address for Map.
143 UINTN PageCount
; // The page numbers used by PCIO freebuffer.
147 // Timeout value which uses 100ns as a unit.
148 // It means 3 second span.
150 #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3)
151 #define ATA_SPINUP_TIMEOUT EFI_TIMER_PERIOD_SECONDS(10)
153 #define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
155 #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
157 ATA_ATAPI_PASS_THRU_INSTANCE, \
159 ATA_ATAPI_PASS_THRU_SIGNATURE \
162 #define EXT_SCSI_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
164 ATA_ATAPI_PASS_THRU_INSTANCE, \
166 ATA_ATAPI_PASS_THRU_SIGNATURE \
169 #define ATA_ATAPI_DEVICE_INFO_FROM_THIS(a) \
171 EFI_ATA_DEVICE_INFO, \
173 ATA_ATAPI_DEVICE_SIGNATURE \
176 #define ATA_NON_BLOCK_TASK_FROM_ENTRY(a) \
180 ATA_NONBLOCKING_TASK_SIGNATURE \
184 Retrieves a Unicode string that is the user readable name of the driver.
186 This function retrieves the user readable name of a driver in the form of a
187 Unicode string. If the driver specified by This has a user readable name in
188 the language specified by Language, then a pointer to the driver name is
189 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
190 by This does not support the language specified by Language,
191 then EFI_UNSUPPORTED is returned.
193 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
194 EFI_COMPONENT_NAME_PROTOCOL instance.
196 @param Language[in] A pointer to a Null-terminated ASCII string
197 array indicating the language. This is the
198 language of the driver name that the caller is
199 requesting, and it must match one of the
200 languages specified in SupportedLanguages. The
201 number of languages supported by a driver is up
202 to the driver writer. Language is specified
203 in RFC 4646 or ISO 639-2 language code format.
205 @param DriverName[out] A pointer to the Unicode string to return.
206 This Unicode string is the name of the
207 driver specified by This in the language
208 specified by Language.
210 @retval EFI_SUCCESS The Unicode string for the Driver specified by
211 This and the language specified by Language was
212 returned in DriverName.
214 @retval EFI_INVALID_PARAMETER Language is NULL.
216 @retval EFI_INVALID_PARAMETER DriverName is NULL.
218 @retval EFI_UNSUPPORTED The driver specified by This does not support
219 the language specified by Language.
224 AtaAtapiPassThruComponentNameGetDriverName (
225 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
227 OUT CHAR16
**DriverName
231 Retrieves a Unicode string that is the user readable name of the controller
232 that is being managed by a driver.
234 This function retrieves the user readable name of the controller specified by
235 ControllerHandle and ChildHandle in the form of a Unicode string. If the
236 driver specified by This has a user readable name in the language specified by
237 Language, then a pointer to the controller name is returned in ControllerName,
238 and EFI_SUCCESS is returned. If the driver specified by This is not currently
239 managing the controller specified by ControllerHandle and ChildHandle,
240 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
241 support the language specified by Language, then EFI_UNSUPPORTED is returned.
243 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
244 EFI_COMPONENT_NAME_PROTOCOL instance.
246 @param ControllerHandle[in] The handle of a controller that the driver
247 specified by This is managing. This handle
248 specifies the controller whose name is to be
251 @param ChildHandle[in] The handle of the child controller to retrieve
252 the name of. This is an optional parameter that
253 may be NULL. It will be NULL for device
254 drivers. It will also be NULL for a bus drivers
255 that wish to retrieve the name of the bus
256 controller. It will not be NULL for a bus
257 driver that wishes to retrieve the name of a
260 @param Language[in] A pointer to a Null-terminated ASCII string
261 array indicating the language. This is the
262 language of the driver name that the caller is
263 requesting, and it must match one of the
264 languages specified in SupportedLanguages. The
265 number of languages supported by a driver is up
266 to the driver writer. Language is specified in
267 RFC 4646 or ISO 639-2 language code format.
269 @param ControllerName[out] A pointer to the Unicode string to return.
270 This Unicode string is the name of the
271 controller specified by ControllerHandle and
272 ChildHandle in the language specified by
273 Language from the point of view of the driver
276 @retval EFI_SUCCESS The Unicode string for the user readable name in
277 the language specified by Language for the
278 driver specified by This was returned in
281 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
283 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
286 @retval EFI_INVALID_PARAMETER Language is NULL.
288 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
290 @retval EFI_UNSUPPORTED The driver specified by This is not currently
291 managing the controller specified by
292 ControllerHandle and ChildHandle.
294 @retval EFI_UNSUPPORTED The driver specified by This does not support
295 the language specified by Language.
300 AtaAtapiPassThruComponentNameGetControllerName (
301 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
302 IN EFI_HANDLE ControllerHandle
,
303 IN EFI_HANDLE ChildHandle OPTIONAL
,
305 OUT CHAR16
**ControllerName
309 Tests to see if this driver supports a given controller. If a child device is provided,
310 it further tests to see if this driver supports creating a handle for the specified child device.
312 This function checks to see if the driver specified by This supports the device specified by
313 ControllerHandle. Drivers will typically use the device path attached to
314 ControllerHandle and/or the services from the bus I/O abstraction attached to
315 ControllerHandle to determine if the driver supports ControllerHandle. This function
316 may be called many times during platform initialization. In order to reduce boot times, the tests
317 performed by this function must be very small, and take as little time as possible to execute. This
318 function must not change the state of any hardware devices, and this function must be aware that the
319 device specified by ControllerHandle may already be managed by the same driver or a
320 different driver. This function must match its calls to AllocatePages() with FreePages(),
321 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
322 Because ControllerHandle may have been previously started by the same driver, if a protocol is
323 already in the opened state, then it must not be closed with CloseProtocol(). This is required
324 to guarantee the state of ControllerHandle is not modified by this function.
326 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
327 @param[in] ControllerHandle The handle of the controller to test. This handle
328 must support a protocol interface that supplies
329 an I/O abstraction to the driver.
330 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
331 parameter is ignored by device drivers, and is optional for bus
332 drivers. For bus drivers, if this parameter is not NULL, then
333 the bus driver must determine if the bus controller specified
334 by ControllerHandle and the child controller specified
335 by RemainingDevicePath are both supported by this
338 @retval EFI_SUCCESS The device specified by ControllerHandle and
339 RemainingDevicePath is supported by the driver specified by This.
340 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
341 RemainingDevicePath is already being managed by the driver
343 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
344 RemainingDevicePath is already being managed by a different
345 driver or an application that requires exclusive access.
346 Currently not implemented.
347 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
348 RemainingDevicePath is not supported by the driver specified by This.
352 AtaAtapiPassThruSupported (
353 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
354 IN EFI_HANDLE Controller
,
355 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
359 Starts a device controller or a bus controller.
361 The Start() function is designed to be invoked from the EFI boot service ConnectController().
362 As a result, much of the error checking on the parameters to Start() has been moved into this
363 common boot service. It is legal to call Start() from other locations,
364 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
365 1. ControllerHandle must be a valid EFI_HANDLE.
366 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
367 EFI_DEVICE_PATH_PROTOCOL.
368 3. Prior to calling Start(), the Supported() function for the driver specified by This must
369 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
371 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
372 @param[in] ControllerHandle The handle of the controller to start. This handle
373 must support a protocol interface that supplies
374 an I/O abstraction to the driver.
375 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
376 parameter is ignored by device drivers, and is optional for bus
377 drivers. For a bus driver, if this parameter is NULL, then handles
378 for all the children of Controller are created by this driver.
379 If this parameter is not NULL and the first Device Path Node is
380 not the End of Device Path Node, then only the handle for the
381 child device specified by the first Device Path Node of
382 RemainingDevicePath is created by this driver.
383 If the first Device Path Node of RemainingDevicePath is
384 the End of Device Path Node, no child handle is created by this
387 @retval EFI_SUCCESS The device was started.
388 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
389 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
390 @retval Others The driver failded to start the device.
395 AtaAtapiPassThruStart (
396 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
397 IN EFI_HANDLE Controller
,
398 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
402 Stops a device controller or a bus controller.
404 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
405 As a result, much of the error checking on the parameters to Stop() has been moved
406 into this common boot service. It is legal to call Stop() from other locations,
407 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
408 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
409 same driver's Start() function.
410 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
411 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
412 Start() function, and the Start() function must have called OpenProtocol() on
413 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
415 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
416 @param[in] ControllerHandle A handle to the device being stopped. The handle must
417 support a bus specific I/O protocol for the driver
418 to use to stop the device.
419 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
420 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
421 if NumberOfChildren is 0.
423 @retval EFI_SUCCESS The device was stopped.
424 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
429 AtaAtapiPassThruStop (
430 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
431 IN EFI_HANDLE Controller
,
432 IN UINTN NumberOfChildren
,
433 IN EFI_HANDLE
*ChildHandleBuffer
437 Traverse the attached ATA devices list to find out the device to access.
439 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
440 @param[in] Port The port number of the ATA device to send the command.
441 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
442 If there is no port multiplier, then specify 0xFFFF.
443 @param[in] DeviceType The device type of the ATA device.
445 @retval The pointer to the data structure of the device info to access.
450 SearchDeviceInfoList (
451 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
453 IN UINT16 PortMultiplier
,
454 IN EFI_ATA_DEVICE_TYPE DeviceType
458 Allocate device info data structure to contain device info.
459 And insert the data structure to the tail of device list for tracing.
461 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
462 @param[in] Port The port number of the ATA device to send the command.
463 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
464 If there is no port multiplier, then specify 0xFFFF.
465 @param[in] DeviceType The device type of the ATA device.
466 @param[in] IdentifyData The data buffer to store the output of the IDENTIFY cmd.
468 @retval EFI_SUCCESS Successfully insert the ata device to the tail of device list.
469 @retval EFI_OUT_OF_RESOURCES Can not allocate enough resource for use.
474 CreateNewDeviceInfo (
475 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
477 IN UINT16 PortMultiplier
,
478 IN EFI_ATA_DEVICE_TYPE DeviceType
,
479 IN EFI_IDENTIFY_DATA
*IdentifyData
483 Destroy all attached ATA devices info.
485 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
490 DestroyDeviceInfoList (
491 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
495 Destroy all pending non blocking tasks.
497 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
498 @param[in] IsSigEvent Indicate whether signal the task event when remove the
504 DestroyAsynTaskList (
505 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
506 IN BOOLEAN IsSigEvent
510 Enumerate all attached ATA devices at IDE mode or AHCI mode separately.
512 The function is designed to enumerate all attached ATA devices.
514 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
516 @retval EFI_SUCCESS Successfully enumerate attached ATA devices.
517 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
522 EnumerateAttachedDevice (
523 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
527 Call back funtion when the timer event is signaled.
529 @param[in] Event The Event this notify function registered to.
530 @param[in] Context Pointer to the context data registered to the
536 AsyncNonBlockingTransferRoutine (
542 Sends an ATA command to an ATA device that is attached to the ATA controller. This function
543 supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,
544 and the non-blocking I/O functionality is optional.
546 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
547 @param[in] Port The port number of the ATA device to send the command.
548 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
549 If there is no port multiplier, then specify 0xFFFF.
550 @param[in, out] Packet A pointer to the ATA command to send to the ATA device specified by Port
551 and PortMultiplierPort.
552 @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking
553 I/O is performed. If Event is NULL, then blocking I/O is performed. If
554 Event is not NULL and non blocking I/O is supported, then non-blocking
555 I/O is performed, and Event will be signaled when the ATA command completes.
557 @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands,
558 InTransferLength bytes were transferred from InDataBuffer. For write and
559 bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.
560 @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred
561 is returned in InTransferLength. For write and bi-directional commands,
562 OutTransferLength bytes were transferred by OutDataBuffer.
563 @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands
564 already queued. The caller may retry again later.
565 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.
566 @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA
567 command was not sent, so no additional status information is available.
572 AtaPassThruPassThru (
573 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
575 IN UINT16 PortMultiplierPort
,
576 IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
,
577 IN EFI_EVENT Event OPTIONAL
581 Used to retrieve the list of legal port numbers for ATA devices on an ATA controller.
582 These can either be the list of ports where ATA devices are actually present or the
583 list of legal port numbers for the ATA controller. Regardless, the caller of this
584 function must probe the port number returned to see if an ATA device is actually
585 present at that location on the ATA controller.
587 The GetNextPort() function retrieves the port number on an ATA controller. If on input
588 Port is 0xFFFF, then the port number of the first port on the ATA controller is returned
589 in Port and EFI_SUCCESS is returned.
591 If Port is a port number that was returned on a previous call to GetNextPort(), then the
592 port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS
593 is returned. If Port is not 0xFFFF and Port was not returned on a previous call to
594 GetNextPort(), then EFI_INVALID_PARAMETER is returned.
596 If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is
599 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
600 @param[in, out] Port On input, a pointer to the port number on the ATA controller.
601 On output, a pointer to the next port number on the ATA
602 controller. An input value of 0xFFFF retrieves the first port
603 number on the ATA controller.
605 @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port.
606 @retval EFI_NOT_FOUND There are no more ports on this ATA controller.
607 @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call
613 AtaPassThruGetNextPort (
614 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
619 Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA
620 controller. These can either be the list of port multiplier ports where ATA devices are actually
621 present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this
622 function must probe the port number and port multiplier port number returned to see if an ATA
623 device is actually present.
625 The GetNextDevice() function retrieves the port multiplier port number of an ATA device
626 present on a port of an ATA controller.
628 If PortMultiplierPort points to a port multiplier port number value that was returned on a
629 previous call to GetNextDevice(), then the port multiplier port number of the next ATA device
630 on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is
633 If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first
634 ATA device on port of the ATA controller is returned in PortMultiplierPort and
635 EFI_SUCCESS is returned.
637 If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort
638 was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER
641 If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of
642 the ATA controller, then EFI_NOT_FOUND is returned.
644 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
645 @param[in] Port The port number present on the ATA controller.
646 @param[in, out] PortMultiplierPort On input, a pointer to the port multiplier port number of an
647 ATA device present on the ATA controller.
648 If on input a PortMultiplierPort of 0xFFFF is specified,
649 then the port multiplier port number of the first ATA device
650 is returned. On output, a pointer to the port multiplier port
651 number of the next ATA device present on an ATA controller.
653 @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port
654 of the ATA controller was returned in PortMultiplierPort.
655 @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller.
656 @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not
657 returned on a previous call to GetNextDevice().
662 AtaPassThruGetNextDevice (
663 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
665 IN OUT UINT16
*PortMultiplierPort
669 Used to allocate and build a device path node for an ATA device on an ATA controller.
671 The BuildDevicePath() function allocates and builds a single device node for the ATA
672 device specified by Port and PortMultiplierPort. If the ATA device specified by Port and
673 PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.
674 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough
675 resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
677 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
678 DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,
679 and EFI_SUCCESS is returned.
681 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
682 @param[in] Port Port specifies the port number of the ATA device for which a
683 device path node is to be allocated and built.
684 @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a
685 device path node is to be allocated and built. If there is no
686 port multiplier, then specify 0xFFFF.
687 @param[in, out] DevicePath A pointer to a single device path node that describes the ATA
688 device specified by Port and PortMultiplierPort. This function
689 is responsible for allocating the buffer DevicePath with the
690 boot service AllocatePool(). It is the caller's responsibility
691 to free DevicePath when the caller is finished with DevicePath.
692 @retval EFI_SUCCESS The device path node that describes the ATA device specified by
693 Port and PortMultiplierPort was allocated and returned in DevicePath.
694 @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not
695 exist on the ATA controller.
696 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
697 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
702 AtaPassThruBuildDevicePath (
703 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
705 IN UINT16 PortMultiplierPort
,
706 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
710 Used to translate a device path node to a port number and port multiplier port number.
712 The GetDevice() function determines the port and port multiplier port number associated with
713 the ATA device described by DevicePath. If DevicePath is a device path node type that the
714 ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents
715 DevicePath into a port number and port multiplier port number.
717 If this translation is successful, then that port number and port multiplier port number are returned
718 in Port and PortMultiplierPort, and EFI_SUCCESS is returned.
720 If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.
722 If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then
723 EFI_UNSUPPORTED is returned.
725 If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not
726 a valid translation from DevicePath to a port number and port multiplier port number, then
727 EFI_NOT_FOUND is returned.
729 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
730 @param[in] DevicePath A pointer to the device path node that describes an ATA device on the
732 @param[out] Port On return, points to the port number of an ATA device on the ATA controller.
733 @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device
734 on the ATA controller.
736 @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier
737 port number, and they were returned in Port and PortMultiplierPort.
738 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
739 @retval EFI_INVALID_PARAMETER Port is NULL.
740 @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL.
741 @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath.
742 @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier
743 port number does not exist.
748 AtaPassThruGetDevice (
749 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
750 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
752 OUT UINT16
*PortMultiplierPort
756 Resets a specific port on the ATA controller. This operation also resets all the ATA devices
757 connected to the port.
759 The ResetChannel() function resets an a specific port on an ATA controller. This operation
760 resets all the ATA devices connected to that port. If this ATA controller does not support
761 a reset port operation, then EFI_UNSUPPORTED is returned.
763 If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is
766 If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.
768 If the port reset operation is completed, then EFI_SUCCESS is returned.
770 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
771 @param[in] Port The port number on the ATA controller.
773 @retval EFI_SUCCESS The ATA controller port was reset.
774 @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation.
775 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port.
776 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port.
781 AtaPassThruResetPort (
782 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
787 Resets an ATA device that is connected to an ATA controller.
789 The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.
790 If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is
793 If Port or PortMultiplierPort are not in a valid range for this ATA controller, then
794 EFI_INVALID_PARAMETER is returned.
796 If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR
799 If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is
802 If the device reset operation is completed, then EFI_SUCCESS is returned.
804 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
805 @param[in] Port Port represents the port number of the ATA device to be reset.
806 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset.
807 If there is no port multiplier, then specify 0xFFFF.
808 @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset.
809 @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation.
810 @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid.
811 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device
812 specified by Port and PortMultiplierPort.
813 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device
814 specified by Port and PortMultiplierPort.
819 AtaPassThruResetDevice (
820 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
822 IN UINT16 PortMultiplierPort
826 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function
827 supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the
828 nonblocking I/O functionality is optional.
830 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
831 @param Target The Target is an array of size TARGET_MAX_BYTES and it represents
832 the id of the SCSI device to send the SCSI Request Packet. Each
833 transport driver may choose to utilize a subset of this size to suit the needs
834 of transport target representation. For example, a Fibre Channel driver
835 may use only 8 bytes (WWN) to represent an FC target.
836 @param Lun The LUN of the SCSI device to send the SCSI Request Packet.
837 @param Packet A pointer to the SCSI Request Packet to send to the SCSI device
838 specified by Target and Lun.
839 @param Event If nonblocking I/O is not supported then Event is ignored, and blocking
840 I/O is performed. If Event is NULL, then blocking I/O is performed. If
841 Event is not NULL and non blocking I/O is supported, then
842 nonblocking I/O is performed, and Event will be signaled when the
843 SCSI Request Packet completes.
845 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional
846 commands, InTransferLength bytes were transferred from
847 InDataBuffer. For write and bi-directional commands,
848 OutTransferLength bytes were transferred by
850 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that
851 could be transferred is returned in InTransferLength. For write
852 and bi-directional commands, OutTransferLength bytes were
853 transferred by OutDataBuffer.
854 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
855 SCSI Request Packets already queued. The caller may retry again later.
856 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request
858 @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.
859 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported
860 by the host adapter. This includes the case of Bi-directional SCSI
861 commands not supported by the implementation. The SCSI Request
862 Packet was not sent, so no additional status information is available.
863 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
868 ExtScsiPassThruPassThru (
869 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
872 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
873 IN EFI_EVENT Event OPTIONAL
877 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These
878 can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal
879 Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the
880 Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI
883 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
884 @param Target On input, a pointer to the Target ID (an array of size
885 TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
886 On output, a pointer to the Target ID (an array of
887 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
888 channel. An input value of 0xF(all bytes in the array are 0xF) in the
889 Target array retrieves the Target ID of the first SCSI device present on a
891 @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI
892 channel. On output, a pointer to the LUN of the next SCSI device present
895 @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI
896 channel was returned in Target and Lun.
897 @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were
898 not returned on a previous call to GetNextTargetLun().
899 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
904 ExtScsiPassThruGetNextTargetLun (
905 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
906 IN OUT UINT8
**Target
,
911 Used to allocate and build a device path node for a SCSI device on a SCSI channel.
913 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
914 @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the
915 Target ID of the SCSI device for which a device path node is to be
916 allocated and built. Transport drivers may chose to utilize a subset of
917 this size to suit the representation of targets. For example, a Fibre
918 Channel driver may use only 8 bytes (WWN) in the array to represent a
920 @param Lun The LUN of the SCSI device for which a device path node is to be
922 @param DevicePath A pointer to a single device path node that describes the SCSI device
923 specified by Target and Lun. This function is responsible for
924 allocating the buffer DevicePath with the boot service
925 AllocatePool(). It is the caller's responsibility to free
926 DevicePath when the caller is finished with DevicePath.
928 @retval EFI_SUCCESS The device path node that describes the SCSI device specified by
929 Target and Lun was allocated and returned in
931 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
932 @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist
934 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
939 ExtScsiPassThruBuildDevicePath (
940 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
943 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
947 Used to translate a device path node to a Target ID and LUN.
949 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
950 @param DevicePath A pointer to a single device path node that describes the SCSI device
952 @param Target A pointer to the Target Array which represents the ID of a SCSI device
954 @param Lun A pointer to the LUN of a SCSI device on the SCSI channel.
956 @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and
957 LUN, and they were returned in Target and Lun.
958 @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.
959 @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN
961 @retval EFI_UNSUPPORTED This driver does not support the device path node type in
967 ExtScsiPassThruGetTargetLun (
968 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
969 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
975 Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
977 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
979 @retval EFI_SUCCESS The SCSI channel was reset.
980 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.
981 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.
982 @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.
987 ExtScsiPassThruResetChannel (
988 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
992 Resets a SCSI logical unit that is connected to a SCSI channel.
994 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
995 @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the
996 target port ID of the SCSI device containing the SCSI logical unit to
997 reset. Transport drivers may chose to utilize a subset of this array to suit
998 the representation of their targets.
999 @param Lun The LUN of the SCSI device to reset.
1001 @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.
1002 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
1003 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device
1004 specified by Target and Lun.
1005 @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.
1006 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device
1007 specified by Target and Lun.
1012 ExtScsiPassThruResetTargetLun (
1013 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1019 Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either
1020 be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs
1021 for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to
1022 see if a SCSI device is actually present at that location on the SCSI channel.
1024 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
1025 @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
1026 On output, a pointer to the Target ID (an array of
1027 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
1028 channel. An input value of 0xF(all bytes in the array are 0xF) in the
1029 Target array retrieves the Target ID of the first SCSI device present on a
1032 @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
1033 channel was returned in Target.
1034 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
1035 @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not
1036 returned on a previous call to GetNextTarget().
1037 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
1042 ExtScsiPassThruGetNextTarget (
1043 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1044 IN OUT UINT8
**Target
1048 Initialize ATA host controller at IDE mode.
1050 The function is designed to initialize ATA host controller.
1052 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1057 IdeModeInitialization (
1058 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1062 Initialize ATA host controller at AHCI mode.
1064 The function is designed to initialize ATA host controller.
1066 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1071 AhciModeInitialization (
1072 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1076 Start a non data transfer on specific port.
1078 @param[in] PciIo The PCI IO protocol instance.
1079 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1080 @param[in] Port The number of port.
1081 @param[in] PortMultiplier The timeout value of stop.
1082 @param[in] AtapiCommand The atapi command will be used for the
1084 @param[in] AtapiCommandLength The length of the atapi command.
1085 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1086 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1087 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1088 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1089 used by non-blocking mode.
1091 @retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
1092 @retval EFI_TIMEOUT The operation is time out.
1093 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1094 @retval EFI_SUCCESS The non data transfer executes successfully.
1099 AhciNonDataTransfer (
1100 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1101 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1103 IN UINT8 PortMultiplier
,
1104 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1105 IN UINT8 AtapiCommandLength
,
1106 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1107 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1109 IN ATA_NONBLOCK_TASK
*Task
1113 Start a DMA data transfer on specific port
1115 @param[in] Instance The ATA_ATAPI_PASS_THRU_INSTANCE protocol instance.
1116 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1117 @param[in] Port The number of port.
1118 @param[in] PortMultiplier The timeout value of stop.
1119 @param[in] AtapiCommand The atapi command will be used for the
1121 @param[in] AtapiCommandLength The length of the atapi command.
1122 @param[in] Read The transfer direction.
1123 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1124 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1125 @param[in, out] MemoryAddr The pointer to the data buffer.
1126 @param[in] DataCount The data count to be transferred.
1127 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1128 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1129 used by non-blocking mode.
1131 @retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
1132 @retval EFI_TIMEOUT The operation is time out.
1133 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1134 @retval EFI_SUCCESS The DMA data transfer executes successfully.
1140 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1141 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1143 IN UINT8 PortMultiplier
,
1144 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1145 IN UINT8 AtapiCommandLength
,
1147 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1148 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1149 IN OUT VOID
*MemoryAddr
,
1150 IN UINT32 DataCount
,
1152 IN ATA_NONBLOCK_TASK
*Task
1156 Start a PIO data transfer on specific port.
1158 @param[in] PciIo The PCI IO protocol instance.
1159 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1160 @param[in] Port The number of port.
1161 @param[in] PortMultiplier The timeout value of stop.
1162 @param[in] AtapiCommand The atapi command will be used for the
1164 @param[in] AtapiCommandLength The length of the atapi command.
1165 @param[in] Read The transfer direction.
1166 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1167 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1168 @param[in, out] MemoryAddr The pointer to the data buffer.
1169 @param[in] DataCount The data count to be transferred.
1170 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1171 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1172 used by non-blocking mode.
1174 @retval EFI_DEVICE_ERROR The PIO data transfer abort with error occurs.
1175 @retval EFI_TIMEOUT The operation is time out.
1176 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1177 @retval EFI_SUCCESS The PIO data transfer executes successfully.
1183 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1184 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1186 IN UINT8 PortMultiplier
,
1187 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1188 IN UINT8 AtapiCommandLength
,
1190 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1191 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1192 IN OUT VOID
*MemoryAddr
,
1193 IN UINT32 DataCount
,
1195 IN ATA_NONBLOCK_TASK
*Task
1199 Send ATA command into device with NON_DATA protocol
1201 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE
1203 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1204 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data
1206 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1207 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1208 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1209 used by non-blocking mode.
1211 @retval EFI_SUCCESS Reading succeed
1212 @retval EFI_ABORTED Command failed
1213 @retval EFI_DEVICE_ERROR Device status error.
1218 AtaNonDataCommandIn (
1219 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1220 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1221 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1222 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1224 IN ATA_NONBLOCK_TASK
*Task
1228 Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).
1230 @param[in] Instance A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1232 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1233 @param[in] Read Flag used to determine the data transfer
1234 direction. Read equals 1, means data transferred
1235 from device to host;Read equals 0, means data
1236 transferred from host to device.
1237 @param[in] DataBuffer A pointer to the source buffer for the data.
1238 @param[in] DataLength The length of the data.
1239 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1240 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1241 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1242 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1243 used by non-blocking mode.
1245 @retval EFI_SUCCESS the operation is successful.
1246 @retval EFI_OUT_OF_RESOURCES Build PRD table failed
1247 @retval EFI_UNSUPPORTED Unknown channel or operations command
1248 @retval EFI_DEVICE_ERROR Ata command execute failed
1254 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1255 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1257 IN VOID
*DataBuffer
,
1258 IN UINT64 DataLength
,
1259 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1260 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1262 IN ATA_NONBLOCK_TASK
*Task
1266 This function is used to send out ATA commands conforms to the PIO Data In Protocol.
1268 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1270 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1271 @param[in, out] Buffer A pointer to the source buffer for the data.
1272 @param[in] ByteCount The length of the data.
1273 @param[in] Read Flag used to determine the data transfer direction.
1274 Read equals 1, means data transferred from device
1275 to host;Read equals 0, means data transferred
1276 from host to device.
1277 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1278 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1279 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1280 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1281 used by non-blocking mode.
1283 @retval EFI_SUCCESS send out the ATA command and device send required data successfully.
1284 @retval EFI_DEVICE_ERROR command sent failed.
1290 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1291 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1292 IN OUT VOID
*Buffer
,
1293 IN UINT64 ByteCount
,
1295 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1296 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1298 IN ATA_NONBLOCK_TASK
*Task