Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Don't try to re-enable tags once they have been d...



details:   https://anonhg.NetBSD.org/src/rev/657229e5d967
branches:  trunk
changeset: 486467:657229e5d967
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Mon May 22 21:14:24 2000 +0000

description:
Don't try to re-enable tags once they have been disabled because of a
MSG_REJECT from the target. Obey the NOTAG quirk.

diffstat:

 sys/dev/ic/aic7xxx.c    |  34 ++++++++++++++++++++++++++--------
 sys/dev/ic/aic7xxxvar.h |   3 ++-
 2 files changed, 28 insertions(+), 9 deletions(-)

diffs (121 lines):

diff -r aea219588dc0 -r 657229e5d967 sys/dev/ic/aic7xxx.c
--- a/sys/dev/ic/aic7xxx.c      Mon May 22 20:13:31 2000 +0000
+++ b/sys/dev/ic/aic7xxx.c      Mon May 22 21:14:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxx.c,v 1.48 2000/05/19 04:34:41 thorpej Exp $     */
+/*     $NetBSD: aic7xxx.c,v 1.49 2000/05/22 21:14:24 fvdl Exp $        */
 
 /*
  * Generic driver for the aic7xxx based adaptec SCSI controllers
@@ -1393,8 +1393,10 @@
 
        if (enable)
                tstate->tagenable |= devinfo->target_mask;
-       else
+       else {
                tstate->tagenable &= ~devinfo->target_mask;
+               tstate->tagdisable |= devinfo->target_mask;
+       }
 }
 
 /*
@@ -1878,8 +1880,10 @@
                                }
                        }
                        break;
+               case SCSI_STATUS_QUEUE_FULL:
+                       scsi_print_addr(xs->sc_link);
+                       printf("queue full\n");
                case SCSI_STATUS_BUSY:
-               case SCSI_STATUS_QUEUE_FULL:
                        /*
                         * Requeue any transactions that haven't been
                         * sent yet.
@@ -3732,6 +3736,7 @@
                tstate->ultraenb = ultraenb;
                tstate->discenable = discenable;
                tstate->tagenable = 0; /* Wait until the XPT says its okay */
+               tstate->tagdisable = 0;
        }
        ahc->user_discenable = discenable;
        ahc->user_tagenable = tagenable;
@@ -5582,13 +5587,26 @@
 {
        struct scsipi_inquiry_data *inq;
        struct ahc_devinfo devinfo;
+       struct tmode_tstate *tstate;
        int target_id, our_id;
+       char channel;
 
        if (xs->cmd->opcode != INQUIRY || xs->error != XS_NOERROR)
                return;
 
+       if (xs->sc_link->quirks & SDEV_NOTAG)
+               return;
+
        target_id = xs->sc_link->scsipi_scsi.target;
        our_id = SIM_SCSI_ID(ahc, xs->sc_link);
+       channel = SIM_CHANNEL(ahc, xs->sc_link);
+
+       (void)ahc_fetch_transinfo(ahc, channel, our_id, target_id, &tstate);
+       ahc_compile_devinfo(&devinfo, our_id, target_id,
+           xs->sc_link->scsipi_scsi.lun, channel, ROLE_INITIATOR);
+
+       if (tstate->tagdisable & devinfo.target_mask)
+               return;
 
        /*
         * Sneak a look at the results of the SCSI Inquiry
@@ -5600,15 +5618,12 @@
                printf("%s: target %d using tagged queuing\n",
                        ahc_name(ahc), xs->sc_link->scsipi_scsi.target);
 
-               ahc_compile_devinfo(&devinfo,
-                   our_id, target_id, xs->sc_link->scsipi_scsi.lun,    
-                   SIM_CHANNEL(ahc, xs->sc_link), ROLE_INITIATOR);
                ahc_set_tags(ahc, &devinfo, TRUE);
 
                if (ahc->scb_data->maxhscbs >= 16 ||
                    (ahc->flags & AHC_PAGESCBS)) {
                        /* Default to 16 tags */
-                       xs->sc_link->openings += 14;
+                       xs->sc_link->openings = 16;
                } else {
                        /*
                         * Default to 4 tags on whimpy
@@ -5618,7 +5633,7 @@
                         * slots.  We should really have a better
                         * way of providing fairness.
                         */
-                       xs->sc_link->openings += 2;
+                       xs->sc_link->openings = 4;
                }
        }
 }
@@ -5631,6 +5646,9 @@
        struct tmode_tstate *tstate;
        struct ahc_devinfo devinfo;
 
+       if (xs->sc_link->quirks & SDEV_NOTAG)
+               return 0;
+
        channel = SIM_CHANNEL(ahc, xs->sc_link);
        our_id = SIM_SCSI_ID(ahc, xs->sc_link);
        target = xs->sc_link->scsipi_scsi.target;
diff -r aea219588dc0 -r 657229e5d967 sys/dev/ic/aic7xxxvar.h
--- a/sys/dev/ic/aic7xxxvar.h   Mon May 22 20:13:31 2000 +0000
+++ b/sys/dev/ic/aic7xxxvar.h   Mon May 22 21:14:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aic7xxxvar.h,v 1.22 2000/03/16 10:33:45 fvdl Exp $     */
+/*     $NetBSD: aic7xxxvar.h,v 1.23 2000/05/22 21:14:26 fvdl Exp $     */
 
 /*
  * Interface to the generic driver for the aic7xxx based adaptec
@@ -361,6 +361,7 @@
        u_int16_t                ultraenb;      /* Using ultra sync rate  */
        u_int16_t                discenable;    /* Disconnection allowed  */
        u_int16_t                tagenable;     /* Tagged Queuing allowed */
+       u_int16_t                tagdisable;    /* TQ explicity disallowed */
 };
 
 #define AHC_TARGET_WILDCARD -1



Home | Main Index | Thread Index | Old Index