diff options
author | Albert Lee <albertcc@tw.ibm.com> | 2005-12-05 02:38:02 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-06 04:49:22 -0500 |
commit | a22e2eb0710798009b8e696ae911aef745089dd6 (patch) | |
tree | 93421443499249db0301868e07f24156c456cf7a /drivers/scsi/libata-scsi.c | |
parent | c14b8331ec4843e4f2b67a4d847a0d812a50e43c (diff) |
[PATCH] libata: move err_mask to ata_queued_cmd
- remove err_mask from the parameter list of the complete functions
- move err_mask to ata_queued_cmd
- initialize qc->err_mask when needed
- for each function call to ata_qc_complete(), replace the err_mask parameter with qc->err_mask.
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
===============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r-- | drivers/scsi/libata-scsi.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index ef763ed9a0e5..2aef41112c43 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -1203,12 +1203,11 @@ nothing_to_do: | |||
1203 | return 1; | 1203 | return 1; |
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | static int ata_scsi_qc_complete(struct ata_queued_cmd *qc, | 1206 | static int ata_scsi_qc_complete(struct ata_queued_cmd *qc) |
1207 | unsigned int err_mask) | ||
1208 | { | 1207 | { |
1209 | struct scsi_cmnd *cmd = qc->scsicmd; | 1208 | struct scsi_cmnd *cmd = qc->scsicmd; |
1210 | u8 *cdb = cmd->cmnd; | 1209 | u8 *cdb = cmd->cmnd; |
1211 | int need_sense = (err_mask != 0); | 1210 | int need_sense = (qc->err_mask != 0); |
1212 | 1211 | ||
1213 | /* For ATA pass thru (SAT) commands, generate a sense block if | 1212 | /* For ATA pass thru (SAT) commands, generate a sense block if |
1214 | * user mandated it or if there's an error. Note that if we | 1213 | * user mandated it or if there's an error. Note that if we |
@@ -1955,9 +1954,9 @@ void ata_scsi_badcmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), u8 | |||
1955 | done(cmd); | 1954 | done(cmd); |
1956 | } | 1955 | } |
1957 | 1956 | ||
1958 | static int atapi_sense_complete(struct ata_queued_cmd *qc,unsigned int err_mask) | 1957 | static int atapi_sense_complete(struct ata_queued_cmd *qc) |
1959 | { | 1958 | { |
1960 | if (err_mask && ((err_mask & AC_ERR_DEV) == 0)) | 1959 | if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0)) |
1961 | /* FIXME: not quite right; we don't want the | 1960 | /* FIXME: not quite right; we don't want the |
1962 | * translation of taskfile registers into | 1961 | * translation of taskfile registers into |
1963 | * a sense descriptors, since that's only | 1962 | * a sense descriptors, since that's only |
@@ -2015,15 +2014,18 @@ static void atapi_request_sense(struct ata_queued_cmd *qc) | |||
2015 | 2014 | ||
2016 | qc->complete_fn = atapi_sense_complete; | 2015 | qc->complete_fn = atapi_sense_complete; |
2017 | 2016 | ||
2018 | if (ata_qc_issue(qc)) | 2017 | if (ata_qc_issue(qc)) { |
2019 | ata_qc_complete(qc, AC_ERR_OTHER); | 2018 | qc->err_mask |= AC_ERR_OTHER; |
2019 | ata_qc_complete(qc); | ||
2020 | } | ||
2020 | 2021 | ||
2021 | DPRINTK("EXIT\n"); | 2022 | DPRINTK("EXIT\n"); |
2022 | } | 2023 | } |
2023 | 2024 | ||
2024 | static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask) | 2025 | static int atapi_qc_complete(struct ata_queued_cmd *qc) |
2025 | { | 2026 | { |
2026 | struct scsi_cmnd *cmd = qc->scsicmd; | 2027 | struct scsi_cmnd *cmd = qc->scsicmd; |
2028 | unsigned int err_mask = qc->err_mask; | ||
2027 | 2029 | ||
2028 | VPRINTK("ENTER, err_mask 0x%X\n", err_mask); | 2030 | VPRINTK("ENTER, err_mask 0x%X\n", err_mask); |
2029 | 2031 | ||