Source-Changes-HG archive

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

[src/thorpej_scsipi]: src/sys/arch Port to thorpej_scsipi.



details:   https://anonhg.NetBSD.org/src/rev/5c3843dcba81
branches:  thorpej_scsipi
changeset: 477429:5c3843dcba81
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Mar 29 09:02:55 2001 +0000

description:
Port to thorpej_scsipi.

diffstat:

 sys/arch/amiga/dev/cbiiisc.c         |    4 +-
 sys/arch/amiga/dev/flsc.c            |    8 +-
 sys/arch/amiga/dev/sbic.c            |   62 +-----
 sys/arch/amiga/dev/sbicvar.h         |    4 +-
 sys/arch/amiga/dev/sci.c             |   47 +----
 sys/arch/amiga/dev/siop.c            |   49 +----
 sys/arch/amiga/dev/siop2.c           |   47 +----
 sys/arch/amiga/dev/siopvar.h         |    4 +-
 sys/arch/amiga/dev/zssc.c            |   28 +-
 sys/arch/arm32/podulebus/asc.c       |   61 +++--
 sys/arch/arm32/podulebus/cosc.c      |   67 +++---
 sys/arch/arm32/podulebus/csa.c       |   10 +-
 sys/arch/arm32/podulebus/csc.c       |   62 +++--
 sys/arch/arm32/podulebus/esc.c       |  167 +++++------------
 sys/arch/arm32/podulebus/escvar.h    |   15 +-
 sys/arch/arm32/podulebus/oak.c       |   10 +-
 sys/arch/arm32/podulebus/ptsc.c      |   64 +++---
 sys/arch/arm32/podulebus/sbic.c      |  340 +++++++++++++---------------------
 sys/arch/arm32/podulebus/sbicvar.h   |    6 +-
 sys/arch/arm32/podulebus/sfas.c      |  168 +++++------------
 sys/arch/arm32/podulebus/sfasvar.h   |   10 +-
 sys/arch/arm32/shark/shark_machdep.c |    8 +-
 sys/arch/mvme68k/dev/ncrsc_pcctwo.c  |   36 +--
 sys/arch/mvme68k/dev/sbic.c          |  309 +++++++++++++------------------
 sys/arch/mvme68k/dev/sbicvar.h       |    9 +-
 sys/arch/mvme68k/dev/siop.c          |  217 ++++++++++-----------
 sys/arch/mvme68k/dev/siopvar.h       |    9 +-
 sys/arch/mvme68k/dev/wdsc.c          |   39 +--
 sys/arch/mvme68k/mvme68k/autoconf.c  |    4 +-
 sys/arch/pc532/dev/ncr.c             |    6 +-
 sys/arch/pc532/pc532/disksubr.c      |    7 +-
 sys/arch/pmax/dev/rz.c               |    8 +-
 sys/arch/pmax/dev/sii.c              |  126 +++++++-----
 sys/arch/pmax/dev/siivar.h           |    7 +-
 sys/arch/pmax/pmax/autoconf.c        |    6 +-
 sys/arch/pmax/tc/asc_pmaz.c          |    6 +-
 36 files changed, 815 insertions(+), 1215 deletions(-)

diffs (truncated from 3629 to 300 lines):

