Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Cosmetics. (tab/space etc.)



details:   https://anonhg.NetBSD.org/src/rev/544084e82a8f
branches:  trunk
changeset: 508835:544084e82a8f
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Apr 20 17:32:33 2001 +0000

description:
Cosmetics. (tab/space etc.)

diffstat:

 sys/dev/ic/ncr53c9x.c |  473 +++++++++++++++++++++++++------------------------
 1 files changed, 240 insertions(+), 233 deletions(-)

diffs (truncated from 1210 to 300 lines):

diff -r d3bf926e70ba -r 544084e82a8f sys/dev/ic/ncr53c9x.c
--- a/sys/dev/ic/ncr53c9x.c     Fri Apr 20 16:58:19 2001 +0000
+++ b/sys/dev/ic/ncr53c9x.c     Fri Apr 20 17:32:33 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ncr53c9x.c,v 1.71 2001/03/29 02:58:39 petrov Exp $     */
+/*     $NetBSD: ncr53c9x.c,v 1.72 2001/04/20 17:32:33 tsutsui Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -117,7 +117,8 @@
 /*static*/ void        ncr53c9x_timeout(void *arg);
 /*static*/ void        ncr53c9x_watch(void *arg);
 /*static*/ void        ncr53c9x_abort(struct ncr53c9x_softc *, struct ncr53c9x_ecb *);
-/*static*/ void ncr53c9x_dequeue(struct ncr53c9x_softc *, struct ncr53c9x_ecb *);
+/*static*/ void ncr53c9x_dequeue(struct ncr53c9x_softc *,
+                                struct ncr53c9x_ecb *);
 /*static*/ int ncr53c9x_ioctl(struct scsipi_link *, u_long,
                               caddr_t, int, struct proc *);
 
@@ -139,15 +140,15 @@
 
 
 #define NCR_SET_COUNT(sc, size) do { \
-                       NCR_WRITE_REG((sc), NCR_TCL, (size));                   \
-                       NCR_WRITE_REG((sc), NCR_TCM, (size) >> 8);              \
-                       if ((sc->sc_cfg2 & NCRCFG2_FE) ||                       \
-                           (sc->sc_rev == NCR_VARIANT_FAS366)) {               \
-                               NCR_WRITE_REG((sc), NCR_TCH, (size) >> 16);     \
-                       }                                                       \
-                       if (sc->sc_rev == NCR_VARIANT_FAS366) {                 \
-                               NCR_WRITE_REG(sc, NCR_RCH, 0);                  \
-                       }                                                       \
+               NCR_WRITE_REG((sc), NCR_TCL, (size));                   \
+               NCR_WRITE_REG((sc), NCR_TCM, (size) >> 8);              \
+               if ((sc->sc_cfg2 & NCRCFG2_FE) ||                       \
+                   (sc->sc_rev == NCR_VARIANT_FAS366)) {               \
+                       NCR_WRITE_REG((sc), NCR_TCH, (size) >> 16);     \
+               }                                                       \
+               if (sc->sc_rev == NCR_VARIANT_FAS366) {                 \
+                       NCR_WRITE_REG(sc, NCR_RCH, 0);                  \
+               }                                                       \
 } while (0)
 
 static int ecb_pool_initialized = 0;
