Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Checking in cosmetic changes -- no functional cha...



details:   https://anonhg.NetBSD.org/src/rev/4e3ab7b14c7a
branches:  trunk
changeset: 328717:4e3ab7b14c7a
user:      buhrow <buhrow%NetBSD.org@localhost>
date:      Tue Apr 15 05:27:54 2014 +0000

description:
Checking in cosmetic changes -- no functional change.
(Suggestions made by Taylor Campbell)

diffstat:

 sys/dev/ic/mpt_netbsd.c |  60 ++++++++++++++++++++++++++++--------------------
 1 files changed, 35 insertions(+), 25 deletions(-)

diffs (167 lines):

diff -r f5d4d10ebcbd -r 4e3ab7b14c7a sys/dev/ic/mpt_netbsd.c
--- a/sys/dev/ic/mpt_netbsd.c   Mon Apr 14 23:53:42 2014 +0000
+++ b/sys/dev/ic/mpt_netbsd.c   Tue Apr 15 05:27:54 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpt_netbsd.c,v 1.21 2014/04/11 18:01:12 buhrow Exp $   */
+/*     $NetBSD: mpt_netbsd.c,v 1.22 2014/04/15 05:27:54 buhrow Exp $   */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.21 2014/04/11 18:01:12 buhrow Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpt_netbsd.c,v 1.22 2014/04/15 05:27:54 buhrow Exp $");
 
 #include <dev/ic/mpt.h>                        /* pulls in all headers */
 #include <sys/scsiio.h>
@@ -145,8 +145,12 @@
        chan->chan_ntargets = mpt->mpt_max_devices;
        chan->chan_id = mpt->mpt_ini_id;
 
-/*Save the output of the config so we can rescan the bus in case of errors*/
-       mpt->sc_scsibus_dv = config_found(mpt->sc_dev, &mpt->sc_channel, scsiprint);
+       /*
+       * Save the output of the config so we can rescan the bus in case of 
+       * errors
+       */
+       mpt->sc_scsibus_dv = config_found(mpt->sc_dev, &mpt->sc_channel, 
+       scsiprint);
 }
 
 int
@@ -373,7 +377,7 @@
        mpt->timeouts++;
        if (mpt_intr(mpt)) {
                if (req->sequence != oseq) {
-                       mpt->success ++;
+                       mpt->success++;
                        mpt_prt(mpt, "recovered from command timeout");
                        splx(s);
                        return;
@@ -381,8 +385,8 @@
        }
 
        /*
-        *Ensure the IOC is really done giving us data since it appears it can
-        *sometimes fail to give us interrupts under heavy load.
+        * Ensure the IOC is really done giving us data since it appears it can
+        * sometimes fail to give us interrupts under heavy load.
         */
        nrepl = mpt_drain_queue(mpt);
        if (nrepl ) {
@@ -390,7 +394,7 @@
        }
 
        if (req->sequence != oseq) {
-               mpt->success ++;
+               mpt->success++;
                splx(s);
                return;
        }
@@ -422,14 +426,17 @@
        /* first, reset the IOC, leaving stopped so all requests are idle */
        if (mpt_soft_reset(mpt) != MPT_OK) {
                mpt_prt(mpt, "soft reset failed");
-               /* don't try a hard reset since this mangles the PCI configuration registers */
+               /* 
+               * Don't try a hard reset since this mangles the PCI 
+               * configuration registers.
+               */
                return;
        }
 
-       /* freeze the channel so scsipi doesn't queue more commands */
+       /* Freeze the channel so scsipi doesn't queue more commands. */
        scsipi_channel_freeze(&mpt->sc_channel, 1);
 
-       /* return all pending requests to scsipi and de-allocate them */
+       /* Return all pending requests to scsipi and de-allocate them. */
        s = splbio();
        nreq = 0;
        for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) {
@@ -445,7 +452,10 @@
                                xs->error = XS_REQUEUE;
                        }
                        scsipi_done(xs);
-                       /* don't really need to mpt_free_request() since mpt_init() below will free all requests anyway */
+                       /*
+                       * Don't need to mpt_free_request() since mpt_init() 
+                       * below will free all requests anyway.
+                       */
                        mpt_free_request(mpt, req);
                }
        }
@@ -453,17 +463,17 @@
        if (nreq > 0)
                mpt_prt(mpt, "re-queued %d requests", nreq);
 
-       /* re-initialize the IOC (which restarts it) */
+       /* Re-initialize the IOC (which restarts it). */
        if (mpt_init(mpt, MPT_DB_INIT_HOST) == 0)
                mpt_prt(mpt, "restart succeeded");
        /* else error message already printed */
 
-       /* thaw the channel, causing scsipi to re-queue the commands */
+       /* Thaw the channel, causing scsipi to re-queue the commands. */
        scsipi_channel_thaw(&mpt->sc_channel, 1);
 }
 
-static
-int mpt_drain_queue(mpt_softc_t *mpt)
+static int 
+mpt_drain_queue(mpt_softc_t *mpt)
 {
        int nrepl = 0;
        uint32_t reply;
@@ -495,7 +505,7 @@
        request_t *req;
        MSG_REQUEST_HEADER *mpt_req;
        MSG_SCSI_IO_REPLY *mpt_reply;
-       int restart = 0; /*nonzero if we need to restart the IOC*/
+       int restart = 0; /* nonzero if we need to restart the IOC*/
 
        if (__predict_true((reply & MPT_CONTEXT_REPLY) == 0)) {
                /* context reply (ok) */
@@ -633,7 +643,7 @@
        }
 
        xs->status = mpt_reply->SCSIStatus;
-       switch ((le16toh(mpt_reply->IOCStatus) & MPI_IOCSTATUS_MASK)) {
+       switch (le16toh(mpt_reply->IOCStatus) & MPI_IOCSTATUS_MASK) {
        case MPI_IOCSTATUS_SCSI_DATA_OVERRUN:
                xs->error = XS_DRIVER_STUFFUP;
                mpt_prt(mpt,"mpt_done: IOC overrun!");
@@ -728,11 +738,10 @@
 
        case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR:
                /*
-                *FreeBSD and Linux indicate this is a phase error between
-                *the IOC and the drive itself. 
-               *When this happens, the IOC becomes unhappy and stops processing
-               *all transactions.  Call mpt_timeout which knows how to
-               *get the IOC back on its feet.
+                * FreeBSD and Linux indicate this is a phase error between
+                * the IOC and the drive itself. When this happens, the IOC
+               * becomes unhappy and stops processing all transactions.  
+               * Call mpt_timeout which knows how to get the IOC back on its feet.
                 */
                 mpt_prt(mpt,"mpt_done: IOC indicates protocol error -- recovering...");
                xs->error = XS_TIMEOUT;
@@ -761,12 +770,13 @@
        }
 
  done:
-       if (le16toh(mpt_reply->IOCStatus) & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) {
+       if (le16toh(mpt_reply->IOCStatus) & 
+       MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) {
                mpt_prt(mpt,"mpt_done: IOC has error - logging...\n");
                mpt_ctlop(mpt, mpt_reply, reply);
        }
 
-       /* If IOC done with this requeset, free it up. */
+       /* If IOC done with this request, free it up. */
        if (mpt_reply == NULL || (mpt_reply->MsgFlags & 0x80) == 0)
                mpt_free_request(mpt, req);
 



Home | Main Index | Thread Index | Old Index