diff -r f3c9b7ac4fd1 -r 5c3843dcba81 sys/arch/amiga/dev/cbiiisc.c
--- a/sys/arch/amiga/dev/cbiiisc.c      Thu Mar 29 09:00:03 2001 +0000
+++ b/sys/arch/amiga/dev/cbiiisc.c      Thu Mar 29 09:02:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cbiiisc.c,v 1.5.2.1 2000/11/20 19:58:30 bouyer Exp $   */
+/*     $NetBSD: cbiiisc.c,v 1.5.2.2 2001/03/29 09:02:55 bouyer Exp $   */
 
 /*
  * Copyright (c) 1994,1998 Michael L. Hitch
@@ -137,7 +137,7 @@
 
        siopnginitialize(sc);
 
-       if (sc->sc_link.scsipi_scsi.max_target < 0)
+       if (sc->sc_channel.chan_ntargets < 0)
                return;
 
        sc->sc_isr.isr_intr = cbiiisc_dmaintr;
diff -r f3c9b7ac4fd1 -r 5c3843dcba81 sys/arch/amiga/dev/flsc.c
--- a/sys/arch/amiga/dev/flsc.c Thu Mar 29 09:00:03 2001 +0000
+++ b/sys/arch/amiga/dev/flsc.c Thu Mar 29 09:02:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: flsc.c,v 1.25.2.1 2000/11/20 19:58:32 bouyer Exp $     */
+/*     $NetBSD: flsc.c,v 1.25.2.2 2001/03/29 09:02:55 bouyer Exp $     */
 
 /*
  * Copyright (c) 1997 Michael L. Hitch
@@ -258,7 +258,7 @@
         */
        if (reg == NCR_SELID) {
                ti = &sc->sc_tinfo[
-                   sc->sc_nexus->xs->sc_link->scsipi_scsi.target];
+                   sc->sc_nexus->xs->xs_periph->periph_target];
                if (sc->sc_nexus->xs->xs_control & XS_CTL_POLL) {
                        if (ti->flags & T_SYNCMODE) {
                                ti->flags ^= T_SYNCMODE | T_NEGOTIATE;
@@ -281,7 +281,7 @@
            sc->sc_flags & NCR_SYNCHNEGO &&
             sc->sc_nexus->xs->xs_control & XS_CTL_POLL) {
                ti = &sc->sc_tinfo[
-                   sc->sc_nexus->xs->sc_link->scsipi_scsi.target];
+                   sc->sc_nexus->xs->xs_periph->periph_target];
                ti->offset = 0;
        }
        fsc->sc_reg[reg * 4] = v;
@@ -335,7 +335,7 @@
 struct ncr53c9x_tinfo *ti;
 
 if (sc->sc_nexus)
-  ti = &sc->sc_tinfo[sc->sc_nexus->xs->sc_link->scsipi_scsi.target];
+  ti = &sc->sc_tinfo[sc->sc_nexus->xs->xs_periph->periph_target];
 else
   ti = &sc->sc_tinfo[1];       /* XXX */
 if (fsc->sc_active) {
diff -r f3c9b7ac4fd1 -r 5c3843dcba81 sys/arch/amiga/dev/sbic.c
--- a/sys/arch/amiga/dev/sbic.c Thu Mar 29 09:00:03 2001 +0000
+++ b/sys/arch/amiga/dev/sbic.c Thu Mar 29 09:02:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbic.c,v 1.36.2.1 2000/11/20 19:58:40 bouyer Exp $     */
+/*     $NetBSD: sbic.c,v 1.36.2.2 2001/03/29 09:02:55 bouyer Exp $     */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -141,7 +141,6 @@
 int    sync_debug = 0;
 int    sbic_dma_debug = 0;
 int    reselect_debug = 0;
-int    report_sense = 0;
 int    data_pointer_debug = 0;
 u_char debug_asr, debug_csr, routine;
 void sbictimeout __P((struct sbic_softc *dev));
@@ -559,11 +558,9 @@
                return;
        }
 #endif
-       /*
-        * is this right?
-        */
+
        xs->status = stat;
