CVS commit: src/sys/dev/qbus
Module Name:src Committed By: thorpej Date: Fri Dec 18 02:41:36 UTC 2020 Modified Files: src/sys/dev/qbus: qd.c Log Message: Use sel{record,remove}_knote(). To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/dev/qbus/qd.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/qbus/qd.c diff -u src/sys/dev/qbus/qd.c:1.57 src/sys/dev/qbus/qd.c:1.58 --- src/sys/dev/qbus/qd.c:1.57 Wed Oct 25 08:12:38 2017 +++ src/sys/dev/qbus/qd.c Fri Dec 18 02:41:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: qd.c,v 1.57 2017/10/25 08:12:38 maya Exp $ */ +/* $NetBSD: qd.c,v 1.58 2020/12/18 02:41:35 thorpej Exp $ */ /*- * Copyright (c) 1988 Regents of the University of California. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: qd.c,v 1.57 2017/10/25 08:12:38 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qd.c,v 1.58 2020/12/18 02:41:35 thorpej Exp $"); #include "opt_ddb.h" @@ -1548,7 +1548,7 @@ filt_qdrdetach(struct knote *kn) int s; s = spl5(); - SLIST_REMOVE([unit].sel_klist, kn, knote, kn_selnext); + selremove_knote([unit], kn); splx(s); } @@ -1597,7 +1597,6 @@ static const struct filterops qdwrite_fi int qdkqfilter(dev_t dev, struct knote *kn) { - struct klist *klist; u_int minor_dev = minor(dev); int s, unit = minor_dev >> 2; @@ -1608,12 +1607,10 @@ qdkqfilter(dev_t dev, struct knote *kn) switch (kn->kn_filter) { case EVFILT_READ: - klist = [unit].sel_klist; kn->kn_fop = _filtops; break; case EVFILT_WRITE: - klist = [unit].sel_klist; kn->kn_fop = _filtops; break; @@ -1624,7 +1621,7 @@ qdkqfilter(dev_t dev, struct knote *kn) kn->kn_hook = (void *)(intptr_t) dev; s = spl5(); - SLIST_INSERT_HEAD(klist, kn, kn_selnext); + selrecord_knote([unit], kn); splx(s); return (0);
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: skrll Date: Wed Feb 5 08:35:10 UTC 2020 Modified Files: src/sys/dev/qbus: if_dmc.c Log Message: Adopt To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/qbus/if_dmc.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/qbus/if_dmc.c diff -u src/sys/dev/qbus/if_dmc.c:1.27 src/sys/dev/qbus/if_dmc.c:1.28 --- src/sys/dev/qbus/if_dmc.c:1.27 Tue Feb 4 07:37:11 2020 +++ src/sys/dev/qbus/if_dmc.c Wed Feb 5 08:35:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_dmc.c,v 1.27 2020/02/04 07:37:11 skrll Exp $ */ +/* $NetBSD: if_dmc.c,v 1.28 2020/02/05 08:35:10 skrll Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.27 2020/02/04 07:37:11 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.28 2020/02/05 08:35:10 skrll Exp $"); #undef DMCDEBUG /* for base table dump on fatal error */ @@ -580,7 +580,7 @@ dmcxint(void *a) * Pass packet to type specific * higher-level input routine. */ - ifp->if_ipackets++; + if_statinc(ifp, if_ipackets); /* find location in dmcuba struct */ ifrw= >sc_ifr[0]; for (rp = >sc_rbufs[0]; rp < >sc_rbufs[NRCV]; rp++) {
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: skrll Date: Tue Feb 4 07:37:11 UTC 2020 Modified Files: src/sys/dev/qbus: if_dmc.c Log Message: Adopt To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/qbus/if_dmc.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/qbus/if_dmc.c diff -u src/sys/dev/qbus/if_dmc.c:1.26 src/sys/dev/qbus/if_dmc.c:1.27 --- src/sys/dev/qbus/if_dmc.c:1.26 Wed Jul 20 07:37:51 2016 +++ src/sys/dev/qbus/if_dmc.c Tue Feb 4 07:37:11 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_dmc.c,v 1.26 2016/07/20 07:37:51 ozaki-r Exp $ */ +/* $NetBSD: if_dmc.c,v 1.27 2020/02/04 07:37:11 skrll Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.26 2016/07/20 07:37:51 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.27 2020/02/04 07:37:11 skrll Exp $"); #undef DMCDEBUG /* for base table dump on fatal error */ @@ -595,7 +595,7 @@ dmcxint(void *a) len = (arg & DMC_CCOUNT) - sizeof (struct dmc_header); if (len < 0 || len > DMCMTU) { -ifp->if_ierrors++; +if_statinc(ifp, if_ierrors); #ifdef DMCDEBUG printd("%s: bad rcv pkt addr 0x%x len 0x%x\n", device_xname(sc->sc_dev), pkaddr, len); @@ -653,7 +653,7 @@ dmcxint(void *a) * A write has completed, start another * transfer if there is more data to send. */ - ifp->if_opackets++; + if_statinc(ifp, if_opackets); /* find associated dmcbuf structure */ ifxp = >sc_ifw[0]; for (rp = >sc_xbufs[0]; rp < >sc_xbufs[NXMT]; rp++) { @@ -704,7 +704,7 @@ dmcxint(void *a) /* ACCUMULATE STATISTICS */ switch(arg) { case DMC_NOBUFS: -ifp->if_ierrors++; +if_statinc(ifp, if_ierrors); if ((sc->sc_nobuf++ % DMC_RPNBFS) == 0) goto report; break; @@ -717,7 +717,7 @@ dmcxint(void *a) goto report; break; case DMC_DATACK: -ifp->if_oerrors++; +if_statinc(ifp, if_oerrors); if ((sc->sc_datck++ % DMC_RPDCK) == 0) goto report; break;
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: thorpej Date: Wed Jan 29 05:57:21 UTC 2020 Modified Files: src/sys/dev/qbus: if_de.c if_qt.c Log Message: Adopt . To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/qbus/if_de.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/qbus/if_qt.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/qbus/if_de.c diff -u src/sys/dev/qbus/if_de.c:1.34 src/sys/dev/qbus/if_de.c:1.35 --- src/sys/dev/qbus/if_de.c:1.34 Tue Jun 26 06:48:02 2018 +++ src/sys/dev/qbus/if_de.c Wed Jan 29 05:57:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_de.c,v 1.34 2018/06/26 06:48:02 msaitoh Exp $ */ +/* $NetBSD: if_de.c,v 1.35 2020/01/29 05:57:21 thorpej Exp $ */ /* * Copyright (c) 1982, 1986, 1989 Regents of the University of California. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.34 2018/06/26 06:48:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.35 2020/01/29 05:57:21 thorpej Exp $"); #include "opt_inet.h" @@ -480,19 +480,19 @@ deintr(void *arg) if (rp->r_flags & XFLG_OWN) break; - sc->sc_if.if_opackets++; + if_statinc(>sc_if, if_opackets); ifxp = >sc_ifw[sc->sc_xindex]; /* check for unusual conditions */ if (rp->r_flags & (XFLG_ERRS|XFLG_MTCH|XFLG_ONE|XFLG_MORE)) { if (rp->r_flags & XFLG_ERRS) { /* output error */ -sc->sc_if.if_oerrors++; +if_statinc(>sc_if, if_oerrors); } else if (rp->r_flags & XFLG_ONE) { /* one collision */ -sc->sc_if.if_collisions++; +if_statinc(>sc_if, if_collisions); } else if (rp->r_flags & XFLG_MORE) { -/* more than one collision */ -sc->sc_if.if_collisions += 2; /* guess */ +/* more than one collision (guess...) */ +if_statadd(>sc_if, if_collisions, 2); } } if_ubaend(>sc_ifuba, ifxp); @@ -534,13 +534,13 @@ derecv(struct de_softc *sc) /* check for errors */ if ((rp->r_flags & (RFLG_ERRS|RFLG_FRAM|RFLG_OFLO|RFLG_CRC)) || (rp->r_lenerr & (RERR_BUFL|RERR_UBTO))) { - sc->sc_if.if_ierrors++; + if_statinc(>sc_if, if_ierrors); goto next; } m = if_ubaget(>sc_ifuba, >sc_ifr[sc->sc_rindex], ifp, len); if (m == 0) { - sc->sc_if.if_ierrors++; + if_statinc(>sc_if, if_ierrors); goto next; } Index: src/sys/dev/qbus/if_qt.c diff -u src/sys/dev/qbus/if_qt.c:1.24 src/sys/dev/qbus/if_qt.c:1.25 --- src/sys/dev/qbus/if_qt.c:1.24 Mon Oct 21 08:22:06 2019 +++ src/sys/dev/qbus/if_qt.c Wed Jan 29 05:57:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_qt.c,v 1.24 2019/10/21 08:22:06 msaitoh Exp $ */ +/* $NetBSD: if_qt.c,v 1.25 2020/01/29 05:57:21 thorpej Exp $ */ /* * Copyright (c) 1992 Steven M. Schultz * All rights reserved. @@ -80,7 +80,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_qt.c,v 1.24 2019/10/21 08:22:06 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_qt.c,v 1.25 2020/01/29 05:57:21 thorpej Exp $"); #include "opt_inet.h" @@ -507,37 +507,35 @@ qtintr(void *arg) void qttint(struct qt_softc *sc) - { +{ struct qt_tring *rp; - while (sc->nxmit > 0) - { + while (sc->nxmit > 0) { rp = >sc_ib->qc_t[sc->xlast]; if ((rp->tmd3 & TMD3_OWN) == 0) break; - sc->is_if.if_opackets++; + if_statinc(>is_if, if_opackets); /* * Collisions don't count as output errors, but babbling and missing packets * do count as output errors. */ - if (rp->tmd2 & TMD2_CER) - sc->is_if.if_collisions++; - if ((rp->tmd0 & TMD0_ERR1) || - ((rp->tmd2 & TMD2_ERR2) && (rp->tmd2 & BBLMIS))) - { + if (rp->tmd2 & TMD2_CER) + if_statinc(>is_if, if_collisions); + if ((rp->tmd0 & TMD0_ERR1) || + ((rp->tmd2 & TMD2_ERR2) && (rp->tmd2 & BBLMIS))) { #ifdef QTDEBUG char buf[100]; snprintb(buf, sizeof(buf), TMD2_BITS, rp->tmd2); printf("%s: tmd2 %s\n", device_xname(sc->sc_dev), buf); #endif - sc->is_if.if_oerrors++; - } + if_statinc(>is_if, if_oerrors); + } if_ubaend(>sc_ifuba, >sc_ifw[sc->xlast]); - if (++sc->xlast >= NXMT) + if (++sc->xlast >= NXMT) sc->xlast = 0; sc->nxmit--; - } } +} /* * Receive interrupt service. Pull packet off the interface and put into @@ -555,16 +553,14 @@ qtrint(struct qt_softc *sc) while (sc->sc_ib->qc_r[(int)sc->rindex].rmd3 & RMD3_OWN) { rp = >sc_ib->qc_r[(int)sc->rindex]; - if ((rp->rmd0 & (RMD0_STP|RMD0_ENP)) != (RMD0_STP|RMD0_ENP)) - { + if ((rp->rmd0 & (RMD0_STP|RMD0_ENP)) != (RMD0_STP|RMD0_ENP)) { printf("%s: chained packet\n", device_xname(sc->sc_dev)); - sc->is_if.if_ierrors++; + if_statinc(>is_if, if_ierrors); goto rnext; - } + } len = (rp->rmd1 & RMD1_MCNT) - 4; /* -4 for CRC */ - if ((rp->rmd0 & RMD0_ERR3) || (rp->rmd2 & RMD2_ERR4)) - { + if ((rp->rmd0 & RMD0_ERR3) || (rp->rmd2 & RMD2_ERR4)) { #ifdef QTDEBUG char buf[100]; snprintb(buf, sizeof(buf), RMD0_BITS, rp->rmd0); @@ -572,13 +568,13 @@ qtrint(struct qt_softc *sc) snprintb(buf,
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: ragge Date: Mon May 22 17:22:29 UTC 2017 Modified Files: src/sys/dev/qbus: dz_uba.c if_de.c if_qe.c rl.c rlreg.h rlvar.h tsreg.h uba.c ubareg.h uda.c Log Message: Update copyright notice for Ludd (remove clause 3 & 4). To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/qbus/dz_uba.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/qbus/if_de.c cvs rdiff -u -r1.76 -r1.77 src/sys/dev/qbus/if_qe.c cvs rdiff -u -r1.50 -r1.51 src/sys/dev/qbus/rl.c cvs rdiff -u -r1.4 -r1.5 src/sys/dev/qbus/rlreg.h src/sys/dev/qbus/tsreg.h cvs rdiff -u -r1.8 -r1.9 src/sys/dev/qbus/rlvar.h cvs rdiff -u -r1.79 -r1.80 src/sys/dev/qbus/uba.c cvs rdiff -u -r1.16 -r1.17 src/sys/dev/qbus/ubareg.h cvs rdiff -u -r1.60 -r1.61 src/sys/dev/qbus/uda.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/qbus/dz_uba.c diff -u src/sys/dev/qbus/dz_uba.c:1.28 src/sys/dev/qbus/dz_uba.c:1.29 --- src/sys/dev/qbus/dz_uba.c:1.28 Sat Mar 15 00:57:15 2008 +++ src/sys/dev/qbus/dz_uba.c Mon May 22 17:22:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dz_uba.c,v 1.28 2008/03/15 00:57:15 matt Exp $ */ +/* $NetBSD: dz_uba.c,v 1.29 2017/05/22 17:22:29 ragge Exp $ */ /* * Copyright (c) 1998 Ludd, University of Lule}, Sweden. All rights reserved. * Copyright (c) 1996 Ken C. Wellsch. All rights reserved. @@ -11,11 +11,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. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed at Ludd, University of - * Lule}, Sweden and its contributors. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products *derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR @@ -31,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dz_uba.c,v 1.28 2008/03/15 00:57:15 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dz_uba.c,v 1.29 2017/05/22 17:22:29 ragge Exp $"); #include #include Index: src/sys/dev/qbus/if_de.c diff -u src/sys/dev/qbus/if_de.c:1.31 src/sys/dev/qbus/if_de.c:1.32 --- src/sys/dev/qbus/if_de.c:1.31 Thu Dec 15 09:28:06 2016 +++ src/sys/dev/qbus/if_de.c Mon May 22 17:22:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_de.c,v 1.31 2016/12/15 09:28:06 ozaki-r Exp $ */ +/* $NetBSD: if_de.c,v 1.32 2017/05/22 17:22:29 ragge Exp $ */ /* * Copyright (c) 1982, 1986, 1989 Regents of the University of California. @@ -45,13 +45,6 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - *may be used to endorse or promote products derived from this software - *without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -64,8 +57,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)if_de.c 7.12 (Berkeley) 12/16/90 */ /* @@ -81,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.31 2016/12/15 09:28:06 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.32 2017/05/22 17:22:29 ragge Exp $"); #include "opt_inet.h" Index: src/sys/dev/qbus/if_qe.c diff -u src/sys/dev/qbus/if_qe.c:1.76 src/sys/dev/qbus/if_qe.c:1.77 --- src/sys/dev/qbus/if_qe.c:1.76 Thu Dec 15 09:28:06 2016 +++ src/sys/dev/qbus/if_qe.c Mon May 22 17:22:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_qe.c,v 1.76 2016/12/15 09:28:06 ozaki-r Exp $ */ +/* $NetBSD: if_qe.c,v 1.77 2017/05/22 17:22:29 ragge Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -10,12 +10,6 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - *must
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: christos Date: Sat Sep 12 19:21:50 UTC 2015 Modified Files: src/sys/dev/qbus: if_il.c Log Message: add missing splx() found by brainy To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/qbus/if_il.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/qbus/if_il.c diff -u src/sys/dev/qbus/if_il.c:1.27 src/sys/dev/qbus/if_il.c:1.28 --- src/sys/dev/qbus/if_il.c:1.27 Thu May 29 03:08:10 2014 +++ src/sys/dev/qbus/if_il.c Sat Sep 12 15:21:50 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_il.c,v 1.27 2014/05/29 07:08:10 wiz Exp $ */ +/* $NetBSD: if_il.c,v 1.28 2015/09/12 19:21:50 christos Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.27 2014/05/29 07:08:10 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.28 2015/09/12 19:21:50 christos Exp $"); #include "opt_inet.h" @@ -291,8 +291,7 @@ ilinit(struct ifnet *ifp) IL_WCSR(IL_CSR, ILC_RESET); if (ilwait(sc, "hardware diag")) { sc->sc_if.if_flags &= ~IFF_UP; - splx(s); - return 0; + goto out; } IL_WCSR(IL_CSR, ILC_CISA); while ((IL_RCSR(IL_CSR) & IL_CDONE) == 0) @@ -310,28 +309,28 @@ ilinit(struct ifnet *ifp) IL_WCSR(IL_BCR, ETHER_ADDR_LEN); IL_WCSR(IL_CSR, ((sc->sc_ui.ui_baddr >> 2) & IL_EUA)|ILC_LDPA); if (ilwait(sc, "setaddr")) - return 0; + goto out; IL_WCSR(IL_BAR, LOWORD(sc->sc_ui.ui_baddr)); IL_WCSR(IL_BCR, sizeof (struct il_stats)); IL_WCSR(IL_CSR, ((sc->sc_ui.ui_baddr >> 2) & IL_EUA)|ILC_STAT); if (ilwait(sc, "verifying setaddr")) - return 0; + goto out; if (memcmp(sc->sc_stats.ils_addr, CLLADDR(ifp->if_sadl), ETHER_ADDR_LEN) != 0) { aprint_error_dev(sc->sc_dev, "setaddr didn't work\n"); - return 0; + goto out; } } #ifdef MULTICAST if (is->is_if.if_flags & IFF_PROMISC) { addr->il_csr = ILC_PRMSC; if (ilwait(ui, "all multi")) - return 0; + goto out; } else if (is->is_if.if_flags & IFF_ALLMULTI) { too_many_multis: addr->il_csr = ILC_ALLMC; if (ilwait(ui, "all multi")) - return 0; + goto out; } else { int i; register struct ether_addr *ep = is->is_maddrs; @@ -360,7 +359,7 @@ ilinit(struct ifnet *ifp) addr->il_csr = ((is->is_ubaddr >> 2) & IL_EUA)| LC_LDGRPS; if (ilwait(ui, "load multi")) -return; +goto out; } else { is->is_if.if_flags |= IFF_ALLMULTI; goto too_many_multis; @@ -388,6 +387,7 @@ ilinit(struct ifnet *ifp) sc->sc_flags |= ILF_RUNNING; sc->sc_lastcmd = 0; ilcint(sc); +out: splx(s); return 0; }
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: riastradh Date: Mon Aug 18 04:16:59 UTC 2014 Modified Files: src/sys/dev/qbus: if_qe.c Log Message: Avoid leak in error branch, noted by maxv@, compile-tested for vax. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/dev/qbus/if_qe.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/qbus/if_qe.c diff -u src/sys/dev/qbus/if_qe.c:1.72 src/sys/dev/qbus/if_qe.c:1.73 --- src/sys/dev/qbus/if_qe.c:1.72 Fri Oct 25 15:42:50 2013 +++ src/sys/dev/qbus/if_qe.c Mon Aug 18 04:16:59 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_qe.c,v 1.72 2013/10/25 15:42:50 martin Exp $ */ +/* $NetBSD: if_qe.c,v 1.73 2014/08/18 04:16:59 riastradh Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_qe.c,v 1.72 2013/10/25 15:42:50 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: if_qe.c,v 1.73 2014/08/18 04:16:59 riastradh Exp $); #include opt_inet.h @@ -142,7 +142,7 @@ qematch(device_t parent, cfdata_t cf, vo #define PROBESIZE 4096 struct qe_ring *ring; struct qe_ring *rp; - int error; + int error, match; ring = malloc(PROBESIZE, M_TEMP, M_WAITOK|M_ZERO); memset(sc, 0, sizeof(*sc)); @@ -161,8 +161,10 @@ qematch(device_t parent, cfdata_t cf, vo */ ui.ui_size = PROBESIZE; ui.ui_vaddr = (void *)ring[0]; - if ((error = uballoc(uh, ui, UBA_CANTWAIT))) - return 0; + if ((error = uballoc(uh, ui, UBA_CANTWAIT))) { + match = 0; + goto out0; + } /* * Init a simple fake receive and transmit descriptor that @@ -192,12 +194,14 @@ qematch(device_t parent, cfdata_t cf, vo QE_WCSR(QE_CSR_XMTH, HIWORD(rp)); DELAY(1); + match = 1; + /* * All done with the bus resources. */ ubfree(uh, ui); - free(ring, M_TEMP); - return 1; +out0: free(ring, M_TEMP); + return match; } /*
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: ryoon Date: Mon Aug 4 14:20:33 UTC 2014 Modified Files: src/sys/dev/qbus: rf.c Log Message: Fix typo in comment. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/qbus/rf.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/qbus/rf.c diff -u src/sys/dev/qbus/rf.c:1.28 src/sys/dev/qbus/rf.c:1.29 --- src/sys/dev/qbus/rf.c:1.28 Fri Jul 25 08:10:38 2014 +++ src/sys/dev/qbus/rf.c Mon Aug 4 14:20:33 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rf.c,v 1.28 2014/07/25 08:10:38 dholland Exp $ */ +/* $NetBSD: rf.c,v 1.29 2014/08/04 14:20:33 ryoon Exp $ */ /* * Copyright (c) 2002 Jochen Kunz. * All rights reserved. @@ -32,11 +32,11 @@ TODO: - Better LBN bound checking, block padding for SD disks. - Formatting / Set Density -- Better error handling / detailed error reason reportnig. +- Better error handling / detailed error reason reporting. */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rf.c,v 1.28 2014/07/25 08:10:38 dholland Exp $); +__KERNEL_RCSID(0, $NetBSD: rf.c,v 1.29 2014/08/04 14:20:33 ryoon Exp $); /* autoconfig stuff */ #include sys/param.h
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: wiz Date: Thu May 29 07:08:10 UTC 2014 Modified Files: src/sys/dev/qbus: if_il.c Log Message: Add missing braces. From Henning Petersen in PR 48846. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/qbus/if_il.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/qbus/if_il.c diff -u src/sys/dev/qbus/if_il.c:1.26 src/sys/dev/qbus/if_il.c:1.27 --- src/sys/dev/qbus/if_il.c:1.26 Sat Oct 27 17:18:37 2012 +++ src/sys/dev/qbus/if_il.c Thu May 29 07:08:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_il.c,v 1.26 2012/10/27 17:18:37 chs Exp $ */ +/* $NetBSD: if_il.c,v 1.27 2014/05/29 07:08:10 wiz Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.26 2012/10/27 17:18:37 chs Exp $); +__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.27 2014/05/29 07:08:10 wiz Exp $); #include opt_inet.h @@ -332,7 +332,7 @@ ilinit(struct ifnet *ifp) addr-il_csr = ILC_ALLMC; if (ilwait(ui, all multi)) return 0; - else { + } else { int i; register struct ether_addr *ep = is-is_maddrs; struct ether_multi *enm;
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: martin Date: Fri Oct 25 15:42:50 UTC 2013 Modified Files: src/sys/dev/qbus: if_qe.c Log Message: Fix dmamap cleanup in an error path To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/dev/qbus/if_qe.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/qbus/if_qe.c diff -u src/sys/dev/qbus/if_qe.c:1.71 src/sys/dev/qbus/if_qe.c:1.72 --- src/sys/dev/qbus/if_qe.c:1.71 Mon Apr 5 07:21:47 2010 +++ src/sys/dev/qbus/if_qe.c Fri Oct 25 15:42:50 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_qe.c,v 1.71 2010/04/05 07:21:47 joerg Exp $ */ +/* $NetBSD: if_qe.c,v 1.72 2013/10/25 15:42:50 martin Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -38,7 +38,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_qe.c,v 1.71 2010/04/05 07:21:47 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: if_qe.c,v 1.72 2013/10/25 15:42:50 martin Exp $); #include opt_inet.h @@ -372,13 +372,13 @@ qeattach(device_t parent, device_t self, } fail_5: for (i = 0; i RXDESCS; i++) { - if (sc-sc_xmtmap[i] != NULL) - bus_dmamap_destroy(sc-sc_dmat, sc-sc_xmtmap[i]); + if (sc-sc_rcvmap[i] != NULL) + bus_dmamap_destroy(sc-sc_dmat, sc-sc_rcvmap[i]); } fail_4: for (i = 0; i TXDESCS; i++) { - if (sc-sc_rcvmap[i] != NULL) - bus_dmamap_destroy(sc-sc_dmat, sc-sc_rcvmap[i]); + if (sc-sc_xmtmap[i] != NULL) + bus_dmamap_destroy(sc-sc_dmat, sc-sc_xmtmap[i]); } } @@ -452,7 +452,7 @@ qestart(struct ifnet *ifp) struct qe_cdata *qc = sc-sc_qedata; paddr_t buffer; struct mbuf *m, *m0; - int idx, len, s, i, totlen, buflen, error; + int idx, len, s, i, totlen, buflen; short orword, csr; if ((QE_RCSR(QE_CSR_CSR) QE_RCV_ENABLE) == 0) @@ -502,7 +502,7 @@ qestart(struct ifnet *ifp) if (m0) { if (m0-m_len == 0) continue; -error = bus_dmamap_load(sc-sc_dmat, +bus_dmamap_load(sc-sc_dmat, sc-sc_xmtmap[idx], mtod(m0, void *), m0-m_len, 0, 0); buffer = sc-sc_xmtmap[idx]-dm_segs[0].ds_addr;
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: wiz Date: Tue Feb 2 14:58:46 UTC 2010 Modified Files: src/sys/dev/qbus: if_il.c Log Message: Fix incomplete line (deleto?), found by cppcheck and reported by Henning Petersen in PR 42719. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/qbus/if_il.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/qbus/if_il.c diff -u src/sys/dev/qbus/if_il.c:1.24 src/sys/dev/qbus/if_il.c:1.25 --- src/sys/dev/qbus/if_il.c:1.24 Tue May 12 14:43:33 2009 +++ src/sys/dev/qbus/if_il.c Tue Feb 2 14:58:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: if_il.c,v 1.24 2009/05/12 14:43:33 cegger Exp $ */ +/* $NetBSD: if_il.c,v 1.25 2010/02/02 14:58:46 wiz Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.24 2009/05/12 14:43:33 cegger Exp $); +__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.25 2010/02/02 14:58:46 wiz Exp $); #include opt_inet.h @@ -444,7 +444,8 @@ char bits[64]; snprintb(bits, sizeof(bits), IL_BITS, IL_RCSR(IL_CSR)); - aprint_error_dev(sc-sc_dev, stray xmit interrupt, csr=%s\n, + aprint_error_dev(sc-sc_dev, + stray xmit interrupt, csr=%s\n, bits); return; }
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: cegger Date: Tue May 12 13:19:12 UTC 2009 Modified Files: src/sys/dev/qbus: dl.c if_dmc.c if_il.c Log Message: struct cfdata * - cfdata_t, no functional changes intended. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/dev/qbus/dl.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/qbus/if_dmc.c cvs rdiff -u -r1.22 -r1.23 src/sys/dev/qbus/if_il.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/qbus/dl.c diff -u src/sys/dev/qbus/dl.c:1.43 src/sys/dev/qbus/dl.c:1.44 --- src/sys/dev/qbus/dl.c:1.43 Wed Jun 11 17:32:30 2008 +++ src/sys/dev/qbus/dl.c Tue May 12 13:19:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dl.c,v 1.43 2008/06/11 17:32:30 drochner Exp $ */ +/* $NetBSD: dl.c,v 1.44 2009/05/12 13:19:12 cegger Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: dl.c,v 1.43 2008/06/11 17:32:30 drochner Exp $); +__KERNEL_RCSID(0, $NetBSD: dl.c,v 1.44 2009/05/12 13:19:12 cegger Exp $); #include sys/param.h #include sys/systm.h @@ -137,7 +137,7 @@ struct tty *sc_tty; }; -static int dl_match (struct device *, struct cfdata *, void *); +static int dl_match (struct device *, cfdata_t, void *); static void dl_attach (struct device *, struct device *, void *); static void dlrint (void *); static void dlxint (void *); @@ -173,7 +173,7 @@ /* then complete the housecleaning for full operation */ static int -dl_match (struct device *parent, struct cfdata *cf, void *aux) +dl_match (struct device *parent, cfdata_t cf, void *aux) { struct uba_attach_args *ua = aux; Index: src/sys/dev/qbus/if_dmc.c diff -u src/sys/dev/qbus/if_dmc.c:1.18 src/sys/dev/qbus/if_dmc.c:1.19 --- src/sys/dev/qbus/if_dmc.c:1.18 Tue Dec 16 22:35:34 2008 +++ src/sys/dev/qbus/if_dmc.c Tue May 12 13:19:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_dmc.c,v 1.18 2008/12/16 22:35:34 christos Exp $ */ +/* $NetBSD: if_dmc.c,v 1.19 2009/05/12 13:19:12 cegger Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -41,7 +41,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_dmc.c,v 1.18 2008/12/16 22:35:34 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: if_dmc.c,v 1.19 2009/05/12 13:19:12 cegger Exp $); #undef DMCDEBUG /* for base table dump on fatal error */ @@ -168,7 +168,7 @@ } dmc_base; }; -static int dmcmatch(struct device *, struct cfdata *, void *); +static int dmcmatch(struct device *, cfdata_t, void *); static void dmcattach(struct device *, struct device *, void *); static int dmcinit(struct ifnet *); static void dmcrint(void *); @@ -214,7 +214,7 @@ (tail) = (head) int -dmcmatch(struct device *parent, struct cfdata *cf, void *aux) +dmcmatch(struct device *parent, cfdata_t cf, void *aux) { struct uba_attach_args *ua = aux; struct dmc_softc ssc; @@ -305,7 +305,7 @@ struct dmcbufs *rp; struct dmc_command *qp; struct ifaddr *ifa; - struct cfdata *ui = device_cfdata(sc-sc_dev); + cfdata_t ui = device_cfdata(sc-sc_dev); int base; int s; Index: src/sys/dev/qbus/if_il.c diff -u src/sys/dev/qbus/if_il.c:1.22 src/sys/dev/qbus/if_il.c:1.23 --- src/sys/dev/qbus/if_il.c:1.22 Sat Apr 18 14:58:03 2009 +++ src/sys/dev/qbus/if_il.c Tue May 12 13:19:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_il.c,v 1.22 2009/04/18 14:58:03 tsutsui Exp $ */ +/* $NetBSD: if_il.c,v 1.23 2009/05/12 13:19:12 cegger Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.22 2009/04/18 14:58:03 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.23 2009/05/12 13:19:12 cegger Exp $); #include opt_inet.h @@ -111,7 +111,7 @@ int sc_ubaddr; /* mapping registers of is_stats */ }; -static int ilmatch(struct device *, struct cfdata *, void *); +static int ilmatch(struct device *, cfdata_t, void *); static void ilattach(struct device *, struct device *, void *); static void ilcint(void *); static void ilrint(void *); @@ -134,7 +134,7 @@ #define HIWORD(x) (((int)(x) 16) 0x3) int -ilmatch(struct device *parent, struct cfdata *cf, void *aux) +ilmatch(struct device *parent, cfdata_t cf, void *aux) { struct uba_attach_args *ua = aux; volatile int i;
CVS commit: src/sys/dev/qbus
Module Name:src Committed By: cegger Date: Tue May 12 14:43:33 UTC 2009 Modified Files: src/sys/dev/qbus: dl.c if_dmc.c if_il.c Log Message: struct device * - device_t, no functional changes intended. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dev/qbus/dl.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/qbus/if_dmc.c cvs rdiff -u -r1.23 -r1.24 src/sys/dev/qbus/if_il.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/qbus/dl.c diff -u src/sys/dev/qbus/dl.c:1.44 src/sys/dev/qbus/dl.c:1.45 --- src/sys/dev/qbus/dl.c:1.44 Tue May 12 13:19:12 2009 +++ src/sys/dev/qbus/dl.c Tue May 12 14:43:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dl.c,v 1.44 2009/05/12 13:19:12 cegger Exp $ */ +/* $NetBSD: dl.c,v 1.45 2009/05/12 14:43:33 cegger Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -104,7 +104,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: dl.c,v 1.44 2009/05/12 13:19:12 cegger Exp $); +__KERNEL_RCSID(0, $NetBSD: dl.c,v 1.45 2009/05/12 14:43:33 cegger Exp $); #include sys/param.h #include sys/systm.h @@ -137,8 +137,8 @@ struct tty *sc_tty; }; -static int dl_match (struct device *, cfdata_t, void *); -static void dl_attach (struct device *, struct device *, void *); +static int dl_match (device_t, cfdata_t, void *); +static void dl_attach (device_t, device_t, void *); static void dlrint (void *); static void dlxint (void *); static void dlstart (struct tty *); @@ -173,7 +173,7 @@ /* then complete the housecleaning for full operation */ static int -dl_match (struct device *parent, cfdata_t cf, void *aux) +dl_match (device_t parent, cfdata_t cf, void *aux) { struct uba_attach_args *ua = aux; @@ -229,7 +229,7 @@ } static void -dl_attach (struct device *parent, struct device *self, void *aux) +dl_attach (device_t parent, device_t self, void *aux) { struct dl_softc *sc = device_private(self); struct uba_attach_args *ua = aux; Index: src/sys/dev/qbus/if_dmc.c diff -u src/sys/dev/qbus/if_dmc.c:1.19 src/sys/dev/qbus/if_dmc.c:1.20 --- src/sys/dev/qbus/if_dmc.c:1.19 Tue May 12 13:19:12 2009 +++ src/sys/dev/qbus/if_dmc.c Tue May 12 14:43:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_dmc.c,v 1.19 2009/05/12 13:19:12 cegger Exp $ */ +/* $NetBSD: if_dmc.c,v 1.20 2009/05/12 14:43:33 cegger Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -41,7 +41,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_dmc.c,v 1.19 2009/05/12 13:19:12 cegger Exp $); +__KERNEL_RCSID(0, $NetBSD: if_dmc.c,v 1.20 2009/05/12 14:43:33 cegger Exp $); #undef DMCDEBUG /* for base table dump on fatal error */ @@ -168,8 +168,8 @@ } dmc_base; }; -static int dmcmatch(struct device *, cfdata_t, void *); -static void dmcattach(struct device *, struct device *, void *); +static int dmcmatch(device_t, cfdata_t, void *); +static void dmcattach(device_t, device_t, void *); static int dmcinit(struct ifnet *); static void dmcrint(void *); static void dmcxint(void *); @@ -181,7 +181,7 @@ static int dmcioctl(struct ifnet *, u_long, void *); static int dmcoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); -static void dmcreset(struct device *); +static void dmcreset(device_t); CFATTACH_DECL(dmc, sizeof(struct dmc_softc), dmcmatch, dmcattach, NULL, NULL); @@ -214,7 +214,7 @@ (tail) = (head) int -dmcmatch(struct device *parent, cfdata_t cf, void *aux) +dmcmatch(device_t parent, cfdata_t cf, void *aux) { struct uba_attach_args *ua = aux; struct dmc_softc ssc; @@ -247,7 +247,7 @@ * to accept packets. */ void -dmcattach(struct device *parent, struct device *self, void *aux) +dmcattach(device_t parent, device_t self, void *aux) { struct uba_attach_args *ua = aux; struct dmc_softc *sc = device_private(self); @@ -284,7 +284,7 @@ * If interface is on specified UBA, reset its state. */ void -dmcreset(struct device *dev) +dmcreset(device_t dev) { struct dmc_softc *sc = (struct dmc_softc *)dev; Index: src/sys/dev/qbus/if_il.c diff -u src/sys/dev/qbus/if_il.c:1.23 src/sys/dev/qbus/if_il.c:1.24 --- src/sys/dev/qbus/if_il.c:1.23 Tue May 12 13:19:12 2009 +++ src/sys/dev/qbus/if_il.c Tue May 12 14:43:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_il.c,v 1.23 2009/05/12 13:19:12 cegger Exp $ */ +/* $NetBSD: if_il.c,v 1.24 2009/05/12 14:43:33 cegger Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.23 2009/05/12 13:19:12 cegger Exp $); +__KERNEL_RCSID(0, $NetBSD: if_il.c,v 1.24 2009/05/12 14:43:33 cegger Exp $); #include opt_inet.h @@ -111,11 +111,11 @@ int sc_ubaddr; /* mapping registers of is_stats */ }; -static int ilmatch(struct device *, cfdata_t, void *); -static void