Add CAM_ATAIO_DMA ATA command flag to mark DMA protocol commands.

It is not needed for SATA controllers, but required for PATA.
This commit is contained in:
Alexander Motin 2009-12-01 23:01:29 +00:00
parent 5fbe7b2589
commit f3631e8d74
3 changed files with 28 additions and 3 deletions

View File

@ -93,8 +93,8 @@ ata_op_string(struct ata_cmd *cmd)
case 0x39: return ("WRITE_MUL48");
case 0x3a: return ("WRITE_STREAM_DMA48");
case 0x3b: return ("WRITE_STREAM48");
case 0x3d: return ("WRITE_DMA_FUA");
case 0x3e: return ("WRITE_DMA_FUA48");
case 0x3d: return ("WRITE_DMA_FUA48");
case 0x3e: return ("WRITE_DMA_QUEUED_FUA48");
case 0x3f: return ("WRITE_LOG_EXT");
case 0x40: return ("READ_VERIFY");
case 0x42: return ("READ_VERIFY48");
@ -119,7 +119,7 @@ ata_op_string(struct ata_cmd *cmd)
case 0xca: return ("WRITE_DMA");
case 0xcc: return ("WRITE_DMA_QUEUED");
case 0xcd: return ("CFA_WRITE_MULTIPLE_WITHOUT_ERASE");
case 0xce: return ("WRITE_MULTIPLE_FUA48");
case 0xce: return ("WRITE_MUL_FUA48");
case 0xd1: return ("CHECK_MEDIA_CARD_TYPE");
case 0xda: return ("GET_MEDIA_STATUS");
case 0xde: return ("MEDIA_LOCK");
@ -309,6 +309,11 @@ ata_28bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features,
{
bzero(&ataio->cmd, sizeof(ataio->cmd));
ataio->cmd.flags = 0;
if (cmd == ATA_READ_DMA ||
cmd == ATA_READ_DMA_QUEUED ||
cmd == ATA_WRITE_DMA ||
cmd == ATA_WRITE_DMA_QUEUED)
ataio->cmd.flags |= CAM_ATAIO_DMA;
ataio->cmd.command = cmd;
ataio->cmd.features = features;
ataio->cmd.lba_low = lba;
@ -324,6 +329,15 @@ ata_48bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint16_t features,
{
bzero(&ataio->cmd, sizeof(ataio->cmd));
ataio->cmd.flags = CAM_ATAIO_48BIT;
if (cmd == ATA_READ_DMA48 ||
cmd == ATA_READ_DMA_QUEUED48 ||
cmd == ATA_READ_STREAM_DMA48 ||
cmd == ATA_WRITE_DMA48 ||
cmd == ATA_WRITE_DMA_FUA48 ||
cmd == ATA_WRITE_DMA_QUEUED48 ||
cmd == ATA_WRITE_DMA_QUEUED_FUA48 ||
cmd == ATA_WRITE_STREAM_DMA48)
ataio->cmd.flags |= CAM_ATAIO_DMA;
ataio->cmd.command = cmd;
ataio->cmd.features = features;
ataio->cmd.lba_low = lba;

View File

@ -41,6 +41,7 @@ struct ata_cmd {
#define CAM_ATAIO_FPDMA 0x02 /* FPDMA command */
#define CAM_ATAIO_CONTROL 0x04 /* Control, not a command */
#define CAM_ATAIO_NEEDRESULT 0x08 /* Request requires result. */
#define CAM_ATAIO_DMA 0x10 /* DMA command */
u_int8_t command;
u_int8_t features;

View File

@ -291,12 +291,21 @@ struct ata_params {
#define ATA_READ_DMA_QUEUED48 0x26 /* read DMA QUEUED 48bit LBA */
#define ATA_READ_NATIVE_MAX_ADDRESS48 0x27 /* read native max addr 48bit */
#define ATA_READ_MUL48 0x29 /* read multi 48bit LBA */
#define ATA_READ_STREAM_DMA48 0x2a /* read DMA stream 48bit LBA */
#define ATA_READ_STREAM48 0x2b /* read stream 48bit LBA */
#define ATA_WRITE 0x30 /* write */
#define ATA_WRITE48 0x34 /* write 48bit LBA */
#define ATA_WRITE_DMA48 0x35 /* write DMA 48bit LBA */
#define ATA_WRITE_DMA_QUEUED48 0x36 /* write DMA QUEUED 48bit LBA*/
#define ATA_SET_MAX_ADDRESS48 0x37 /* set max address 48bit */
#define ATA_WRITE_MUL48 0x39 /* write multi 48bit LBA */
#define ATA_WRITE_STREAM_DMA48 0x3a
#define ATA_WRITE_STREAM48 0x3b
#define ATA_WRITE_DMA_FUA48 0x3d
#define ATA_WRITE_DMA_QUEUED_FUA48 0x3e
#define ATA_WRITE_LOG_EXT 0x3f
#define ATA_READ_VERIFY 0x40
#define ATA_READ_VERIFY48 0x42
#define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */
#define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */
#define ATA_SEEK 0x70 /* seek */
@ -312,6 +321,7 @@ struct ata_params {
#define ATA_READ_DMA 0xc8 /* read DMA */
#define ATA_WRITE_DMA 0xca /* write DMA */
#define ATA_WRITE_DMA_QUEUED 0xcc /* write DMA QUEUED */
#define ATA_WRITE_MUL_FUA48 0xce
#define ATA_STANDBY_IMMEDIATE 0xe0 /* standby immediate */
#define ATA_IDLE_IMMEDIATE 0xe1 /* idle immediate */
#define ATA_STANDBY_CMD 0xe2 /* standby */