Source-Changes-HG archive

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

[src/thorpej_scsipi]: src/sys/dev/i2o Fix a couple of style nits & merge errors.



details:   https://anonhg.NetBSD.org/src/rev/a6b810d859d6
branches:  thorpej_scsipi
changeset: 477420:a6b810d859d6
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Mar 27 15:58:41 2001 +0000

description:
Fix a couple of style nits & merge errors.

diffstat:

 sys/dev/i2o/iopsp.c |  38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

diffs (134 lines):

diff -r 84a194a181ab -r a6b810d859d6 sys/dev/i2o/iopsp.c
--- a/sys/dev/i2o/iopsp.c       Tue Mar 27 15:52:51 2001 +0000
+++ b/sys/dev/i2o/iopsp.c       Tue Mar 27 15:58:41 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iopsp.c,v 1.2.2.7 2001/03/27 15:31:52 bouyer Exp $     */
+/*     $NetBSD: iopsp.c,v 1.2.2.8 2001/03/27 15:58:41 ad Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
 static int     iopsp_reconfig(struct device *);
 static int     iopsp_scsi_abort(struct iopsp_softc *, int, struct iop_msg *);
 static void    iopsp_scsipi_request(struct scsipi_channel *,
-                           scsipi_adapter_req_t, void *);
+                                    scsipi_adapter_req_t, void *);
 
 struct cfattach iopsp_ca = {
        sizeof(struct iopsp_softc), iopsp_match, iopsp_attach
@@ -193,7 +193,7 @@
        sc->sc_channel.chan_bustype = &scsi_bustype;
        sc->sc_channel.chan_channel = 0;
        sc->sc_channel.chan_ntargets = fcal ?
-                       IOPSP_MAX_FCAL_TARGET : param.p.sci.maxdatawidth;
+           IOPSP_MAX_FCAL_TARGET : param.p.sci.maxdatawidth;
        sc->sc_channel.chan_nluns = IOPSP_MAX_LUN;
        sc->sc_channel.chan_id = le32toh(param.p.sci.initiatorid);
 
@@ -412,17 +412,20 @@
  */
 static void
 iopsp_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
-       void *arg)
+                    void *arg)
 {
        struct scsipi_xfer *xs;
        struct scsipi_periph *periph;
-       struct iopsp_softc *sc = (void *)chan->chan_adapter->adapt_dev;
+       struct iopsp_softc *sc;
        struct iop_msg *im;
-       struct iop_softc *iop = (struct iop_softc *)sc->sc_dv.dv_parent;
+       struct iop_softc *iop;
        struct i2o_scsi_scb_exec *mf;
        int error, flags, tid, imf;
        u_int32_t mb[IOP_MAX_MSG_SIZE / sizeof(u_int32_t)];
 
+       sc = (void *)chan->chan_adapter->adapt_dev;
+       iop = (struct iop_softc *)sc->sc_dv.dv_parent;
+
        switch (req) {
        case ADAPTER_REQ_RUN_XFER:
                xs = arg;
@@ -430,7 +433,7 @@
                flags = xs->xs_control;
 
                tid = IOPSP_TIDMAP(sc->sc_tidmap, periph->periph_target,
-                    periph->periph_lun);
+                   periph->periph_lun);
                if (tid == IOPSP_TID_ABSENT || tid == IOPSP_TID_INUSE) {
                        xs->error = XS_SELTIMEOUT;
                        scsipi_done(xs);
@@ -442,7 +445,7 @@
                /* Need to reset the target? */
                if ((flags & XS_CTL_RESET) != 0) {
                        if (iop_simple_cmd(iop, tid, I2O_SCSI_DEVICE_RESET,
-                       sc->sc_ii.ii_ictx, 1, 10*1000) != 0) {
+                           sc->sc_ii.ii_ictx, 1, 10*1000) != 0) {
 #ifdef I2ODEBUG
                                printf("%s: reset failed\n",
                                    sc->sc_dv.dv_xname);
@@ -460,8 +463,8 @@
                        panic("%s: CDB too large\n", sc->sc_dv.dv_xname);
 #endif
 
-               imf = (flags & (XS_CTL_POLL | XS_CTL_NOSLEEP)) != 0 ?
-                                                               IM_POLL : 0;                    im = iop_msg_alloc(iop, &sc->sc_ii, imf);
+               imf = (flags & (XS_CTL_POLL|XS_CTL_NOSLEEP)) != 0 ? IM_POLL : 0;
+               im = iop_msg_alloc(iop, &sc->sc_ii, imf);
                im->im_dvcontext = xs;
 
                mf = (struct i2o_scsi_scb_exec *)mb;
@@ -487,6 +490,7 @@
                default:
                        break;
                }
+
                if (xs->datalen != 0) {
                        error = iop_msg_map_bio(iop, im, mb, xs->data,
                            xs->datalen, (flags & XS_CTL_DATA_OUT) == 0);
@@ -518,7 +522,7 @@
                                xs->error = XS_DRIVER_STUFFUP;
                                scsipi_done(xs);
                        }
-                       return;
+                       break;
                }
 
                if (iop_msg_post(iop, im, mb, xs->timeout)) {
@@ -531,13 +535,15 @@
                        xs->error = XS_TIMEOUT;
                }
                scsipi_done(xs);
-               return;
+               break;
+
        case ADAPTER_REQ_GROW_RESOURCES:
                /* XXX Not supported. */
-               return;
+               break;
+
        case ADAPTER_REQ_SET_XFER_MODE:
                /* XXX Not supported. */
-               return;
+               break;
        }
 }
 
@@ -657,8 +663,6 @@
 
        switch (cmd) {
        case SCBUSIOLLSCAN:
-               rv = iopsp_rescan(
-                   (struct iopsp_softc *)chan->chan_adapter->adapt_dev);
                /*
                 * If it's boot time, the bus will have been scanned and the
                 * maps built.  Locking would stop re-configuration, but we
@@ -675,7 +679,7 @@
                rv = ENOTTY;
                break;
        }
-       
+
        return (rv);
 }
 



Home | Main Index | Thread Index | Old Index