diff options
author | Tejun Heo <htejun@gmail.com> | 2007-11-27 05:28:53 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-01-23 05:24:10 -0500 |
commit | 405e66b38797875e80669eaf72d313dbb76533c3 (patch) | |
tree | a069f0bb4ae1e81a58bc8f8965a2443d25186f0d /drivers/ata/sata_sil.c | |
parent | f20ded38aa54b92dd0af32578b8916d0aa2d9e05 (diff) |
libata: implement protocol tests
Implement protocol tests - ata_is_atapi(), ata_is_nodata(),
ata_is_pio(), ata_is_dma(), ata_is_ncq() and ata_is_data() and use
them to replace is_atapi_taskfile() and hard coded protocol tests.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/sata_sil.c')
-rw-r--r-- | drivers/ata/sata_sil.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index f5119bf40c24..0b8191b52f97 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -416,15 +416,14 @@ static void sil_host_intr(struct ata_port *ap, u32 bmdma2) | |||
416 | */ | 416 | */ |
417 | 417 | ||
418 | /* Check the ATA_DFLAG_CDB_INTR flag is enough here. | 418 | /* Check the ATA_DFLAG_CDB_INTR flag is enough here. |
419 | * The flag was turned on only for atapi devices. | 419 | * The flag was turned on only for atapi devices. No |
420 | * No need to check is_atapi_taskfile(&qc->tf) again. | 420 | * need to check ata_is_atapi(qc->tf.protocol) again. |
421 | */ | 421 | */ |
422 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) | 422 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) |
423 | goto err_hsm; | 423 | goto err_hsm; |
424 | break; | 424 | break; |
425 | case HSM_ST_LAST: | 425 | case HSM_ST_LAST: |
426 | if (qc->tf.protocol == ATA_PROT_DMA || | 426 | if (ata_is_dma(qc->tf.protocol)) { |
427 | qc->tf.protocol == ATA_PROT_ATAPI_DMA) { | ||
428 | /* clear DMA-Start bit */ | 427 | /* clear DMA-Start bit */ |
429 | ap->ops->bmdma_stop(qc); | 428 | ap->ops->bmdma_stop(qc); |
430 | 429 | ||
@@ -451,8 +450,7 @@ static void sil_host_intr(struct ata_port *ap, u32 bmdma2) | |||
451 | /* kick HSM in the ass */ | 450 | /* kick HSM in the ass */ |
452 | ata_hsm_move(ap, qc, status, 0); | 451 | ata_hsm_move(ap, qc, status, 0); |
453 | 452 | ||
454 | if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA || | 453 | if (unlikely(qc->err_mask) && ata_is_dma(qc->tf.protocol)) |
455 | qc->tf.protocol == ATA_PROT_ATAPI_DMA)) | ||
456 | ata_ehi_push_desc(ehi, "BMDMA2 stat 0x%x", bmdma2); | 454 | ata_ehi_push_desc(ehi, "BMDMA2 stat 0x%x", bmdma2); |
457 | 455 | ||
458 | return; | 456 | return; |