Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic make the driver able to send scsi commands; now t...



details:   https://anonhg.NetBSD.org/src/rev/ad9506314a7f
branches:  trunk
changeset: 790462:ad9506314a7f
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 13 04:24:21 2013 +0000

description:
make the driver able to send scsi commands; now the disks are found.
it was converted incorrectly to device_t.

diffstat:

 sys/dev/ic/ciss.c |  20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diffs (76 lines):

diff -r fc57ecc22212 -r ad9506314a7f sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Sat Oct 12 22:37:43 2013 +0000
+++ b/sys/dev/ic/ciss.c Sun Oct 13 04:24:21 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss.c,v 1.30 2013/10/12 16:52:21 christos Exp $       */
+/*     $NetBSD: ciss.c,v 1.31 2013/10/13 04:24:21 christos Exp $       */
 /*     $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $       */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.30 2013/10/12 16:52:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.31 2013/10/13 04:24:21 christos Exp $");
 
 #include "bio.h"
 
@@ -599,7 +599,7 @@
 
                        error = ciss_done(ccb1);
                        if (ccb1 == ccb)
-                               return error;
+                               break;
                }
 
                /* if never got a chance to be done above... */
@@ -986,8 +986,8 @@
        void *arg)                              /* TODO */
 {
        struct scsipi_xfer *xs = (struct scsipi_xfer *) arg;
-       struct ciss_rawsoftc *rsc =
-               (struct ciss_rawsoftc *) chan->chan_adapter->adapt_dev;
+       struct ciss_rawsoftc *rsc = device_private(
+           chan->chan_adapter->adapt_dev);
        struct ciss_softc *sc = rsc->sc_softc;
        struct ciss_ccb *ccb;
        struct ciss_cmd *cmd;
@@ -1063,8 +1063,7 @@
 {
        struct scsipi_xfer *xs;
        struct scsipi_xfer_mode *xm;
-       struct ciss_softc *sc =
-               (struct ciss_softc *) chan->chan_adapter->adapt_dev;
+       struct ciss_softc *sc = device_private(chan->chan_adapter->adapt_dev);
        u_int8_t target;
        struct ciss_ccb *ccb;
        struct ciss_cmd *cmd;
@@ -1137,6 +1136,8 @@
                xm->xm_mode |= PERIPH_CAP_TQING;
                scsipi_async_event(chan, ASYNC_EVENT_XFER_MODE, xm);
                break;
+       default:
+               printf("%s: %d %d unsupported\n", __func__, __LINE__, req);
        }
 }
 
@@ -1151,6 +1152,9 @@
 
        CISS_DPRINTF(CISS_D_INTR, ("intr "));
 
+       if (!(bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_ISR) & sc->iem))
+               return 0;
+
        if (sc->cfg.methods & CISS_METH_FIFO64)
                reg = CISS_OUTQ64_HI;
        else if (sc->cfg.methods & CISS_METH_FIFO64_RRO)
@@ -1234,7 +1238,7 @@
 int
 ciss_ioctl(device_t dev, u_long cmd, void *addr)
 {
-       struct ciss_softc       *sc = (struct ciss_softc *)dev;
+       struct ciss_softc       *sc = device_private(dev);
        struct bioc_inq *bi;
        struct bioc_disk *bd;
        struct bioc_blink *bb;



Home | Main Index | Thread Index | Old Index