Date: Sun, 16 Nov 2008 17:42:02 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r185003 - in head/sys/dev: ppbus ppc Message-ID: <200811161742.mAGHg2ln060788@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Sun Nov 16 17:42:02 2008 New Revision: 185003 URL: http://svn.freebsd.org/changeset/base/185003 Log: Various whitespace and style fixes. Modified: head/sys/dev/ppbus/if_plip.c head/sys/dev/ppbus/immio.c head/sys/dev/ppbus/lpbb.c head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/lpt.h head/sys/dev/ppbus/pcfclock.c head/sys/dev/ppbus/ppb_1284.c head/sys/dev/ppbus/ppb_base.c head/sys/dev/ppbus/ppb_msq.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/ppbus/ppbconf.h head/sys/dev/ppbus/ppi.c head/sys/dev/ppbus/ppi.h head/sys/dev/ppbus/pps.c head/sys/dev/ppbus/vpo.c head/sys/dev/ppbus/vpoio.c head/sys/dev/ppbus/vpoio.h head/sys/dev/ppc/ppc.c head/sys/dev/ppc/ppc_acpi.c Modified: head/sys/dev/ppbus/if_plip.c ============================================================================== --- head/sys/dev/ppbus/if_plip.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/if_plip.c Sun Nov 16 17:42:02 2008 (r185003) @@ -125,19 +125,19 @@ __FBSDID("$FreeBSD$"); #define LPMAXERRS 100 #endif -#define CLPIPHDRLEN 14 /* We send dummy ethernet addresses (two) + packet type in front of packet */ +#define CLPIPHDRLEN 14 /* We send dummy ethernet addresses (two) + packet type in front of packet */ #define CLPIP_SHAKE 0x80 /* This bit toggles between nibble reception */ -#define MLPIPHDRLEN CLPIPHDRLEN +#define MLPIPHDRLEN CLPIPHDRLEN -#define LPIPHDRLEN 2 /* We send 0x08, 0x00 in front of packet */ +#define LPIPHDRLEN 2 /* We send 0x08, 0x00 in front of packet */ #define LPIP_SHAKE 0x40 /* This bit toggles between nibble reception */ #if !defined(MLPIPHDRLEN) || LPIPHDRLEN > MLPIPHDRLEN -#define MLPIPHDRLEN LPIPHDRLEN +#define MLPIPHDRLEN LPIPHDRLEN #endif #define LPIPTBLSIZE 256 /* Size of octet translation table */ -#define lprintf if (lptflag) printf +#define lprintf if (lptflag) printf #ifdef PLIP_DEBUG static int volatile lptflag = 1; @@ -156,14 +156,14 @@ struct lp_data { /* Tables for the lp# interface */ static u_char *txmith; -#define txmitl (txmith + (1 * LPIPTBLSIZE)) -#define trecvh (txmith + (2 * LPIPTBLSIZE)) -#define trecvl (txmith + (3 * LPIPTBLSIZE)) +#define txmitl (txmith + (1 * LPIPTBLSIZE)) +#define trecvh (txmith + (2 * LPIPTBLSIZE)) +#define trecvl (txmith + (3 * LPIPTBLSIZE)) static u_char *ctxmith; -#define ctxmitl (ctxmith + (1 * LPIPTBLSIZE)) -#define ctrecvh (ctxmith + (2 * LPIPTBLSIZE)) -#define ctrecvl (ctxmith + (3 * LPIPTBLSIZE)) +#define ctxmitl (ctxmith + (1 * LPIPTBLSIZE)) +#define ctrecvh (ctxmith + (2 * LPIPTBLSIZE)) +#define ctrecvl (ctxmith + (3 * LPIPTBLSIZE)) /* Functions for the lp# interface */ static int lpinittables(void); @@ -172,7 +172,7 @@ static int lpoutput(struct ifnet *, stru struct rtentry *); static void lp_intr(void *); -#define DEVTOSOFTC(dev) \ +#define DEVTOSOFTC(dev) \ ((struct lp_data *)device_get_softc(dev)) static devclass_t lp_devclass; @@ -254,7 +254,7 @@ lpinittables(void) return (1); if (ctxmith == NULL) - ctxmith = malloc(4*LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); + ctxmith = malloc(4 * LPIPTBLSIZE, M_DEVBUF, M_NOWAIT); if (ctxmith == NULL) return (1); @@ -446,7 +446,7 @@ static void lp_intr(void *arg) { device_t dev = (device_t)arg; - device_t ppbus = device_get_parent(dev); + device_t ppbus = device_get_parent(dev); struct lp_data *sc = DEVTOSOFTC(dev); int len, s, j; u_char *bp; @@ -559,7 +559,7 @@ lp_intr(void *arg) } goto done; - err: +err: ppb_wdtr(ppbus, 0); lprintf("R"); sc->sc_ifp->if_ierrors++; @@ -576,12 +576,12 @@ lp_intr(void *arg) sc->sc_iferrs = 0; } - done: +done: splx(s); } static __inline int -lpoutbyte (u_char byte, int spin, device_t ppbus) +lpoutbyte(u_char byte, int spin, device_t ppbus) { ppb_wdtr(ppbus, txmith[byte]); Modified: head/sys/dev/ppbus/immio.c ============================================================================== --- head/sys/dev/ppbus/immio.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/immio.c Sun Nov 16 17:42:02 2008 (r185003) @@ -250,10 +250,10 @@ static struct ppb_microseq spp_outbyte_s MS_CASS(0x4), /* loop: */ - MS_RASSERT_P(1, MS_REG_DTR), + MS_RASSERT_P(1, MS_REG_DTR), MS_CASS(0x5), MS_DBRA(0), /* decrement counter */ - MS_RASSERT_P(1, MS_REG_DTR), + MS_RASSERT_P(1, MS_REG_DTR), MS_CASS(0x0), MS_DBRA(-6 /* loop */), @@ -265,14 +265,14 @@ static struct ppb_microseq spp_outbyte_s /* EPP 1.7 microsequences, ptr and len set at runtime */ static struct ppb_microseq epp17_outstr[] = { MS_CASS(0x4), - MS_RASSERT_P(MS_ACCUM, MS_REG_EPP_D), + MS_RASSERT_P(MS_ACCUM, MS_REG_EPP_D), MS_CASS(0xc), MS_RET(0), }; static struct ppb_microseq epp17_instr[] = { MS_CASS(PCD | 0x4), - MS_RFETCH_P(MS_ACCUM, MS_REG_EPP_D, MS_FETCH_ALL), + MS_RFETCH_P(MS_ACCUM, MS_REG_EPP_D, MS_FETCH_ALL), MS_CASS(PCD | 0xc), MS_RET(0), }; @@ -416,7 +416,7 @@ imm_detect(struct vpoio_data *vpo) /* release the bus now */ imm_disconnect(vpo, &error, 1); - /* ensure we are disconnected or daisy chained peripheral + /* ensure we are disconnected or daisy chained peripheral * may cause serious problem to the disk */ if (error) { @@ -479,7 +479,7 @@ imm_select(struct vpoio_data *vpo, int i /* initialize the select microsequence */ ppb_MS_init_msq(select_microseq, 1, SELECT_TARGET, 1 << initiator | 1 << target); - + ppb_MS_microseq(ppbus, vpo->vpo_dev, select_microseq, &ret); return (ret); @@ -514,7 +514,7 @@ imm_wait(struct vpoio_data *vpo, int tmo ppb_MS_microseq(ppbus, vpo->vpo_dev, wait_microseq, &err); if (err) - return (0); /* command timed out */ + return (0); /* command timed out */ return(ret); } @@ -540,7 +540,7 @@ imm_negociate(struct vpoio_data *vpo) if (ret) return (VP0_ENEGOCIATE); #endif - + ppb_MS_init_msq(negociate_microseq, 1, NEGOCIATED_MODE, negociate_mode); @@ -580,7 +580,7 @@ imm_probe(device_t dev, struct vpoio_dat int imm_attach(struct vpoio_data *vpo) { - DECLARE_NIBBLE_INBYTE_SUBMICROSEQ; + DECLARE_NIBBLE_INBYTE_SUBMICROSEQ; device_t ppbus = device_get_parent(vpo->vpo_dev); int error = 0; @@ -601,7 +601,7 @@ imm_attach(struct vpoio_data *vpo) INB_NIBBLE_H, (void *)&(vpo)->vpo_nibble.h, INB_NIBBLE_L, (void *)&(vpo)->vpo_nibble.l, INB_NIBBLE_F, nibble_inbyte_hook, - INB_NIBBLE_P, (void *)&(vpo)->vpo_nibble); + INB_NIBBLE_P, (void *)&(vpo)->vpo_nibble); /* * Initialize mode dependent in/out microsequences @@ -666,7 +666,7 @@ imm_reset_bus(struct vpoio_data *vpo) * Send an SCSI command * */ -int +int imm_do_scsi(struct vpoio_data *vpo, int host, int target, char *command, int clen, char *buffer, int blen, int *result, int *count, int *ret) @@ -690,7 +690,8 @@ imm_do_scsi(struct vpoio_data *vpo, int return (error); if (not_connected) { - *ret = VP0_ECONNECT; goto error; + *ret = VP0_ECONNECT; + goto error; } /* @@ -714,7 +715,8 @@ imm_do_scsi(struct vpoio_data *vpo, int } if (!(r = imm_wait(vpo, VP0_LOW_SPINTMO))) { - *ret = VP0_ESTATUS_TIMEOUT; goto error; + *ret = VP0_ESTATUS_TIMEOUT; + goto error; } if ((r & 0x30) == 0x10) { @@ -725,14 +727,15 @@ imm_do_scsi(struct vpoio_data *vpo, int negociated = 1; } - /* - * Complete transfer ... + /* + * Complete transfer ... */ *count = 0; for (;;) { if (!(r = imm_wait(vpo, VP0_LOW_SPINTMO))) { - *ret = VP0_ESTATUS_TIMEOUT; goto error; + *ret = VP0_ESTATUS_TIMEOUT; + goto error; } /* stop when the ZIP+ wants to send status */ @@ -782,13 +785,15 @@ imm_do_scsi(struct vpoio_data *vpo, int negociated = 1; if (imm_instr(vpo, &l, 1)) { - *ret = VP0_EOTHER; goto error; + *ret = VP0_EOTHER; + goto error; } /* check if the ZIP+ wants to send more status */ if (imm_wait(vpo, VP0_FAST_SPINTMO) == (char)0xb8) if (imm_instr(vpo, &h, 1)) { - *ret = VP0_EOTHER+2; goto error; + *ret = VP0_EOTHER + 2; + goto error; } /* Experience showed that we should discard this */ Modified: head/sys/dev/ppbus/lpbb.c ============================================================================== --- head/sys/dev/ppbus/lpbb.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/lpbb.c Sun Nov 16 17:42:02 2008 (r185003) @@ -84,7 +84,7 @@ static int lpbb_attach(device_t dev) { device_t bitbang; - + /* add generic bit-banging code */ bitbang = device_add_child(dev, "iicbb", -1); device_probe_and_attach(bitbang); @@ -159,7 +159,7 @@ lpbb_setsda(device_t dev, char val) mtx_lock(&Giant); if (val == 0) ppb_wdtr(ppbus, (u_char)SDA_out); - else + else ppb_wdtr(ppbus, (u_char)~SDA_out); mtx_unlock(&Giant); } @@ -172,8 +172,8 @@ lpbb_setscl(device_t dev, unsigned char mtx_lock(&Giant); if (val == 0) ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) & ~SCL_out)); - else - ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) | SCL_out)); + else + ppb_wctr(ppbus, (u_char)(ppb_rctr(ppbus) | SCL_out)); mtx_unlock(&Giant); } Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/lpt.c Sun Nov 16 17:42:02 2008 (r185003) @@ -87,9 +87,9 @@ __FBSDID("$FreeBSD$"); #include <dev/ppbus/ppbio.h> #ifndef LPT_DEBUG -#define lprintf(args) +#define lprintf(args) #else -#define lprintf(args) \ +#define lprintf(args) \ do { \ if (lptflag) \ printf args; \ @@ -113,36 +113,35 @@ struct lpt_data { prime once */ u_char sc_control; char sc_flags; -#define LP_POS_INIT 0x04 /* if we are a postive init signal */ -#define LP_POS_ACK 0x08 /* if we are a positive going ack */ -#define LP_NO_PRIME 0x10 /* don't prime the printer at all */ -#define LP_PRIMEOPEN 0x20 /* prime on every open */ -#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */ -#define LP_BYPASS 0x80 /* bypass printer ready checks */ +#define LP_POS_INIT 0x04 /* if we are a postive init signal */ +#define LP_POS_ACK 0x08 /* if we are a positive going ack */ +#define LP_NO_PRIME 0x10 /* don't prime the printer at all */ +#define LP_PRIMEOPEN 0x20 /* prime on every open */ +#define LP_AUTOLF 0x40 /* tell printer to do an automatic lf */ +#define LP_BYPASS 0x80 /* bypass printer ready checks */ void *sc_inbuf; void *sc_statbuf; short sc_xfercnt ; char sc_primed; char *sc_cp ; u_short sc_irq ; /* IRQ status of port */ -#define LP_HAS_IRQ 0x01 /* we have an irq available */ -#define LP_USE_IRQ 0x02 /* we are using our irq */ -#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */ -#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */ +#define LP_HAS_IRQ 0x01 /* we have an irq available */ +#define LP_USE_IRQ 0x02 /* we are using our irq */ +#define LP_ENABLE_IRQ 0x04 /* enable IRQ on open */ +#define LP_ENABLE_EXT 0x10 /* we shall use advanced mode when possible */ u_char sc_backoff ; /* time to call lptout() again */ struct resource *intr_resource; /* interrupt resource */ void *intr_cookie; /* interrupt registration cookie */ - }; -#define LPT_NAME "lpt" /* our official name */ +#define LPT_NAME "lpt" /* our official name */ static timeout_t lptout; static int lpt_port_test(device_t dev, u_char data, u_char mask); static int lpt_detect(device_t dev); -#define DEVTOSOFTC(dev) \ +#define DEVTOSOFTC(dev) \ ((struct lpt_data *)device_get_softc(dev)) static void lptintr(device_t dev); @@ -156,17 +155,15 @@ static devclass_t lpt_devclass; #define ASLP (1<<1) /* awaiting draining of printer */ #define EERROR (1<<2) /* error was received from printer */ #define OBUSY (1<<3) /* printer is busy doing output */ -#define LPTOUT (1<<4) /* timeout while not selected */ -#define TOUT (1<<5) /* timeout while not selected */ -#define LPTINIT (1<<6) /* waiting to initialize for open */ -#define INTERRUPTED (1<<7) /* write call was interrupted */ - -#define HAVEBUS (1<<8) /* the driver owns the bus */ - +#define LPTOUT (1<<4) /* timeout while not selected */ +#define TOUT (1<<5) /* timeout while not selected */ +#define LPTINIT (1<<6) /* waiting to initialize for open */ +#define INTERRUPTED (1<<7) /* write call was interrupted */ +#define HAVEBUS (1<<8) /* the driver owns the bus */ /* status masks to interrogate printer status */ -#define RDY_MASK (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR) /* ready ? */ -#define LP_READY (LPS_SEL|LPS_NBSY|LPS_NERR) +#define RDY_MASK (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR) /* ready ? */ +#define LP_READY (LPS_SEL|LPS_NBSY|LPS_NERR) /* Printer Ready condition - from lpa.c */ /* Only used in polling code */ @@ -503,7 +500,7 @@ lptopen(struct cdev *dev, int flags, int /* init printer */ if ((sc->sc_flags & LP_NO_PRIME) == 0) { - if((sc->sc_flags & LP_PRIMEOPEN) || sc->sc_primed == 0) { + if ((sc->sc_flags & LP_PRIMEOPEN) || sc->sc_primed == 0) { ppb_wctr(ppbus, 0); sc->sc_primed++; DELAY(500); @@ -582,7 +579,7 @@ lptclose(struct cdev *dev, int flags, in { struct lpt_data *sc = dev->si_drv1; device_t lptdev = sc->dev; - device_t ppbus = device_get_parent(lptdev); + device_t ppbus = device_get_parent(lptdev); int err; if (sc->sc_flags & LP_BYPASS) @@ -594,7 +591,7 @@ lptclose(struct cdev *dev, int flags, in sc->sc_state &= ~OPEN; /* if the last write was interrupted, don't complete it */ - if((!(sc->sc_state & INTERRUPTED)) && (sc->sc_irq & LP_USE_IRQ)) + if ((!(sc->sc_state & INTERRUPTED)) && (sc->sc_irq & LP_USE_IRQ)) while ((ppb_rstr(ppbus) & (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) != (LPS_SEL|LPS_NBSY|LPS_NERR) || sc->sc_xfercnt) @@ -690,7 +687,7 @@ lptread(struct cdev *dev, struct uio *ui { struct lpt_data *sc = dev->si_drv1; device_t lptdev = sc->dev; - device_t ppbus = device_get_parent(lptdev); + device_t ppbus = device_get_parent(lptdev); int error = 0, len; if (sc->sc_flags & LP_BYPASS) { @@ -736,9 +733,9 @@ lptwrite(struct cdev *dev, struct uio *u int err; struct lpt_data *sc = dev->si_drv1; device_t lptdev = sc->dev; - device_t ppbus = device_get_parent(lptdev); + device_t ppbus = device_get_parent(lptdev); - if(sc->sc_flags & LP_BYPASS) { + if (sc->sc_flags & LP_BYPASS) { /* we can't do writes in bypass mode */ return(EPERM); } @@ -777,7 +774,7 @@ lptwrite(struct cdev *dev, struct uio *u sc->sc_xfercnt = 0; break; case EINTR: - sc->sc_state |= INTERRUPTED; + sc->sc_state |= INTERRUPTED; return(err); case EINVAL: /* advanced mode not avail */ @@ -806,7 +803,7 @@ lptwrite(struct cdev *dev, struct uio *u } /* check to see if we must do a polled write */ - if(!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) { + if (!(sc->sc_irq & LP_USE_IRQ) && (sc->sc_xfercnt)) { lprintf(("p")); err = lpt_pushbytes(lptdev); @@ -828,16 +825,15 @@ lptwrite(struct cdev *dev, struct uio *u * * do checking for interrupted write call. */ - static void lpt_intr(void *arg) { device_t lptdev = (device_t)arg; - device_t ppbus = device_get_parent(lptdev); + device_t ppbus = device_get_parent(lptdev); struct lpt_data *sc = DEVTOSOFTC(lptdev); int sts = 0; int i; - + /* we must own the bus to use it */ if ((sc->sc_state & HAVEBUS) == 0) return; @@ -853,7 +849,7 @@ lpt_intr(void *arg) if ((sts & RDY_MASK) == LP_READY) { sc->sc_state = (sc->sc_state | OBUSY) & ~EERROR; - sc->sc_backoff = hz/LPTOUTINITIAL; + sc->sc_backoff = hz / LPTOUTINITIAL; if (sc->sc_xfercnt) { /* send char */ @@ -864,7 +860,8 @@ lpt_intr(void *arg) ppb_wctr(ppbus, sc->sc_control); /* any more data for printer */ - if(--(sc->sc_xfercnt) > 0) return; + if (--(sc->sc_xfercnt) > 0) + return; } /* @@ -873,12 +870,12 @@ lpt_intr(void *arg) */ sc->sc_state &= ~OBUSY; - if(!(sc->sc_state & INTERRUPTED)) + if (!(sc->sc_state & INTERRUPTED)) wakeup(lptdev); lprintf(("w ")); return; } else { /* check for error */ - if(((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) && + if (((sts & (LPS_NERR | LPS_OUT) ) != LPS_NERR) && (sc->sc_state & OPEN)) sc->sc_state |= EERROR; /* lptout() will jump in and try to restart. */ @@ -907,7 +904,7 @@ lptioctl(struct cdev *dev, u_long cmd, c switch (cmd) { case LPT_IRQ : - if(sc->sc_irq & LP_HAS_IRQ) { + if (sc->sc_irq & LP_HAS_IRQ) { /* * NOTE: * If the IRQ status is changed, @@ -939,7 +936,7 @@ lptioctl(struct cdev *dev, u_long cmd, c default: break; } - + if (old_sc_irq != sc->sc_irq ) log(LOG_NOTICE, "%s: switched to %s %s mode\n", device_get_nameunit(sc->dev), Modified: head/sys/dev/ppbus/lpt.h ============================================================================== --- head/sys/dev/ppbus/lpt.h Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/lpt.h Sun Nov 16 17:42:02 2008 (r185003) @@ -31,7 +31,7 @@ * * Distantly from : * @(#)lptreg.h 1.1 (Berkeley) 12/19/90 - * Id: lptreg.h,v 1.6 1997/02/22 09:36:52 peter Exp + * Id: lptreg.h,v 1.6 1997/02/22 09:36:52 peter Exp * From Id: nlpt.h,v 1.3 1999/01/10 12:04:54 nsouch Exp * * $FreeBSD$ @@ -45,7 +45,7 @@ */ #ifndef __LPT_H -#define __LPT_H +#define __LPT_H /* machine independent definitions, it shall only depend on the ppbus * parallel port model */ Modified: head/sys/dev/ppbus/pcfclock.c ============================================================================== --- head/sys/dev/ppbus/pcfclock.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/pcfclock.c Sun Nov 16 17:42:02 2008 (r185003) @@ -9,7 +9,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -105,7 +105,7 @@ static struct cdevsw pcfclock_cdevsw = { NR(buf, 2) <= 59) #define PCFCLOCK_BATTERY_STATUS_LOW(buf) (buf[8] & 4) - + #define PCFCLOCK_CMD_TIME 0 /* send current time */ #define PCFCLOCK_CMD_COPY 7 /* copy received signal to PC */ @@ -133,7 +133,7 @@ pcfclock_attach(device_t dev) { struct pcfclock_data *sc = device_get_softc(dev); int unit; - + unit = device_get_unit(dev); sc->dev = dev; @@ -148,14 +148,14 @@ pcfclock_attach(device_t dev) return (0); } -static int +static int pcfclock_open(struct cdev *dev, int flag, int fms, struct thread *td) { struct pcfclock_data *sc = dev->si_drv1; device_t pcfclockdev = sc->dev; device_t ppbus = device_get_parent(pcfclockdev); int res; - + if (!sc) return (ENXIO); @@ -164,7 +164,7 @@ pcfclock_open(struct cdev *dev, int flag return (res); sc->count++; - + return (0); } @@ -187,10 +187,10 @@ pcfclock_write_cmd(struct cdev *dev, uns { struct pcfclock_data *sc = dev->si_drv1; device_t pcfclockdev = sc->dev; - device_t ppbus = device_get_parent(pcfclockdev); + device_t ppbus = device_get_parent(pcfclockdev); unsigned char ctr = 14; char i; - + for (i = 0; i <= 7; i++) { ppb_wdtr(ppbus, i); AUTOFEED_CLOCK(i & 1 ? AFC_HI : AFC_LO); @@ -203,7 +203,7 @@ pcfclock_write_cmd(struct cdev *dev, uns } static void -pcfclock_display_data(struct cdev *dev, char buf[18]) +pcfclock_display_data(struct cdev *dev, char buf[18]) { struct pcfclock_data *sc = dev->si_drv1; #ifdef PCFCLOCK_VERBOSE @@ -224,19 +224,19 @@ pcfclock_display_data(struct cdev *dev, #endif } -static int +static int pcfclock_read_data(struct cdev *dev, char *buf, ssize_t bits) { struct pcfclock_data *sc = dev->si_drv1; device_t pcfclockdev = sc->dev; - device_t ppbus = device_get_parent(pcfclockdev); + device_t ppbus = device_get_parent(pcfclockdev); int i; char waitfor; int offset; /* one byte per four bits */ bzero(buf, ((bits + 3) >> 2) + 1); - + waitfor = 100; for (i = 0; i <= bits; i++) { /* wait for clock, maximum (waitfor*100) usec */ @@ -244,11 +244,11 @@ pcfclock_read_data(struct cdev *dev, cha DELAY(100); /* timed out? */ - if (!waitfor) + if (!waitfor) return (EIO); - + waitfor = 100; /* reload */ - + /* give it some time */ DELAY(500); @@ -263,12 +263,12 @@ pcfclock_read_data(struct cdev *dev, cha return (0); } -static int -pcfclock_read_dev(struct cdev *dev, char *buf, int maxretries) +static int +pcfclock_read_dev(struct cdev *dev, char *buf, int maxretries) { struct pcfclock_data *sc = dev->si_drv1; device_t pcfclockdev = sc->dev; - device_t ppbus = device_get_parent(pcfclockdev); + device_t ppbus = device_get_parent(pcfclockdev); int error = 0; ppb_set_mode(ppbus, PPB_COMPATIBLE); @@ -277,7 +277,7 @@ pcfclock_read_dev(struct cdev *dev, char pcfclock_write_cmd(dev, PCFCLOCK_CMD_TIME); if (pcfclock_read_data(dev, buf, 68)) continue; - + if (!PCFCLOCK_CORRECT_SYNC(buf)) continue; @@ -289,7 +289,7 @@ pcfclock_read_dev(struct cdev *dev, char if (!maxretries) error = EIO; - + return (error); } @@ -304,15 +304,15 @@ pcfclock_read(struct cdev *dev, struct u return (ERANGE); error = pcfclock_read_dev(dev, buf, PCFCLOCK_MAX_RETRIES); - + if (error) { device_printf(sc->dev, "no PCF found\n"); } else { pcfclock_display_data(dev, buf); - + uiomove(buf, 18, uio); } - + return (error); } Modified: head/sys/dev/ppbus/ppb_1284.c ============================================================================== --- head/sys/dev/ppbus/ppb_1284.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/ppb_1284.c Sun Nov 16 17:42:02 2008 (r185003) @@ -92,7 +92,8 @@ ppb_1284_reset_error(device_t bus, int s int ppb_1284_get_state(device_t bus) { - return (DEVTOSOFTC(bus)->state); + + return (DEVTOSOFTC(bus)->state); } /* @@ -293,7 +294,7 @@ ppb_peripheral_terminate(device_t bus, i } /* Event 24 */ - ppb_wctr(bus, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN)); + ppb_wctr(bus, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN)); /* Event 25 - wait up to host response time (1s) */ if ((error = do_peripheral_wait(bus, nBUSY, nBUSY))) { @@ -302,17 +303,17 @@ ppb_peripheral_terminate(device_t bus, i } /* Event 26 */ - ppb_wctr(bus, (SELECTIN | nINIT | STROBE) & ~(AUTOFEED)); + ppb_wctr(bus, (SELECTIN | nINIT | STROBE) & ~(AUTOFEED)); DELAY(1); /* Event 27 */ - ppb_wctr(bus, (SELECTIN | nINIT) & ~(STROBE | AUTOFEED)); + ppb_wctr(bus, (SELECTIN | nINIT) & ~(STROBE | AUTOFEED)); /* Event 28 - wait up to host response time (1s) */ if ((error = do_peripheral_wait(bus, nBUSY, 0))) { ppb_1284_set_error(bus, PPB_TIMEOUT, 28); goto error; } - + error: ppb_set_mode(bus, PPB_COMPATIBLE); ppb_1284_set_state(bus, PPB_FORWARD_IDLE); @@ -538,7 +539,7 @@ spp_1284_read(device_t bus, int mode, ch case PPB_REVERSE_IDLE: terminate_after_transfer = 0; break; - + default: ppb_1284_terminate(bus); if ((error = ppb_1284_negociate(bus, mode, 0))) @@ -689,9 +690,9 @@ ppb_1284_negociate(device_t bus, int mod #ifdef PERIPH_1284 /* request remote host attention */ - ppb_wctr(bus, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN)); - DELAY(1); - ppb_wctr(bus, (nINIT) & ~(STROBE | AUTOFEED | SELECTIN)); + ppb_wctr(bus, (nINIT | STROBE) & ~(AUTOFEED | SELECTIN)); + DELAY(1); + ppb_wctr(bus, (nINIT) & ~(STROBE | AUTOFEED | SELECTIN)); #else DELAY(1); @@ -701,14 +702,14 @@ ppb_1284_negociate(device_t bus, int mod ppb_wctr(bus, (nINIT | AUTOFEED) & ~(STROBE | SELECTIN)); #ifdef PERIPH_1284 - /* ignore the PError line, wait a bit more, remote host's + /* ignore the PError line, wait a bit more, remote host's * interrupts don't respond fast enough */ if (ppb_poll_bus(bus, 40, nACK | SELECT | nFAULT, SELECT | nFAULT, PPB_NOINTR | PPB_POLL)) { - ppb_1284_set_error(bus, PPB_NOT_IEEE1284, 2); - error = ENODEV; - goto error; - } + ppb_1284_set_error(bus, PPB_NOT_IEEE1284, 2); + error = ENODEV; + goto error; + } #else /* Event 2 - trying IEEE1284 dialog */ if (do_1284_wait(bus, nACK | PERROR | SELECT | nFAULT, @@ -770,11 +771,11 @@ ppb_1284_negociate(device_t bus, int mod #ifdef PERIPH_1284 /* ignore PError line */ if (do_1284_wait(bus, nACK | SELECT | nBUSY, - nACK | SELECT | nBUSY)) { - ppb_1284_set_error(bus, PPB_TIMEOUT, 30); - error = ENODEV; - goto error; - } + nACK | SELECT | nBUSY)) { + ppb_1284_set_error(bus, PPB_TIMEOUT, 30); + error = ENODEV; + goto error; + } #else if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY, nACK | SELECT | PERROR | nBUSY)) { @@ -824,8 +825,8 @@ ppb_1284_terminate(device_t bus) #ifdef PERIPH_1284 /* request remote host attention */ - ppb_wctr(bus, (nINIT | STROBE | SELECTIN) & ~(AUTOFEED)); - DELAY(1); + ppb_wctr(bus, (nINIT | STROBE | SELECTIN) & ~(AUTOFEED)); + DELAY(1); #endif /* PERIPH_1284 */ /* Event 22 - set nSelectin low and nAutoFeed high */ Modified: head/sys/dev/ppbus/ppb_base.c ============================================================================== --- head/sys/dev/ppbus/ppb_base.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/ppb_base.c Sun Nov 16 17:42:02 2008 (r185003) @@ -34,15 +34,15 @@ __FBSDID("$FreeBSD$"); #include <sys/bus.h> #include <dev/ppbus/ppbconf.h> - + #include "ppbus_if.h" #include <dev/ppbus/ppbio.h> - + MODULE_VERSION(ppbus, 1); #define DEVTOSOFTC(dev) ((struct ppb_data *)device_get_softc(dev)) - + /* * ppb_poll_bus() * @@ -133,7 +133,7 @@ ppb_set_mode(device_t bus, int mode) int old_mode = ppb_get_mode(bus); if (PPBUS_SETMODE(device_get_parent(bus), mode)) - return -1; + return (-1); /* XXX yet device mode = ppbus mode = chipset mode */ ppb->mode = (mode & PPB_MASK); Modified: head/sys/dev/ppbus/ppb_msq.c ============================================================================== --- head/sys/dev/ppbus/ppb_msq.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/ppb_msq.c Sun Nov 16 17:42:02 2008 (r185003) @@ -210,7 +210,7 @@ ppb_MS_init_msq(struct ppb_microseq *msq __func__, param); #if 0 - printf("%s: param = %d, ins = %d, arg = %d, type = %d\n", + printf("%s: param = %d, ins = %d, arg = %d, type = %d\n", __func__, param, ins, arg, type); #endif @@ -272,7 +272,7 @@ ppb_MS_microseq(device_t bus, device_t d mi = msq; for (;;) { - switch (mi->opcode) { + switch (mi->opcode) { case MS_OP_PUT: case MS_OP_GET: @@ -315,11 +315,10 @@ ppb_MS_microseq(device_t bus, device_t d INCR_PC; break; - case MS_OP_RET: + case MS_OP_RET: if (ret) *ret = mi->arg[0].i; /* return code */ return (0); - break; default: /* executing microinstructions at ppc level is Modified: head/sys/dev/ppbus/ppbconf.c ============================================================================== --- head/sys/dev/ppbus/ppbconf.c Sun Nov 16 15:45:41 2008 (r185002) +++ head/sys/dev/ppbus/ppbconf.c Sun Nov 16 17:42:02 2008 (r185003) @@ -44,9 +44,9 @@ __FBSDID("$FreeBSD$"); #include <dev/ppbus/ppb_1284.h> #include "ppbus_if.h" - + #define DEVTOSOFTC(dev) ((struct ppb_data *)device_get_softc(dev)) - + static MALLOC_DEFINE(M_PPBUSDEV, "ppbusdev", "Parallel Port bus device"); @@ -90,12 +90,12 @@ ppbus_add_child(device_t dev, int order, { struct ppb_device *ppbdev; device_t child; - + /* allocate ivars for the new ppbus child */ ppbdev = malloc(sizeof(struct ppb_device), M_PPBUSDEV, M_NOWAIT | M_ZERO); if (!ppbdev) - return NULL; + return (NULL); /* initialize the ivars */ ppbdev->name = name; @@ -105,13 +105,13 @@ ppbus_add_child(device_t dev, int order, child = device_add_child_ordered(dev, order, name, unit); device_set_ivars(child, ppbdev); - return child; + return (child); } static int ppbus_read_ivar(device_t bus, device_t dev, int index, uintptr_t* val) { - + switch (index) { case PPBUS_IVAR_MODE: /* XXX yet device mode = ppbus mode = chipset mode */ @@ -120,12 +120,12 @@ ppbus_read_ivar(device_t bus, device_t d default: return (ENOENT); } - + return (0); } - + static int -ppbus_write_ivar(device_t bus, device_t dev, int index, u_long val) +ppbus_write_ivar(device_t bus, device_t dev, int index, uintptr_t val) { switch (index) { @@ -208,7 +208,7 @@ ppb_pnp_detect(device_t bus) char str[PPB_PnP_STRING_SIZE+1]; device_printf(bus, "Probing for PnP devices:\n"); - + if ((error = ppb_1284_read_id(bus, PPB_NIBBLE, str, PPB_PnP_STRING_SIZE, &len))) goto end_detect; @@ -287,7 +287,7 @@ ppb_scan_bus(device_t bus) int error = 0; /* try all IEEE1284 modes, for one device only - * + * * XXX We should implement the IEEE1284.3 standard to detect * daisy chained devices */ @@ -384,7 +384,7 @@ ppbus_attach(device_t dev) ppb_scan_bus(dev); #endif /* !DONTPROBE_1284 */ - /* launch attachement of the added children */ + /* launch attachment of the added children */ bus_generic_attach(dev); return (0); @@ -393,8 +393,8 @@ ppbus_attach(device_t dev) static int ppbus_detach(device_t dev) { - device_t *children; - int error, nchildren, i; + device_t *children; + int error, nchildren, i; error = bus_generic_detach(dev); if (error) @@ -406,7 +406,7 @@ ppbus_detach(device_t dev) if (children[i]) device_delete_child(dev, children[i]); free(children, M_TEMP); - } + } return (0); } @@ -441,7 +441,7 @@ ppbus_teardown_intr(device_t bus, device { struct ppb_data *ppb = DEVTOSOFTC(bus); struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(child); - + /* a device driver must own the bus to unregister an interrupt */ if ((ppb->ppb_owner != child) || (ppbdev->intr_cookie != ih) || (ppbdev->intr_resource != r)) @@ -469,7 +469,7 @@ ppb_request_bus(device_t bus, device_t d struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); while (!error) { - s = splhigh(); + s = splhigh(); if (ppb->ppb_owner) { splx(s); @@ -493,7 +493,7 @@ ppb_request_bus(device_t bus, device_t d /* restore the context of the device * The first time, ctx.valid is certainly false * then do not change anything. This is usefull for *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811161742.mAGHg2ln060788>