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>
27 #include <Protocol/AtaAtapiPolicy.h>
29 #include <Library/DebugLib.h>
30 #include <Library/BaseLib.h>
31 #include <Library/BaseMemoryLib.h>
32 #include <Library/UefiDriverEntryPoint.h>
33 #include <Library/UefiBootServicesTableLib.h>
34 #include <Library/UefiLib.h>
35 #include <Library/PciLib.h>
36 #include <Library/PcdLib.h>
37 #include <Library/TimerLib.h>
38 #include <Library/MemoryAllocationLib.h>
39 #include <Library/ReportStatusCodeLib.h>
40 #include <Library/DevicePathLib.h>
45 extern EFI_DRIVER_BINDING_PROTOCOL gAtaAtapiPassThruDriverBinding
;
46 extern EFI_COMPONENT_NAME_PROTOCOL gAtaAtapiPassThruComponentName
;
47 extern EFI_COMPONENT_NAME2_PROTOCOL gAtaAtapiPassThruComponentName2
;
49 extern EDKII_ATA_ATAPI_POLICY_PROTOCOL
*mAtaAtapiPolicy
;
51 #define ATA_ATAPI_PASS_THRU_SIGNATURE SIGNATURE_32 ('a', 'a', 'p', 't')
52 #define ATA_ATAPI_DEVICE_SIGNATURE SIGNATURE_32 ('a', 'd', 'e', 'v')
53 #define ATA_NONBLOCKING_TASK_SIGNATURE SIGNATURE_32 ('a', 't', 's', 'k')
55 typedef struct _ATA_NONBLOCK_TASK ATA_NONBLOCK_TASK
;
62 } EFI_ATA_HC_WORK_MODE
;
65 EfiIdeCdrom
, /* ATAPI CDROM */
66 EfiIdeHarddisk
, /* Hard Disk */
67 EfiPortMultiplier
, /* Port Multiplier */
69 } EFI_ATA_DEVICE_TYPE
;
72 // Ahci mode device info
79 UINT16 PortMultiplier
;
80 EFI_ATA_DEVICE_TYPE Type
;
82 EFI_IDENTIFY_DATA
*IdentifyData
;
83 } EFI_ATA_DEVICE_INFO
;
88 EFI_HANDLE ControllerHandle
;
89 EFI_PCI_IO_PROTOCOL
*PciIo
;
90 EFI_IDE_CONTROLLER_INIT_PROTOCOL
*IdeControllerInit
;
92 EFI_ATA_PASS_THRU_MODE AtaPassThruMode
;
93 EFI_ATA_PASS_THRU_PROTOCOL AtaPassThru
;
94 EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode
;
95 EFI_EXT_SCSI_PASS_THRU_PROTOCOL ExtScsiPassThru
;
97 EFI_ATA_HC_WORK_MODE Mode
;
99 EFI_IDE_REGISTERS IdeRegisters
[EfiIdeMaxChannel
];
100 EFI_AHCI_REGISTERS AhciRegisters
;
103 // The attached device list
105 LIST_ENTRY DeviceList
;
106 UINT64 EnabledPciAttributes
;
107 UINT64 OriginalPciAttributes
;
110 // For AtaPassThru protocol, using the following bytes to record the previous call in
111 // GetNextPort()/GetNextDevice().
114 UINT16 PreviousPortMultiplier
;
116 // For ExtScsiPassThru protocol, using the following bytes to record the previous call in
117 // GetNextTarget()/GetNextTargetLun().
119 UINT16 PreviousTargetId
;
125 EFI_EVENT TimerEvent
;
126 LIST_ENTRY NonBlockingTaskList
;
127 } ATA_ATAPI_PASS_THRU_INSTANCE
;
130 // Task for Non-blocking mode.
132 struct _ATA_NONBLOCK_TASK
{
137 UINT16 PortMultiplier
;
138 EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
;
142 BOOLEAN InfiniteWait
;
143 VOID
*Map
; // Pointer to map.
144 VOID
*TableMap
; // Pointer to PRD table map.
145 EFI_ATA_DMA_PRD
*MapBaseAddress
; // Pointer to range Base address for Map.
146 UINTN PageCount
; // The page numbers used by PCIO freebuffer.
150 // Timeout value which uses 100ns as a unit.
151 // It means 3 second span.
153 #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3)
154 #define ATA_SPINUP_TIMEOUT EFI_TIMER_PERIOD_SECONDS(10)
156 #define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
158 #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
160 ATA_ATAPI_PASS_THRU_INSTANCE, \
162 ATA_ATAPI_PASS_THRU_SIGNATURE \
165 #define EXT_SCSI_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
167 ATA_ATAPI_PASS_THRU_INSTANCE, \
169 ATA_ATAPI_PASS_THRU_SIGNATURE \
172 #define ATA_ATAPI_DEVICE_INFO_FROM_THIS(a) \
174 EFI_ATA_DEVICE_INFO, \
176 ATA_ATAPI_DEVICE_SIGNATURE \
179 #define ATA_NON_BLOCK_TASK_FROM_ENTRY(a) \
183 ATA_NONBLOCKING_TASK_SIGNATURE \
187 Retrieves a Unicode string that is the user readable name of the driver.
189 This function retrieves the user readable name of a driver in the form of a
190 Unicode string. If the driver specified by This has a user readable name in
191 the language specified by Language, then a pointer to the driver name is
192 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
193 by This does not support the language specified by Language,
194 then EFI_UNSUPPORTED is returned.
196 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
197 EFI_COMPONENT_NAME_PROTOCOL instance.
199 @param Language[in] A pointer to a Null-terminated ASCII string
200 array indicating the language. This is the
201 language of the driver name that the caller is
202 requesting, and it must match one of the
203 languages specified in SupportedLanguages. The
204 number of languages supported by a driver is up
205 to the driver writer. Language is specified
206 in RFC 4646 or ISO 639-2 language code format.
208 @param DriverName[out] A pointer to the Unicode string to return.
209 This Unicode string is the name of the
210 driver specified by This in the language
211 specified by Language.
213 @retval EFI_SUCCESS The Unicode string for the Driver specified by
214 This and the language specified by Language was
215 returned in DriverName.
217 @retval EFI_INVALID_PARAMETER Language is NULL.
219 @retval EFI_INVALID_PARAMETER DriverName is NULL.
221 @retval EFI_UNSUPPORTED The driver specified by This does not support
222 the language specified by Language.
227 AtaAtapiPassThruComponentNameGetDriverName (
228 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
230 OUT CHAR16
**DriverName
234 Retrieves a Unicode string that is the user readable name of the controller
235 that is being managed by a driver.
237 This function retrieves the user readable name of the controller specified by
238 ControllerHandle and ChildHandle in the form of a Unicode string. If the
239 driver specified by This has a user readable name in the language specified by
240 Language, then a pointer to the controller name is returned in ControllerName,
241 and EFI_SUCCESS is returned. If the driver specified by This is not currently
242 managing the controller specified by ControllerHandle and ChildHandle,
243 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
244 support the language specified by Language, then EFI_UNSUPPORTED is returned.
246 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
247 EFI_COMPONENT_NAME_PROTOCOL instance.
249 @param ControllerHandle[in] The handle of a controller that the driver
250 specified by This is managing. This handle
251 specifies the controller whose name is to be
254 @param ChildHandle[in] The handle of the child controller to retrieve
255 the name of. This is an optional parameter that
256 may be NULL. It will be NULL for device
257 drivers. It will also be NULL for a bus drivers
258 that wish to retrieve the name of the bus
259 controller. It will not be NULL for a bus
260 driver that wishes to retrieve the name of a
263 @param Language[in] A pointer to a Null-terminated ASCII string
264 array indicating the language. This is the
265 language of the driver name that the caller is
266 requesting, and it must match one of the
267 languages specified in SupportedLanguages. The
268 number of languages supported by a driver is up
269 to the driver writer. Language is specified in
270 RFC 4646 or ISO 639-2 language code format.
272 @param ControllerName[out] A pointer to the Unicode string to return.
273 This Unicode string is the name of the
274 controller specified by ControllerHandle and
275 ChildHandle in the language specified by
276 Language from the point of view of the driver
279 @retval EFI_SUCCESS The Unicode string for the user readable name in
280 the language specified by Language for the
281 driver specified by This was returned in
284 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
286 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
289 @retval EFI_INVALID_PARAMETER Language is NULL.
291 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
293 @retval EFI_UNSUPPORTED The driver specified by This is not currently
294 managing the controller specified by
295 ControllerHandle and ChildHandle.
297 @retval EFI_UNSUPPORTED The driver specified by This does not support
298 the language specified by Language.
303 AtaAtapiPassThruComponentNameGetControllerName (
304 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
305 IN EFI_HANDLE ControllerHandle
,
306 IN EFI_HANDLE ChildHandle OPTIONAL
,
308 OUT CHAR16
**ControllerName
312 Tests to see if this driver supports a given controller. If a child device is provided,
313 it further tests to see if this driver supports creating a handle for the specified child device.
315 This function checks to see if the driver specified by This supports the device specified by
316 ControllerHandle. Drivers will typically use the device path attached to
317 ControllerHandle and/or the services from the bus I/O abstraction attached to
318 ControllerHandle to determine if the driver supports ControllerHandle. This function
319 may be called many times during platform initialization. In order to reduce boot times, the tests
320 performed by this function must be very small, and take as little time as possible to execute. This
321 function must not change the state of any hardware devices, and this function must be aware that the
322 device specified by ControllerHandle may already be managed by the same driver or a
323 different driver. This function must match its calls to AllocatePages() with FreePages(),
324 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
325 Because ControllerHandle may have been previously started by the same driver, if a protocol is
326 already in the opened state, then it must not be closed with CloseProtocol(). This is required
327 to guarantee the state of ControllerHandle is not modified by this function.
329 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
330 @param[in] ControllerHandle The handle of the controller to test. This handle
331 must support a protocol interface that supplies
332 an I/O abstraction to the driver.
333 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
334 parameter is ignored by device drivers, and is optional for bus
335 drivers. For bus drivers, if this parameter is not NULL, then
336 the bus driver must determine if the bus controller specified
337 by ControllerHandle and the child controller specified
338 by RemainingDevicePath are both supported by this
341 @retval EFI_SUCCESS The device specified by ControllerHandle and
342 RemainingDevicePath is supported by the driver specified by This.
343 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
344 RemainingDevicePath is already being managed by the driver
346 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
347 RemainingDevicePath is already being managed by a different
348 driver or an application that requires exclusive access.
349 Currently not implemented.
350 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
351 RemainingDevicePath is not supported by the driver specified by This.
355 AtaAtapiPassThruSupported (
356 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
357 IN EFI_HANDLE Controller
,
358 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
362 Starts a device controller or a bus controller.
364 The Start() function is designed to be invoked from the EFI boot service ConnectController().
365 As a result, much of the error checking on the parameters to Start() has been moved into this
366 common boot service. It is legal to call Start() from other locations,
367 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
368 1. ControllerHandle must be a valid EFI_HANDLE.
369 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
370 EFI_DEVICE_PATH_PROTOCOL.
371 3. Prior to calling Start(), the Supported() function for the driver specified by This must
372 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
374 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
375 @param[in] ControllerHandle The handle of the controller to start. This handle
376 must support a protocol interface that supplies
377 an I/O abstraction to the driver.
378 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
379 parameter is ignored by device drivers, and is optional for bus
380 drivers. For a bus driver, if this parameter is NULL, then handles
381 for all the children of Controller are created by this driver.
382 If this parameter is not NULL and the first Device Path Node is
383 not the End of Device Path Node, then only the handle for the
384 child device specified by the first Device Path Node of
385 RemainingDevicePath is created by this driver.
386 If the first Device Path Node of RemainingDevicePath is
387 the End of Device Path Node, no child handle is created by this
390 @retval EFI_SUCCESS The device was started.
391 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
392 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
393 @retval Others The driver failded to start the device.
398 AtaAtapiPassThruStart (
399 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
400 IN EFI_HANDLE Controller
,
401 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
405 Stops a device controller or a bus controller.
407 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
408 As a result, much of the error checking on the parameters to Stop() has been moved
409 into this common boot service. It is legal to call Stop() from other locations,
410 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
411 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
412 same driver's Start() function.
413 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
414 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
415 Start() function, and the Start() function must have called OpenProtocol() on
416 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
418 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
419 @param[in] ControllerHandle A handle to the device being stopped. The handle must
420 support a bus specific I/O protocol for the driver
421 to use to stop the device.
422 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
423 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
424 if NumberOfChildren is 0.
426 @retval EFI_SUCCESS The device was stopped.
427 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
432 AtaAtapiPassThruStop (
433 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
434 IN EFI_HANDLE Controller
,
435 IN UINTN NumberOfChildren
,
436 IN EFI_HANDLE
*ChildHandleBuffer
440 Traverse the attached ATA devices list to find out the device to access.
442 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
443 @param[in] Port The port number of the ATA device to send the command.
444 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
445 If there is no port multiplier, then specify 0xFFFF.
446 @param[in] DeviceType The device type of the ATA device.
448 @retval The pointer to the data structure of the device info to access.
453 SearchDeviceInfoList (
454 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
456 IN UINT16 PortMultiplier
,
457 IN EFI_ATA_DEVICE_TYPE DeviceType
461 Allocate device info data structure to contain device info.
462 And insert the data structure to the tail of device list for tracing.
464 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
465 @param[in] Port The port number of the ATA device to send the command.
466 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
467 If there is no port multiplier, then specify 0xFFFF.
468 @param[in] DeviceType The device type of the ATA device.
469 @param[in] IdentifyData The data buffer to store the output of the IDENTIFY cmd.
471 @retval EFI_SUCCESS Successfully insert the ata device to the tail of device list.
472 @retval EFI_OUT_OF_RESOURCES Can not allocate enough resource for use.
477 CreateNewDeviceInfo (
478 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
480 IN UINT16 PortMultiplier
,
481 IN EFI_ATA_DEVICE_TYPE DeviceType
,
482 IN EFI_IDENTIFY_DATA
*IdentifyData
486 Destroy all attached ATA devices info.
488 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
493 DestroyDeviceInfoList (
494 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
498 Destroy all pending non blocking tasks.
500 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
501 @param[in] IsSigEvent Indicate whether signal the task event when remove the
507 DestroyAsynTaskList (
508 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
509 IN BOOLEAN IsSigEvent
513 Enumerate all attached ATA devices at IDE mode or AHCI mode separately.
515 The function is designed to enumerate all attached ATA devices.
517 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
519 @retval EFI_SUCCESS Successfully enumerate attached ATA devices.
520 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
525 EnumerateAttachedDevice (
526 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
530 Call back funtion when the timer event is signaled.
532 @param[in] Event The Event this notify function registered to.
533 @param[in] Context Pointer to the context data registered to the
539 AsyncNonBlockingTransferRoutine (
545 Sends an ATA command to an ATA device that is attached to the ATA controller. This function
546 supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,
547 and the non-blocking I/O functionality is optional.
549 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
550 @param[in] Port The port number of the ATA device to send the command.
551 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
552 If there is no port multiplier, then specify 0xFFFF.
553 @param[in, out] Packet A pointer to the ATA command to send to the ATA device specified by Port
554 and PortMultiplierPort.
555 @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking
556 I/O is performed. If Event is NULL, then blocking I/O is performed. If
557 Event is not NULL and non blocking I/O is supported, then non-blocking
558 I/O is performed, and Event will be signaled when the ATA command completes.
560 @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands,
561 InTransferLength bytes were transferred from InDataBuffer. For write and
562 bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.
563 @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred
564 is returned in InTransferLength. For write and bi-directional commands,
565 OutTransferLength bytes were transferred by OutDataBuffer.
566 @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands
567 already queued. The caller may retry again later.
568 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.
569 @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA
570 command was not sent, so no additional status information is available.
575 AtaPassThruPassThru (
576 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
578 IN UINT16 PortMultiplierPort
,
579 IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
,
580 IN EFI_EVENT Event OPTIONAL
584 Used to retrieve the list of legal port numbers for ATA devices on an ATA controller.
585 These can either be the list of ports where ATA devices are actually present or the
586 list of legal port numbers for the ATA controller. Regardless, the caller of this
587 function must probe the port number returned to see if an ATA device is actually
588 present at that location on the ATA controller.
590 The GetNextPort() function retrieves the port number on an ATA controller. If on input
591 Port is 0xFFFF, then the port number of the first port on the ATA controller is returned
592 in Port and EFI_SUCCESS is returned.
594 If Port is a port number that was returned on a previous call to GetNextPort(), then the
595 port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS
596 is returned. If Port is not 0xFFFF and Port was not returned on a previous call to
597 GetNextPort(), then EFI_INVALID_PARAMETER is returned.
599 If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is
602 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
603 @param[in, out] Port On input, a pointer to the port number on the ATA controller.
604 On output, a pointer to the next port number on the ATA
605 controller. An input value of 0xFFFF retrieves the first port
606 number on the ATA controller.
608 @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port.
609 @retval EFI_NOT_FOUND There are no more ports on this ATA controller.
610 @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call
616 AtaPassThruGetNextPort (
617 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
622 Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA
623 controller. These can either be the list of port multiplier ports where ATA devices are actually
624 present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this
625 function must probe the port number and port multiplier port number returned to see if an ATA
626 device is actually present.
628 The GetNextDevice() function retrieves the port multiplier port number of an ATA device
629 present on a port of an ATA controller.
631 If PortMultiplierPort points to a port multiplier port number value that was returned on a
632 previous call to GetNextDevice(), then the port multiplier port number of the next ATA device
633 on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is
636 If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first
637 ATA device on port of the ATA controller is returned in PortMultiplierPort and
638 EFI_SUCCESS is returned.
640 If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort
641 was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER
644 If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of
645 the ATA controller, then EFI_NOT_FOUND is returned.
647 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
648 @param[in] Port The port number present on the ATA controller.
649 @param[in, out] PortMultiplierPort On input, a pointer to the port multiplier port number of an
650 ATA device present on the ATA controller.
651 If on input a PortMultiplierPort of 0xFFFF is specified,
652 then the port multiplier port number of the first ATA device
653 is returned. On output, a pointer to the port multiplier port
654 number of the next ATA device present on an ATA controller.
656 @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port
657 of the ATA controller was returned in PortMultiplierPort.
658 @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller.
659 @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not
660 returned on a previous call to GetNextDevice().
665 AtaPassThruGetNextDevice (
666 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
668 IN OUT UINT16
*PortMultiplierPort
672 Used to allocate and build a device path node for an ATA device on an ATA controller.
674 The BuildDevicePath() function allocates and builds a single device node for the ATA
675 device specified by Port and PortMultiplierPort. If the ATA device specified by Port and
676 PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.
677 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough
678 resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
680 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
681 DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,
682 and EFI_SUCCESS is returned.
684 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
685 @param[in] Port Port specifies the port number of the ATA device for which a
686 device path node is to be allocated and built.
687 @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a
688 device path node is to be allocated and built. If there is no
689 port multiplier, then specify 0xFFFF.
690 @param[in, out] DevicePath A pointer to a single device path node that describes the ATA
691 device specified by Port and PortMultiplierPort. This function
692 is responsible for allocating the buffer DevicePath with the
693 boot service AllocatePool(). It is the caller's responsibility
694 to free DevicePath when the caller is finished with DevicePath.
695 @retval EFI_SUCCESS The device path node that describes the ATA device specified by
696 Port and PortMultiplierPort was allocated and returned in DevicePath.
697 @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not
698 exist on the ATA controller.
699 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
700 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
705 AtaPassThruBuildDevicePath (
706 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
708 IN UINT16 PortMultiplierPort
,
709 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
713 Used to translate a device path node to a port number and port multiplier port number.
715 The GetDevice() function determines the port and port multiplier port number associated with
716 the ATA device described by DevicePath. If DevicePath is a device path node type that the
717 ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents
718 DevicePath into a port number and port multiplier port number.
720 If this translation is successful, then that port number and port multiplier port number are returned
721 in Port and PortMultiplierPort, and EFI_SUCCESS is returned.
723 If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.
725 If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then
726 EFI_UNSUPPORTED is returned.
728 If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not
729 a valid translation from DevicePath to a port number and port multiplier port number, then
730 EFI_NOT_FOUND is returned.
732 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
733 @param[in] DevicePath A pointer to the device path node that describes an ATA device on the
735 @param[out] Port On return, points to the port number of an ATA device on the ATA controller.
736 @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device
737 on the ATA controller.
739 @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier
740 port number, and they were returned in Port and PortMultiplierPort.
741 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
742 @retval EFI_INVALID_PARAMETER Port is NULL.
743 @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL.
744 @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath.
745 @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier
746 port number does not exist.
751 AtaPassThruGetDevice (
752 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
753 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
755 OUT UINT16
*PortMultiplierPort
759 Resets a specific port on the ATA controller. This operation also resets all the ATA devices
760 connected to the port.
762 The ResetChannel() function resets an a specific port on an ATA controller. This operation
763 resets all the ATA devices connected to that port. If this ATA controller does not support
764 a reset port operation, then EFI_UNSUPPORTED is returned.
766 If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is
769 If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.
771 If the port reset operation is completed, then EFI_SUCCESS is returned.
773 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
774 @param[in] Port The port number on the ATA controller.
776 @retval EFI_SUCCESS The ATA controller port was reset.
777 @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation.
778 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port.
779 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port.
784 AtaPassThruResetPort (
785 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
790 Resets an ATA device that is connected to an ATA controller.
792 The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.
793 If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is
796 If Port or PortMultiplierPort are not in a valid range for this ATA controller, then
797 EFI_INVALID_PARAMETER is returned.
799 If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR
802 If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is
805 If the device reset operation is completed, then EFI_SUCCESS is returned.
807 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
808 @param[in] Port Port represents the port number of the ATA device to be reset.
809 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset.
810 If there is no port multiplier, then specify 0xFFFF.
811 @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset.
812 @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation.
813 @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid.
814 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device
815 specified by Port and PortMultiplierPort.
816 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device
817 specified by Port and PortMultiplierPort.
822 AtaPassThruResetDevice (
823 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
825 IN UINT16 PortMultiplierPort
829 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function
830 supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the
831 nonblocking I/O functionality is optional.
833 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
834 @param Target The Target is an array of size TARGET_MAX_BYTES and it represents
835 the id of the SCSI device to send the SCSI Request Packet. Each
836 transport driver may choose to utilize a subset of this size to suit the needs
837 of transport target representation. For example, a Fibre Channel driver
838 may use only 8 bytes (WWN) to represent an FC target.
839 @param Lun The LUN of the SCSI device to send the SCSI Request Packet.
840 @param Packet A pointer to the SCSI Request Packet to send to the SCSI device
841 specified by Target and Lun.
842 @param Event If nonblocking I/O is not supported then Event is ignored, and blocking
843 I/O is performed. If Event is NULL, then blocking I/O is performed. If
844 Event is not NULL and non blocking I/O is supported, then
845 nonblocking I/O is performed, and Event will be signaled when the
846 SCSI Request Packet completes.
848 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional
849 commands, InTransferLength bytes were transferred from
850 InDataBuffer. For write and bi-directional commands,
851 OutTransferLength bytes were transferred by
853 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that
854 could be transferred is returned in InTransferLength. For write
855 and bi-directional commands, OutTransferLength bytes were
856 transferred by OutDataBuffer.
857 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
858 SCSI Request Packets already queued. The caller may retry again later.
859 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request
861 @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.
862 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported
863 by the host adapter. This includes the case of Bi-directional SCSI
864 commands not supported by the implementation. The SCSI Request
865 Packet was not sent, so no additional status information is available.
866 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
871 ExtScsiPassThruPassThru (
872 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
875 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
876 IN EFI_EVENT Event OPTIONAL
880 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These
881 can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal
882 Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the
883 Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI
886 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
887 @param Target On input, a pointer to the Target ID (an array of size
888 TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
889 On output, a pointer to the Target ID (an array of
890 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
891 channel. An input value of 0xF(all bytes in the array are 0xF) in the
892 Target array retrieves the Target ID of the first SCSI device present on a
894 @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI
895 channel. On output, a pointer to the LUN of the next SCSI device present
898 @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI
899 channel was returned in Target and Lun.
900 @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were
901 not returned on a previous call to GetNextTargetLun().
902 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
907 ExtScsiPassThruGetNextTargetLun (
908 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
909 IN OUT UINT8
**Target
,
914 Used to allocate and build a device path node for a SCSI device on a SCSI channel.
916 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
917 @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the
918 Target ID of the SCSI device for which a device path node is to be
919 allocated and built. Transport drivers may chose to utilize a subset of
920 this size to suit the representation of targets. For example, a Fibre
921 Channel driver may use only 8 bytes (WWN) in the array to represent a
923 @param Lun The LUN of the SCSI device for which a device path node is to be
925 @param DevicePath A pointer to a single device path node that describes the SCSI device
926 specified by Target and Lun. This function is responsible for
927 allocating the buffer DevicePath with the boot service
928 AllocatePool(). It is the caller's responsibility to free
929 DevicePath when the caller is finished with DevicePath.
931 @retval EFI_SUCCESS The device path node that describes the SCSI device specified by
932 Target and Lun was allocated and returned in
934 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
935 @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist
937 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
942 ExtScsiPassThruBuildDevicePath (
943 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
946 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
950 Used to translate a device path node to a Target ID and LUN.
952 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
953 @param DevicePath A pointer to a single device path node that describes the SCSI device
955 @param Target A pointer to the Target Array which represents the ID of a SCSI device
957 @param Lun A pointer to the LUN of a SCSI device on the SCSI channel.
959 @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and
960 LUN, and they were returned in Target and Lun.
961 @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.
962 @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN
964 @retval EFI_UNSUPPORTED This driver does not support the device path node type in
970 ExtScsiPassThruGetTargetLun (
971 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
972 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
978 Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
980 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
982 @retval EFI_SUCCESS The SCSI channel was reset.
983 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.
984 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.
985 @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.
990 ExtScsiPassThruResetChannel (
991 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
995 Resets a SCSI logical unit that is connected to a SCSI channel.
997 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
998 @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the
999 target port ID of the SCSI device containing the SCSI logical unit to
1000 reset. Transport drivers may chose to utilize a subset of this array to suit
1001 the representation of their targets.
1002 @param Lun The LUN of the SCSI device to reset.
1004 @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.
1005 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
1006 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device
1007 specified by Target and Lun.
1008 @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.
1009 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device
1010 specified by Target and Lun.
1015 ExtScsiPassThruResetTargetLun (
1016 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1022 Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either
1023 be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs
1024 for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to
1025 see if a SCSI device is actually present at that location on the SCSI channel.
1027 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
1028 @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
1029 On output, a pointer to the Target ID (an array of
1030 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
1031 channel. An input value of 0xF(all bytes in the array are 0xF) in the
1032 Target array retrieves the Target ID of the first SCSI device present on a
1035 @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
1036 channel was returned in Target.
1037 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
1038 @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not
1039 returned on a previous call to GetNextTarget().
1040 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
1045 ExtScsiPassThruGetNextTarget (
1046 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1047 IN OUT UINT8
**Target
1051 Initialize ATA host controller at IDE mode.
1053 The function is designed to initialize ATA host controller.
1055 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1060 IdeModeInitialization (
1061 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1065 Initialize ATA host controller at AHCI mode.
1067 The function is designed to initialize ATA host controller.
1069 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1074 AhciModeInitialization (
1075 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1079 Start a non data transfer on specific port.
1081 @param[in] PciIo The PCI IO protocol instance.
1082 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1083 @param[in] Port The number of port.
1084 @param[in] PortMultiplier The timeout value of stop.
1085 @param[in] AtapiCommand The atapi command will be used for the
1087 @param[in] AtapiCommandLength The length of the atapi command.
1088 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1089 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1090 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1091 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1092 used by non-blocking mode.
1094 @retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
1095 @retval EFI_TIMEOUT The operation is time out.
1096 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1097 @retval EFI_SUCCESS The non data transfer executes successfully.
1102 AhciNonDataTransfer (
1103 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1104 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1106 IN UINT8 PortMultiplier
,
1107 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1108 IN UINT8 AtapiCommandLength
,
1109 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1110 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1112 IN ATA_NONBLOCK_TASK
*Task
1116 Start a DMA data transfer on specific port
1118 @param[in] Instance The ATA_ATAPI_PASS_THRU_INSTANCE protocol instance.
1119 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1120 @param[in] Port The number of port.
1121 @param[in] PortMultiplier The timeout value of stop.
1122 @param[in] AtapiCommand The atapi command will be used for the
1124 @param[in] AtapiCommandLength The length of the atapi command.
1125 @param[in] Read The transfer direction.
1126 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1127 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1128 @param[in, out] MemoryAddr The pointer to the data buffer.
1129 @param[in] DataCount The data count to be transferred.
1130 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1131 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1132 used by non-blocking mode.
1134 @retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
1135 @retval EFI_TIMEOUT The operation is time out.
1136 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1137 @retval EFI_SUCCESS The DMA data transfer executes successfully.
1143 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1144 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1146 IN UINT8 PortMultiplier
,
1147 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1148 IN UINT8 AtapiCommandLength
,
1150 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1151 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1152 IN OUT VOID
*MemoryAddr
,
1153 IN UINT32 DataCount
,
1155 IN ATA_NONBLOCK_TASK
*Task
1159 Start a PIO data transfer on specific port.
1161 @param[in] PciIo The PCI IO protocol instance.
1162 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1163 @param[in] Port The number of port.
1164 @param[in] PortMultiplier The timeout value of stop.
1165 @param[in] AtapiCommand The atapi command will be used for the
1167 @param[in] AtapiCommandLength The length of the atapi command.
1168 @param[in] Read The transfer direction.
1169 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1170 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1171 @param[in, out] MemoryAddr The pointer to the data buffer.
1172 @param[in] DataCount The data count to be transferred.
1173 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1174 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1175 used by non-blocking mode.
1177 @retval EFI_DEVICE_ERROR The PIO data transfer abort with error occurs.
1178 @retval EFI_TIMEOUT The operation is time out.
1179 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1180 @retval EFI_SUCCESS The PIO data transfer executes successfully.
1186 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1187 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1189 IN UINT8 PortMultiplier
,
1190 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1191 IN UINT8 AtapiCommandLength
,
1193 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1194 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1195 IN OUT VOID
*MemoryAddr
,
1196 IN UINT32 DataCount
,
1198 IN ATA_NONBLOCK_TASK
*Task
1202 Send ATA command into device with NON_DATA protocol
1204 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE
1206 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1207 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data
1209 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1210 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1211 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1212 used by non-blocking mode.
1214 @retval EFI_SUCCESS Reading succeed
1215 @retval EFI_ABORTED Command failed
1216 @retval EFI_DEVICE_ERROR Device status error.
1221 AtaNonDataCommandIn (
1222 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1223 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1224 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1225 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1227 IN ATA_NONBLOCK_TASK
*Task
1231 Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).
1233 @param[in] Instance A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1235 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1236 @param[in] Read Flag used to determine the data transfer
1237 direction. Read equals 1, means data transferred
1238 from device to host;Read equals 0, means data
1239 transferred from host to device.
1240 @param[in] DataBuffer A pointer to the source buffer for the data.
1241 @param[in] DataLength The length of the data.
1242 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1243 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1244 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1245 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1246 used by non-blocking mode.
1248 @retval EFI_SUCCESS the operation is successful.
1249 @retval EFI_OUT_OF_RESOURCES Build PRD table failed
1250 @retval EFI_UNSUPPORTED Unknown channel or operations command
1251 @retval EFI_DEVICE_ERROR Ata command execute failed
1257 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1258 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1260 IN VOID
*DataBuffer
,
1261 IN UINT64 DataLength
,
1262 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1263 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1265 IN ATA_NONBLOCK_TASK
*Task
1269 This function is used to send out ATA commands conforms to the PIO Data In Protocol.
1271 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1273 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1274 @param[in, out] Buffer A pointer to the source buffer for the data.
1275 @param[in] ByteCount The length of the data.
1276 @param[in] Read Flag used to determine the data transfer direction.
1277 Read equals 1, means data transferred from device
1278 to host;Read equals 0, means data transferred
1279 from host to device.
1280 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1281 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1282 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1283 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1284 used by non-blocking mode.
1286 @retval EFI_SUCCESS send out the ATA command and device send required data successfully.
1287 @retval EFI_DEVICE_ERROR command sent failed.
1293 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1294 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1295 IN OUT VOID
*Buffer
,
1296 IN UINT64 ByteCount
,
1298 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1299 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1301 IN ATA_NONBLOCK_TASK
*Task