summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-03-04 14:20:38 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-03-04 14:20:38 +0000
commit1737bb1f1443032f0ed34b42d72b72968e4655eb (patch)
tree21ab67cee2c415ce31ae67d4b69a605a703d7e95 /sys/dev/ic
parent2671c587bc640f9caf86a61f5d0a8a8cca0eb5ca (diff)
All CAM_* values stored in xs->error must be 'interpreted' by
ah[cd]_done() into XS_* values understood by the SCSI code before returning xs to the tender mercies of the SCSI code. So if we bail out without calling ah[cd]_done(), because the request cdb length is excessive, don't use ah[cd]_set_transaction() to put CAM_REQ_INVALID into xs->error, just jam in XS_DRIVER_STUFFUP as ah[cd]_done() would have. If CAM_REQ_INVALID escapes it will be interpreted as XS_SHORT_SENSE as far as I can tell. This code path should never be trod so the net effect should be minimal.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c4
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index d973286d26b..c32948cd517 100644
--- a/sys/dev/ic/aic79xx_openbsd.c
+++ b/sys/dev/ic/aic79xx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx_openbsd.c,v 1.23 2005/12/28 02:43:54 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.24 2006/03/04 14:20:37 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -545,10 +545,10 @@ ahd_setup_data(struct ahd_softc *ahd, struct scsi_xfer *xs,
hscb->cdb_len = xs->cmdlen;
if (hscb->cdb_len > MAX_CDB_LEN) {
- aic_set_transaction_status(scb, CAM_REQ_INVALID);
ahd_lock(ahd, &s);
ahd_free_scb(ahd, scb);
ahd_unlock(ahd, &s);
+ xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
return (COMPLETE);
diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c
index 9933f9ecfbe..8969172287c 100644
--- a/sys/dev/ic/aic7xxx_openbsd.c
+++ b/sys/dev/ic/aic7xxx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.c,v 1.31 2005/12/28 03:00:07 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.c,v 1.32 2006/03/04 14:20:37 krw Exp $ */
/* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -572,10 +572,10 @@ ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs,
hscb->cdb_len = xs->cmdlen;
if (hscb->cdb_len > sizeof(hscb->cdb32)) {
- ahc_set_transaction_status(scb, CAM_REQ_INVALID);
ahc_lock(ahc, &s);
ahc_free_scb(ahc, scb);
ahc_unlock(ahc, &s);
+ xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
return (COMPLETE);