diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 062abc0b8c0d..91c28b46f286 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -2578,10 +2578,10 @@ ahci_setup_fis(struct ahci_channel *ch, struct ahci_cmd_tab *ctp, union ccb *ccb fis[9] = ccb->ataio.cmd.lba_mid_exp; fis[10] = ccb->ataio.cmd.lba_high_exp; fis[11] = ccb->ataio.cmd.features_exp; + fis[12] = ccb->ataio.cmd.sector_count; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - fis[12] = tag << 3; - } else { - fis[12] = ccb->ataio.cmd.sector_count; + fis[12] &= 0xf8; + fis[12] |= tag << 3; } fis[13] = ccb->ataio.cmd.sector_count_exp; fis[15] = ATA_A_4BIT; diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c index f6d2ef240c2b..e018aba5bdea 100644 --- a/sys/dev/mvs/mvs.c +++ b/sys/dev/mvs/mvs.c @@ -1493,7 +1493,8 @@ mvs_execute_transaction(struct mvs_slot *slot) crqb->cmd[i++] = ccb->ataio.cmd.features; crqb->cmd[i++] = 0x11; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - crqb->cmd[i++] = slot->tag << 3; + crqb->cmd[i++] = (slot->tag << 3) | + (ccb->ataio.cmd.sector_count & 0x07); crqb->cmd[i++] = 0x12; } else { crqb->cmd[i++] = ccb->ataio.cmd.sector_count_exp; diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c index bf3448068731..f853412b5b24 100644 --- a/sys/dev/siis/siis.c +++ b/sys/dev/siis/siis.c @@ -1723,13 +1723,12 @@ siis_setup_fis(device_t dev, struct siis_cmd *ctp, union ccb *ccb, int tag) fis[9] = ccb->ataio.cmd.lba_mid_exp; fis[10] = ccb->ataio.cmd.lba_high_exp; fis[11] = ccb->ataio.cmd.features_exp; + fis[12] = ccb->ataio.cmd.sector_count; if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) { - fis[12] = tag << 3; - fis[13] = 0; - } else { - fis[12] = ccb->ataio.cmd.sector_count; - fis[13] = ccb->ataio.cmd.sector_count_exp; + fis[12] &= 0xf8; + fis[12] |= tag << 3; } + fis[13] = ccb->ataio.cmd.sector_count_exp; fis[15] = ATA_A_4BIT; if (ccb->ataio.ata_flags & ATA_FLAG_AUX) { fis[16] = ccb->ataio.aux & 0xff;