aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-12-13 01:46:20 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-13 01:46:20 -0500
commit80c7af4074cbb4cb6be5d35c443ea6d5e8838a84 (patch)
treee900ad4c0beb4f44f0912b847c3319f11ef57d73 /drivers/scsi/libata-scsi.c
parent451ec6ab310602515b361418debe93d00f67e273 (diff)
parentd00d598ffbba974d9045ba8b95296655fe2162c5 (diff)
Merge branch 'upstream'
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 7445d8b524d..e2f298b2ade 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -418,7 +418,7 @@ void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk, u8 *asc,
418 int i; 418 int i;
419 419
420 /* Based on the 3ware driver translation table */ 420 /* Based on the 3ware driver translation table */
421 static unsigned char sense_table[][4] = { 421 static const unsigned char sense_table[][4] = {
422 /* BBD|ECC|ID|MAR */ 422 /* BBD|ECC|ID|MAR */
423 {0xd1, ABORTED_COMMAND, 0x00, 0x00}, // Device busy Aborted command 423 {0xd1, ABORTED_COMMAND, 0x00, 0x00}, // Device busy Aborted command
424 /* BBD|ECC|ID */ 424 /* BBD|ECC|ID */
@@ -449,7 +449,7 @@ void ata_to_sense_error(unsigned id, u8 drv_stat, u8 drv_err, u8 *sk, u8 *asc,
449 {0x80, MEDIUM_ERROR, 0x11, 0x04}, // Block marked bad Medium error, unrecovered read error 449 {0x80, MEDIUM_ERROR, 0x11, 0x04}, // Block marked bad Medium error, unrecovered read error
450 {0xFF, 0xFF, 0xFF, 0xFF}, // END mark 450 {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
451 }; 451 };
452 static unsigned char stat_table[][4] = { 452 static const unsigned char stat_table[][4] = {
453 /* Must be first because BUSY means no other bits valid */ 453 /* Must be first because BUSY means no other bits valid */
454 {0x80, ABORTED_COMMAND, 0x47, 0x00}, // Busy, fake parity for now 454 {0x80, ABORTED_COMMAND, 0x47, 0x00}, // Busy, fake parity for now
455 {0x20, HARDWARE_ERROR, 0x00, 0x00}, // Device fault 455 {0x20, HARDWARE_ERROR, 0x00, 0x00}, // Device fault
@@ -1197,12 +1197,11 @@ nothing_to_do:
1197 return 1; 1197 return 1;
1198} 1198}
1199 1199
1200static int ata_scsi_qc_complete(struct ata_queued_cmd *qc, 1200static int ata_scsi_qc_complete(struct ata_queued_cmd *qc)
1201 unsigned int err_mask)
1202{ 1201{
1203 struct scsi_cmnd *cmd = qc->scsicmd; 1202 struct scsi_cmnd *cmd = qc->scsicmd;
1204 u8 *cdb = cmd->cmnd; 1203 u8 *cdb = cmd->cmnd;
1205 int need_sense = (err_mask != 0); 1204 int need_sense = (qc->err_mask != 0);
1206 1205
1207 /* For ATA pass thru (SAT) commands, generate a sense block if 1206 /* For ATA pass thru (SAT) commands, generate a sense block if
1208 * user mandated it or if there's an error. Note that if we 1207 * user mandated it or if there's an error. Note that if we
@@ -1526,7 +1525,7 @@ unsigned int ata_scsiop_inq_80(struct ata_scsi_args *args, u8 *rbuf,
1526 return 0; 1525 return 0;
1527} 1526}
1528 1527
1529static const char *inq_83_str = "Linux ATA-SCSI simulator"; 1528static const char * const inq_83_str = "Linux ATA-SCSI simulator";
1530 1529
1531/** 1530/**
1532 * ata_scsiop_inq_83 - Simulate INQUIRY EVPD page 83, device identity 1531 * ata_scsiop_inq_83 - Simulate INQUIRY EVPD page 83, device identity
@@ -1949,9 +1948,9 @@ void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8
1949 done(cmd); 1948 done(cmd);
1950} 1949}
1951 1950
1952static int atapi_sense_complete(struct ata_queued_cmd *qc,unsigned int err_mask) 1951static int atapi_sense_complete(struct ata_queued_cmd *qc)
1953{ 1952{
1954 if (err_mask && ((err_mask & AC_ERR_DEV) == 0)) 1953 if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0))
1955 /* FIXME: not quite right; we don't want the 1954 /* FIXME: not quite right; we don't want the
1956 * translation of taskfile registers into 1955 * translation of taskfile registers into
1957 * a sense descriptors, since that's only 1956 * a sense descriptors, since that's only
@@ -2009,15 +2008,18 @@ static void atapi_request_sense(struct ata_queued_cmd *qc)
2009 2008
2010 qc->complete_fn = atapi_sense_complete; 2009 qc->complete_fn = atapi_sense_complete;
2011 2010
2012 if (ata_qc_issue(qc)) 2011 if (ata_qc_issue(qc)) {
2013 ata_qc_complete(qc, AC_ERR_OTHER); 2012 qc->err_mask |= AC_ERR_OTHER;
2013 ata_qc_complete(qc);
2014 }
2014 2015
2015 DPRINTK("EXIT\n"); 2016 DPRINTK("EXIT\n");
2016} 2017}
2017 2018
2018static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask) 2019static int atapi_qc_complete(struct ata_queued_cmd *qc)
2019{ 2020{
2020 struct scsi_cmnd *cmd = qc->scsicmd; 2021 struct scsi_cmnd *cmd = qc->scsicmd;
2022 unsigned int err_mask = qc->err_mask;
2021 2023
2022 VPRINTK("ENTER, err_mask 0x%X\n", err_mask); 2024 VPRINTK("ENTER, err_mask 0x%X\n", err_mask);
2023 2025