summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-05-07 06:54:01 +0000
committerbde <bde@FreeBSD.org>1995-05-07 06:54:01 +0000
commitbf30e374f0e9ee0cf74eeec29e283bf75cc1a38b (patch)
treedf4312ef32b966db35ade2a40d9ab51944940943 /sys/i386/isa
parent683c8324872c5a63cc1a272fb8daa3cd8c512f46 (diff)
downloadFreeBSD-src-bf30e374f0e9ee0cf74eeec29e283bf75cc1a38b.zip
FreeBSD-src-bf30e374f0e9ee0cf74eeec29e283bf75cc1a38b.tar.gz
Submitted by: john@physiol.su.oz.au (John Mackin)
Fix handling of sense errors. Nonexistent media and end of media were mishandled.
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/ultra14f.c60
1 files changed, 32 insertions, 28 deletions
diff --git a/sys/i386/isa/ultra14f.c b/sys/i386/isa/ultra14f.c
index 7e6bd8f..f80e800 100644
--- a/sys/i386/isa/ultra14f.c
+++ b/sys/i386/isa/ultra14f.c
@@ -22,7 +22,7 @@
* today: Fri Jun 2 17:21:03 EST 1994
* added 24F support ++sg
*
- * $Id: ultra14f.c,v 1.29 1995/03/23 09:00:20 rgrimes Exp $
+ * $Id: ultra14f.c,v 1.30 1995/04/12 20:48:09 wollman Exp $
*/
#include <sys/types.h>
@@ -638,19 +638,19 @@ uha_done(unit, mscp)
* Otherwise, put the results of the operation
* into the xfer and call whoever started it
*/
- if ((mscp->ha_status == UHA_NO_ERR) || (xs->flags & SCSI_ERR_OK)) { /* All went correctly OR errors expected */
- xs->resid = 0;
- xs->error = 0;
- } else {
+ if (((mscp->ha_status != UHA_NO_ERR) || (mscp->targ_status != SCSI_OK))
+ && ((xs->flags & SCSI_ERR_OK) == 0)) {
s1 = &(mscp->mscp_sense);
s2 = &(xs->sense);
if (mscp->ha_status != UHA_NO_ERR) {
switch (mscp->ha_status) {
- case UHA_SBUS_TIMEOUT: /* No response */
+ case UHA_SBUS_ABORT_ERR:
+ case UHA_SBUS_TIMEOUT: /* No sel response */
SC_DEBUG(xs->sc_link, SDEV_DB3,
- ("timeout reported back\n"));
+ ("abort or timeout; ha_status 0x%x\n",
+ mscp->ha_status));
xs->error = XS_TIMEOUT;
break;
case UHA_SBUS_OVER_UNDER:
@@ -658,34 +658,38 @@ uha_done(unit, mscp)
("scsi bus xfer over/underrun\n"));
xs->error = XS_DRIVER_STUFFUP;
break;
- case UHA_BAD_SG_LIST:
- SC_DEBUG(xs->sc_link, SDEV_DB3,
- ("bad sg list reported back\n"));
- xs->error = XS_DRIVER_STUFFUP;
- break;
default: /* Other scsi protocol messes */
xs->error = XS_DRIVER_STUFFUP;
- SC_DEBUG(xs->sc_link, SDEV_DB3,
- ("unexpected ha_status: %x\n",
- mscp->ha_status));
+ printf("uha%d: unexpected ha_status 0x%x (target status 0x%x)\n",
+ unit, mscp->ha_status,
+ mscp->targ_status);
+ break;
}
} else {
-
- if (mscp->targ_status != 0)
-/*
- * I have no information for any possible value of target status field
- * other than 0 means no error!! So I guess any error is unexpected in that
- * event!!
- */
-
- {
- SC_DEBUG(xs->sc_link, SDEV_DB3,
- ("unexpected targ_status: %x\n",
- mscp->targ_status));
+ /* Target status problem */
+ SC_DEBUG(xs->sc_link, SDEV_DB3, ("target err 0x%x\n",
+ mscp->targ_status));
+ switch (mscp->targ_status) {
+ case 0x02:
+ *s2 = *s1;
+ xs->error = XS_SENSE;
+ break;
+ case 0x08:
+ xs->error = XS_BUSY;
+ break;
+ default:
+ printf("uha%d: unexpected targ_status 0x%x\n",
+ unit, mscp->targ_status);
xs->error = XS_DRIVER_STUFFUP;
+ break;
}
}
- }
+ }
+ else {
+ /* All went correctly OR errors expected */
+ xs->resid = 0;
+ xs->error = 0;
+ }
done:
xs->flags |= ITSDONE;
uha_free_mscp(unit, mscp, xs->flags);
OpenPOWER on IntegriCloud