summaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-01-23 13:09:36 +0900
committerJeff Garzik <jgarzik@pobox.com>2006-01-26 22:36:27 -0500
commit11a56d2439259892319df81cf1582687d7e7fde5 (patch)
tree976f5ecb7ff61c19620ca482c0550b0b009bfa6a /include/linux/libata.h
parent284b6481cc7112ca6a9e60b7a9b650fba3bf0492 (diff)
downloadkernel-crypto-11a56d2439259892319df81cf1582687d7e7fde5.tar.gz
kernel-crypto-11a56d2439259892319df81cf1582687d7e7fde5.tar.xz
kernel-crypto-11a56d2439259892319df81cf1582687d7e7fde5.zip
[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 d58b659cf3f..8ff3a7f6f63 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -222,10 +222,15 @@ enum hsm_task_states {
};
enum ata_completion_errors {
- AC_ERR_OTHER = (1 << 0),
- AC_ERR_DEV = (1 << 1),
- AC_ERR_ATA_BUS = (1 << 2),
- AC_ERR_HOST_BUS = (1 << 3),
+ AC_ERR_DEV = (1 << 0), /* device reported error */
+ AC_ERR_HSM = (1 << 1), /* host state machine violation */
+ AC_ERR_TIMEOUT = (1 << 2), /* timeout */
+ AC_ERR_MEDIA = (1 << 3), /* media error */
+ AC_ERR_ATA_BUS = (1 << 4), /* ATA bus error */
+ AC_ERR_HOST_BUS = (1 << 5), /* host bus error */
+ AC_ERR_SYSTEM = (1 << 6), /* system error */
+ AC_ERR_INVALID = (1 << 7), /* invalid argument */
+ AC_ERR_OTHER = (1 << 8), /* unknown */
};
/* forward declarations */
@@ -833,7 +838,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev)
static inline unsigned int ac_err_mask(u8 status)
{
if (status & ATA_BUSY)
- return AC_ERR_ATA_BUS;
+ return AC_ERR_HSM;
if (status & (ATA_ERR | ATA_DF))
return AC_ERR_DEV;
return 0;