summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorKenjiro Cho <kjc@cvs.openbsd.org>2002-03-12 09:51:21 +0000
committerKenjiro Cho <kjc@cvs.openbsd.org>2002-03-12 09:51:21 +0000
commitc0673e7470e78851e90fed12a36fc994cd4a9596 (patch)
tree493f6323005acbca62cfdc1588c1bcca53310914 /sys/dev/ic
parenta58c9d8493088f72eea1a7fe29bd0458cad36e81 (diff)
sync with KAME
ALTQify more drivers. ok millert@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/an.c11
-rw-r--r--sys/dev/ic/dp8390.c3
-rw-r--r--sys/dev/ic/pdq_ifsubr.c12
-rw-r--r--sys/dev/ic/smc90cx6.c5
-rw-r--r--sys/dev/ic/tropic.c4
5 files changed, 16 insertions, 19 deletions
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c
index 97595de2504..c62fc8e0824 100644
--- a/sys/dev/ic/an.c
+++ b/sys/dev/ic/an.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: an.c,v 1.21 2002/01/02 18:34:11 mickey Exp $ */
+/* $OpenBSD: an.c,v 1.22 2002/03/12 09:51:20 kjc Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -239,6 +239,7 @@ an_attach(sc)
ifp->if_start = an_start;
ifp->if_watchdog = an_watchdog;
ifp->if_baudrate = 10000000;
+ IFQ_SET_READY(&ifp->if_snd);
bzero(sc->an_config.an_nodename, sizeof(sc->an_config.an_nodename));
bcopy(AN_DEFAULT_NODENAME, sc->an_config.an_nodename,
@@ -518,7 +519,7 @@ an_intr(xsc)
/* Re-enable interrupts. */
CSR_WRITE_2(sc, AN_INT_EN, AN_INTRS);
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_IS_EMPTY(&ifp->if_snd))
an_start(ifp);
return 1;
@@ -1237,6 +1238,7 @@ an_start(ifp)
int id;
int idx;
unsigned char txcontrol;
+ int pkts = 0;
sc = ifp->if_softc;
@@ -1253,10 +1255,11 @@ an_start(ifp)
bzero((char *)&tx_frame_802_3, sizeof(tx_frame_802_3));
while(sc->an_rdata.an_tx_ring[idx] == 0) {
- IF_DEQUEUE(&ifp->if_snd, m0);
+ IFQ_DEQUEUE(&ifp->if_snd, m0);
if (m0 == NULL)
break;
+ pkts++;
id = sc->an_rdata.an_tx_fids[idx];
eh = mtod(m0, struct ether_header *);
@@ -1301,6 +1304,8 @@ an_start(ifp)
AN_INC(idx, AN_TX_RING_CNT);
}
+ if (pkts == 0)
+ return;
if (m0 != NULL)
ifp->if_flags |= IFF_OACTIVE;
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c
index 4f369894d55..5cf5df6e4f7 100644
--- a/sys/dev/ic/dp8390.c
+++ b/sys/dev/ic/dp8390.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dp8390.c,v 1.20 2002/01/08 05:38:53 fgsch Exp $ */
+/* $OpenBSD: dp8390.c,v 1.21 2002/03/12 09:51:20 kjc Exp $ */
/* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */
/*
@@ -138,6 +138,7 @@ dp8390_config(sc)
/* Initialize media goo. */
(*sc->sc_media_init)(sc);
+ IFQ_SET_READY(&ifp->if_snd);
/* Attach the interface. */
if_attach(ifp);
diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c
index 198091004d7..8f55f8631b1 100644
--- a/sys/dev/ic/pdq_ifsubr.c
+++ b/sys/dev/ic/pdq_ifsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdq_ifsubr.c,v 1.10 2001/11/06 19:53:18 miod Exp $ */
+/* $OpenBSD: pdq_ifsubr.c,v 1.11 2002/03/12 09:51:20 kjc Exp $ */
/* $NetBSD: pdq_ifsubr.c,v 1.5 1996/05/20 00:26:21 thorpej Exp $ */
/*-
@@ -144,13 +144,7 @@ pdq_ifwatchdog(
ifp->if_flags &= ~IFF_OACTIVE;
ifp->if_timer = 0;
- for (;;) {
- struct mbuf *m;
- IFQ_DEQUEUE(&ifp->if_snd, m);
- if (m == NULL)
- return;
- m_freem(m);
- }
+ IFQ_PURGE(&ifp->if_snd);
}
ifnet_ret_t
@@ -372,9 +366,7 @@ pdq_ifattach(
ifp->if_ioctl = pdq_ifioctl;
ifp->if_output = fddi_output;
ifp->if_start = pdq_ifstart;
-#ifdef notyet /* if_fddisubr.c hasn't been converted yet */
IFQ_SET_READY(&ifp->if_snd);
-#endif
if_attach(ifp);
fddi_ifattach(ifp);
diff --git a/sys/dev/ic/smc90cx6.c b/sys/dev/ic/smc90cx6.c
index 65a9d80ac92..86348f9dcce 100644
--- a/sys/dev/ic/smc90cx6.c
+++ b/sys/dev/ic/smc90cx6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smc90cx6.c,v 1.3 1996/10/31 01:01:39 niklas Exp $ */
+/* $OpenBSD: smc90cx6.c,v 1.4 2002/03/12 09:51:20 kjc Exp $ */
/* $NetBSD: smc90cx6.c,v 1.17 1996/05/07 01:43:18 thorpej Exp $ */
/*
@@ -285,6 +285,7 @@ bah_zbus_attach(parent, self, aux)
IFF_NOTRAILERS | IFF_NOARP;
ifp->if_mtu = ARCMTU;
+ IFQ_SET_READY(&ifp->if_snd);
if_attach(ifp);
arc_ifattach(ifp);
@@ -557,7 +558,7 @@ bah_start(ifp)
return;
}
- IF_DEQUEUE(&ifp->if_snd, m);
+ IFQ_DEQUEUE(&ifp->if_snd, m);
buffer = sc->sc_tx_act ^ 1;
splx(s);
diff --git a/sys/dev/ic/tropic.c b/sys/dev/ic/tropic.c
index a73ef15a060..7ea095b2cca 100644
--- a/sys/dev/ic/tropic.c
+++ b/sys/dev/ic/tropic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tropic.c,v 1.4 2001/08/19 15:07:30 miod Exp $ */
+/* $OpenBSD: tropic.c,v 1.5 2002/03/12 09:51:20 kjc Exp $ */
/* $NetBSD: tropic.c,v 1.6 1999/12/17 08:26:31 fvdl Exp $ */
/*
@@ -352,9 +352,7 @@ tr_attach(sc)
ifp->if_start = tr_oldstart;
ifp->if_flags = IFF_BROADCAST | IFF_NOTRAILERS;
ifp->if_watchdog = tr_watchdog;
-#ifdef notyet /* if_tokensubr.c hasn't been converted yet */
IFQ_SET_READY(&ifp->if_snd);
-#endif
switch (MM_INB(sc, TR_MEDIAS_OFFSET)) {
case 0xF: