TianoCore EDK2 master
|
#include <PiPei.h>
#include <Ppi/BlockIo.h>
#include <Ppi/BlockIo2.h>
#include <Ppi/AtaController.h>
#include <Library/DebugLib.h>
#include <Library/TimerLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/IoLib.h>
#include <Library/PeiServicesTablePointerLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <IndustryStandard/Atapi.h>
Go to the source code of this file.
Data Structures | |
union | IDE_CMD_OR_STATUS |
union | IDE_ERROR_OR_FEATURE |
union | IDE_ALTSTATUS_OR_DEVICECONTROL |
struct | IDE_BASE_REGISTERS |
struct | PEI_ATAPI_DEVICE_INFO |
struct | ATAPI_BLK_IO_DEV |
Macros | |
#define | MAX_SENSE_KEY_COUNT 6 |
#define | MAX_IDE_CHANNELS 4 |
#define | MAX_IDE_DEVICES 8 |
#define | ATAPI_BLK_IO_DEV_SIGNATURE SIGNATURE_32 ('a', 'b', 'i', 'o') |
#define | PEI_RECOVERY_ATAPI_FROM_BLKIO_THIS(a) CR (a, ATAPI_BLK_IO_DEV, AtapiBlkIo, ATAPI_BLK_IO_DEV_SIGNATURE) |
#define | PEI_RECOVERY_ATAPI_FROM_BLKIO2_THIS(a) CR (a, ATAPI_BLK_IO_DEV, AtapiBlkIo2, ATAPI_BLK_IO_DEV_SIGNATURE) |
#define | STALL_1_MILLI_SECOND 1000 |
#define | STALL_1_SECONDS 1000 * STALL_1_MILLI_SECOND |
#define | ATATIMEOUT 1000 |
#define | ATAPITIMEOUT 1000 |
#define | CDROMLONGTIMEOUT 2000 |
#define | ATAPILONGTIMEOUT 5000 |
Private Include file for IdeBus PEIM.
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AtapiPeim.h.
#define ATAPI_BLK_IO_DEV_SIGNATURE SIGNATURE_32 ('a', 'b', 'i', 'o') |
Definition at line 88 of file AtapiPeim.h.
#define ATAPILONGTIMEOUT 5000 |
Definition at line 123 of file AtapiPeim.h.
#define ATAPITIMEOUT 1000 |
Definition at line 118 of file AtapiPeim.h.
#define ATATIMEOUT 1000 |
Definition at line 114 of file AtapiPeim.h.
#define CDROMLONGTIMEOUT 2000 |
Definition at line 122 of file AtapiPeim.h.
#define MAX_IDE_CHANNELS 4 |
Definition at line 32 of file AtapiPeim.h.
#define MAX_IDE_DEVICES 8 |
Definition at line 33 of file AtapiPeim.h.
#define MAX_SENSE_KEY_COUNT 6 |
Definition at line 31 of file AtapiPeim.h.
#define PEI_RECOVERY_ATAPI_FROM_BLKIO2_THIS | ( | a | ) | CR (a, ATAPI_BLK_IO_DEV, AtapiBlkIo2, ATAPI_BLK_IO_DEV_SIGNATURE) |
Definition at line 104 of file AtapiPeim.h.
#define PEI_RECOVERY_ATAPI_FROM_BLKIO_THIS | ( | a | ) | CR (a, ATAPI_BLK_IO_DEV, AtapiBlkIo, ATAPI_BLK_IO_DEV_SIGNATURE) |
Definition at line 103 of file AtapiPeim.h.
#define STALL_1_MILLI_SECOND 1000 |
Definition at line 106 of file AtapiPeim.h.
#define STALL_1_SECONDS 1000 * STALL_1_MILLI_SECOND |
Definition at line 107 of file AtapiPeim.h.
enum EFI_IDE_CHANNEL |
Definition at line 35 of file AtapiPeim.h.
enum EFI_IDE_DEVICE |
Definition at line 41 of file AtapiPeim.h.
VOID AtapiEnumerateDevices | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev | ) |
Enumerate Atapi devices.
This function is used to enumerate Atatpi device in Ide channel.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device |
Definition at line 515 of file AtapiPeim.c.
EFI_STATUS EFIAPI AtapiGetBlockDeviceMediaInfo | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_RECOVERY_BLOCK_IO_PPI * | This, | ||
IN UINTN | DeviceIndex, | ||
OUT EFI_PEI_BLOCK_IO_MEDIA * | MediaInfo | ||
) |
Gets a block device's media information.
This function will provide the caller with the specified block device's media information. If the media changes, calling this function will update the media information accordingly.
[in] | PeiServices | General-purpose services that are available to every PEIM |
[in] | This | Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance. |
[in] | DeviceIndex | Specifies the block device to which the function wants to talk. Because the driver that implements Block I/O PPIs will manage multiple block devices, the PPIs that want to talk to a single device must specify the device index that was assigned during the enumeration process. This index is a number from one to NumberBlockDevices. |
[out] | MediaInfo | The media information of the specified block media. The caller is responsible for the ownership of this data structure. |
EFI_SUCCESS | Media information about the specified block device was obtained successfully. |
EFI_DEVICE_ERROR | Cannot get the media information due to a hardware error. |
Others | Other failure occurs. |
Definition at line 158 of file AtapiPeim.c.
EFI_STATUS EFIAPI AtapiGetBlockDeviceMediaInfo2 | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI * | This, | ||
IN UINTN | DeviceIndex, | ||
OUT EFI_PEI_BLOCK_IO2_MEDIA * | MediaInfo | ||
) |
Gets a block device's media information.
This function will provide the caller with the specified block device's media information. If the media changes, calling this function will update the media information accordingly.
[in] | PeiServices | General-purpose services that are available to every PEIM |
[in] | This | Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI instance. |
[in] | DeviceIndex | Specifies the block device to which the function wants to talk. Because the driver that implements Block I/O PPIs will manage multiple block devices, the PPIs that want to talk to a single device must specify the device index that was assigned during the enumeration process. This index is a number from one to NumberBlockDevices. |
[out] | MediaInfo | The media information of the specified block media. The caller is responsible for the ownership of this data structure. |
EFI_SUCCESS | Media information about the specified block device was obtained successfully. |
EFI_DEVICE_ERROR | Cannot get the media information due to a hardware error. |
Others | Other failure occurs. |
Definition at line 401 of file AtapiPeim.c.
EFI_STATUS EFIAPI AtapiGetNumberOfBlockDevices | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_RECOVERY_BLOCK_IO_PPI * | This, | ||
OUT UINTN * | NumberBlockDevices | ||
) |
Gets the count of block I/O devices that one specific block driver detects.
This function is used for getting the count of block I/O devices that one specific block driver detects. To the PEI ATAPI driver, it returns the number of all the detected ATAPI devices it detects during the enumeration process. To the PEI legacy floppy driver, it returns the number of all the legacy devices it finds during its enumeration process. If no device is detected, then the function will return zero.
[in] | PeiServices | General-purpose services that are available to every PEIM. |
[in] | This | Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance. |
[out] | NumberBlockDevices | The number of block I/O devices discovered. |
EFI_SUCCESS | Operation performed successfully. |
Definition at line 111 of file AtapiPeim.c.
EFI_STATUS EFIAPI AtapiGetNumberOfBlockDevices2 | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI * | This, | ||
OUT UINTN * | NumberBlockDevices | ||
) |
Gets the count of block I/O devices that one specific block driver detects.
This function is used for getting the count of block I/O devices that one specific block driver detects. To the PEI ATAPI driver, it returns the number of all the detected ATAPI devices it detects during the enumeration process. To the PEI legacy floppy driver, it returns the number of all the legacy devices it finds during its enumeration process. If no device is detected, then the function will return zero.
[in] | PeiServices | General-purpose services that are available to every PEIM. |
[in] | This | Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI instance. |
[out] | NumberBlockDevices | The number of block I/O devices discovered. |
EFI_SUCCESS | Operation performed successfully. |
Definition at line 351 of file AtapiPeim.c.
EFI_STATUS ATAPIIdentify | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition | ||
) |
Idendify Atapi devices.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
EFI_SUCCESS | Identify successfully. |
EFI_DEVICE_ERROR | Device cannot be identified successfully. |
Definition at line 1211 of file AtapiPeim.c.
EFI_STATUS AtapiPacketCommandIn | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
IN ATAPI_PACKET_COMMAND * | Packet, | ||
IN UINT16 * | Buffer, | ||
IN UINT32 | ByteCount, | ||
IN UINTN | TimeoutInMilliSeconds | ||
) |
Send out ATAPI commands conforms to the Packet Command with PIO Data In Protocol.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[in] | Packet | A pointer to ATAPI command packet. |
[in] | Buffer | Buffer to contain requested transfer data from device. |
[in] | ByteCount | Requested transfer data length. |
[in] | TimeoutInMilliSeconds | Time out value, in unit of milliseconds. |
EFI_SUCCESS | Command executed successfully. |
EFI_DEVICE_ERROR | Device cannot be executed command successfully. |
Definition at line 1415 of file AtapiPeim.c.
EFI_STATUS EFIAPI AtapiReadBlocks | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_RECOVERY_BLOCK_IO_PPI * | This, | ||
IN UINTN | DeviceIndex, | ||
IN EFI_PEI_LBA | StartLBA, | ||
IN UINTN | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Reads the requested number of blocks from the specified block device.
The function reads the requested number of blocks from the device. All the blocks are read, or an error is returned. If there is no media in the device, the function returns EFI_NO_MEDIA.
[in] | PeiServices | General-purpose services that are available to every PEIM. |
[in] | This | Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance. |
[in] | DeviceIndex | Specifies the block device to which the function wants to talk. Because the driver that implements Block I/O PPIs will manage multiple block devices, the PPIs that want to talk to a single device must specify the device index that was assigned during the enumeration process. This index is a number from one to NumberBlockDevices. |
[in] | StartLBA | The starting logical block address (LBA) to read from on the device |
[in] | BufferSize | The size of the Buffer in bytes. This number must be a multiple of the intrinsic block size of the device. |
[out] | Buffer | A pointer to the destination buffer for the data. The caller is responsible for the ownership of the buffer. |
EFI_SUCCESS | The data was read correctly from the device. |
EFI_DEVICE_ERROR | The device reported an error while attempting to perform the read operation. |
EFI_INVALID_PARAMETER | The read request contains LBAs that are not valid, or the buffer is not properly aligned. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_BAD_BUFFER_SIZE | The BufferSize parameter is not a multiple of the intrinsic block size of the device. |
Definition at line 258 of file AtapiPeim.c.
EFI_STATUS EFIAPI AtapiReadBlocks2 | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI * | This, | ||
IN UINTN | DeviceIndex, | ||
IN EFI_PEI_LBA | StartLBA, | ||
IN UINTN | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Reads the requested number of blocks from the specified block device.
The function reads the requested number of blocks from the device. All the blocks are read, or an error is returned. If there is no media in the device, the function returns EFI_NO_MEDIA.
[in] | PeiServices | General-purpose services that are available to every PEIM. |
[in] | This | Indicates the EFI_PEI_RECOVERY_BLOCK_IO2_PPI instance. |
[in] | DeviceIndex | Specifies the block device to which the function wants to talk. Because the driver that implements Block I/O PPIs will manage multiple block devices, the PPIs that want to talk to a single device must specify the device index that was assigned during the enumeration process. This index is a number from one to NumberBlockDevices. |
[in] | StartLBA | The starting logical block address (LBA) to read from on the device |
[in] | BufferSize | The size of the Buffer in bytes. This number must be a multiple of the intrinsic block size of the device. |
[out] | Buffer | A pointer to the destination buffer for the data. The caller is responsible for the ownership of the buffer. |
EFI_SUCCESS | The data was read correctly from the device. |
EFI_DEVICE_ERROR | The device reported an error while attempting to perform the read operation. |
EFI_INVALID_PARAMETER | The read request contains LBAs that are not valid, or the buffer is not properly aligned. |
EFI_NO_MEDIA | There is no media in the device. |
EFI_BAD_BUFFER_SIZE | The BufferSize parameter is not a multiple of the intrinsic block size of the device. |
Definition at line 474 of file AtapiPeim.c.
EFI_STATUS CheckErrorStatus | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINT16 | StatusReg | ||
) |
Check if there is an error in Status Register.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | StatusReg | The address to IDE IO registers. |
EFI_SUCCESS | Operation success. |
EFI_DEVICE_ERROR | Device error. |
Definition at line 1184 of file AtapiPeim.c.
BOOLEAN DetectIDEController | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition | ||
) |
Detect if an IDE controller exists in specified position.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
TRUE | The Atapi device exists. |
FALSE | The Atapi device does not present. |
Definition at line 806 of file AtapiPeim.c.
EFI_STATUS DetectMedia | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
IN OUT EFI_PEI_BLOCK_IO_MEDIA * | MediaInfo, | ||
IN OUT EFI_PEI_BLOCK_IO2_MEDIA * | MediaInfo2 | ||
) |
Used before read/write blocks from/to ATAPI device media. Since ATAPI device media is removable, it is necessary to detect whether media is present and get current present media's information.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[in,out] | MediaInfo | The media information of the specified block media. |
[in,out] | MediaInfo2 | The media information 2 of the specified block media. |
EFI_SUCCESS | Command executed successfully. |
EFI_DEVICE_ERROR | Some device errors happen. |
EFI_OUT_OF_RESOURCES | Can not allocate required resources. |
Definition at line 1720 of file AtapiPeim.c.
BOOLEAN DiscoverAtapiDevice | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
OUT EFI_PEI_BLOCK_IO_MEDIA * | MediaInfo, | ||
OUT EFI_PEI_BLOCK_IO2_MEDIA * | MediaInfo2 | ||
) |
Detect Atapi devices.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[out] | MediaInfo | The media information of the specified block media. |
[out] | MediaInfo2 | The media information 2 of the specified block media. |
TRUE | Atapi device exists in specified position. |
FALSE | Atapi device does not exist in specified position. |
Definition at line 635 of file AtapiPeim.c.
EFI_STATUS DRDYReady | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN IDE_BASE_REGISTERS * | IdeIoRegisters, | ||
IN UINTN | TimeoutInMilliSeconds | ||
) |
Wait specified time interval to poll for DRDY bit set in the Status register.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | IdeIoRegisters | A pointer to IDE IO registers. |
[in] | TimeoutInMilliSeconds | Time specified in milliseconds. |
EFI_SUCCESS | DRDY bit is set in the specified time interval. |
EFI_TIMEOUT | DRDY bit is not set in the specified time interval. |
Definition at line 895 of file AtapiPeim.c.
EFI_STATUS DRQClear | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN IDE_BASE_REGISTERS * | IdeIoRegisters, | ||
IN UINTN | TimeoutInMilliSeconds | ||
) |
Wait specified time interval to poll for DRQ bit clear in the Status Register.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | IdeIoRegisters | A pointer to IDE IO registers. |
[in] | TimeoutInMilliSeconds | Time specified in milliseconds. |
EFI_SUCCESS | DRQ bit is cleared in the specified time interval. |
EFI_TIMEOUT | DRQ bit is not cleared in the specified time interval. |
Definition at line 951 of file AtapiPeim.c.
EFI_STATUS DRQClear2 | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN IDE_BASE_REGISTERS * | IdeIoRegisters, | ||
IN UINTN | TimeoutInMilliSeconds | ||
) |
Wait specified time interval to poll for DRQ bit clear in the Alternate Status Register.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | IdeIoRegisters | A pointer to IDE IO registers. |
[in] | TimeoutInMilliSeconds | Time specified in milliseconds. |
EFI_SUCCESS | DRQ bit is cleared in the specified time interval. |
EFI_TIMEOUT | DRQ bit is not cleared in the specified time interval. |
Definition at line 1008 of file AtapiPeim.c.
EFI_STATUS DRQReady | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN IDE_BASE_REGISTERS * | IdeIoRegisters, | ||
IN UINTN | TimeoutInMilliSeconds | ||
) |
Wait specified time interval to poll for DRQ bit set in the Status Register.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | IdeIoRegisters | A pointer to IDE IO registers. |
[in] | TimeoutInMilliSeconds | Time specified in milliseconds. |
EFI_SUCCESS | DRQ bit is set in the specified time interval. |
EFI_TIMEOUT | DRQ bit is not set in the specified time interval. |
EFI_ABORTED | Operation Aborted. |
Definition at line 1066 of file AtapiPeim.c.
EFI_STATUS DRQReady2 | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN IDE_BASE_REGISTERS * | IdeIoRegisters, | ||
IN UINTN | TimeoutInMilliSeconds | ||
) |
Wait specified time interval to poll for DRQ bit set in the Alternate Status Register.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | IdeIoRegisters | A pointer to IDE IO registers. |
[in] | TimeoutInMilliSeconds | Time specified in milliseconds. |
EFI_SUCCESS | DRQ bit is set in the specified time interval. |
EFI_TIMEOUT | DRQ bit is not set in the specified time interval. |
EFI_ABORTED | Operation Aborted. |
Definition at line 1128 of file AtapiPeim.c.
EFI_STATUS Inquiry | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
OUT EFI_PEI_BLOCK_IO_MEDIA * | MediaInfo, | ||
OUT EFI_PEI_BLOCK_IO2_MEDIA * | MediaInfo2 | ||
) |
Sends out ATAPI Inquiry Packet Command to the specified device. This command will return INQUIRY data of the device.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[out] | MediaInfo | The media information of the specified block media. |
[out] | MediaInfo2 | The media information 2 of the specified block media. |
EFI_SUCCESS | Command executed successfully. |
EFI_DEVICE_ERROR | Device cannot be executed command successfully. |
EFI_UNSUPPORTED | Unsupported device type. |
Definition at line 1623 of file AtapiPeim.c.
BOOLEAN IsDeviceStateUnclear | ( | IN ATAPI_REQUEST_SENSE_DATA * | SenseData, |
IN UINTN | SenseCounts | ||
) |
Check if device state is unclear according to sense data.
[in] | SenseData | Pointer to sense data. |
[in] | SenseCounts | Count of sense data. |
TRUE | Device state is unclear |
FALSE | Device state is clear |
Definition at line 2315 of file AtapiPeim.c.
BOOLEAN IsDriveReady | ( | IN ATAPI_REQUEST_SENSE_DATA * | SenseData, |
IN UINTN | SenseCounts, | ||
OUT BOOLEAN * | NeedRetry | ||
) |
Check if drive is ready according to sense data.
[in] | SenseData | Pointer to sense data. |
[in] | SenseCounts | Count of sense data. |
[out] | NeedRetry | Indicate if retry is needed. |
TRUE | Drive ready |
FALSE | Drive not ready |
Definition at line 2428 of file AtapiPeim.c.
BOOLEAN IsMediaError | ( | IN ATAPI_REQUEST_SENSE_DATA * | SenseData, |
IN UINTN | SenseCounts | ||
) |
Check if there is media error according to sense data.
[in] | SenseData | Pointer to sense data. |
[in] | SenseCounts | Count of sense data. |
TRUE | Media error |
FALSE | No media error |
Check if there is media error according to sense data.
SenseData | Pointer to sense data. |
SenseCounts | Count of sense data. |
TRUE | Media error |
FALSE | No media error |
Definition at line 2355 of file AtapiPeim.c.
BOOLEAN IsNoMedia | ( | IN ATAPI_REQUEST_SENSE_DATA * | SenseData, |
IN UINTN | SenseCounts | ||
) |
Check if there is media according to sense data.
[in] | SenseData | Pointer to sense data. |
[in] | SenseCounts | Count of sense data. |
TRUE | No media |
FALSE | Media exists |
Check if there is media according to sense data.
SenseData | Pointer to sense data. |
SenseCounts | Count of sense data. |
TRUE | No media |
FALSE | Media exists |
Definition at line 2280 of file AtapiPeim.c.
EFI_STATUS ReadCapacity | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
IN OUT EFI_PEI_BLOCK_IO_MEDIA * | MediaInfo, | ||
IN OUT EFI_PEI_BLOCK_IO2_MEDIA * | MediaInfo2 | ||
) |
Sends out ATAPI Read Capacity Packet Command to the specified device. This command will return the information regarding the capacity of the media in the device.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[in,out] | MediaInfo | The media information of the specified block media. |
[in,out] | MediaInfo2 | The media information 2 of the specified block media. |
EFI_SUCCESS | Command executed successfully. |
EFI_DEVICE_ERROR | Some device errors happen. |
Definition at line 2076 of file AtapiPeim.c.
EFI_STATUS ReadSectors | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
IN VOID * | Buffer, | ||
IN EFI_PEI_LBA | StartLba, | ||
IN UINTN | NumberOfBlocks, | ||
IN UINTN | BlockSize | ||
) |
Perform read from disk in block unit.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[in] | Buffer | Buffer to contain read data. |
[in] | StartLba | Starting LBA address. |
[in] | NumberOfBlocks | Number of blocks to read. |
[in] | BlockSize | Size of each block. |
EFI_SUCCESS | Command executed successfully. |
EFI_DEVICE_ERROR | Some device errors happen. |
Definition at line 2182 of file AtapiPeim.c.
EFI_STATUS RequestSense | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
IN ATAPI_REQUEST_SENSE_DATA * | SenseBuffers, | ||
IN OUT UINT8 * | SenseCounts | ||
) |
Sends out ATAPI Request Sense Packet Command to the specified device.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[in] | SenseBuffers | Pointer to sense buffer. |
[in,out] | SenseCounts | Length of sense buffer. |
EFI_SUCCESS | Command executed successfully. |
EFI_DEVICE_ERROR | Some device errors happen. |
Definition at line 1979 of file AtapiPeim.c.
EFI_STATUS ResetDevice | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition, | ||
IN BOOLEAN | Extensive | ||
) |
Reset specified Atapi device.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
[in] | Extensive | If TRUE, use ATA soft reset, otherwise use Atapi soft reset. |
EFI_SUCCESS | Command executed successfully. |
EFI_DEVICE_ERROR | Some device errors happen. |
Definition at line 1882 of file AtapiPeim.c.
EFI_STATUS TestUnitReady | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN UINTN | DevicePosition | ||
) |
Sends out ATAPI Test Unit Ready Packet Command to the specified device to find out whether device is accessible.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | DevicePosition | An integer to signify device position. |
EFI_SUCCESS | TestUnit command executed successfully. |
EFI_DEVICE_ERROR | Device cannot be executed TestUnit command successfully. |
Definition at line 1379 of file AtapiPeim.c.
EFI_STATUS WaitForBSYClear | ( | IN ATAPI_BLK_IO_DEV * | AtapiBlkIoDev, |
IN IDE_BASE_REGISTERS * | IdeIoRegisters, | ||
IN UINTN | TimeoutInMilliSeconds | ||
) |
Wait specified time interval to poll for BSY bit clear in the Status Register.
[in] | AtapiBlkIoDev | A pointer to atapi block IO device. |
[in] | IdeIoRegisters | A pointer to IDE IO registers. |
[in] | TimeoutInMilliSeconds | Time specified in milliseconds. |
EFI_SUCCESS | BSY bit is cleared in the specified time interval. |
EFI_TIMEOUT | BSY bit is not cleared in the specified time interval. |
Definition at line 850 of file AtapiPeim.c.