diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 04:50:22 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 04:50:22 -0500 |
commit | 054ee8fd39f1b5d50e803f126b63f400d631eea4 (patch) | |
tree | 2819e388f853de88e09635de8e38017b563069bc /include/linux/libata.h | |
parent | f0612bbc41f65f5a684f69d714a1a17a6f0f40c5 (diff) | |
parent | a7dac447bb9cef27d4d29cdf63e2d7809c50b1f4 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 364cd11456f6..6225b78fa65b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -176,6 +176,13 @@ enum hsm_task_states { | |||
176 | HSM_ST_ERR, | 176 | HSM_ST_ERR, |
177 | }; | 177 | }; |
178 | 178 | ||
179 | enum ata_completion_errors { | ||
180 | AC_ERR_OTHER = (1 << 0), | ||
181 | AC_ERR_DEV = (1 << 1), | ||
182 | AC_ERR_ATA_BUS = (1 << 2), | ||
183 | AC_ERR_HOST_BUS = (1 << 3), | ||
184 | }; | ||
185 | |||
179 | /* forward declarations */ | 186 | /* forward declarations */ |
180 | struct scsi_device; | 187 | struct scsi_device; |
181 | struct ata_port_operations; | 188 | struct ata_port_operations; |
@@ -183,7 +190,7 @@ struct ata_port; | |||
183 | struct ata_queued_cmd; | 190 | struct ata_queued_cmd; |
184 | 191 | ||
185 | /* typedefs */ | 192 | /* typedefs */ |
186 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, u8 drv_stat); | 193 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int err_mask); |
187 | 194 | ||
188 | struct ata_ioports { | 195 | struct ata_ioports { |
189 | unsigned long cmd_addr; | 196 | unsigned long cmd_addr; |
@@ -465,7 +472,7 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc); | |||
465 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 472 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
466 | extern u8 ata_bmdma_status(struct ata_port *ap); | 473 | extern u8 ata_bmdma_status(struct ata_port *ap); |
467 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 474 | extern void ata_bmdma_irq_clear(struct ata_port *ap); |
468 | extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat); | 475 | extern void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask); |
469 | extern void ata_eng_timeout(struct ata_port *ap); | 476 | extern void ata_eng_timeout(struct ata_port *ap); |
470 | extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, | 477 | extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, |
471 | void (*done)(struct scsi_cmnd *)); | 478 | void (*done)(struct scsi_cmnd *)); |
@@ -753,4 +760,21 @@ static inline int ata_try_flush_cache(const struct ata_device *dev) | |||
753 | ata_id_has_flush_ext(dev->id); | 760 | ata_id_has_flush_ext(dev->id); |
754 | } | 761 | } |
755 | 762 | ||
763 | static inline unsigned int ac_err_mask(u8 status) | ||
764 | { | ||
765 | if (status & ATA_BUSY) | ||
766 | return AC_ERR_ATA_BUS; | ||
767 | if (status & (ATA_ERR | ATA_DF)) | ||
768 | return AC_ERR_DEV; | ||
769 | return 0; | ||
770 | } | ||
771 | |||
772 | static inline unsigned int __ac_err_mask(u8 status) | ||
773 | { | ||
774 | unsigned int mask = ac_err_mask(status); | ||
775 | if (mask == 0) | ||
776 | return AC_ERR_OTHER; | ||
777 | return mask; | ||
778 | } | ||
779 | |||
756 | #endif /* __LINUX_LIBATA_H__ */ | 780 | #endif /* __LINUX_LIBATA_H__ */ |