-
+       xs->resid = 0;          /* XXXX */
 #ifdef DEBUG
        if( data_pointer_debug > 1 )
                printf("scsidone: (%d,%d)->(%d,%d)%02x\n",
@@ -574,54 +571,10 @@
                panic("target == hostid");
 #endif
 
-       if (xs->error == XS_NOERROR && !(acb->flags & ACB_CHKSENSE)) {
-               if (stat == SCSI_CHECK) {
-                       /* Schedule a REQUEST SENSE */
-                       struct scsipi_sense *ss = (void *)&acb->cmd;
-#ifdef DEBUG
-                       if (report_sense)
-                               printf("sbic_scsidone: autosense %02x targ %d lun %d",
-                                   acb->cmd.opcode, periph->periph_target,
-                                       periph->periph_lun);
-#endif
-                       bzero(ss, sizeof(*ss));
-                       ss->opcode = REQUEST_SENSE;
-                       ss->byte2 = periph->periph_lun << 5;
-                       ss->length = sizeof(struct scsipi_sense_data);
-                       acb->clen = sizeof(*ss);
-                       acb->sc_kv.dc_addr = (char *)&xs->sense.scsi_sense;
-                       acb->sc_kv.dc_count = sizeof(struct scsipi_sense_data);
-                       acb->pa_addr = (char *)kvtop((u_char *)&xs->sense.scsi_sense); /* XXX check */
-                       acb->flags = ACB_ACTIVE | ACB_CHKSENSE | ACB_DATAIN;
-                       TAILQ_INSERT_HEAD(&dev->ready_list, acb, chain);
-                       dev->sc_tinfo[periph->periph_target].lubusy &=
-                           ~(1 << periph->periph_lun);
-                       dev->sc_tinfo[periph->periph_target].senses++;
-                       if (dev->sc_nexus == acb) {
-                               dev->sc_nexus = NULL;
-                               dev->sc_xs = NULL;
-                               sbic_sched(dev);
-                       }
-                       SBIC_TRACE(dev);
-                       return;
-               }
+       if (xs->error == XS_NOERROR) {
+               if (stat == SCSI_CHECK || stat == SCSI_BUSY)
+               xs->error == XS_BUSY;
        }
-       if (xs->error == XS_NOERROR && (acb->flags & ACB_CHKSENSE)) {
-               xs->error = XS_SENSE;
-#ifdef DEBUG
-               if (report_sense)
-                       printf(" => %02x %02x\n", xs->sense.scsi_sense.flags,
-                           xs->sense.scsi_sense.extra_bytes[3]);
-#endif
-       } else {
-               xs->resid = 0;          /* XXXX */
-       }
-#if whataboutthisone
-               case SCSI_BUSY:
-                       xs->error = XS_BUSY;
-                       break;
-#endif
-       xs->xs_status |= XS_STS_DONE;
 
        /*
         * Remove the ACB from whatever queue it's on.  We have to do a bit of
@@ -2892,10 +2845,9 @@
            dev->sc_dmacmd, dev->sc_dmamask);
        for (i = 0; i < 8; ++i) {
                if (dev->sc_tinfo[i].cmds > 2) {
-                       printf("tgt %d: cmds %d disc %d senses %d lubusy %x\n",
+                       printf("tgt %d: cmds %d disc %d lubusy %x\n",
                            i, dev->sc_tinfo[i].cmds,
                            dev->sc_tinfo[i].dconns,
-                           dev->sc_tinfo[i].senses,
                            dev->sc_tinfo[i].lubusy);
                }
        }
diff -r f3c9b7ac4fd1 -r 5c3843dcba81 sys/arch/amiga/dev/sbicvar.h
--- a/sys/arch/amiga/dev/sbicvar.h      Thu Mar 29 09:00:03 2001 +0000
+++ b/sys/arch/amiga/dev/sbicvar.h      Thu Mar 29 09:02:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbicvar.h,v 1.14.10.1 2000/11/20 19:58:41 bouyer Exp $ */
+/*     $NetBSD: sbicvar.h,v 1.14.10.2 2001/03/29 09:02:56 bouyer Exp $ */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -70,7 +70,6 @@
 #define ACB_FREE       0x00
 #define ACB_ACTIVE     0x01
 #define ACB_DONE       0x04
-#define ACB_CHKSENSE   0x08
 #define ACB_BBUF       0x10    /* DMA input needs to be copied from bounce */
 #define        ACB_DATAIN      0x20    /* DMA direction flag */
        struct scsi_generic cmd;        /* SCSI command block */
@@ -95,7 +94,6 @@
        int     dconns;         /* #disconnects */
        int     touts;          /* #timeouts */
        int     perrs;          /* #parity errors */
-       int     senses;         /* #request sense commands sent */
        u_char* bounce;         /* Bounce buffer for this device */
        ushort  lubusy;         /* What local units/subr. are busy? */
        u_char  flags;
diff -r f3c9b7ac4fd1 -r 5c3843dcba81 sys/arch/amiga/dev/sci.c
--- a/sys/arch/amiga/dev/sci.c  Thu Mar 29 09:00:03 2001 +0000
+++ b/sys/arch/amiga/dev/sci.c  Thu Mar 29 09:02:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sci.c,v 1.21.2.1 2000/11/20 19:58:41 bouyer Exp $      */
+/*     $NetBSD: sci.c,v 1.21.2.2 2001/03/29 09:02:56 bouyer Exp $      */
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -71,7 +71,6 @@
 
 int  sciicmd __P((struct sci_softc *, int, void *, int, void *, int,u_char));
 int  scigo __P((struct sci_softc *, struct scsipi_xfer *));
-int  scigetsense __P((struct sci_softc *, struct scsipi_xfer *));
 int  sciselectbus __P((struct sci_softc *, u_char, u_char));
 void sciabort __P((struct sci_softc *, char *));
 void scierror __P((struct sci_softc *, u_char));
@@ -218,25 +217,17 @@
        if (xs == NULL)
                panic("sci_scsidone");
 #endif
-       /*
-        * is this right?
-        */
        xs->status = stat;
-
        if (stat == 0)
                xs->resid = 0;
        else {
                switch(stat) {
                case SCSI_CHECK:
-                       stat = scigetsense(dev, xs);
-                       if (stat != 0)
-                               goto bad_sense;
-                       xs->error = XS_SENSE;
-                       break;
+                       xs->resid = 0;
+                       /* FALLTHOUGH */
                case SCSI_BUSY:
                        xs->error = XS_BUSY;
                        break;
-               bad_sense:
                default:
                        xs->error = XS_DRIVER_STUFFUP;
                        QPRINTF(("sci_scsicmd() bad %x\n", stat));
@@ -244,42 +235,10 @@
                }
        }
 
-       xs->xs_status |= XS_STS_DONE;
-
-       /*
-        * grab next command before scsipi_done()
-        * this way no single device can hog scsi resources.
-        */
        scsipi_done(xs);
 
 }
 
-int
-scigetsense(dev, xs)
-       struct sci_softc *dev;
-       struct scsipi_xfer *xs;
-{
-       struct scsipi_sense rqs;
-       struct scsipi_periph *periph;
-
-       periph = xs->xs_periph;
-
-       rqs.opcode = REQUEST_SENSE;
-       rqs.byte2 = periph->periph_lun << 5;
-#ifdef not_yet
-       rqs.length = xs->req_sense_length ? xs->req_sense_length :
-           sizeof(xs->sense.scsi_sense);
-#else
-       rqs.length = sizeof(xs->sense.scsi_sense);
-#endif
-
-       rqs.unused[0] = rqs.unused[1] = rqs.control = 0;
-
-       return(sciicmd(dev, periph->periph_target, &rqs, sizeof(rqs),
-               &xs->sense.scsi_sense,
-           rqs.length, DATA_IN_PHASE));
-}
-
 void
 sciabort(dev, where)
        struct sci_softc *dev;
diff -r f3c9b7ac4fd1 -r 5c3843dcba81 sys/arch/amiga/dev/siop.c
--- a/sys/arch/amiga/dev/siop.c Thu Mar 29 09:00:03 2001 +0000
+++ b/sys/arch/amiga/dev/siop.c Thu Mar 29 09:02:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: siop.c,v 1.43.2.1 2000/11/20 19:58:42 bouyer Exp $     */
+/*     $NetBSD: siop.c,v 1.43.2.2 2001/03/29 09:02:56 bouyer Exp $     */
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -400,46 +400,14 @@
        }
        periph = xs->xs_periph;
        sc = (void *)periph->periph_channel->chan_adapter->adapt_dev;
-       /*
-        * is this right?
-        */
+        
        xs->status = stat;
+       xs->resid = 0;          /* XXXX */
 
-       if (xs->error == XS_NOERROR && !(acb->flags & ACB_CHKSENSE)) {
-               if (stat == SCSI_CHECK) {
-                       struct scsipi_sense *ss = (void *)&acb->cmd;
-                       bzero(ss, sizeof(*ss));
-                       ss->opcode = REQUEST_SENSE;
-                       ss->byte2 = slp->scsipi_scsi.lun << 5;
-                       ss->length = sizeof(struct scsipi_sense_data);
-                       acb->clen = sizeof(*ss);
-                       acb->daddr = (char *)&xs->sense.scsi_sense;
-                       acb->dleft = sizeof(struct scsipi_sense_data);
-                       acb->flags = ACB_ACTIVE | ACB_CHKSENSE;
-                       TAILQ_INSERT_HEAD(&sc->ready_list, acb, chain);



Home | Main Index | Thread Index | Old Index