atapipassthru.h
来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C头文件 代码 · 共 1,065 行 · 第 1/2 页
H
1,065 行
Packet - The pointer of EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
SubmitBlockingIoCommand (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT32 Target,
EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
)
/*++
Routine Description:
Performs blocking I/O request.
Arguments:
AtapiScsiPrivate: Private data structure for the specified channel.
Target: The Target ID of the ATAPI device to send the SCSI
Request Packet. To ATAPI devices attached on an IDE
Channel, Target ID 0 indicates Master device;Target
ID 1 indicates Slave device.
Packet: The SCSI Request Packet to send to the ATAPI device
specified by Target.
Returns: EFI_STATUS
--*/
;
BOOLEAN
IsCommandValid (
EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
)
/*++
Routine Description:
Checks the requested SCSI command:
Is it supported by this driver?
Is the Data transfer direction reasonable?
Arguments:
Packet - The pointer of EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
RequestSenseCommand (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT32 Target,
UINT64 Timeout,
VOID *SenseData,
UINT8 *SenseDataLength
)
/*++
Routine Description:
Sumbit request sense command
Arguments:
AtapiScsiPrivate - The pionter of ATAPI_SCSI_PASS_THRU_DEV
Target - The target ID
Timeout - The time to complete the command
SenseData - The buffer to fill in sense data
SenseDataLength - The length of buffer
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
AtapiPacketCommand (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT32 Target,
UINT8 *PacketCommand,
VOID *Buffer,
UINT32 *ByteCount,
DATA_DIRECTION Direction,
UINT64 TimeOutInMicroSeconds
)
/*++
Routine Description:
Submits ATAPI command packet to the specified ATAPI device.
Arguments:
AtapiScsiPrivate: Private data structure for the specified channel.
Target: The Target ID of the ATAPI device to send the SCSI
Request Packet. To ATAPI devices attached on an IDE
Channel, Target ID 0 indicates Master device;Target
ID 1 indicates Slave device.
PacketCommand: Points to the ATAPI command packet.
Buffer: Points to the transferred data.
ByteCount: When input,indicates the buffer size; when output,
indicates the actually transferred data size.
Direction: Indicates the data transfer direction.
TimeoutInMicroSeconds:
The timeout, in micro second units, to use for the
execution of this ATAPI command.
A TimeoutInMicroSeconds value of 0 means that
this function will wait indefinitely for the ATAPI
command to execute.
If TimeoutInMicroSeconds is greater than zero, then
this function will return EFI_TIMEOUT if the time
required to execute the ATAPI command is greater
than TimeoutInMicroSeconds.
Returns:
EFI_STATUS
--*/
;
STATIC
UINT8
ReadPortB (
IN EFI_PCI_IO_PROTOCOL *PciIo,
IN UINT16 Port
)
/*++
Routine Description:
Read one byte from a specified I/O port.
Arguments:
PciIo - The pointer of EFI_PCI_IO_PROTOCOL
Port - IO port
Returns:
A byte read out
--*/
;
STATIC
UINT16
ReadPortW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
IN UINT16 Port
)
/*++
Routine Description:
Read one word from a specified I/O port.
Arguments:
PciIo - The pointer of EFI_PCI_IO_PROTOCOL
Port - IO port
Returns:
A word read out
--*/
;
STATIC
VOID
WritePortB (
IN EFI_PCI_IO_PROTOCOL *PciIo,
IN UINT16 Port,
IN UINT8 Data
)
/*++
Routine Description:
Write one byte to a specified I/O port.
Arguments:
PciIo - The pointer of EFI_PCI_IO_PROTOCOL
Port - IO port
Data - The data to write
Returns:
NONE
--*/
;
STATIC
VOID
WritePortW (
IN EFI_PCI_IO_PROTOCOL *PciIo,
IN UINT16 Port,
IN UINT16 Data
)
/*++
Routine Description:
Write one word to a specified I/O port.
Arguments:
PciIo - The pointer of EFI_PCI_IO_PROTOCOL
Port - IO port
Data - The data to write
Returns:
NONE
--*/
;
EFI_STATUS
StatusDRQClear (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeOutInMicroSeconds
)
/*++
Routine Description:
Check whether DRQ is clear in the Status Register. (BSY must also be cleared)
If TimeoutInMicroSeconds is zero, this routine should wait infinitely for
DRQ clear. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
AltStatusDRQClear (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeOutInMicroSeconds
)
/*++
Routine Description:
Check whether DRQ is clear in the Alternate Status Register.
(BSY must also be cleared).If TimeoutInMicroSeconds is zero, this routine should
wait infinitely for DRQ clear. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
StatusDRQReady (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeOutInMicroSeconds
)
/*++
Routine Description:
Check whether DRQ is ready in the Status Register. (BSY must also be cleared)
If TimeoutInMicroSeconds is zero, this routine should wait infinitely for
DRQ ready. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
AltStatusDRQReady (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeOutInMicroSeconds
)
/*++
Routine Description:
Check whether DRQ is ready in the Alternate Status Register.
(BSY must also be cleared)
If TimeoutInMicroSeconds is zero, this routine should wait infinitely for
DRQ ready. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
StatusWaitForBSYClear (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeoutInMicroSeconds
)
/*++
Routine Description:
Check whether BSY is clear in the Status Register.
If TimeoutInMicroSeconds is zero, this routine should wait infinitely for
BSY clear. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
AltStatusWaitForBSYClear (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeoutInMicroSeconds
)
/*++
Routine Description:
Check whether BSY is clear in the Alternate Status Register.
If TimeoutInMicroSeconds is zero, this routine should wait infinitely for
BSY clear. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
StatusDRDYReady (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeoutInMicroSeconds
)
/*++
Routine Description:
Check whether DRDY is ready in the Status Register.
(BSY must also be cleared)
If TimeoutInMicroSeconds is zero, this routine should wait infinitely for
DRDY ready. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
AltStatusDRDYReady (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT64 TimeoutInMicroSeconds
)
/*++
Routine Description:
Check whether DRDY is ready in the Alternate Status Register.
(BSY must also be cleared)
If TimeoutInMicroSeconds is zero, this routine should wait infinitely for
DRDY ready. Otherwise, it will return EFI_TIMEOUT when specified time is
elapsed.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
TimeoutInMicroSeconds - The time to wait for
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
AtapiPassThruPioReadWriteData (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate,
UINT16 *Buffer,
UINT32 *ByteCount,
DATA_DIRECTION Direction,
UINT64 TimeOutInMicroSeconds
)
/*++
Routine Description:
Performs data transfer between ATAPI device and host after the
ATAPI command packet is sent.
Arguments:
AtapiScsiPrivate: Private data structure for the specified channel.
Buffer: Points to the transferred data.
ByteCount: When input,indicates the buffer size; when output,
indicates the actually transferred data size.
Direction: Indicates the data transfer direction.
TimeoutInMicroSeconds:
The timeout, in micro second units, to use for the
execution of this ATAPI command.
A TimeoutInMicroSeconds value of 0 means that
this function will wait indefinitely for the ATAPI
command to execute.
If TimeoutInMicroSeconds is greater than zero, then
this function will return EFI_TIMEOUT if the time
required to execute the ATAPI command is greater
than TimeoutInMicroSeconds.
Returns:
EFI_STATUS
--*/
;
EFI_STATUS
AtapiPassThruCheckErrorStatus (
ATAPI_SCSI_PASS_THRU_DEV *AtapiScsiPrivate
)
/*++
Routine Description:
Check Error Register for Error Information.
Arguments:
AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV
Returns:
EFI_STATUS
--*/
;
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
STATIC
EFI_STATUS
PacketSwitch (
IN EFI_SCSI_IO_SCSI_REQUEST_PACKET *Packet,
IN OUT EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *CommandPacket
)
/*++
Routine Description:
Transfer EFI_SCSI_IO_SCSI_REQUEST_PACKET packet to
EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET packet
Arguments:
Packet - The pointer of EFI_SCSI_IO_SCSI_REQUEST_PACKET
CommandPacket - The pointer of EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
Returns:
NONE
--*/
;
#endif
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?