aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-01-22 23:09:36 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-26 22:36:27 -0500
commit11a56d2439259892319df81cf1582687d7e7fde5 (patch)
tree976f5ecb7ff61c19620ca482c0550b0b009bfa6a /include/linux/libata.h
parent284b6481cc7112ca6a9e60b7a9b650fba3bf0492 (diff)
[PATCH] libata: add detailed AC_ERR_* flags
Add detailed AC_ERR_* flags and use them. Long-term goal is to describe all errors with err_mask and tf combination (tf for failed sector information, etc...). After proper error diagnosis is implemented, sense data should also be generated from err_mask instead of directly from hardware tf registers as it is currently. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d58b659cf3f5..8ff3a7f6f63c 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -222,10 +222,15 @@ enum hsm_task_states {
222}; 222};
223 223
224enum ata_completion_errors { 224enum ata_completion_errors {
225 AC_ERR_OTHER = (1 << 0), 225 AC_ERR_DEV = (1 << 0), /* device reported error */
226 AC_ERR_DEV = (1 << 1), 226 AC_ERR_HSM = (1 << 1), /* host state machine violation */
227 AC_ERR_ATA_BUS = (1 << 2), 227 AC_ERR_TIMEOUT = (1 << 2), /* timeout */
228 AC_ERR_HOST_BUS = (1 << 3), 228 AC_ERR_MEDIA = (1 << 3), /* media error */
229 AC_ERR_ATA_BUS = (1 << 4), /* ATA bus error */
230 AC_ERR_HOST_BUS = (1 << 5), /* host bus error */
231 AC_ERR_SYSTEM = (1 << 6), /* system error */
232 AC_ERR_INVALID = (1 << 7), /* invalid argument */
233 AC_ERR_OTHER = (1 << 8), /* unknown */
229}; 234};
230 235
231/* forward declarations */ 236/* forward declarations */
@@ -833,7 +838,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev)
833static inline unsigned int ac_err_mask(u8 status) 838static inline unsigned int ac_err_mask(u8 status)
834{ 839{
835 if (status & ATA_BUSY) 840 if (status & ATA_BUSY)
836 return AC_ERR_ATA_BUS; 841 return AC_ERR_HSM;
837 if (status & (ATA_ERR | ATA_DF)) 842 if (status & (ATA_ERR | ATA_DF))
838 return AC_ERR_DEV; 843 return AC_ERR_DEV;
839 return 0; 844 return 0;