diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2011-07-07 20:42:57 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2011-07-07 20:42:57 +0000 |
commit | 6dcc67f5a65c901e09cc8c82acd1da6ed4a6ac3a (patch) | |
tree | 707e484e41f3f079840cca13c3499583af1858ce | |
parent | c2c49577053bdab156761ac49dc3b55fc92381ba (diff) |
use IF_LEN/IFQ_LEN to access and ifqueue's length field. ryan ok
with this nothing in the tree fiddles if ifqueue internals any more, of
course except if.c and if.h (and some altq)
-rw-r--r-- | sys/dev/ic/dc.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_de.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_lmc.c | 6 | ||||
-rw-r--r-- | sys/net/if_ppp.c | 4 | ||||
-rw-r--r-- | sys/net/if_pppx.c | 4 | ||||
-rw-r--r-- | sys/net/if_tun.c | 8 |
6 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index ffb4b9db446..23030834bde 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.123 2011/06/21 16:52:45 tedu Exp $ */ +/* $OpenBSD: dc.c,v 1.124 2011/07/07 20:42:56 henning Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2668,7 +2668,7 @@ dc_start(struct ifnet *ifp) sc = ifp->if_softc; - if (!sc->dc_link && ifp->if_snd.ifq_len < 10) + if (!sc->dc_link && IFQ_LEN(&ifp->if_snd) < 10) return; if (ifp->if_flags & IFF_OACTIVE) diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index fa2f274d47d..e2ce3371cd8 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.108 2011/07/06 02:42:27 henning Exp $ */ +/* $OpenBSD: if_de.c,v 1.109 2011/07/07 20:42:56 henning Exp $ */ /* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */ /*- @@ -3205,7 +3205,7 @@ tulip_rx_intr(tulip_softc_t * const sc) bus_dmamap_t map; int error; - if (fillok && sc->tulip_rxq.ifq_len < TULIP_RXQ_TARGET) + if (fillok && IF_LEN(&sc->tulip_rxq) < TULIP_RXQ_TARGET) goto queue_mbuf; #if defined(TULIP_DEBUG) @@ -3458,7 +3458,7 @@ tulip_rx_intr(tulip_softc_t * const sc) IF_ENQUEUE(&sc->tulip_rxq, ms); } while ((ms = me) != NULL); - if (sc->tulip_rxq.ifq_len >= TULIP_RXQ_TARGET) + if (IF_LEN(&sc->tulip_rxq) >= TULIP_RXQ_TARGET) sc->tulip_flags &= ~TULIP_RXBUFSLOW; TULIP_PERFEND(rxget); } diff --git a/sys/dev/pci/if_lmc.c b/sys/dev/pci/if_lmc.c index a60df284061..5f1b3a5b3ed 100644 --- a/sys/dev/pci/if_lmc.c +++ b/sys/dev/pci/if_lmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lmc.c,v 1.24 2010/01/04 18:34:19 chl Exp $ */ +/* $OpenBSD: if_lmc.c,v 1.25 2011/07/07 20:42:56 henning Exp $ */ /* $NetBSD: if_lmc.c,v 1.1 1999/03/25 03:32:43 explorer Exp $ */ /*- @@ -507,7 +507,7 @@ lmc_rx_intr(lmc_softc_t * const sc) bus_dmamap_t map; int error; - if (fillok && sc->lmc_rxq.ifq_len < LMC_RXQ_TARGET) + if (fillok && IF_LEN(&sc->lmc_rxq) < LMC_RXQ_TARGET) goto queue_mbuf; /* @@ -737,7 +737,7 @@ lmc_rx_intr(lmc_softc_t * const sc) IF_ENQUEUE(&sc->lmc_rxq, ms); } while ((ms = me) != NULL); - if (sc->lmc_rxq.ifq_len >= LMC_RXQ_TARGET) + if (IF_LEN(&sc->lmc_rxq) >= LMC_RXQ_TARGET) sc->lmc_flags &= ~LMC_RXBUFSLOW; } } diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index edcf2bb258e..286ec101f87 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ppp.c,v 1.62 2011/07/06 22:08:50 henning Exp $ */ +/* $OpenBSD: if_ppp.c,v 1.63 2011/07/07 20:42:56 henning Exp $ */ /* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */ /* @@ -420,7 +420,7 @@ pppioctl(sc, cmd, data, flag, p) switch (cmd) { case FIONREAD: - *(int *)data = sc->sc_inq.ifq_len; + *(int *)data = IFQ_LEN(&sc->sc_inq); break; case PPPIOCGUNIT: diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index a624eedfbef..79686d2597d 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.8 2011/07/02 22:20:08 nicm Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.9 2011/07/07 20:42:56 henning Exp $ */ /* * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> @@ -553,7 +553,7 @@ filt_pppx_read(struct knote *kn, long hint) s = splnet(); if (!IF_IS_EMPTY(&pxd->pxd_svcq)) { event = 1; - kn->kn_data = pxd->pxd_svcq.ifq_len; + kn->kn_data = IF_LEN(&pxd->pxd_svcq); } splx(s); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index ef649750c68..6c152ee6514 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.110 2011/07/02 22:20:08 nicm Exp $ */ +/* $OpenBSD: if_tun.c,v 1.111 2011/07/07 20:42:56 henning Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -1002,7 +1002,7 @@ tunpoll(dev_t dev, int events, struct proc *p) IFQ_POLL(&ifp->if_snd, m); if (m != NULL) { TUNDEBUG(("%s: tunselect q=%d\n", ifp->if_xname, - ifp->if_snd.ifq_len)); + IFQ_LEN(ifp->if_snd))); revents |= events & (POLLIN | POLLRDNORM); } else { TUNDEBUG(("%s: tunpoll waiting\n", ifp->if_xname)); @@ -1096,10 +1096,10 @@ filt_tunread(struct knote *kn, long hint) IFQ_POLL(&ifp->if_snd, m); if (m != NULL) { splx(s); - kn->kn_data = ifp->if_snd.ifq_len; + kn->kn_data = IFQ_LEN(&ifp->if_snd); TUNDEBUG(("%s: tunkqread q=%d\n", ifp->if_xname, - ifp->if_snd.ifq_len)); + IFQ_LEN(&ifp->if_snd))); return (1); } splx(s); |