EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions

MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c File Reference

#include "AtaAtapiPassThru.h"

Go to the source code of this file.

Functions

UINT32 EFIAPI AhciReadReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset)
VOID EFIAPI AhciWriteReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT32 Data)
VOID EFIAPI AhciAndReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT32 AndData)
VOID EFIAPI AhciOrReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT32 OrData)
EFI_STATUS EFIAPI AhciWaitMmioSet (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINTN Offset, IN UINT32 MaskValue, IN UINT32 TestValue, IN UINT64 Timeout)
EFI_STATUS EFIAPI AhciWaitMemSet (IN EFI_PHYSICAL_ADDRESS Address, IN UINT32 MaskValue, IN UINT32 TestValue, IN UINT64 Timeout)
EFI_STATUS EFIAPI AhciCheckMemSet (IN UINTN Address, IN UINT32 MaskValue, IN UINT32 TestValue, IN OUT UINTN *RetryTimes OPTIONAL)
EFI_STATUS EFIAPI AhciCheckDeviceStatus (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port)
VOID EFIAPI AhciClearPortStatus (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port)
VOID EFIAPI AhciDumpPortStatus (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock)
EFI_STATUS EFIAPI AhciEnableFisReceive (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout)
EFI_STATUS EFIAPI AhciDisableFisReceive (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout)
VOID EFIAPI AhciBuildCommand (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_COMMAND_FIS *CommandFis, IN EFI_AHCI_COMMAND_LIST *CommandList, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN UINT8 CommandSlotNumber, IN OUT VOID *DataPhysicalAddr, IN UINT64 DataLength)
VOID EFIAPI AhciBuildCommandFis (IN OUT EFI_AHCI_COMMAND_FIS *CmdFis, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock)
EFI_STATUS EFIAPI AhciPioTransfer (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN BOOLEAN Read, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock, IN OUT VOID *MemoryAddr, IN UINT32 DataCount, IN UINT64 Timeout, IN ATA_NONBLOCK_TASK *Task)
EFI_STATUS EFIAPI AhciDmaTransfer (IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN BOOLEAN Read, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock, IN OUT VOID *MemoryAddr, IN UINT32 DataCount, IN UINT64 Timeout, IN ATA_NONBLOCK_TASK *Task)
EFI_STATUS EFIAPI AhciNonDataTransfer (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand OPTIONAL, IN UINT8 AtapiCommandLength, IN EFI_ATA_COMMAND_BLOCK *AtaCommandBlock, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock, IN UINT64 Timeout, IN ATA_NONBLOCK_TASK *Task)
EFI_STATUS EFIAPI AhciStopCommand (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout)
EFI_STATUS EFIAPI AhciStartCommand (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT8 CommandSlot, IN UINT64 Timeout)
EFI_STATUS EFIAPI AhciPortReset (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port, IN UINT64 Timeout)
EFI_STATUS EFIAPI AhciReset (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT64 Timeout)
EFI_STATUS EFIAPI AhciAtaSmartReturnStatusCheck (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock)
VOID EFIAPI AhciAtaSmartSupport (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_IDENTIFY_DATA *IdentifyData, IN OUT EFI_ATA_STATUS_BLOCK *AtaStatusBlock)
EFI_STATUS EFIAPI AhciIdentify (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT EFI_IDENTIFY_DATA *Buffer)
EFI_STATUS EFIAPI AhciIdentifyPacket (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN OUT EFI_IDENTIFY_DATA *Buffer)
EFI_STATUS EFIAPI AhciDeviceSetFeature (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN UINT16 Feature, IN UINT32 FeatureSpecificData)
EFI_STATUS EFIAPI AhciPacketCommandExecute (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_AHCI_REGISTERS *AhciRegisters, IN UINT8 Port, IN UINT8 PortMultiplier, IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
EFI_STATUS EFIAPI AhciCreateTransferDescriptor (IN EFI_PCI_IO_PROTOCOL *PciIo, IN OUT EFI_AHCI_REGISTERS *AhciRegisters)
EFI_STATUS EFIAPI AhciModeInitialization (IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance)

Detailed Description

The file for AHCI mode of ATA host controller.

Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file AhciMode.c.


Function Documentation

VOID EFIAPI AhciAndReg ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset,
IN UINT32  AndData 
)

Do AND operation with the value of AHCI Operation register.

