diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-09-20 06:17:50 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2010-09-20 06:17:50 +0000 |
commit | 89b7d30bb900859eceeed12811d4f11ce4936fee (patch) | |
tree | 62a8f338dd9cbfcdcdceae9fcdfbbff1ce43e01e /sys/dev | |
parent | 9844e20bc88783a482ceaeed5eeebd0daf66d9fc (diff) |
Use SSD_ERRCODE_CURRENT instead of magic 0x70.
ok dlg@ matthew@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/atascsi.c | 4 | ||||
-rw-r--r-- | sys/dev/atapiscsi/atapiscsi.c | 4 | ||||
-rw-r--r-- | sys/dev/i2o/ioprbs.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/aac.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/ami.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/cac.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/ciss.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/gdt_common.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/mfi.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/mpi.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/twe.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/ips.c | 4 |
12 files changed, 30 insertions, 27 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index 6061fa26185..a930193bfb2 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.94 2010/09/20 06:02:50 dlg Exp $ */ +/* $OpenBSD: atascsi.c,v 1.95 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1066,7 +1066,7 @@ atascsi_disk_sense(struct scsi_xfer *xs) bzero(xs->data, xs->datalen); /* check datalen > sizeof(struct scsi_sense_data)? */ - sd->error_code = 0x70; /* XXX magic */ + sd->error_code = SSD_ERRCODE_CURRENT; sd->flags = SKEY_NO_SENSE; atascsi_done(xs, XS_NOERROR); diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c index 164e5d8e7c7..96abda2308a 100644 --- a/sys/dev/atapiscsi/atapiscsi.c +++ b/sys/dev/atapiscsi/atapiscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiscsi.c,v 1.94 2010/08/04 19:43:52 deraadt Exp $ */ +/* $OpenBSD: atapiscsi.c,v 1.95 2010/09/20 06:17:49 krw Exp $ */ /* * This code is derived from code with the copyright below. @@ -480,7 +480,7 @@ atapi_to_scsi_sense(xfer, flags) xfer->error = XS_SHORTSENSE; - sense->error_code = SSD_ERRCODE_VALID | 0x70; + sense->error_code = SSD_ERRCODE_VALID | SSD_ERRCODE_CURRENT; sense->flags = (flags >> 4); WDCDEBUG_PRINT(("Atapi error: %d ", (flags >> 4)), DEBUG_ERRORS); diff --git a/sys/dev/i2o/ioprbs.c b/sys/dev/i2o/ioprbs.c index f431524cdae..2eb36da18e2 100644 --- a/sys/dev/i2o/ioprbs.c +++ b/sys/dev/i2o/ioprbs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioprbs.c,v 1.22 2010/07/14 06:16:04 matthew Exp $ */ +/* $OpenBSD: ioprbs.c,v 1.23 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2001 Niklas Hallqvist @@ -714,7 +714,7 @@ ioprbs_internal_cache_cmd(xs) case REQUEST_SENSE: DPRINTF(("REQUEST SENSE tgt %d ", target)); bzero(&sd, sizeof sd); - sd.error_code = 0x70; + sd.error_code = SSD_ERRCODE_CURRENT; sd.segment = 0; sd.flags = SKEY_NO_SENSE; bzero(sd.info, sizeof sd.info); diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index 93d19b55a15..e79a7125f27 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.48 2010/08/07 03:50:01 krw Exp $ */ +/* $OpenBSD: aac.c,v 1.49 2010/09/20 06:17:49 krw Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -2429,7 +2429,7 @@ aac_internal_cache_cmd(struct scsi_xfer *xs) case REQUEST_SENSE: AAC_DPRINTF(AAC_D_CMD, ("REQUEST SENSE tgt %d ", target)); bzero(&sd, sizeof sd); - sd.error_code = 0x70; + sd.error_code = SSD_ERRCODE_CURRENT; sd.segment = 0; sd.flags = SKEY_NO_SENSE; aac_enc32(sd.info, 0); diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 1cf07bd2f5e..9712e9b7f6b 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.214 2010/09/02 11:54:44 dlg Exp $ */ +/* $OpenBSD: ami.c,v 1.215 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -1215,7 +1215,7 @@ ami_scsi_raw_cmd(struct scsi_xfer *xs) if (xs->cmdlen > AMI_MAX_CDB) { AMI_DPRINTF(AMI_D_CMD, ("CDB too big %p ", xs)); bzero(&xs->sense, sizeof(xs->sense)); - xs->sense.error_code = SSD_ERRCODE_VALID | 0x70; + xs->sense.error_code = SSD_ERRCODE_VALID | SSD_ERRCODE_CURRENT; xs->sense.flags = SKEY_ILLEGAL_REQUEST; xs->sense.add_sense_code = 0x20; /* illcmd, 0x24 illfield */ xs->error = XS_SENSE; @@ -1375,7 +1375,7 @@ ami_scsi_cmd(struct scsi_xfer *xs) case REQUEST_SENSE: AMI_DPRINTF(AMI_D_CMD, ("REQUEST SENSE tgt %d ", target)); bzero(&sd, sizeof(sd)); - sd.error_code = 0x70; + sd.error_code = SSD_ERRCODE_CURRENT; sd.segment = 0; sd.flags = SKEY_NO_SENSE; *(u_int32_t*)sd.info = htole32(0); diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index b6ab9a51917..e6169ea840f 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.40 2010/07/01 03:20:38 matthew Exp $ */ +/* $OpenBSD: cac.c,v 1.41 2010/09/20 06:17:49 krw Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -611,7 +611,7 @@ cac_scsi_cmd(xs) case REQUEST_SENSE: bzero(&sd, sizeof sd); - sd.error_code = 0x70; + sd.error_code = SSD_ERRCODE_CURRENT; sd.segment = 0; sd.flags = SKEY_NO_SENSE; *(u_int32_t*)sd.info = htole32(0); diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index 54f86414a94..d35556a593a 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.62 2010/09/20 04:08:36 dlg Exp $ */ +/* $OpenBSD: ciss.c,v 1.63 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -478,6 +478,7 @@ ciss_cmd(struct ciss_ccb *ccb, int flags, int wait) if (ccb->ccb_xs) { ccb->ccb_xs->error = XS_DRIVER_STUFFUP; scsi_done(ccb->ccb_xs); + ccb->ccb_xs = NULL; } return (error); } @@ -668,7 +669,8 @@ ciss_error(struct ciss_ccb *ccb) err->err_info, err->err_type[3], err->err_type[2]); if (xs) { bzero(&xs->sense, sizeof(xs->sense)); - xs->sense.error_code = SSD_ERRCODE_VALID | 0x70; + xs->sense.error_code = SSD_ERRCODE_VALID | + SSD_ERRCODE_CURRENT; xs->sense.flags = SKEY_ILLEGAL_REQUEST; xs->sense.add_sense_code = 0x24; /* ill field */ xs->error = XS_SENSE; @@ -845,7 +847,7 @@ ciss_scsi_cmd(struct scsi_xfer *xs) if (xs->cmdlen > CISS_MAX_CDB) { CISS_DPRINTF(CISS_D_CMD, ("CDB too big %p ", xs)); bzero(&xs->sense, sizeof(xs->sense)); - xs->sense.error_code = SSD_ERRCODE_VALID | 0x70; + xs->sense.error_code = SSD_ERRCODE_VALID | SSD_ERRCODE_CURRENT; xs->sense.flags = SKEY_ILLEGAL_REQUEST; xs->sense.add_sense_code = 0x20; /* illcmd, 0x24 illfield */ xs->error = XS_SENSE; diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c index 12b8895e7e5..4c018c97708 100644 --- a/sys/dev/ic/gdt_common.c +++ b/sys/dev/ic/gdt_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.53 2010/08/12 00:26:55 matthew Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.54 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -944,7 +944,7 @@ gdt_internal_cache_cmd(struct scsi_xfer *xs) case REQUEST_SENSE: GDT_DPRINTF(GDT_D_CMD, ("REQUEST SENSE tgt %d ", target)); bzero(&sd, sizeof sd); - sd.error_code = 0x70; + sd.error_code = SSD_ERRCODE_CURRENT; sd.segment = 0; sd.flags = SKEY_NO_SENSE; gdt_enc32(sd.info, 0); @@ -1002,7 +1002,7 @@ gdt_raw_scsi_cmd(struct scsi_xfer *xs) if (xs->cmdlen > 12 /* XXX create #define */) { GDT_DPRINTF(GDT_D_CMD, ("CDB too big %p ", xs)); bzero(&xs->sense, sizeof(xs->sense)); - xs->sense.error_code = SSD_ERRCODE_VALID | 0x70; + xs->sense.error_code = SSD_ERRCODE_VALID | SSD_ERRCODE_CURRENT; xs->sense.flags = SKEY_ILLEGAL_REQUEST; xs->sense.add_sense_code = 0x20; /* illcmd, 0x24 illfield */ xs->error = XS_SENSE; diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index 972d03c21cd..21c9beb1ff7 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.111 2010/08/29 23:23:31 dlg Exp $ */ +/* $OpenBSD: mfi.c,v 1.112 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * @@ -1087,7 +1087,8 @@ mfi_scsi_cmd(struct scsi_xfer *xs) printf("%s: mfi_scsi_cmd poll failed\n", DEVNAME(sc)); bzero(&xs->sense, sizeof(xs->sense)); - xs->sense.error_code = SSD_ERRCODE_VALID | 0x70; + xs->sense.error_code = SSD_ERRCODE_VALID | + SSD_ERRCODE_CURRENT; xs->sense.flags = SKEY_ILLEGAL_REQUEST; xs->sense.add_sense_code = 0x20; /* invalid opcode */ xs->error = XS_SENSE; diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 4de8613fd17..78ae30ad58c 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.162 2010/09/14 00:03:04 dlg Exp $ */ +/* $OpenBSD: mpi.c,v 1.163 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org> @@ -1233,7 +1233,7 @@ mpi_scsi_cmd(struct scsi_xfer *xs) DNPRINTF(MPI_D_CMD, "%s: CBD too big %d\n", DEVNAME(sc), xs->cmdlen); bzero(&xs->sense, sizeof(xs->sense)); - xs->sense.error_code = SSD_ERRCODE_VALID | 0x70; + xs->sense.error_code = SSD_ERRCODE_VALID | SSD_ERRCODE_CURRENT; xs->sense.flags = SKEY_ILLEGAL_REQUEST; xs->sense.add_sense_code = 0x20; xs->error = XS_SENSE; diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c index 2e1751dfaa6..1fb78682019 100644 --- a/sys/dev/ic/twe.c +++ b/sys/dev/ic/twe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: twe.c,v 1.37 2010/06/28 18:31:02 krw Exp $ */ +/* $OpenBSD: twe.c,v 1.38 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2000-2002 Michael Shalayeff. All rights reserved. @@ -808,7 +808,7 @@ twe_scsi_cmd(xs) case REQUEST_SENSE: TWE_DPRINTF(TWE_D_CMD, ("REQUEST SENSE tgt %d ", target)); bzero(&sd, sizeof sd); - sd.error_code = 0x70; + sd.error_code = SSD_ERRCODE_CURRENT; sd.segment = 0; sd.flags = SKEY_NO_SENSE; *(u_int32_t*)sd.info = htole32(0); diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index a0419e14f3f..3ea223970af 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.102 2010/07/01 16:30:57 deraadt Exp $ */ +/* $OpenBSD: ips.c,v 1.103 2010/09/20 06:17:49 krw Exp $ */ /* * Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org> @@ -1009,7 +1009,7 @@ ips_scsi_pt_cmd(struct scsi_xfer *xs) sc->sc_dev.dv_xname, xs->cmdlen)); bzero(&xs->sense, sizeof(xs->sense)); - xs->sense.error_code = SSD_ERRCODE_VALID | 0x70; + xs->sense.error_code = SSD_ERRCODE_VALID | SSD_ERRCODE_CURRENT; xs->sense.flags = SKEY_ILLEGAL_REQUEST; xs->sense.add_sense_code = 0x20; /* illcmd, 0x24 illfield */ xs->error = XS_SENSE; |