41#define ATA_TIMEOUT EFI_TIMER_PERIOD_SECONDS (3)
46#define MAX_RETRY_TIMES 3
51#define MAX_28BIT_ADDRESSING_CAPACITY 0xfffffff
56#define MAX_28BIT_TRANSFER_BLOCK_NUM 0x100
69#define MAX_48BIT_TRANSFER_BLOCK_NUM 0xFFFF
74#define MAX_MODEL_NAME_LEN 40
76#define ATA_TASK_SIGNATURE SIGNATURE_32 ('A', 'T', 'S', 'K')
77#define ATA_DEVICE_SIGNATURE SIGNATURE_32 ('A', 'B', 'I', 'D')
78#define ATA_SUB_TASK_SIGNATURE SIGNATURE_32 ('A', 'S', 'T', 'S')
106 UINT16 PortMultiplierPort;
124 CHAR16 ModelName[MAX_MODEL_NAME_LEN + 1];
138 UINTN *UnsignalledEventCount;
153 UINTN NumberOfBlocks;
158#define ATA_DEVICE_FROM_BLOCK_IO(a) CR (a, ATA_DEVICE, BlockIo, ATA_DEVICE_SIGNATURE)
159#define ATA_DEVICE_FROM_BLOCK_IO2(a) CR (a, ATA_DEVICE, BlockIo2, ATA_DEVICE_SIGNATURE)
160#define ATA_DEVICE_FROM_DISK_INFO(a) CR (a, ATA_DEVICE, DiskInfo, ATA_DEVICE_SIGNATURE)
161#define ATA_DEVICE_FROM_STORAGE_SECURITY(a) CR (a, ATA_DEVICE, StorageSecurity, ATA_DEVICE_SIGNATURE)
162#define ATA_ASYN_SUB_TASK_FROM_ENTRY(a) CR (a, ATA_BUS_ASYN_SUB_TASK, TaskEntry, ATA_SUB_TASK_SIGNATURE)
163#define ATA_ASYN_TASK_FROM_ENTRY(a) CR (a, ATA_BUS_ASYN_TASK, TaskEntry, ATA_TASK_SIGNATURE)
275 IN OUT UINT8 *Buffer,
316 IN UINT8 SecurityProtocolId,
317 IN UINT16 SecurityProtocolSpecificData,
319 IN BOOLEAN IsTrustSend,
500 OUT CHAR16 **DriverName
578 OUT CHAR16 **ControllerName
596 IN BOOLEAN ExtendedVerification
689 IN BOOLEAN ExtendedVerification
816 IN OUT VOID *InquiryData,
817 IN OUT UINT32 *InquiryDataSize
842 IN OUT VOID *IdentifyData,
843 IN OUT UINT32 *IdentifyDataSize
867 IN OUT VOID *SenseData,
868 IN OUT UINT32 *SenseDataSize,
869 OUT UINT8 *SenseDataNumber
887 OUT UINT32 *IdeChannel,
888 OUT UINT32 *IdeDevice
971 IN UINT8 SecurityProtocolId,
972 IN UINT16 SecurityProtocolSpecificData,
974 OUT VOID *PayloadBuffer,
1047 IN UINT8 SecurityProtocolId,
1048 IN UINT16 SecurityProtocolSpecificData,
1050 IN VOID *PayloadBuffer
EFI_STATUS ResetAtaDevice(IN ATA_DEVICE *AtaDevice)
EFI_STATUS EFIAPI AtaBlockIoResetEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI AtaDiskInfoSenseData(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *SenseData, IN OUT UINT32 *SenseDataSize, OUT UINT8 *SenseDataNumber)
EFI_STATUS DiscoverAtaDevice(IN OUT ATA_DEVICE *AtaDevice)
EFI_STATUS EFIAPI AtaStorageSecurityReceiveData(IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, OUT VOID *PayloadBuffer, OUT UINTN *PayloadTransferSize)
VOID EFIAPI FreeAtaSubTask(IN OUT ATA_BUS_ASYN_SUB_TASK *Task)
VOID EFIAPI AtaTerminateNonBlockingTask(IN ATA_DEVICE *AtaDevice)
VOID FreeAlignedBuffer(IN VOID *Buffer, IN UINTN BufferSize)
EFI_STATUS EFIAPI AtaBusComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS EFIAPI AtaBusDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI AtaBlockIoWriteBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI AtaBlockIoFlushBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN OUT EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI AtaBlockIoWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI AtaBlockIoReset(IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI AtaDiskInfoInquiry(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *InquiryData, IN OUT UINT32 *InquiryDataSize)
EFI_STATUS EFIAPI AtaBusDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI AtaBusDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI AtaBusComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
EFI_STATUS EFIAPI TrustTransferAtaDevice(IN OUT ATA_DEVICE *AtaDevice, IN OUT VOID *Buffer, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN TransferLength, IN BOOLEAN IsTrustSend, IN UINT64 Timeout, OUT UINTN *TransferLengthOut)
EFI_STATUS EFIAPI AtaBlockIoReadBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI AtaDiskInfoWhichIde(IN EFI_DISK_INFO_PROTOCOL *This, OUT UINT32 *IdeChannel, OUT UINT32 *IdeDevice)
VOID * AllocateAlignedBuffer(IN ATA_DEVICE *AtaDevice, IN UINTN BufferSize)
EFI_STATUS EFIAPI AtaStorageSecuritySendData(IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Timeout, IN UINT8 SecurityProtocolId, IN UINT16 SecurityProtocolSpecificData, IN UINTN PayloadBufferSize, IN VOID *PayloadBuffer)
EFI_STATUS AccessAtaDevice(IN OUT ATA_DEVICE *AtaDevice, IN OUT UINT8 *Buffer, IN EFI_LBA StartLba, IN UINTN NumberOfBlocks, IN BOOLEAN IsWrite, IN OUT EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI AtaBlockIoReadBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
VOID InitiateTPerReset(IN ATA_DEVICE *AtaDevice)
EFI_STATUS EFIAPI AtaDiskInfoIdentify(IN EFI_DISK_INFO_PROTOCOL *This, IN OUT VOID *IdentifyData, IN OUT UINT32 *IdentifyDataSize)
EFI_STATUS EFIAPI AtaBlockIoFlushBlocks(IN EFI_BLOCK_IO_PROTOCOL *This)