summaryrefslogtreecommitdiffstats
path: root/sys/i386/scsi
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1995-05-01 09:49:45 +0000
committergibbs <gibbs@FreeBSD.org>1995-05-01 09:49:45 +0000
commitb5e924a383096a613a12241d85667189937eebf8 (patch)
treeeaa8ce225ba697e1d9a03aaba032f9d68fa748e1 /sys/i386/scsi
parent48dd93ce46018e8da0408350611e1ef6d058c7f1 (diff)
downloadFreeBSD-src-b5e924a383096a613a12241d85667189937eebf8.zip
FreeBSD-src-b5e924a383096a613a12241d85667189937eebf8.tar.gz
Set the return value (outb'd to the sequencer) for non zero status
interrupts to zero to start with. This is the value we return in most cases. The sense code then outbs the apropriate value to cause sense retrieval. The return value was uninitialized before this change (something that was an okay thing with the old sequencer code, but not with the semantics of the new). This problem caused us to always retrieve sense upon recieving a non zero status byte. This is exactly what was happening for the "target busy" status returned by exabyte tape drives when they rewind or power on with a tape installed. The request sense proved fatal. This should fix the tape problems.
Diffstat (limited to 'sys/i386/scsi')
-rw-r--r--sys/i386/scsi/aic7xxx.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/sys/i386/scsi/aic7xxx.c b/sys/i386/scsi/aic7xxx.c
index fae9c76..b0176569 100644
--- a/sys/i386/scsi/aic7xxx.c
+++ b/sys/i386/scsi/aic7xxx.c
@@ -24,7 +24,7 @@
*
* commenced: Sun Sep 27 18:14:01 PDT 1992
*
- * $Id: aic7xxx.c,v 1.22 1995/04/23 22:04:57 gibbs Exp $
+ * $Id: aic7xxx.c,v 1.23 1995/04/27 17:47:16 gibbs Exp $
*/
/*
* TODO:
@@ -1024,23 +1024,31 @@ ahcintr(unit)
scb_index = inb(SCBPTR + iobase);
scb = ahc->scbarray[scb_index];
+
+ /*
+ * Set the default return value to 0 (don't
+ * send sense). The sense code with change
+ * this if needed and this reduces code
+ * duplication.
+ */
+ outb(HA_RETURN_1 + iobase, 0);
if (!scb || !(scb->flags & SCB_ACTIVE)) {
printf("ahc%d: ahcintr - referenced scb not "
- "valid during seqint 0x%x scb(%d)\n",
- unit, intstat, scb_index);
+ "valid during seqint 0x%x scb(%d)\n",
+ unit, intstat, scb_index);
goto clear;
- }
+ }
- xs = scb->xs;
+ xs = scb->xs;
- ahc_getscb(iobase, scb);
+ ahc_getscb(iobase, scb);
#ifdef AHC_DEBUG
- if(xs->sc_link->target == DEBUGTARG)
+ if(xs->sc_link->target == DEBUGTARG)
ahc_print_scb(scb);
#endif
- xs->status = scb->target_status;
- switch(scb->target_status){
+ xs->status = scb->target_status;
+ switch(scb->target_status){
case SCSI_OK:
printf("ahc%d: Interrupted for staus of"
" 0???\n", unit);
@@ -1131,7 +1139,6 @@ ahcintr(unit)
* we already had.
*/
scb->flags &= ~SCB_SENSE;
- outb(HA_RETURN_1 + iobase, 0);
if(xs->error == XS_NOERROR)
xs->error = XS_DRIVER_STUFFUP;
break;
OpenPOWER on IntegriCloud