diff options
-rw-r--r-- | sys/scsi/cd.c | 4 | ||||
-rw-r--r-- | sys/scsi/ch.c | 4 | ||||
-rw-r--r-- | sys/scsi/scsi_all.h | 4 | ||||
-rw-r--r-- | sys/scsi/scsi_base.c | 9 | ||||
-rw-r--r-- | sys/scsi/sd.c | 4 | ||||
-rw-r--r-- | sys/scsi/st.c | 4 |
6 files changed, 16 insertions, 13 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 3fe7ed99257..19ebf06f078 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.114 2006/11/27 20:15:09 beck Exp $ */ +/* $OpenBSD: cd.c,v 1.115 2006/11/27 23:14:22 beck Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -2033,7 +2033,7 @@ cd_interpret_sense(xs) u_int8_t serr = sense->error_code & SSD_ERRCODE; if (((sc_link->flags & SDEV_OPEN) == 0) || - (serr != 0x70 && serr != 0x71)) + (serr != SSD_ERRCODE_CURRENT && serr != SSD_ERRCODE_DEFERRED)) return (EJUSTRETURN); /* let the generic code handle it */ /* diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index c5960f3d2e5..f8c8e4cdd9d 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ch.c,v 1.30 2006/11/27 18:24:43 beck Exp $ */ +/* $OpenBSD: ch.c,v 1.31 2006/11/27 23:14:22 beck Exp $ */ /* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */ /* @@ -769,7 +769,7 @@ ch_interpret_sense(xs) u_int8_t skey = sense->flags & SSD_KEY; if (((sc_link->flags & SDEV_OPEN) == 0) || - (serr != 0x70 && serr != 0x71)) + (serr != SSD_ERRCODE_CURRENT && serr != SSD_ERRCODE_DEFERRED)) return (EJUSTRETURN); /* let the generic code handle it */ switch (skey) { diff --git a/sys/scsi/scsi_all.h b/sys/scsi/scsi_all.h index cfa50e838b4..cf2155d5256 100644 --- a/sys/scsi/scsi_all.h +++ b/sys/scsi/scsi_all.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_all.h,v 1.39 2006/11/27 20:15:09 beck Exp $ */ +/* $OpenBSD: scsi_all.h,v 1.40 2006/11/27 23:14:22 beck Exp $ */ /* $NetBSD: scsi_all.h,v 1.10 1996/09/12 01:57:17 thorpej Exp $ */ /* @@ -271,6 +271,8 @@ struct scsi_sense_data_unextended { struct scsi_sense_data { /* 1*/ u_int8_t error_code; +#define SSD_ERRCODE_CURRENT 0x70 +#define SSD_ERRCODE_DEFERRED 0x71 #define SSD_ERRCODE 0x7F #define SSD_ERRCODE_VALID 0x80 /* 2*/ u_int8_t segment; diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 8dc8b415b60..6542287cfcb 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.115 2006/11/27 18:24:43 beck Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.116 2006/11/27 23:14:22 beck Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -1069,7 +1069,7 @@ scsi_interpret_sense(struct scsi_xfer *xs) /* Default sense interpretation. */ serr = sense->error_code & SSD_ERRCODE; - if (serr != 0x70 && serr != 0x71) + if (serr != SSD_ERRCODE_CURRENT && serr != SSD_ERRCODE_DEFERRED) skey = 0xff; /* Invalid value, since key is 4 bit value. */ else skey = sense->flags & SSD_KEY; @@ -1828,9 +1828,10 @@ scsi_print_sense(struct scsi_xfer *xs) /* XXX For error 0x71, current opcode is not the relevant one. */ printf("%sCheck Condition (error %#x) on opcode 0x%x\n", - (serr == 0x71) ? "DEFERRED " : "", serr, xs->cmd->opcode); + (serr == SSD_ERRCODE_DEFERRED) ? "DEFERRED " : "", serr, + xs->cmd->opcode); - if (serr != 0x70 && serr != 0x71) { + if (serr != SSD_ERRCODE_CURRENT && serr != SSD_ERRCODE_DEFERRED) { if ((sense->error_code & SSD_ERRCODE_VALID) != 0) { struct scsi_sense_data_unextended *usense = (struct scsi_sense_data_unextended *)sense; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index affb97e41b1..0ce25761f0d 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.112 2006/11/27 20:15:09 beck Exp $ */ +/* $OpenBSD: sd.c,v 1.113 2006/11/27 23:14:22 beck Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -1079,7 +1079,7 @@ sd_interpret_sense(xs) * LUN not ready errors on open devices. */ if (((sc_link->flags & SDEV_OPEN) == 0) || - (serr != 0x70 && serr != 0x71) || + (serr != SSD_ERRCODE_CURRENT && serr != SSD_ERRCODE_DEFERRED) || ((sense->flags & SSD_KEY) != SKEY_NOT_READY) || (sense->extra_len < 6)) return (EJUSTRETURN); diff --git a/sys/scsi/st.c b/sys/scsi/st.c index c4bf42ff130..afcc958952d 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -1,4 +1,4 @@ -/* $OpenBSD: st.c,v 1.66 2006/11/27 18:24:43 beck Exp $ */ +/* $OpenBSD: st.c,v 1.67 2006/11/27 23:14:22 beck Exp $ */ /* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */ /* @@ -1719,7 +1719,7 @@ st_interpret_sense(xs) int32_t info; if (((sc_link->flags & SDEV_OPEN) == 0) || - (serr != 0x70 && serr != 0x71)) + (serr != SSD_ERRCODE_CURRENT && serr != SSD_ERRCODE_DEFERRED)) return (EJUSTRETURN); /* let the generic code handle it */ switch (skey) { |