diff options
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/if_ed.c | 8 | ||||
-rw-r--r-- | sys/dev/isa/if_ef_isapnp.c | 9 | ||||
-rw-r--r-- | sys/dev/isa/if_eg.c | 5 | ||||
-rw-r--r-- | sys/dev/isa/if_el.c | 5 | ||||
-rw-r--r-- | sys/dev/isa/if_ex.c | 13 | ||||
-rw-r--r-- | sys/dev/isa/if_fe.c | 5 | ||||
-rw-r--r-- | sys/dev/isa/if_hp.c | 5 | ||||
-rw-r--r-- | sys/dev/isa/if_ie.c | 5 | ||||
-rw-r--r-- | sys/dev/isa/if_iy.c | 12 |
9 files changed, 41 insertions, 26 deletions
diff --git a/sys/dev/isa/if_ed.c b/sys/dev/isa/if_ed.c index 9a56c092f28..5b4d8d9b2f9 100644 --- a/sys/dev/isa/if_ed.c +++ b/sys/dev/isa/if_ed.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ed.c,v 1.44 2001/06/25 04:44:27 fgsch Exp $ */ +/* $OpenBSD: if_ed.c,v 1.45 2001/06/27 06:34:44 kjc Exp $ */ /* $NetBSD: if_ed.c,v 1.105 1996/10/21 22:40:45 thorpej Exp $ */ /* @@ -230,7 +230,7 @@ ed_pcmcia_isa_attach(parent, match, aux, pc_link) /* clear ED_NOTPRESENT, set ED_REATTACH if needed */ sc->spec_flags=pc_link->flags&PCMCIA_REATTACH?ED_REATTACH:0; sc->type_str = dev->model; - sc->sc_arpcom.ac_if.if_snd.ifq_maxlen=ifqmaxlen; + IFQ_SET_MAXLEN(&sc->sc_arpcom.ac_if.if_snd, ifqmaxlen); sc->sc_ic = ia->ia_ic; return 1; } else @@ -499,6 +499,7 @@ ed_pci_attach(parent, self, aux) ifp->if_watchdog = edwatchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; + IFQ_SET_READY(&ifp->if_snd); /* Attach the interface. */ if ((sc->spec_flags & ED_REATTACH) == 0) @@ -1655,6 +1656,7 @@ edattach(parent, self, aux) ifp->if_watchdog = edwatchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; + IFQ_SET_READY(&ifp->if_snd); /* * Set default state for LINK0 flag (used to disable the tranceiver @@ -1992,7 +1994,7 @@ outloop: return; } - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); if (m0 == 0) return; diff --git a/sys/dev/isa/if_ef_isapnp.c b/sys/dev/isa/if_ef_isapnp.c index cf9e28652c8..b0d3e74a82d 100644 --- a/sys/dev/isa/if_ef_isapnp.c +++ b/sys/dev/isa/if_ef_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ef_isapnp.c,v 1.12 2001/06/25 04:44:28 fgsch Exp $ */ +/* $OpenBSD: if_ef_isapnp.c,v 1.13 2001/06/27 06:34:45 kjc Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -214,6 +214,7 @@ ef_isapnp_attach(parent, self, aux) ifp->if_watchdog = efwatchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; + IFQ_SET_READY(&ifp->if_snd); sc->sc_mii.mii_ifp = ifp; sc->sc_mii.mii_readreg = ef_miibus_readreg; @@ -253,7 +254,7 @@ efstart(ifp) return; startagain: - m0 = ifp->if_snd.ifq_head; + IFQ_POLL(&ifp->if_snd, m0); if (m0 == NULL) return; @@ -264,7 +265,7 @@ startagain: if (len + pad > ETHER_MAX_LEN) { ifp->if_oerrors++; - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); m_freem(m0); goto startagain; } @@ -287,7 +288,7 @@ startagain: bpf_mtap(ifp->if_bpf, m0); #endif - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); if (m0 == NULL) /* XXX not needed */ return; diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c index e6784ec5e64..800575e9023 100644 --- a/sys/dev/isa/if_eg.c +++ b/sys/dev/isa/if_eg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_eg.c,v 1.20 2001/06/25 04:44:28 fgsch Exp $ */ +/* $OpenBSD: if_eg.c,v 1.21 2001/06/27 06:34:45 kjc Exp $ */ /* $NetBSD: if_eg.c,v 1.26 1996/05/12 23:52:27 mycroft Exp $ */ /* @@ -444,6 +444,7 @@ egattach(parent, self, aux) ifp->if_ioctl = egioctl; ifp->if_watchdog = egwatchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS; + IFQ_SET_READY(&ifp->if_snd); /* Now we can attach the interface. */ if_attach(ifp); @@ -543,7 +544,7 @@ egstart(ifp) loop: /* Dequeue the next datagram. */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); if (m0 == 0) return; diff --git a/sys/dev/isa/if_el.c b/sys/dev/isa/if_el.c index f49bd8bef2e..cc79f9c35c1 100644 --- a/sys/dev/isa/if_el.c +++ b/sys/dev/isa/if_el.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_el.c,v 1.15 2001/06/25 04:44:28 fgsch Exp $ */ +/* $OpenBSD: if_el.c,v 1.16 2001/06/27 06:34:45 kjc Exp $ */ /* $NetBSD: if_el.c,v 1.39 1996/05/12 23:52:32 mycroft Exp $ */ /* @@ -187,6 +187,7 @@ elattach(parent, self, aux) ifp->if_ioctl = elioctl; ifp->if_watchdog = elwatchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS; + IFQ_SET_READY(&ifp->if_snd); /* Now we can attach the interface. */ dprintf(("Attaching interface...\n")); @@ -316,7 +317,7 @@ elstart(ifp) */ for (;;) { /* Dequeue the next datagram. */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); /* If there's nothing to send, return. */ if (m0 == 0) diff --git a/sys/dev/isa/if_ex.c b/sys/dev/isa/if_ex.c index 7b12438e32b..b8541856ae1 100644 --- a/sys/dev/isa/if_ex.c +++ b/sys/dev/isa/if_ex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ex.c,v 1.6 2001/02/20 19:39:40 mickey Exp $ */ +/* $OpenBSD: if_ex.c,v 1.7 2001/06/27 06:34:46 kjc Exp $ */ /* * Copyright (c) 1997, Donald A. Schmidt * Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es) @@ -294,6 +294,7 @@ ex_attach(parent, self, aux) ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST; /* XXX not done yet. | IFF_MULTICAST */ + IFQ_SET_READY(&ifp->if_snd); /* * Attach the interface. @@ -425,8 +426,10 @@ ex_start(ifp) * Main loop: send outgoing packets to network card until there are no * more packets left, or the card cannot accept any more yet. */ - while (((opkt = ifp->if_snd.ifq_head) != NULL) && - !(ifp->if_flags & IFF_OACTIVE)) { + while (!(ifp->if_flags & IFF_OACTIVE)) { + IFQ_POLL(&ifp->if_snd, opkt); + if (opkt == NULL) + break; /* * Ensure there is enough free transmit buffer space for this @@ -449,7 +452,7 @@ ex_start(ifp) avail = -i; DODEBUG(Sent_Pkts, printf("i=%d, avail=%d\n", i, avail);); if (avail >= len + XMT_HEADER_LEN) { - IF_DEQUEUE(&ifp->if_snd, opkt); + IFQ_DEQUEUE(&ifp->if_snd, opkt); #ifdef EX_PSA_INTR /* @@ -631,7 +634,7 @@ exintr(arg) * be sent, attempt to send more packets to the network card. */ - if (send_pkts && (ifp->if_snd.ifq_head != NULL)) + if (send_pkts && IFQ_IS_EMPTY(&ifp->if_snd) == 0) ex_start(ifp); #ifdef EXDEBUG exintr_count--; diff --git a/sys/dev/isa/if_fe.c b/sys/dev/isa/if_fe.c index 95cf28caa77..688345e7d9e 100644 --- a/sys/dev/isa/if_fe.c +++ b/sys/dev/isa/if_fe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_fe.c,v 1.15 2001/06/25 04:44:28 fgsch Exp $ */ +/* $OpenBSD: if_fe.c,v 1.16 2001/06/27 06:34:46 kjc Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -999,6 +999,7 @@ feattach(parent, self, aux) ifp->if_watchdog = fe_watchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; + IFQ_SET_READY(&ifp->if_snd); /* * Set maximum size of output queue, if it has not been set. @@ -1508,7 +1509,7 @@ fe_start(ifp) /* * Get the next mbuf chain for a packet to send. */ - IF_DEQUEUE(&ifp->if_snd, m); + IFQ_DEQUEUE(&ifp->if_snd, m); if (m == 0) { /* No more packets to send. */ goto indicate_inactive; diff --git a/sys/dev/isa/if_hp.c b/sys/dev/isa/if_hp.c index b4a01b473d7..b7374534d64 100644 --- a/sys/dev/isa/if_hp.c +++ b/sys/dev/isa/if_hp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_hp.c,v 1.7 2001/06/23 22:03:09 fgsch Exp $ */ +/* $OpenBSD: if_hp.c,v 1.8 2001/06/27 06:34:46 kjc Exp $ */ /* $NetBSD: if_hp.c,v 1.21 1995/12/24 02:31:31 mycroft Exp $ */ /* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */ @@ -410,6 +410,7 @@ hpattach(dvp) ifp->if_ioctl = hpioctl; ifp->if_reset = hpreset; ifp->if_watchdog = 0; + IFQ_SET_READY(&ifp->if_snd); if_attach(ifp); } /* @@ -519,7 +520,7 @@ hpstart(ifp) if ((ns->ns_if.if_flags & IFF_RUNNING) == 0) return; - IF_DEQUEUE(&ns->ns_if.if_snd, m); + IFQ_DEQUEUE(&ns->ns_if.if_snd, m); if (m == 0) return; diff --git a/sys/dev/isa/if_ie.c b/sys/dev/isa/if_ie.c index 53e8b77c80f..d96e8592f4f 100644 --- a/sys/dev/isa/if_ie.c +++ b/sys/dev/isa/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.21 2001/06/23 21:54:52 fgsch Exp $ */ +/* $OpenBSD: if_ie.c,v 1.22 2001/06/27 06:34:46 kjc Exp $ */ /* $NetBSD: if_ie.c,v 1.51 1996/05/12 23:52:48 mycroft Exp $ */ /*- @@ -790,6 +790,7 @@ ieattach(parent, self, aux) ifp->if_watchdog = iewatchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; + IFQ_SET_READY(&ifp->if_snd); /* Attach the interface. */ if_attach(ifp); @@ -1484,7 +1485,7 @@ iestart(ifp) break; } - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); if (m0 == 0) break; diff --git a/sys/dev/isa/if_iy.c b/sys/dev/isa/if_iy.c index 8315a07113d..56aa82081f7 100644 --- a/sys/dev/isa/if_iy.c +++ b/sys/dev/isa/if_iy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iy.c,v 1.13 2001/06/25 04:44:28 fgsch Exp $ */ +/* $OpenBSD: if_iy.c,v 1.14 2001/06/27 06:34:47 kjc Exp $ */ /* $NetBSD: if_iy.c,v 1.4 1996/05/12 23:52:53 mycroft Exp $ */ /* #define IYDEBUG */ /* #define IYMEMDEBUG */ @@ -295,6 +295,7 @@ iyattach(parent, self, aux) ifp->if_ioctl = iyioctl; ifp->if_watchdog = iywatchdog; + IFQ_SET_READY(&ifp->if_snd); /* Attach the interface. */ if_attach(ifp); @@ -495,7 +496,10 @@ struct ifnet *ifp; sc = ifp->if_softc; iobase = sc->sc_iobase; - while ((m0 = ifp->if_snd.ifq_head) != NULL) { + while (1) { + IFQ_POLL(&ifp->if_snd, m0); + if (m0 == NULL) + break; #ifdef IYDEBUG printf("%s: trying to write another packet to the hardware\n", sc->sc_dev.dv_xname); @@ -518,7 +522,7 @@ struct ifnet *ifp; if (len + pad > ETHER_MAX_LEN) { /* packet is obviously too large: toss it */ ++ifp->if_oerrors; - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); m_freem(m0); continue; } @@ -550,7 +554,7 @@ struct ifnet *ifp; } /* we know it fits in the hardware now, so dequeue it */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); last = sc->tx_end; end = last + pad + len + I595_XMT_HDRLEN; |