Parameters:
PciIoThe PCI IO protocol instance.
OffsetThe operation register offset.
AndDataThe data used to do AND operation.

Definition at line 91 of file AhciMode.c.

EFI_STATUS EFIAPI AhciAtaSmartReturnStatusCheck ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN OUT EFI_ATA_STATUS_BLOCK AtaStatusBlock 
)

Send SMART Return Status command to check if the execution of SMART cmd is successful or not.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
PortThe number of port.
PortMultiplierThe timeout value of stop.
AtaStatusBlockA pointer to EFI_ATA_STATUS_BLOCK data structure.
Return values:
EFI_SUCCESSSuccessfully get the return status of S.M.A.R.T command execution.
OthersFail to get return status data.

Definition at line 1448 of file AhciMode.c.

VOID EFIAPI AhciAtaSmartSupport ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN EFI_IDENTIFY_DATA IdentifyData,
IN OUT EFI_ATA_STATUS_BLOCK AtaStatusBlock 
)

Enable SMART command of the disk if supported.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
PortThe number of port.
PortMultiplierThe timeout value of stop.
IdentifyDataA pointer to data buffer which is used to contain IDENTIFY data.
AtaStatusBlockA pointer to EFI_ATA_STATUS_BLOCK data structure.

Definition at line 1528 of file AhciMode.c.

VOID EFIAPI AhciBuildCommand ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN EFI_AHCI_COMMAND_FIS CommandFis,
IN EFI_AHCI_COMMAND_LIST CommandList,
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand  OPTIONAL,
IN UINT8  AtapiCommandLength,
IN UINT8  CommandSlotNumber,
IN OUT VOID *  DataPhysicalAddr,
IN UINT64  DataLength 
)

Build the command list, command table and prepare the fis receiver.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
PortThe number of port.
PortMultiplierThe timeout value of stop.
CommandFisThe control fis will be used for the transfer.
CommandListThe command list will be used for the transfer.
AtapiCommandThe atapi command will be used for the transfer.
AtapiCommandLengthThe length of the atapi command.
CommandSlotNumberThe command slot will be used for the transfer.
DataPhysicalAddrThe pointer to the data buffer pci bus master address.
DataLengthThe data count to be transferred.

Definition at line 495 of file AhciMode.c.

VOID EFIAPI AhciBuildCommandFis ( IN OUT EFI_AHCI_COMMAND_FIS CmdFis,
IN EFI_ATA_COMMAND_BLOCK AtaCommandBlock 
)

Buid a command FIS.

Parameters:
CmdFisA pointer to the EFI_AHCI_COMMAND_FIS data structure.
AtaCommandBlockA pointer to the AhciBuildCommandFis data structure.

Definition at line 605 of file AhciMode.c.

EFI_STATUS EFIAPI AhciCheckDeviceStatus ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port 
)

Check if the device is still on port. It also checks if the AHCI controller supports the address and data count will be transferred.

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.
Return values:
EFI_SUCCESSThe device is attached to port and the transfer data is supported by AHCI controller.
EFI_UNSUPPORTEDThe transfer address and count is not supported by AHCI controller.
EFI_NOT_READYThe physical communication between AHCI controller and device is not ready.

Definition at line 298 of file AhciMode.c.

EFI_STATUS EFIAPI AhciCheckMemSet ( IN UINTN  Address,
IN UINT32  MaskValue,
IN UINT32  TestValue,
IN OUT UINTN *RetryTimes  OPTIONAL 
)

Check the memory status to the test value.

Parameters:
[in]AddressThe memory address to test.
[in]MaskValueThe mask value of memory.
[in]TestValueThe test value of memory.
[in,out]RetryTimesThe retry times value for waitting memory set. If 0, then just try once.
Return values:
EFI_NOTREADYThe memory is not set.
EFI_TIMEOUTThe memory setting retry times out.
EFI_SUCCESSThe memory is correct set.

Definition at line 254 of file AhciMode.c.

VOID EFIAPI AhciClearPortStatus ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port 
)

Clear the port interrupt and error status. It will also clear HBA interrupt status.

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.

Definition at line 328 of file AhciMode.c.

EFI_STATUS EFIAPI AhciCreateTransferDescriptor ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN OUT EFI_AHCI_REGISTERS AhciRegisters 
)

Allocate transfer-related data struct which is used at AHCI mode.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.

Definition at line 1897 of file AhciMode.c.

EFI_STATUS EFIAPI AhciDeviceSetFeature ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN UINT16  Feature,
IN UINT32  FeatureSpecificData 
)

