diff options
author | mlaier <mlaier@FreeBSD.org> | 2004-06-15 01:45:19 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2004-06-15 01:45:19 +0000 |
commit | de92edb6b40acca5f92bbd5dd5fc05f52923f0cd (patch) | |
tree | 893aca9ae1367e7ea2d586dce0f636c5e22a8598 /sys/net | |
parent | 0d395ced064ef2b8552aa3cac8df26f23da67356 (diff) | |
download | FreeBSD-src-de92edb6b40acca5f92bbd5dd5fc05f52923f0cd.zip FreeBSD-src-de92edb6b40acca5f92bbd5dd5fc05f52923f0cd.tar.gz |
Transform tbr_dequeue into a function pointer in order to build drivers with
ALTQ enabled versions of IFQ_* macros by default, as requested by serveral
others. This is a follow-up to the quick fix I committed yesterday which
turned off the ALTQ checks for non-ALTQ kernels.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 4 | ||||
-rw-r--r-- | sys/net/if_var.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index c1d874a..7942065 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -75,6 +75,8 @@ #include <netinet/if_ether.h> #endif +struct mbuf *(*tbr_dequeue_ptr)(struct ifaltq *, int) = NULL; + static void if_attachdomain(void *); static void if_attachdomain1(struct ifnet *); static int ifconf(u_long, caddr_t); @@ -441,13 +443,11 @@ if_attach(struct ifnet *ifp) ifa->ifa_refcnt = 1; TAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link); ifp->if_broadcastaddr = 0; /* reliably crash if used uninitialized */ -#ifdef ALTQ ifp->if_snd.altq_type = 0; ifp->if_snd.altq_disc = NULL; ifp->if_snd.altq_flags &= ALTQF_CANTCHANGE; ifp->if_snd.altq_tbr = NULL; ifp->if_snd.altq_ifp = ifp; -#endif if (domains) if_attachdomain1(ifp); diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 0354f53..58372ad 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -356,7 +356,7 @@ if_handoff(struct ifqueue *ifq, struct mbuf *m, struct ifnet *ifp, int adjust) (*ifp->if_start)(ifp); return (1); } -#ifdef ALTQ +#if 1 /* ALTQ */ #define IFQ_ENQUEUE(ifq, m, err) \ do { \ IF_LOCK(ifq); \ @@ -379,7 +379,7 @@ do { \ #define IFQ_DEQUEUE_NOLOCK(ifq, m) \ do { \ if (TBR_IS_ENABLED(ifq)) \ - (m) = tbr_dequeue(ifq, ALTDQ_REMOVE); \ + (m) = tbr_dequeue_ptr(ifq, ALTDQ_REMOVE); \ else if (ALTQ_IS_ENABLED(ifq)) \ ALTQ_DEQUEUE(ifq, m); \ else \ @@ -396,7 +396,7 @@ do { \ #define IFQ_POLL_NOLOCK(ifq, m) \ do { \ if (TBR_IS_ENABLED(ifq)) \ - (m) = tbr_dequeue(ifq, ALTDQ_POLL); \ + (m) = tbr_dequeue_ptr(ifq, ALTDQ_POLL); \ else if (ALTQ_IS_ENABLED(ifq)) \ ALTQ_POLL(ifq, m); \ else \ |