diff options
author | dufault <dufault@FreeBSD.org> | 1995-03-15 22:42:25 +0000 |
---|---|---|
committer | dufault <dufault@FreeBSD.org> | 1995-03-15 22:42:25 +0000 |
commit | 28a0824062ef0104d777ef8dae4f8b6ccb452a70 (patch) | |
tree | 7b844c461a5582e97a466b0ba91694c7fa3fefe5 /sys/scsi/scsi_sense.c | |
parent | 9f506b229f9942e4bd90ebd8ad3162f53c843c6e (diff) | |
download | FreeBSD-src-28a0824062ef0104d777ef8dae4f8b6ccb452a70.zip FreeBSD-src-28a0824062ef0104d777ef8dae4f8b6ccb452a70.tar.gz |
Plug lurking bug when a device returns ASC:ASCQ 0xff:0xff
Diffstat (limited to 'sys/scsi/scsi_sense.c')
-rw-r--r-- | sys/scsi/scsi_sense.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/scsi/scsi_sense.c b/sys/scsi/scsi_sense.c index a6cc359..a21496a 100644 --- a/sys/scsi/scsi_sense.c +++ b/sys/scsi/scsi_sense.c @@ -1,4 +1,11 @@ #include <sys/types.h> + +/* XXX There should be a way for a type driver to have its own + * private senses and add them when it is added. + */ + +#if !defined(NO_SCSI_SENSE) + #include "sd.h" #include "st.h" #define NSPRINT 0 @@ -16,7 +23,6 @@ static struct u_char ascq; char *desc; } tab[] = { -#if !defined(NO_SCSI_SENSE) #if (NCH > 0) {0x28, 0x01, "Import or export element accessed" }, {0x21, 0x01, "Invalid element address" }, @@ -272,8 +278,6 @@ static struct {0x3f, 0x00, "Target operating conditions have changed" }, {0x26, 0x03, "Threshold parameters not supported" }, {0x46, 0x00, "Unsuccessful soft reset" }, -#endif /* NO_SCSI_SENSE */ - {0xff, 0xff, 0 }, }; char *scsi_sense_desc(int asc, int ascq) @@ -283,5 +287,12 @@ char *scsi_sense_desc(int asc, int ascq) if (tab[i].asc == asc && tab[i].ascq == ascq) return tab[i].desc; - return "no available sense description"; + return ""; } + +#else /* NO_SCSI_SENSE */ +char *scsi_sense_desc(int asc, int ascq) +{ + return ""; +} +#endif |