@@ -195,7 +196,7 @@
        int64_t lun;
 {
        struct ncr53c9x_linfo *li;
-       LIST_FOREACH(li, &ti->luns, link) 
+       LIST_FOREACH(li, &ti->luns, link)
                if (li->lun == lun)
                        return (li);
        return (NULL);
@@ -222,7 +223,7 @@
                sc->sc_omess = malloc(NCR_MAX_MSG_LEN, M_DEVBUF, M_NOWAIT);
 
        if (sc->sc_imess == NULL)
-               sc->sc_imess = malloc(NCR_MAX_MSG_LEN+1, M_DEVBUF, M_NOWAIT);
+               sc->sc_imess = malloc(NCR_MAX_MSG_LEN + 1, M_DEVBUF, M_NOWAIT);
 
        if (sc->sc_omess == NULL || sc->sc_imess == NULL) {
                printf("out of memory\n");
@@ -364,8 +365,8 @@
 
        case NCR_VARIANT_FAS366:
                sc->sc_features |= NCR_F_HASCFG3 | NCR_F_FASTSCSI;
-               sc->sc_cfg3 =  NCRFASCFG3_FASTCLK | NCRFASCFG3_OBAUTO;
-               sc->sc_cfg3_fscsi =  NCRFASCFG3_FASTSCSI;
+               sc->sc_cfg3 = NCRFASCFG3_FASTCLK | NCRFASCFG3_OBAUTO;
+               sc->sc_cfg3_fscsi = NCRFASCFG3_FASTSCSI;
                NCR_WRITE_REG(sc, NCR_CFG3, sc->sc_cfg3);
                sc->sc_cfg2 = 0; /* NCRCFG2_HMEFE| NCRCFG2_HME32 */
                NCR_WRITE_REG(sc, NCR_CFG2, sc->sc_cfg2);
@@ -390,10 +391,10 @@
 #if 0
        printf("%s: ncr53c9x_reset: revision %d\n",
               sc->sc_dev.dv_xname, sc->sc_rev);
-       printf("%s: ncr53c9x_reset: cfg1 0x%x, cfg2 0x%x, cfg3 0x%x, ccf 0x%x, timeout 0x%x\n",
-              sc->sc_dev.dv_xname,
-              sc->sc_cfg1, sc->sc_cfg2, sc->sc_cfg3,
-              sc->sc_ccf, sc->sc_timeout);
+       printf("%s: ncr53c9x_reset: cfg1 0x%x, cfg2 0x%x, cfg3 0x%x, "
+           "ccf 0x%x, timeout 0x%x\n",
+           sc->sc_dev.dv_xname, sc->sc_cfg1, sc->sc_cfg2, sc->sc_cfg3,
+           sc->sc_ccf, sc->sc_timeout);
 #endif
 }
 
@@ -427,8 +428,8 @@
 
        if (!ecb_pool_initialized) {
                /* All instances share this pool */
-               pool_init(&ecb_pool, sizeof(struct ncr53c9x_ecb), 0, 0, 0, 
-                         "ncr53c9x_ecb", 0, NULL, NULL, 0);
+               pool_init(&ecb_pool, sizeof(struct ncr53c9x_ecb), 0, 0, 0,
+                   "ncr53c9x_ecb", 0, NULL, NULL, 0);
                ecb_pool_initialized = 1;
        }
 
@@ -454,11 +455,11 @@
                        LIST_FOREACH(li, &sc->sc_tinfo[r].luns, link) {
                                if ((ecb = li->untagged) != NULL) {
                                        li->untagged = NULL;
-                                       /* 
+                                       /*
                                         * XXXXXXX
                                         *
-                                        * Should we terminate a command 
-                                        * that never reached the disk? 
+                                        * Should we terminate a command
+                                        * that never reached the disk?
                                         */
                                        li->busy = 0;
                                        ecb->xs->error = XS_TIMEOUT;
@@ -486,9 +487,9 @@
 /* XXX - config flags per target: low bits: no reselect; high bits: no synch */
 
                ti->flags = ((sc->sc_minsync && !(sc->sc_cfflags & (1<<(r+8))))
-                        ? 0 : T_SYNCHOFF) |
-                       ((sc->sc_cfflags & (1<<r)) ? T_RSELECTOFF : 0) |
-                       T_NEED_TO_RESET;
+                   ? 0 : T_SYNCHOFF) |
+                   ((sc->sc_cfflags & (1<<r)) ? T_RSELECTOFF : 0) |
+                   T_NEED_TO_RESET;
 #ifdef DEBUG
                if (ncr53c9x_notag)
                        ti->flags &= ~T_TAG;
@@ -538,12 +539,11 @@
         * or some pseudo phase we use to detect certain exceptions.
         */
 
-       sc->sc_phase = (sc->sc_espintr & NCRINTR_DIS)
-                       ? /* Disconnected */ BUSFREE_PHASE
-                       : sc->sc_espstat & NCRSTAT_PHASE;
+       sc->sc_phase = (sc->sc_espintr & NCRINTR_DIS) ?
+           /* Disconnected */ BUSFREE_PHASE : sc->sc_espstat & NCRSTAT_PHASE;
 
        NCR_MISC(("regs[intr=%02x,stat=%02x,step=%02x,stat2=%02x] ",
-               sc->sc_espintr, sc->sc_espstat, sc->sc_espstep, sc->sc_espstat2));
+           sc->sc_espintr, sc->sc_espstat, sc->sc_espstep, sc->sc_espstat2));
 }
 
 /*
@@ -632,7 +632,7 @@
        size_t dmasize;
 
        NCR_TRACE(("[ncr53c9x_select(t%d,l%d,cmd:%x,tag:%x,%x)] ",
-                  target, lun, ecb->cmd.cmd.opcode, ecb->tag[0], ecb->tag[1]));
+           target, lun, ecb->cmd.cmd.opcode, ecb->tag[0], ecb->tag[1]));
 
        sc->sc_state = NCR_SELECTING;
        /*
@@ -649,7 +649,7 @@
                        timeout = (timeout * hz) / 1000;
 
                callout_reset(&ecb->xs->xs_callout, timeout,
-                             ncr53c9x_timeout, ecb);
+                   ncr53c9x_timeout, ecb);
        }
 
        /*
@@ -687,7 +687,7 @@
                        dmasize = clen = ecb->clen;
                        sc->sc_cmdlen = clen;
                        sc->sc_cmdp = (caddr_t)&ecb->cmd.cmd;
-       
+
                        /* Program the SCSI counter */
                        NCR_SET_COUNT(sc, dmasize);
 
@@ -696,18 +696,18 @@
 
                        /* And get the targets attention */
                        NCRCMD(sc, NCRCMD_SELNATN | NCRCMD_DMA);
