summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2005-02-21 17:11:09 +0000
committermlaier <mlaier@FreeBSD.org>2005-02-21 17:11:09 +0000
commita448425842938ffbd5c979639b47bb6c303238bc (patch)
tree231a8af96e3a167cb952d880214f020566b49f18 /sys/contrib
parent5003a52a0ce2712f8874cec0648262f4b0a3e3d7 (diff)
downloadFreeBSD-src-a448425842938ffbd5c979639b47bb6c303238bc.zip
FreeBSD-src-a448425842938ffbd5c979639b47bb6c303238bc.tar.gz
Don't use the static CALLOUT_INITIALIZER for __FreeBSD_version >= 600000. It
was a bad idea, but since it is done like this in the vendor source we keep it around for older versions. As a safe guard against future misuse we don't even define CALLOUT_INITIALIZER anymore. This fixes ALTQ after callout_init_mtx() and takes altq_var.h off the vendor branch. Submitted by: Divacky Roman <xdivac02NOstud.fit.vutbrSPAMcz> (w/ changes)
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/altq/altq/altq_subr.c7
-rw-r--r--sys/contrib/altq/altq/altq_var.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/contrib/altq/altq/altq_subr.c b/sys/contrib/altq/altq/altq_subr.c
index 31fe133..4f9ca6d 100644
--- a/sys/contrib/altq/altq/altq_subr.c
+++ b/sys/contrib/altq/altq/altq_subr.c
@@ -93,7 +93,11 @@ 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 */
+#if !defined(__FreeBSD__) || (__FreeBSD_version < 600000)
static struct callout tbr_callout = CALLOUT_INITIALIZER;
+#else
+static struct callout tbr_callout;
+#endif
#ifdef ALTQ3_CLFIER_COMPAT
static int extract_ports4(struct mbuf *, struct ip *, struct flowinfo_in *);
@@ -932,6 +936,9 @@ init_machclk(void)
#ifdef __FreeBSD__
#if (__FreeBSD_version > 300000)
machclk_freq = tsc_freq;
+#if (__FreeBSD_version >= 600000)
+ callout_init(&tbr_callout, 0);
+#endif
#else
machclk_freq = i586_ctr_freq;
#endif
diff --git a/sys/contrib/altq/altq/altq_var.h b/sys/contrib/altq/altq/altq_var.h
index dff9e5c..4c4fc29 100644
--- a/sys/contrib/altq/altq/altq_var.h
+++ b/sys/contrib/altq/altq/altq_var.h
@@ -1,3 +1,4 @@
+/* $FreeBSD$ */
/* $KAME: altq_var.h,v 1.16 2003/10/03 05:05:15 kjc Exp $ */
/*
@@ -175,7 +176,7 @@ typedef u_long ioctlcmd_t;
#endif
#define CALLOUT_RESET(c,t,f,a) callout_reset((c),(t),(f),(a))
#define CALLOUT_STOP(c) callout_stop((c))
-#ifndef CALLOUT_INITIALIZER
+#if !defined(CALLOUT_INITIALIZER) && (__FreeBSD_version < 600000)
#define CALLOUT_INITIALIZER { { { NULL } }, 0, NULL, NULL, 0 }
#endif
#elif defined(__OpenBSD__)
OpenPOWER on IntegriCloud