Module Name: src Committed By: buhrow Date: Tue Apr 15 05:27:54 UTC 2014
Modified Files: src/sys/dev/ic: mpt_netbsd.c Log Message: Checking in cosmetic changes -- no functional change. (Suggestions made by Taylor Campbell) To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/mpt_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/mpt_netbsd.c diff -u src/sys/dev/ic/mpt_netbsd.c:1.21 src/sys/dev/ic/mpt_netbsd.c:1.22 --- src/sys/dev/ic/mpt_netbsd.c:1.21 Fri Apr 11 18:01:12 2014 +++ src/sys/dev/ic/mpt_netbsd.c Tue Apr 15 05:27:54 2014 @@ -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 @@ mpt_scsipi_attach(mpt_softc_t *mpt) 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_timeout(void *arg) 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 @@ mpt_timeout(void *arg) } /* - *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 @@ mpt_timeout(void *arg) } if (req->sequence != oseq) { - mpt->success ++; + mpt->success++; splx(s); return; } @@ -422,14 +426,17 @@ mpt_restart(mpt_softc_t *mpt, request_t /* 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 @@ mpt_restart(mpt_softc_t *mpt, request_t 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 @@ mpt_restart(mpt_softc_t *mpt, request_t 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 @@ mpt_done(mpt_softc_t *mpt, uint32_t repl 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 @@ mpt_done(mpt_softc_t *mpt, uint32_t repl } 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 @@ mpt_done(mpt_softc_t *mpt, uint32_t repl 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 @@ mpt_done(mpt_softc_t *mpt, uint32_t repl } 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);