-                       NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0, &dmasize);
+                       NCRDMA_SETUP(sc, &sc->sc_cmdp, &sc->sc_cmdlen, 0,
+                           &dmasize);
                        NCRDMA_GO(sc);
                } else {
-
                        ncr53c9x_wrfifo(sc, (u_char *)&ecb->cmd.cmd, ecb->clen);
-
                        NCRCMD(sc, NCRCMD_SELNATN);
                }
                return;
        }
 
-       if (tiflags & T_NEGOTIATE) selandstop = 1;
+       if (tiflags & T_NEGOTIATE)
+               selandstop = 1;
        cmd = (u_char *)&ecb->cmd.cmd;
 
        if (ecb->tag[0] && !selatn3)
@@ -724,7 +724,7 @@
                selatn3 = 0;    /* Do not use selatn3 even if we have it */
                clen = ecb->clen + 1;
                cmd -= 1;
-               cmd[0] = MSG_IDENTIFY(lun, (tiflags & T_RSELECTOFF)?0:1);
+               cmd[0] = MSG_IDENTIFY(lun, (tiflags & T_RSELECTOFF) == 0);
        }
 
        if ((sc->sc_features & NCR_F_DMASELECT) && !selandstop) {
@@ -852,9 +852,9 @@
                /* Initialize LUN info and add to list. */
                if ((curproc != NULL) && ((flags & XS_CTL_NOSLEEP) == 0))
                        wait = M_WAITOK;
-               if ((li = malloc(sizeof(*li), M_DEVBUF, M_NOWAIT)) == NULL) {
-                   return (TRY_AGAIN_LATER);
-               }
+               if ((li = malloc(sizeof(*li), M_DEVBUF, M_NOWAIT)) == NULL)
+                       return (TRY_AGAIN_LATER);
+
                bzero(li, sizeof(*li));
                li->last_used = time.tv_sec;
                li->lun = lun;
@@ -983,7 +983,7 @@
                                break;
 
                        NCR_MISC(("%s: target %d: sync negotiation\n",
-                                       sc->sc_dev.dv_xname, sp->sa_target));
+                           sc->sc_dev.dv_xname, sp->sa_target));
                        ti->flags |= T_NEGOTIATE;
                }
 
@@ -996,7 +996,7 @@
                                       sc->sc_dev.dv_xname, sp->sa_target);
                        }
                }
-       break;
+               break;
        }
        default:
                error = ENOTTY;
@@ -1043,7 +1043,7 @@
                lun = sc_link->scsipi_scsi.lun;
 
                /* Select type of tag for this command */
-               if ((ti->flags & (T_RSELECTOFF)) != 0) 
+               if ((ti->flags & (T_RSELECTOFF)) != 0)
                        tag = 0;
                else if ((ti->flags & (T_TAG)) == 0)
                        tag = 0;
@@ -1066,9 +1066,11 @@
                        int flags = ecb->xs->xs_control;
 
                        /* Initialize LUN info and add to list. */
-                       if ((curproc != NULL) && ((flags & XS_CTL_NOSLEEP) == 0))
+                       if ((curproc != NULL) &&
+                           ((flags & XS_CTL_NOSLEEP) == 0))
                                wait = M_WAITOK;
-                       if ((li = malloc(sizeof(*li), M_DEVBUF, M_NOWAIT)) == NULL) {
+                       if ((li = malloc(sizeof(*li), M_DEVBUF, M_NOWAIT))
+                           == NULL) {
                                splx(s);
                                continue;
                        }
@@ -1091,8 +1093,7 @@
                                /* We need to issue this untagged command now */
                                ecb = li->untagged;
                                sc_link = ecb->xs->sc_link;
-                       } 
-                       else {
+                       } else {
                                /* Not ready yet */
                                splx(s);
                                continue;
@@ -1127,8 +1128,8 @@
 #endif
 
                        /* Save where to start next time. */
-                       li->avail = i+1;
-                       li->used ++;
+                       li->avail = i + 1;
+                       li->used++;
 
                        li->queued[i] = ecb;
                        ecb->tag[1] = i;
@@ -1150,8 +1151,8 @@
                        break;
                } else
                        NCR_MISC(("%d:%d busy\n",
-                                 sc_link->scsipi_scsi.target,
-                                 sc_link->scsipi_scsi.lun));
+                           sc_link->scsipi_scsi.target,
+                           sc_link->scsipi_scsi.lun));
        }
 }
 
@@ -1171,7 +1172,7 @@
        /* Next, setup a request sense command block */
        bzero(ss, sizeof(*ss));
        ss->opcode = REQUEST_SENSE;
-       ss->byte2 = sc_link->scsipi_scsi.lun << 5;
+       ss->byte2 = sc_link->scsipi_scsi.lun << SCSI_CMD_LUN_SHIFT;
        ss->length = sizeof(struct scsipi_sense_data);
        ecb->clen = sizeof(*ss);
        ecb->daddr = (char *)&xs->sense.scsi_sense;
@@ -1180,7 +1181,8 @@
        ecb->timeout = NCR_SENSE_TIMEOUT;
        ti->senses++;



Home | Main Index | Thread Index | Old Index