summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Laier <mlaier@FreeBSD.org>2004-06-15 01:45:19 +0000
committerMax Laier <mlaier@FreeBSD.org>2004-06-15 01:45:19 +0000
commit4cb655c020ce0bf72ffd024a23e2f468760c2c94 (patch)
tree893aca9ae1367e7ea2d586dce0f636c5e22a8598
parent1cab0c857e3cc81ea3148f393932aa702eb9aa75 (diff)
Notes
-rw-r--r--sys/contrib/altq/altq/altq_subr.c6
-rw-r--r--sys/contrib/altq/altq/if_altq.h4
-rw-r--r--sys/net/if.c4
-rw-r--r--sys/net/if_var.h6
4 files changed, 12 insertions, 8 deletions
diff --git a/sys/contrib/altq/altq/altq_subr.c b/sys/contrib/altq/altq/altq_subr.c
index 435f7ab44621..b673d3c9406b 100644
--- a/sys/contrib/altq/altq/altq_subr.c
+++ b/sys/contrib/altq/altq/altq_subr.c
@@ -91,6 +91,7 @@
*/
static void tbr_timeout(void *);
int (*altq_input)(struct mbuf *, int) = NULL;
+static struct mbuf *tbr_dequeue(struct ifaltq *, int);
static int tbr_timer = 0; /* token bucket regulator timer */
static struct callout tbr_callout = CALLOUT_INITIALIZER;
@@ -312,7 +313,7 @@ altq_assert(file, line, failedexpr)
#define TBR_SCALE(x) ((int64_t)(x) << TBR_SHIFT)
#define TBR_UNSCALE(x) ((x) >> TBR_SHIFT)
-struct mbuf *
+static struct mbuf *
tbr_dequeue(ifq, op)
struct ifaltq *ifq;
int op;
@@ -370,6 +371,9 @@ tbr_set(ifq, profile)
struct tb_profile *profile;
{
struct tb_regulator *tbr, *otbr;
+
+ if (tbr_dequeue_ptr == NULL)
+ tbr_dequeue_ptr = tbr_dequeue;
if (machclk_freq == 0)
init_machclk();
diff --git a/sys/contrib/altq/altq/if_altq.h b/sys/contrib/altq/altq/if_altq.h
index 8e605870f1b7..0676e401f0b2 100644
--- a/sys/contrib/altq/altq/if_altq.h
+++ b/sys/contrib/altq/altq/if_altq.h
@@ -181,9 +181,9 @@ extern int altq_attach(struct ifaltq *, int, void *,
extern int altq_detach(struct ifaltq *);
extern int altq_enable(struct ifaltq *);
extern int altq_disable(struct ifaltq *);
-extern struct mbuf *tbr_dequeue(struct ifaltq *, int);
+extern struct mbuf *(*tbr_dequeue_ptr)(struct ifaltq *, int);
extern int (*altq_input)(struct mbuf *, int);
-#if 1 /* ALTQ3_CLFIER_COMPAT */
+#if 0 /* ALTQ3_CLFIER_COMPAT */
void altq_etherclassify(struct ifaltq *, struct mbuf *, struct altq_pktattr *);
#endif
#endif /* _KERNEL */
diff --git a/sys/net/if.c b/sys/net/if.c
index c1d874a647d4..79420656abc1 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 0354f534cbd8..58372adb8575 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 \