summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_txp.c
diff options
context:
space:
mode:
authorKenjiro Cho <kjc@cvs.openbsd.org>2001-06-27 06:34:54 +0000
committerKenjiro Cho <kjc@cvs.openbsd.org>2001-06-27 06:34:54 +0000
commit17cc5dbba19bbbbeb9361149e56ee11dbc22da68 (patch)
tree8a51ae8b2bde0887aa6650a31196833183a5b94f /sys/dev/pci/if_txp.c
parent30721c7f5299136d216635afefc517f47511b9f3 (diff)
ALTQ'ify network drivers.
- use the new queue macros. - use IFQ_POLL() to peek at the next packet. - use IFQ_IS_EMPTY() for empty check. - drivers should always check if (m == NULL) after IFQ_DEQUEUE(), since it could return NULL even when IFQ_IS_EMPTY() is FALSE under rate-limiting. - drivers are supposed to call if_start from tx complete interrupts (in order to trigger the next dequeue under rate-limiting).
Diffstat (limited to 'sys/dev/pci/if_txp.c')
-rw-r--r--sys/dev/pci/if_txp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c
index 9a777506fd4..a0ad84c0b18 100644
--- a/sys/dev/pci/if_txp.c
+++ b/sys/dev/pci/if_txp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_txp.c,v 1.47 2001/06/24 22:58:01 fgsch Exp $ */
+/* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */
/*
* Copyright (c) 2001
@@ -270,7 +270,8 @@ txp_attach(parent, self, aux)
ifp->if_start = txp_start;
ifp->if_watchdog = txp_watchdog;
ifp->if_baudrate = 10000000;
- ifp->if_snd.ifq_maxlen = TX_ENTRIES;
+ IFQ_SET_MAXLEN(&ifp->if_snd, TX_ENTRIES);
+ IFQ_SET_READY(&ifp->if_snd);
ifp->if_capabilities = 0;
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
@@ -1280,7 +1281,7 @@ txp_start(ifp)
cnt = r->r_cnt;
while (1) {
- IF_DEQUEUE(&ifp->if_snd, m);
+ IFQ_DEQUEUE(&ifp->if_snd, m);
if (m == NULL)
break;