TianoCore EDK2 master
|
#include "AtaAtapiPassThru.h"
Go to the source code of this file.
Header file for AHCI mode of ATA host controller.
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file IdeMode.c.
EFI_STATUS EFIAPI AtaIdentify | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN UINT8 | Channel, | ||
IN UINT8 | Device, | ||
IN OUT EFI_IDENTIFY_DATA * | Buffer, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
Sends out an ATA Identify Command to the specified device.
This function is called by DiscoverIdeDevice() during its device identification. It sends out the ATA Identify Command to the specified device. Only ATA device responses to this command. If the command succeeds, it returns the Identify data structure which contains information about the device. This function extracts the information it needs to fill the IDE_BLK_IO_DEV data structure, including device type, media block size, media capacity, and etc.
Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
Channel | The channel number of device. |
Device | The device number of device. |
Buffer | A pointer to data buffer which is used to contain IDENTIFY data. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_SUCCESS | Identify ATA device successfully. |
EFI_DEVICE_ERROR | ATA Identify Device Command failed or device is not ATA device. |
EFI_OUT_OF_RESOURCES | Allocate memory failed. |
EFI_STATUS EFIAPI AtaIdentifyPacket | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN UINT8 | Channel, | ||
IN UINT8 | Device, | ||
IN OUT EFI_IDENTIFY_DATA * | Buffer, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
This function is called by DiscoverIdeDevice() during its device identification. Its main purpose is to get enough information for the device media to fill in the Media data structure of the Block I/O Protocol interface.
There are 5 steps to reach such objective:
Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
Channel | The channel number of device. |
Device | The device number of device. |
Buffer | A pointer to data buffer which is used to contain IDENTIFY data. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_SUCCESS | Identify ATAPI device successfully. |
EFI_DEVICE_ERROR | ATA Identify Packet Device Command failed or device type is not supported by this IDE driver. |
EFI_OUT_OF_RESOURCES | Allocate memory failed. |
EFI_STATUS EFIAPI AtaIssueCommand | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, | ||
IN UINT64 | Timeout | ||
) |
Send ATA Ext command into device with NON_DATA protocol.
PciIo | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
AtaCommandBlock | A pointer to EFI_ATA_COMMAND_BLOCK data structure. |
Timeout | The time to complete the command, uses 100ns as a unit. |
EFI_SUCCESS | Reading succeed |
EFI_DEVICE_ERROR | Error executing commands on this device. |
EFI_STATUS EFIAPI AtaNonDataCommandIn | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock, | ||
IN UINT64 | Timeout, | ||
IN ATA_NONBLOCK_TASK * | Task | ||
) |
Send ATA command into device with NON_DATA protocol
[in] | PciIo | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
[in] | IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
[in] | AtaCommandBlock | A pointer to EFI_ATA_COMMAND_BLOCK data structure. |
[in,out] | AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
[in] | Timeout | The time to complete the command, uses 100ns as a unit. |
[in] | Task | Optional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode. |
EFI_SUCCESS | Reading succeed |
EFI_ABORTED | Command failed |
EFI_DEVICE_ERROR | Device status error. |
EFI_STATUS EFIAPI AtaPacketCommandExecute | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN UINT8 | Channel, | ||
IN UINT8 | Device, | ||
IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET * | Packet | ||
) |
This function is used to send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
[in] | PciIo | Pointer to the EFI_PCI_IO_PROTOCOL instance |
[in] | IdeRegisters | Pointer to EFI_IDE_REGISTERS which is used to store the IDE i/o port registers' base addresses |
[in] | Channel | The channel number of device. |
[in] | Device | The device number of device. |
[in] | Packet | A pointer to EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET data structure. |
EFI_SUCCESS | send out the ATAPI packet command successfully and device sends data successfully. |
EFI_DEVICE_ERROR | the device failed to send data. |
EFI_STATUS EFIAPI AtaPacketReadPendingData | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters | ||
) |
This function reads the pending data in the device.
PciIo | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
EFI_SUCCESS | Successfully read. |
EFI_NOT_READY | The BSY is set avoiding reading. |
EFI_STATUS EFIAPI AtaPacketReadWrite | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN OUT VOID * | Buffer, | ||
IN OUT UINT32 * | ByteCount, | ||
IN BOOLEAN | Read, | ||
IN UINT64 | Timeout | ||
) |
This function is called by AtaPacketCommandExecute(). It is used to transfer data between host and device. The data direction is specified by the fourth parameter.
PciIo | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
Buffer | Buffer contained data transferred between host and device. |
ByteCount | Data size in byte unit of the buffer. |
Read | Flag used to determine the data transfer direction. Read equals 1, means data transferred from device to host; Read equals 0, means data transferred from host to device. |
Timeout | Timeout value for wait DRQ ready before each data stream's transfer , uses 100ns as a unit. |
EFI_SUCCESS | data is transferred successfully. |
EFI_DEVICE_ERROR | the device failed to transfer data. |
EFI_STATUS EFIAPI AtaPioDataInOut | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN OUT VOID * | Buffer, | ||
IN UINT64 | ByteCount, | ||
IN BOOLEAN | Read, | ||
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock, | ||
IN UINT64 | Timeout, | ||
IN ATA_NONBLOCK_TASK * | Task | ||
) |
This function is used to send out ATA commands conforms to the PIO Data In Protocol.
[in] | PciIo | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
[in] | IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
[in,out] | Buffer | A pointer to the source buffer for the data. |
[in] | ByteCount | The length of the data. |
[in] | Read | Flag used to determine the data transfer direction. Read equals 1, means data transferred from device to host;Read equals 0, means data transferred from host to device. |
[in] | AtaCommandBlock | A pointer to EFI_ATA_COMMAND_BLOCK data structure. |
[in,out] | AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
[in] | Timeout | The time to complete the command, uses 100ns as a unit. |
[in] | Task | Optional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode. |
EFI_SUCCESS | send out the ATA command and device send required data successfully. |
EFI_DEVICE_ERROR | command sent failed. |
EFI_STATUS EFIAPI AtaUdmaInOut | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN BOOLEAN | Read, | ||
IN VOID * | DataBuffer, | ||
IN UINT64 | DataLength, | ||
IN EFI_ATA_COMMAND_BLOCK * | AtaCommandBlock, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock, | ||
IN UINT64 | Timeout, | ||
IN ATA_NONBLOCK_TASK * | Task | ||
) |
Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).
[in] | Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
[in] | IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
[in] | Read | Flag used to determine the data transfer direction. Read equals 1, means data transferred from device to host;Read equals 0, means data transferred from host to device. |
[in] | DataBuffer | A pointer to the source buffer for the data. |
[in] | DataLength | The length of the data. |
[in] | AtaCommandBlock | A pointer to EFI_ATA_COMMAND_BLOCK data structure. |
[in,out] | AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
[in] | Timeout | The time to complete the command, uses 100ns as a unit. |
[in] | Task | Optional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode. |
EFI_SUCCESS | the operation is successful. |
EFI_OUT_OF_RESOURCES | Build PRD table failed |
EFI_UNSUPPORTED | Unknown channel or operations command |
EFI_DEVICE_ERROR | Ata command execute failed |
EFI_STATUS AtaUdmStatusCheck | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN ATA_NONBLOCK_TASK * | Task, | ||
IN EFI_IDE_REGISTERS * | IdeRegisters | ||
) |
Check if the memory to be set.
[in] | PciIo | The PCI IO protocol instance. |
[in] | Task | Optional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode. |
[in] | IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
EFI_DEVICE_ERROR | The memory setting met a issue. |
EFI_NOT_READY | The memory is not set. |
EFI_TIMEOUT | The memory setting is time out. |
EFI_SUCCESS | The memory is correct set. |
EFI_STATUS AtaUdmStatusWait | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN UINT64 | Timeout | ||
) |
Wait for memory to be set.
[in] | PciIo | The PCI IO protocol instance. |
[in] | IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
[in] | Timeout | The time to complete the command, uses 100ns as a unit. |
EFI_DEVICE_ERROR | The memory is not set. |
EFI_TIMEOUT | The memory setting is time out. |
EFI_SUCCESS | The memory is correct set. |
EFI_STATUS EFIAPI CheckStatusRegister | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters | ||
) |
This function is used to analyze the Status Register at the condition that BSY is zero. if there is ERR bit set in the Status Register, then return error.
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
EFI_SUCCESS | No err information in the Status Register. |
EFI_DEVICE_ERROR | Any err information in the Status Register. |
EFI_STATUS EFIAPI DetectAndConfigIdeDevice | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN UINT8 | IdeChannel | ||
) |
This function is used for detect whether the IDE device exists in the specified Channel as the specified Device Number.
There is two IDE channels: one is Primary Channel, the other is Secondary Channel.(Channel is the logical name for the physical "Cable".) Different channel has different register group.
On each IDE channel, at most two IDE devices attach, one is called Device 0 (Master device), the other is called Device 1 (Slave device). The devices on the same channel co-use the same register group, so before sending out a command for a specified device via command register, it is a must to select the current device to accept the command by set the device number in the Head/Device Register.
Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
IdeChannel | The channel number of device. |
EFI_SUCCESS | successfully detects device. |
other | any failure during detection process will return this value. |
EFI_STATUS EFIAPI DRQClear | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN UINT64 | Timeout | ||
) |
This function is used to poll for the DRQ bit clear in the Status Register. DRQ is cleared when the device is finished transferring data. So this function is called after data transfer is finished.
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
Timeout | The time to complete the command, uses 100ns as a unit. |
EFI_SUCCESS | DRQ bit clear within the time out. |
EFI_TIMEOUT | DRQ bit not clear within the time out. |
EFI_STATUS EFIAPI DRQClear2 | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN UINT64 | Timeout | ||
) |
This function is used to poll for the DRQ bit clear in the Alternate Status Register. DRQ is cleared when the device is finished transferring data. So this function is called after data transfer is finished.
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
Timeout | The time to complete the command, uses 100ns as a unit. |
EFI_SUCCESS | DRQ bit clear within the time out. |
EFI_TIMEOUT | DRQ bit not clear within the time out. |
EFI_STATUS EFIAPI DRQReady | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN UINT64 | Timeout | ||
) |
This function is used to poll for the DRQ bit set in the Status Register. DRQ is set when the device is ready to transfer data. So this function is called after the command is sent to the device and before required data is transferred.
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
Timeout | The time to complete the command, uses 100ns as a unit. |
EFI_SUCCESS | BSY bit cleared and DRQ bit set within the timeout. |
EFI_TIMEOUT | BSY bit not cleared within the timeout. |
EFI_ABORTED | Polling abandoned due to command abort. |
EFI_DEVICE_ERROR | Polling abandoned due to a non-abort error. |
EFI_NOT_READY | BSY bit cleared within timeout, and device reported "command complete" by clearing DRQ bit. |
EFI_STATUS EFIAPI DRQReady2 | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN UINT64 | Timeout | ||
) |
This function is used to poll for the DRQ bit set in the Alternate Status Register. DRQ is set when the device is ready to transfer data. So this function is called after the command is sent to the device and before required data is transferred.
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
Timeout | The time to complete the command, uses 100ns as a unit. |
EFI_SUCCESS | BSY bit cleared and DRQ bit set within the timeout. |
EFI_TIMEOUT | BSY bit not cleared within the timeout. |
EFI_ABORTED | Polling abandoned due to command abort. |
EFI_DEVICE_ERROR | Polling abandoned due to a non-abort error. |
EFI_NOT_READY | BSY bit cleared within timeout, and device reported "command complete" by clearing DRQ bit. |
VOID EFIAPI DumpAllIdeRegisters | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
This function is used to analyze the Status Register and print out some debug information and if there is ERR bit set in the Status Register, the Error Register's value is also be parsed and print out.
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_STATUS EFIAPI GetIdeRegisterIoAddr | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN OUT EFI_IDE_REGISTERS * | IdeRegisters | ||
) |
Get IDE i/o port registers' base addresses by mode.
In 'Compatibility' mode, use fixed addresses. In Native-PCI mode, get base addresses from BARs in the PCI IDE controller's Configuration Space.
The steps to get IDE i/o port registers' base addresses for each channel as follows:
Table 1. Compatibility resource mappings
b) In Native-PCI mode, IDE registers are mapped into IO space using the BARs in IDE controller's PCI Configuration Space, shown in the Table 2 below.
| | Command Block | Control Block | | Channel | Registers | Registers | |___________|___________________|___________________| | Primary | BAR at offset 0x10| BAR at offset 0x14| |___________|___________________|___________________| | Secondary | BAR at offset 0x18| BAR at offset 0x1C| |___________|___________________|___________________|
Table 2. BARs for Register Mapping
[in] | PciIo | Pointer to the EFI_PCI_IO_PROTOCOL instance |
[in,out] | IdeRegisters | Pointer to EFI_IDE_REGISTERS which is used to store the IDE i/o port registers' base addresses |
EFI_UNSUPPORTED | Return this value when the BARs is not IO type |
EFI_SUCCESS | Get the Base address successfully |
Other | Read the pci configuration data error |
EFI_STATUS EFIAPI IdeAtaSmartReturnStatusCheck | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN UINT8 | Channel, | ||
IN UINT8 | Device, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
Send SMART Return Status command to check if the execution of SMART cmd is successful or not.
Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
Channel | The channel number of device. |
Device | The device number of device. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_SUCCESS | Successfully get the return status of S.M.A.R.T command execution. |
Others | Fail to get return status data. |
VOID EFIAPI IdeAtaSmartSupport | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN UINT8 | Channel, | ||
IN UINT8 | Device, | ||
IN EFI_IDENTIFY_DATA * | IdentifyData, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
Enable SMART command of the disk if supported.
Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
Channel | The channel number of device. |
Device | The device number of device. |
IdentifyData | A pointer to data buffer which is used to contain IDENTIFY data. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_STATUS EFIAPI IdeModeInitialization | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance | ) |
Initialize ATA host controller at IDE mode.
The function is designed to initialize ATA host controller.
[in] | Instance | A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. |
UINT8 EFIAPI IdeReadPortB | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT16 | Port | ||
) |
VOID EFIAPI IdeReadPortWMultiple | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT16 | Port, | ||
IN UINTN | Count, | ||
IN VOID * | Buffer | ||
) |
Reads multiple words of data from the IDE data port. Call the IO abstraction once to do the complete read, not one word at a time
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure |
Port | IO port to read |
Count | Number of UINT16's to read |
Buffer | Pointer to the data buffer for read |
VOID EFIAPI IdeWritePortB | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT16 | Port, | ||
IN UINT8 | Data | ||
) |
VOID EFIAPI IdeWritePortDW | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT16 | Port, | ||
IN UINT32 | Data | ||
) |
VOID EFIAPI IdeWritePortW | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT16 | Port, | ||
IN UINT16 | Data | ||
) |
VOID EFIAPI IdeWritePortWMultiple | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT16 | Port, | ||
IN UINTN | Count, | ||
IN VOID * | Buffer | ||
) |
Write multiple words of data to the IDE data port. Call the IO abstraction once to do the complete read, not one word at a time
PciIo | A pointer to EFI_PCI_IO_PROTOCOL data structure |
Port | IO port to read |
Count | No. of UINT16's to read |
Buffer | Pointer to the data buffer for read |
EFI_STATUS EFIAPI SetDeviceTransferMode | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN UINT8 | Channel, | ||
IN UINT8 | Device, | ||
IN EFI_ATA_TRANSFER_MODE * | TransferMode, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
Set the calculated Best transfer mode to a detected device.
Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
Channel | The channel number of device. |
Device | The device number of device. |
TransferMode | A pointer to EFI_ATA_TRANSFER_MODE data structure. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_SUCCESS | Set transfer mode successfully. |
EFI_DEVICE_ERROR | Set transfer mode failed. |
EFI_OUT_OF_RESOURCES | Allocate memory failed. |
EFI_STATUS EFIAPI SetDriveParameters | ( | IN ATA_ATAPI_PASS_THRU_INSTANCE * | Instance, |
IN UINT8 | Channel, | ||
IN UINT8 | Device, | ||
IN EFI_ATA_DRIVE_PARMS * | DriveParameters, | ||
IN OUT EFI_ATA_STATUS_BLOCK * | AtaStatusBlock | ||
) |
Set drive parameters for devices not support PACKETS command.
Instance | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
Channel | The channel number of device. |
Device | The device number of device. |
DriveParameters | A pointer to EFI_ATA_DRIVE_PARMS data structure. |
AtaStatusBlock | A pointer to EFI_ATA_STATUS_BLOCK data structure. |
EFI_SUCCESS | Set drive parameter successfully. |
EFI_DEVICE_ERROR | Set drive parameter failed. |
EFI_OUT_OF_RESOURCES | Allocate memory failed. |
EFI_STATUS EFIAPI WaitForBSYClear | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_IDE_REGISTERS * | IdeRegisters, | ||
IN UINT64 | Timeout | ||
) |
This function is used to poll for the BSY bit clear in the Status Register. BSY is clear when the device is not busy. Every command must be sent after device is not busy.
PciIo | A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data structure. |
IdeRegisters | A pointer to EFI_IDE_REGISTERS data structure. |
Timeout | The time to complete the command, uses 100ns as a unit. |
EFI_SUCCESS | BSY bit clear within the time out. |
EFI_TIMEOUT | BSY bit not clear within the time out. |