Send SET FEATURE cmd on specific device.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
PortThe number of port.
PortMultiplierThe timeout value of stop.
FeatureThe data to send Feature register.
FeatureSpecificDataThe specific data for SET FEATURE cmd.
Return values:
EFI_DEVICE_ERRORThe cmd abort with error occurs.
EFI_TIMEOUTThe operation is time out.
EFI_UNSUPPORTEDThe device is not ready for executing.
EFI_SUCCESSThe cmd executes successfully.

Definition at line 1755 of file AhciMode.c.

EFI_STATUS EFIAPI AhciDisableFisReceive ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port,
IN UINT64  Timeout 
)

Disable the FIS running for giving port.

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.
TimeoutThe timeout value of disabling FIS, uses 100ns as a unit.
Return values:
EFI_DEVICE_ERRORThe FIS disable setting fails.
EFI_TIMEOUTThe FIS disable setting is time out.
EFI_UNSUPPORTEDThe port is in running state.
EFI_SUCCESSThe FIS disable successfully.

Definition at line 438 of file AhciMode.c.

EFI_STATUS EFIAPI AhciDmaTransfer ( IN ATA_ATAPI_PASS_THRU_INSTANCE Instance,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand  OPTIONAL,
IN UINT8  AtapiCommandLength,
IN BOOLEAN  Read,
IN EFI_ATA_COMMAND_BLOCK AtaCommandBlock,
IN OUT EFI_ATA_STATUS_BLOCK AtaStatusBlock,
IN OUT VOID *  MemoryAddr,
IN UINT32  DataCount,
IN UINT64  Timeout,
IN ATA_NONBLOCK_TASK Task 
)

Start a DMA data transfer on specific port

Parameters:
[in]InstanceThe ATA_ATAPI_PASS_THRU_INSTANCE protocol instance.
[in]AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
[in]PortThe number of port.
[in]PortMultiplierThe timeout value of stop.
[in]AtapiCommandThe atapi command will be used for the transfer.
[in]AtapiCommandLengthThe length of the atapi command.
[in]ReadThe transfer direction.
[in]AtaCommandBlockThe EFI_ATA_COMMAND_BLOCK data.
[in,out]AtaStatusBlockThe EFI_ATA_STATUS_BLOCK data.
[in,out]MemoryAddrThe pointer to the data buffer.
[in]DataCountThe data count to be transferred.
[in]TimeoutThe timeout value of non data transfer, uses 100ns as a unit.
[in]TaskOptional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode.
Return values:
EFI_DEVICE_ERRORThe DMA data transfer abort with error occurs.
EFI_TIMEOUTThe operation is time out.
EFI_UNSUPPORTEDThe device is not ready for transfer.
EFI_SUCCESSThe DMA data transfer executes successfully.

Definition at line 866 of file AhciMode.c.

VOID EFIAPI AhciDumpPortStatus ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port,
IN OUT EFI_ATA_STATUS_BLOCK AtaStatusBlock 
)

This function is used to dump the Status Registers and if there is ERR bit set in the Status Register, the Error Register's value is also be dumped.

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.
AtaStatusBlockA pointer to EFI_ATA_STATUS_BLOCK data structure.

Definition at line 364 of file AhciMode.c.

EFI_STATUS EFIAPI AhciEnableFisReceive ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port,
IN UINT64  Timeout 
)

Enable the FIS running for giving port.

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.
TimeoutThe timeout value of enabling FIS, uses 100ns as a unit.
Return values:
EFI_DEVICE_ERRORThe FIS enable setting fails.
EFI_TIMEOUTThe FIS enable setting is time out.
EFI_SUCCESSThe FIS enable successfully.

Definition at line 403 of file AhciMode.c.

EFI_STATUS EFIAPI AhciIdentify ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN OUT EFI_IDENTIFY_DATA Buffer 
)

Send Buffer cmd to specific device.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
PortThe number of port.
PortMultiplierThe timeout value of stop.
BufferThe data buffer to store IDENTIFY PACKET data.
Return values:
EFI_DEVICE_ERRORThe cmd abort with error occurs.
EFI_TIMEOUTThe operation is time out.
EFI_UNSUPPORTEDThe device is not ready for executing.
EFI_SUCCESSThe cmd executes successfully.

Definition at line 1638 of file AhciMode.c.

