aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_qstor.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-30 04:44:42 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-10-30 04:44:42 -0500
commita7dac447bb9cef27d4d29cdf63e2d7809c50b1f4 (patch)
treea8935490cdd374aba3a804ba9f79d1aed67db36d /drivers/scsi/sata_qstor.c
parent81cfb8864c73230eb1c37753aba517db15cf4d8f (diff)
[libata] change ata_qc_complete() to take error mask as second arg
The second argument to ata_qc_complete() was being used for two purposes: communicate the ATA Status register to the completion function, and indicate an error. On legacy PCI IDE hardware, the latter is often implicit in the former. On more modern hardware, the driver often completely emulated a Status register value, passing ATA_ERR as an indication that something went wrong. Now that previous code changes have eliminated the need to use drv_stat arg to communicate the ATA Status register value, we can convert it to a mask of possible error classes. This will lead to more flexible error handling in the future.
Diffstat (limited to 'drivers/scsi/sata_qstor.c')
-rw-r--r--drivers/scsi/sata_qstor.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index 1aaf3304d397..d95a02fa7afb 100644
--- a/drivers/scsi/sata_qstor.c
+++ b/drivers/scsi/sata_qstor.c
@@ -400,11 +400,12 @@ static inline unsigned int qs_intr_pkt(struct ata_host_set *host_set)
400 qc = ata_qc_from_tag(ap, ap->active_tag); 400 qc = ata_qc_from_tag(ap, ap->active_tag);
401 if (qc && (!(qc->tf.ctl & ATA_NIEN))) { 401 if (qc && (!(qc->tf.ctl & ATA_NIEN))) {
402 switch (sHST) { 402 switch (sHST) {
403 case 0: /* sucessful CPB */ 403 case 0: /* successful CPB */
404 case 3: /* device error */ 404 case 3: /* device error */
405 pp->state = qs_state_idle; 405 pp->state = qs_state_idle;
406 qs_enter_reg_mode(qc->ap); 406 qs_enter_reg_mode(qc->ap);
407 ata_qc_complete(qc, sDST); 407 ata_qc_complete(qc,
408 ac_err_mask(sDST));
408 break; 409 break;
409 default: 410 default:
410 break; 411 break;
@@ -441,7 +442,7 @@ static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set)
441 442
442 /* complete taskfile transaction */ 443 /* complete taskfile transaction */
443 pp->state = qs_state_idle; 444 pp->state = qs_state_idle;
444 ata_qc_complete(qc, status); 445 ata_qc_complete(qc, ac_err_mask(status));
445 handled = 1; 446 handled = 1;
446 } 447 }
447 } 448 }