EFI_STATUS EFIAPI AhciIdentifyPacket ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN OUT EFI_IDENTIFY_DATA Buffer 
)

Send Buffer cmd to specific device.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
PortThe number of port.
PortMultiplierThe timeout value of stop.
BufferThe data buffer to store IDENTIFY PACKET data.
Return values:
EFI_DEVICE_ERRORThe cmd abort with error occurs.
EFI_TIMEOUTThe operation is time out.
EFI_UNSUPPORTEDThe device is not ready for executing.
EFI_SUCCESSThe cmd executes successfully.

Definition at line 1696 of file AhciMode.c.

EFI_STATUS EFIAPI AhciModeInitialization ( IN ATA_ATAPI_PASS_THRU_INSTANCE Instance)

Initialize ATA host controller at AHCI mode.

The function is designed to initialize ATA host controller.

Parameters:
[in]InstanceA pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.

Definition at line 2137 of file AhciMode.c.

EFI_STATUS EFIAPI AhciNonDataTransfer ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand  OPTIONAL,
IN UINT8  AtapiCommandLength,
IN EFI_ATA_COMMAND_BLOCK AtaCommandBlock,
IN OUT EFI_ATA_STATUS_BLOCK AtaStatusBlock,
IN UINT64  Timeout,
IN ATA_NONBLOCK_TASK Task 
)

Start a non data transfer on specific port.

Parameters:
[in]PciIoThe PCI IO protocol instance.
[in]AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
[in]PortThe number of port.
[in]PortMultiplierThe timeout value of stop.
[in]AtapiCommandThe atapi command will be used for the transfer.
[in]AtapiCommandLengthThe length of the atapi command.
[in]AtaCommandBlockThe EFI_ATA_COMMAND_BLOCK data.
[in,out]AtaStatusBlockThe EFI_ATA_STATUS_BLOCK data.
[in]TimeoutThe timeout value of non data transfer, uses 100ns as a unit.
[in]TaskOptional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode.
Return values:
EFI_DEVICE_ERRORThe non data transfer abort with error occurs.
EFI_TIMEOUTThe operation is time out.
EFI_UNSUPPORTEDThe device is not ready for transfer.
EFI_SUCCESSThe non data transfer executes successfully.

Definition at line 1082 of file AhciMode.c.

VOID EFIAPI AhciOrReg ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset,
IN UINT32  OrData 
)

Do OR operation with the value of AHCI Operation register.

Parameters:
PciIoThe PCI IO protocol instance.
OffsetThe operation register offset.
OrDataThe data used to do OR operation.

Definition at line 118 of file AhciMode.c.

EFI_STATUS EFIAPI AhciPacketCommandExecute ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
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 Protocol.

Parameters:
PciIoThe PCI IO protocol instance.
AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
PortThe number of port.
PortMultiplierThe number of port multiplier.
PacketA pointer to EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET structure.
Return values:
EFI_SUCCESSsend out the ATAPI packet command successfully and device sends data successfully.
EFI_DEVICE_ERRORthe device failed to send data.

Definition at line 1812 of file AhciMode.c.

EFI_STATUS EFIAPI AhciPioTransfer ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_AHCI_REGISTERS AhciRegisters,
IN UINT8  Port,
IN UINT8  PortMultiplier,
IN EFI_AHCI_ATAPI_COMMAND *AtapiCommand  OPTIONAL,
IN UINT8  AtapiCommandLength,
IN BOOLEAN  Read,
IN EFI_ATA_COMMAND_BLOCK AtaCommandBlock,
IN OUT EFI_ATA_STATUS_BLOCK AtaStatusBlock,
IN OUT VOID *  MemoryAddr,
IN UINT32  DataCount,
IN UINT64  Timeout,
IN ATA_NONBLOCK_TASK Task 
)

Start a PIO data transfer on specific port.

Parameters:
[in]PciIoThe PCI IO protocol instance.
[in]AhciRegistersThe pointer to the EFI_AHCI_REGISTERS.
[in]PortThe number of port.
[in]PortMultiplierThe timeout value of stop.
[in]AtapiCommandThe atapi command will be used for the transfer.
[in]AtapiCommandLengthThe length of the atapi command.
[in]ReadThe transfer direction.
[in]AtaCommandBlockThe EFI_ATA_COMMAND_BLOCK data.
[in,out]AtaStatusBlockThe EFI_ATA_STATUS_BLOCK data.
[in,out]MemoryAddrThe pointer to the data buffer.
[in]DataCountThe data count to be transferred.
[in]TimeoutThe timeout value of non data transfer, uses 100ns as a unit.
[in]TaskOptional. Pointer to the ATA_NONBLOCK_TASK used by non-blocking mode.
Return values:
EFI_DEVICE_ERRORThe PIO data transfer abort with error occurs.
EFI_TIMEOUTThe operation is time out.
EFI_UNSUPPORTEDThe device is not ready for transfer.
EFI_SUCCESSThe PIO data transfer executes successfully.

Definition at line 664 of file AhciMode.c.

EFI_STATUS EFIAPI AhciPortReset ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port,
IN UINT64  Timeout 
)

Do AHCI port reset.

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.
TimeoutThe timeout value of reset, uses 100ns as a unit.
Return values:
EFI_DEVICE_ERRORThe port reset unsuccessfully
EFI_TIMEOUTThe reset operation is time out.
EFI_SUCCESSThe port reset successfully.

Definition at line 1329 of file AhciMode.c.

UINT32 EFIAPI AhciReadReg ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset 
)

Read AHCI Operation register.

Parameters:
PciIoThe PCI IO protocol instance.
OffsetThe operation register offset.
Returns:
The register content read.

Definition at line 28 of file AhciMode.c.

EFI_STATUS EFIAPI AhciReset ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT64  Timeout 
)

Do AHCI HBA reset.

Parameters:
PciIoThe PCI IO protocol instance.
TimeoutThe timeout value of reset, uses 100ns as a unit.
Return values:
EFI_DEVICE_ERRORAHCI controller is failed to complete hardware reset.
EFI_TIMEOUTThe reset operation is time out.
EFI_SUCCESSAHCI controller is reset successfully.

Definition at line 1397 of file AhciMode.c.

EFI_STATUS EFIAPI AhciStartCommand ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port,
IN UINT8  CommandSlot,
IN UINT64  Timeout 
)

Start command for give slot on specific port.

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.
CommandSlotThe number of Command Slot.
TimeoutThe timeout value of start, uses 100ns as a unit.
Return values:
EFI_DEVICE_ERRORThe command start unsuccessfully.
EFI_TIMEOUTThe operation is time out.
EFI_SUCCESSThe command start successfully.

Definition at line 1233 of file AhciMode.c.

EFI_STATUS EFIAPI AhciStopCommand ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT8  Port,
IN UINT64  Timeout 
)

Stop command running for giving port

Parameters:
PciIoThe PCI IO protocol instance.
PortThe number of port.
TimeoutThe timeout value of stop, uses 100ns as a unit.
Return values:
EFI_DEVICE_ERRORThe command stop unsuccessfully.
EFI_TIMEOUTThe operation is time out.
EFI_SUCCESSThe command stop successfully.

Definition at line 1189 of file AhciMode.c.

EFI_STATUS EFIAPI AhciWaitMemSet ( IN EFI_PHYSICAL_ADDRESS  Address,
IN UINT32  MaskValue,
IN UINT32  TestValue,
IN UINT64  Timeout 
)

Wait for the value of the specified system memory set to the test value.

Parameters:
AddressThe system memory address to test.
MaskValueThe mask value of memory.
TestValueThe test value of memory.
TimeoutThe time out value for wait memory set, uses 100ns as a unit.
Return values:
EFI_TIMEOUTThe system memory setting is time out.
EFI_SUCCESSThe system memory is correct set.

Definition at line 199 of file AhciMode.c.

EFI_STATUS EFIAPI AhciWaitMmioSet ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINTN  Offset,
IN UINT32  MaskValue,
IN UINT32  TestValue,
IN UINT64  Timeout 
)

Wait for the value of the specified MMIO register set to the test value.

Parameters:
PciIoThe PCI IO protocol instance.
OffsetThe MMIO address to test.
MaskValueThe mask value of memory.
TestValueThe test value of memory.
TimeoutThe time out value for wait memory set, uses 100ns as a unit.
Return values:
EFI_TIMEOUTThe MMIO setting is time out.
EFI_SUCCESSThe MMIO is correct set.

Definition at line 150 of file AhciMode.c.

VOID EFIAPI AhciWriteReg ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset,
IN UINT32  Data 
)

Write AHCI Operation register.

Parameters:
PciIoThe PCI IO protocol instance.
OffsetThe operation register offset.
DataThe data used to write down.

Definition at line 61 of file AhciMode.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines