- Format copyright notices, VCS ids.
- Run through unifdef(1).
This commit is contained in:
parent
6a69db4155
commit
c067f1844a
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq.h,v 1.10 2003/07/10 12:07:47 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 1998-2003
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -25,6 +22,9 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq.h,v 1.10 2003/07/10 12:07:47 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#ifndef _ALTQ_ALTQ_H_
|
||||
#define _ALTQ_ALTQ_H_
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_cbq.c,v 1.19 2003/09/17 14:23:25 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -29,15 +26,14 @@
|
||||
* provided "as is" without express or implied warranty of any kind.
|
||||
*
|
||||
* These notices must be retained in any copies of any part of this software.
|
||||
*
|
||||
* $KAME: altq_cbq.c,v 1.19 2003/09/17 14:23:25 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
#ifdef ALTQ_CBQ /* cbq is enabled by ALTQ_CBQ option in opt_altq.h */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -251,11 +247,7 @@ cbq_pfattach(struct pf_altq *a)
|
||||
|
||||
if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL)
|
||||
return (EINVAL);
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
error = altq_attach(&ifp->if_snd, ALTQT_CBQ, a->altq_disc,
|
||||
cbq_enqueue, cbq_dequeue, cbq_request, NULL, NULL);
|
||||
splx(s);
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_cdnr.c,v 1.15 2005/04/13 03:44:24 suz Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 1999-2002
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -25,15 +22,14 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq_cdnr.c,v 1.15 2005/04/13 03:44:24 suz Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/malloc.h>
|
||||
@ -1272,11 +1268,7 @@ cdnrioctl(dev, cmd, addr, flag, p)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
switch (cmd) {
|
||||
|
||||
case CDNR_IF_ATTACH:
|
||||
|
@ -1,6 +1,4 @@
|
||||
/* $KAME: altq_classq.h,v 1.6 2003/01/07 07:33:38 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 1991-1997 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -31,6 +29,9 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq_classq.h,v 1.6 2003/01/07 07:33:38 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
/*
|
||||
* class queue definitions extracted from rm_class.h.
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_hfsc.c,v 1.24 2003/12/05 05:40:46 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 1997-1999 Carnegie Mellon University. All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and
|
||||
@ -29,6 +26,9 @@
|
||||
* software to return any improvements or extensions that they make,
|
||||
* and to grant Carnegie Mellon the rights to redistribute these
|
||||
* changes without encumbrance.
|
||||
*
|
||||
* $KAME: altq_hfsc.c,v 1.24 2003/12/05 05:40:46 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
/*
|
||||
* H-FSC is described in Proceedings of SIGCOMM'97,
|
||||
@ -42,13 +42,9 @@
|
||||
* a class whose fit-time exceeds the current time.
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
|
||||
#ifdef ALTQ_HFSC /* hfsc is enabled by ALTQ_HFSC option in opt_altq.h */
|
||||
|
||||
@ -177,11 +173,7 @@ hfsc_pfattach(struct pf_altq *a)
|
||||
|
||||
if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL)
|
||||
return (EINVAL);
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
error = altq_attach(&ifp->if_snd, ALTQT_HFSC, a->altq_disc,
|
||||
hfsc_enqueue, hfsc_dequeue, hfsc_request, NULL, NULL);
|
||||
splx(s);
|
||||
@ -483,11 +475,7 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc,
|
||||
cl->cl_hif = hif;
|
||||
cl->cl_parent = parent;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(hif->hif_ifq);
|
||||
hif->hif_classes++;
|
||||
|
||||
@ -567,11 +555,7 @@ hfsc_class_destroy(struct hfsc_class *cl)
|
||||
if (is_a_parent_class(cl))
|
||||
return (EBUSY);
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(cl->cl_hif->hif_ifq);
|
||||
|
||||
#ifdef ALTQ3_COMPAT
|
||||
@ -1771,11 +1755,7 @@ hfsc_class_modify(cl, rsc, fsc, usc)
|
||||
}
|
||||
|
||||
cur_time = read_machclk();
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(cl->cl_hif->hif_ifq);
|
||||
|
||||
if (rsc != NULL) {
|
||||
|
@ -1,6 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_priq.c,v 1.11 2003/09/17 14:23:25 kjc Exp $ */
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 2000-2003
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -24,18 +22,17 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq_priq.c,v 1.11 2003/09/17 14:23:25 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
/*
|
||||
* priority queue
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
|
||||
#ifdef ALTQ_PRIQ /* priq is enabled by ALTQ_PRIQ option in opt_altq.h */
|
||||
|
||||
@ -113,11 +110,7 @@ priq_pfattach(struct pf_altq *a)
|
||||
|
||||
if ((ifp = ifunit(a->ifname)) == NULL || a->altq_disc == NULL)
|
||||
return (EINVAL);
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
error = altq_attach(&ifp->if_snd, ALTQT_PRIQ, a->altq_disc,
|
||||
priq_enqueue, priq_dequeue, priq_request, NULL, NULL);
|
||||
splx(s);
|
||||
@ -300,11 +293,7 @@ priq_class_create(struct priq_if *pif, int pri, int qlimit, int flags, int qid)
|
||||
|
||||
if ((cl = pif->pif_classes[pri]) != NULL) {
|
||||
/* modify the class instead of creating a new one */
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(cl->cl_pif->pif_ifq);
|
||||
if (!qempty(cl->cl_q))
|
||||
priq_purgeq(cl);
|
||||
@ -407,11 +396,7 @@ priq_class_destroy(struct priq_class *cl)
|
||||
struct priq_if *pif;
|
||||
int s, pri;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(cl->cl_pif->pif_ifq);
|
||||
|
||||
#ifdef ALTQ3_CLFIER_COMPAT
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_red.c,v 1.18 2003/09/05 22:40:36 itojun Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 1997-2003
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -27,7 +24,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 1990-1994 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -58,15 +55,14 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq_red.c,v 1.18 2003/09/05 22:40:36 itojun Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
#ifdef ALTQ_RED /* red is enabled by ALTQ_RED option in opt_altq.h */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -944,11 +940,7 @@ redioctl(dev, cmd, addr, flag, p)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
red_purgeq(rqp);
|
||||
limit = fc->red_limit;
|
||||
if (limit < fc->red_thmax)
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_rio.c,v 1.17 2003/07/10 12:07:49 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 1998-2003
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -26,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 1990-1994 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -57,15 +54,14 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq_rio.c,v 1.17 2003/07/10 12:07:49 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
#ifdef ALTQ_RIO /* rio is enabled by ALTQ_RIO option in opt_altq.h */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -684,11 +680,7 @@ rioioctl(dev, cmd, addr, flag, p)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
_flushq(rqp->rq_q);
|
||||
limit = fc->rio_limit;
|
||||
if (limit < fc->q_params[RIO_NDROPPREC-1].th_max)
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_rmclass.c,v 1.19 2005/04/13 03:44:25 suz Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 1991-1997 Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -37,14 +34,12 @@
|
||||
* For questions and/or comments, please send mail to cbq@ee.lbl.gov
|
||||
*
|
||||
* @(#)rm_class.c 1.48 97/12/05 SMI
|
||||
* $KAME: altq_rmclass.c,v 1.19 2005/04/13 03:44:25 suz Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
#ifdef ALTQ_CBQ /* cbq is enabled by ALTQ_CBQ option in opt_altq.h */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -306,11 +301,7 @@ rmc_newclass(int pri, struct rm_ifdat *ifd, u_int nsecPerByte,
|
||||
/*
|
||||
* put the class into the class tree
|
||||
*/
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(ifd->ifq_);
|
||||
if ((peer = ifd->active_[pri]) != NULL) {
|
||||
/* find the last class at this pri */
|
||||
@ -359,11 +350,7 @@ rmc_modclass(struct rm_class *cl, u_int nsecPerByte, int maxq, u_int maxidle,
|
||||
ifd = cl->ifdat_;
|
||||
old_allotment = cl->allotment_;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(ifd->ifq_);
|
||||
cl->allotment_ = RM_NS_PER_SEC / nsecPerByte; /* Bytes per sec */
|
||||
cl->qthresh_ = 0;
|
||||
@ -559,11 +546,7 @@ rmc_delete_class(struct rm_ifdat *ifd, struct rm_class *cl)
|
||||
if (cl->sleeping_)
|
||||
CALLOUT_STOP(&cl->callout_);
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(ifd->ifq_);
|
||||
/*
|
||||
* Free packets in the packet queue.
|
||||
@ -1531,13 +1514,8 @@ rmc_delay_action(struct rm_class *cl, struct rm_class *borrow)
|
||||
* a 'backstop' to restart this class.
|
||||
*/
|
||||
if (delay > tick * 2) {
|
||||
#ifdef __FreeBSD__
|
||||
/* FreeBSD rounds up the tick */
|
||||
t = hzto(&cl->undertime_);
|
||||
#else
|
||||
/* other BSDs round down the tick */
|
||||
t = hzto(&cl->undertime_) + 1;
|
||||
#endif
|
||||
} else
|
||||
t = 2;
|
||||
CALLOUT_RESET(&cl->callout_, t,
|
||||
@ -1568,11 +1546,7 @@ rmc_restart(struct rm_class *cl)
|
||||
struct rm_ifdat *ifd = cl->ifdat_;
|
||||
int s;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_LOCK(ifd->ifq_);
|
||||
if (cl->sleeping_) {
|
||||
cl->sleeping_ = 0;
|
||||
|
@ -1,6 +1,4 @@
|
||||
/* $KAME: altq_rmclass_debug.h,v 1.3 2002/11/29 04:36:24 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) Sun Microsystems, Inc. 1998 All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -28,6 +26,9 @@
|
||||
* provided "as is" without express or implied warranty of any kind.
|
||||
*
|
||||
* These notices must be retained in any copies of any part of this software.
|
||||
*
|
||||
* $KAME: altq_rmclass_debug.h,v 1.3 2002/11/29 04:36:24 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _ALTQ_ALTQ_RMCLASS_DEBUG_H_
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_subr.c,v 1.21 2003/11/06 06:32:53 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 1997-2003
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -25,15 +22,14 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq_subr.c,v 1.21 2003/11/06 06:32:53 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#include "opt_altq.h"
|
||||
#include "opt_inet.h"
|
||||
#ifdef __FreeBSD__
|
||||
#include "opt_inet6.h"
|
||||
#endif
|
||||
#endif /* __FreeBSD__ || __NetBSD__ */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/malloc.h>
|
||||
@ -52,9 +48,7 @@
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
#ifdef __FreeBSD__
|
||||
#include <net/vnet.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
@ -73,20 +67,14 @@
|
||||
#endif
|
||||
|
||||
/* machine dependent clock related includes */
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/bus.h>
|
||||
#include <sys/cpu.h>
|
||||
#include <sys/eventhandler.h>
|
||||
#include <machine/clock.h>
|
||||
#endif
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
#include <machine/cpufunc.h> /* for pentium tsc */
|
||||
#include <machine/specialreg.h> /* for CPUID_TSC */
|
||||
#ifdef __FreeBSD__
|
||||
#include <machine/md_var.h> /* for cpu_feature */
|
||||
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#include <machine/cpu.h> /* for cpu_feature */
|
||||
#endif
|
||||
#endif /* __amd64 || __i386__ */
|
||||
|
||||
/*
|
||||
@ -254,11 +242,7 @@ altq_enable(ifq)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_PURGE_NOLOCK(ifq);
|
||||
ASSERT(ifq->ifq_len == 0);
|
||||
ifq->ifq_drv_maxlen = 0; /* disable bulk dequeue */
|
||||
@ -283,11 +267,7 @@ altq_disable(ifq)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
IFQ_PURGE_NOLOCK(ifq);
|
||||
ASSERT(ifq->ifq_len == 0);
|
||||
ifq->altq_flags &= ~(ALTQF_ENABLED|ALTQF_CLASSIFY);
|
||||
@ -444,24 +424,16 @@ static void
|
||||
tbr_timeout(arg)
|
||||
void *arg;
|
||||
{
|
||||
#ifdef __FreeBSD__
|
||||
VNET_ITERATOR_DECL(vnet_iter);
|
||||
#endif
|
||||
struct ifnet *ifp;
|
||||
int active, s;
|
||||
|
||||
active = 0;
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
IFNET_RLOCK_NOSLEEP();
|
||||
VNET_LIST_RLOCK_NOSLEEP();
|
||||
VNET_FOREACH(vnet_iter) {
|
||||
CURVNET_SET(vnet_iter);
|
||||
#endif
|
||||
for (ifp = TAILQ_FIRST(&V_ifnet); ifp;
|
||||
ifp = TAILQ_NEXT(ifp, if_list)) {
|
||||
/* read from if_snd unlocked */
|
||||
@ -472,12 +444,10 @@ tbr_timeout(arg)
|
||||
ifp->if_start != NULL)
|
||||
(*ifp->if_start)(ifp);
|
||||
}
|
||||
#ifdef __FreeBSD__
|
||||
CURVNET_RESTORE();
|
||||
}
|
||||
VNET_LIST_RUNLOCK_NOSLEEP();
|
||||
IFNET_RUNLOCK_NOSLEEP();
|
||||
#endif
|
||||
splx(s);
|
||||
if (active > 0)
|
||||
CALLOUT_RESET(&tbr_callout, 1, tbr_timeout, (void *)0);
|
||||
@ -563,11 +533,7 @@ altq_pfdetach(struct pf_altq *a)
|
||||
if (a->altq_disc == NULL || a->altq_disc != ifp->if_snd.altq_disc)
|
||||
return (0);
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
/* read unlocked from if_snd, _disable and _detach take care */
|
||||
if (ALTQ_IS_ENABLED(&ifp->if_snd))
|
||||
error = altq_disable(&ifp->if_snd);
|
||||
@ -926,12 +892,8 @@ init_machclk_setup(void)
|
||||
#endif
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
/* check if TSC is available */
|
||||
#ifdef __FreeBSD__
|
||||
if ((cpu_feature & CPUID_TSC) == 0 ||
|
||||
atomic_load_acq_64(&tsc_freq) == 0)
|
||||
#else
|
||||
if ((cpu_feature & CPUID_TSC) == 0)
|
||||
#endif
|
||||
machclk_usepcc = 0;
|
||||
#endif
|
||||
}
|
||||
@ -962,13 +924,7 @@ init_machclk(void)
|
||||
* accessible, just use it.
|
||||
*/
|
||||
#if defined(__amd64__) || defined(__i386__)
|
||||
#ifdef __FreeBSD__
|
||||
machclk_freq = atomic_load_acq_64(&tsc_freq);
|
||||
#elif defined(__NetBSD__)
|
||||
machclk_freq = (u_int32_t)cpu_tsc_freq;
|
||||
#elif defined(__OpenBSD__) && (defined(I586_CPU) || defined(I686_CPU))
|
||||
machclk_freq = pentium_mhz * 1000000;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1449,11 +1405,7 @@ acc_add_filter(classifier, filter, class, phandle)
|
||||
* add this filter to the filter list.
|
||||
* filters are ordered from the highest rule number.
|
||||
*/
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
prev = NULL;
|
||||
LIST_FOREACH(tmp, &classifier->acc_filters[i], f_chain) {
|
||||
if (tmp->f_filter.ff_ruleno > afp->f_filter.ff_ruleno)
|
||||
@ -1482,11 +1434,7 @@ acc_delete_filter(classifier, handle)
|
||||
if ((afp = filth_to_filtp(classifier, handle)) == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
LIST_REMOVE(afp, f_chain);
|
||||
splx(s);
|
||||
|
||||
@ -1510,11 +1458,7 @@ acc_discard_filters(classifier, class, all)
|
||||
struct acc_filter *afp;
|
||||
int i, s;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
s = splnet();
|
||||
#else
|
||||
s = splimp();
|
||||
#endif
|
||||
for (i = 0; i < ACC_FILTER_TABLESIZE; i++) {
|
||||
do {
|
||||
LIST_FOREACH(afp, &classifier->acc_filters[i], f_chain)
|
||||
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: altq_var.h,v 1.16 2003/10/03 05:05:15 kjc Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 1998-2003
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -25,6 +22,9 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: altq_var.h,v 1.16 2003/10/03 05:05:15 kjc Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#ifndef _ALTQ_ALTQ_VAR_H_
|
||||
#define _ALTQ_ALTQ_VAR_H_
|
||||
@ -161,7 +161,6 @@ typedef u_long ioctlcmd_t;
|
||||
#endif
|
||||
|
||||
/* macro for timeout/untimeout */
|
||||
#if (__FreeBSD_version > 300000) || defined(__NetBSD__)
|
||||
/* use callout */
|
||||
#include <sys/callout.h>
|
||||
|
||||
@ -175,35 +174,6 @@ typedef u_long ioctlcmd_t;
|
||||
#if !defined(CALLOUT_INITIALIZER) && (__FreeBSD_version < 600000)
|
||||
#define CALLOUT_INITIALIZER { { { NULL } }, 0, NULL, NULL, 0 }
|
||||
#endif
|
||||
#elif defined(__OpenBSD__)
|
||||
#include <sys/timeout.h>
|
||||
/* callout structure as a wrapper of struct timeout */
|
||||
struct callout {
|
||||
struct timeout c_to;
|
||||
};
|
||||
#define CALLOUT_INIT(c) do { bzero((c), sizeof(*(c))); } while (/*CONSTCOND*/ 0)
|
||||
#define CALLOUT_RESET(c,t,f,a) do { if (!timeout_initialized(&(c)->c_to)) \
|
||||
timeout_set(&(c)->c_to, (f), (a)); \
|
||||
timeout_add(&(c)->c_to, (t)); } while (/*CONSTCOND*/ 0)
|
||||
#define CALLOUT_STOP(c) timeout_del(&(c)->c_to)
|
||||
#define CALLOUT_INITIALIZER { { { NULL }, NULL, NULL, 0, 0 } }
|
||||
#else
|
||||
/* use old-style timeout/untimeout */
|
||||
/* dummy callout structure */
|
||||
struct callout {
|
||||
void *c_arg; /* function argument */
|
||||
void (*c_func)(void *); /* functiuon to call */
|
||||
};
|
||||
#define CALLOUT_INIT(c) do { bzero((c), sizeof(*(c))); } while (/*CONSTCOND*/ 0)
|
||||
#define CALLOUT_RESET(c,t,f,a) do { (c)->c_arg = (a); \
|
||||
(c)->c_func = (f); \
|
||||
timeout((f),(a),(t)); } while (/*CONSTCOND*/ 0)
|
||||
#define CALLOUT_STOP(c) untimeout((c)->c_func,(c)->c_arg)
|
||||
#define CALLOUT_INITIALIZER { NULL, NULL }
|
||||
#endif
|
||||
#if !defined(__FreeBSD__)
|
||||
typedef void (timeout_t)(void *);
|
||||
#endif
|
||||
|
||||
#define m_pktlen(m) ((m)->m_pkthdr.len)
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
/* $OpenBSD: altqconf.h,v 1.1 2001/06/27 05:28:36 kjc Exp $ */
|
||||
/* $NetBSD: altqconf.h,v 1.2 2001/05/30 11:57:16 mrg Exp $ */
|
||||
|
||||
#if defined(_KERNEL_OPT) || defined(__OpenBSD__)
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_altq_enabled.h"
|
||||
#endif
|
||||
|
||||
#include <sys/conf.h>
|
||||
|
||||
#ifdef ALTQ
|
||||
#define NALTQ 1
|
||||
#else
|
||||
#define NALTQ 0
|
||||
#endif
|
||||
|
||||
cdev_decl(altq);
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
#define cdev_altq_init(c,n) { \
|
||||
dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
|
||||
(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
|
||||
(dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
|
||||
(dev_type_mmap((*))) enodev }
|
||||
#else
|
||||
#define cdev_altq_init(x,y) cdev__oci_init(x,y)
|
||||
#endif
|
||||
#endif /* defined(_KERNEL_OPT) || defined(__OpenBSD__) */
|
@ -1,7 +1,4 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $KAME: if_altq.h,v 1.12 2005/04/13 03:44:25 suz Exp $ */
|
||||
|
||||
/*
|
||||
/*-
|
||||
* Copyright (C) 1997-2003
|
||||
* Sony Computer Science Laboratories Inc. All rights reserved.
|
||||
*
|
||||
@ -25,19 +22,16 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $KAME: if_altq.h,v 1.12 2005/04/13 03:44:25 suz Exp $
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#ifndef _ALTQ_IF_ALTQ_H_
|
||||
#define _ALTQ_IF_ALTQ_H_
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/lock.h> /* XXX */
|
||||
#include <sys/mutex.h> /* XXX */
|
||||
#include <sys/event.h> /* XXX */
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include <net/altq/altqconf.h>
|
||||
#endif
|
||||
|
||||
struct altq_pktattr; struct tb_regulator; struct top_cdnr;
|
||||
|
||||
@ -50,9 +44,7 @@ struct ifaltq {
|
||||
struct mbuf *ifq_tail;
|
||||
int ifq_len;
|
||||
int ifq_maxlen;
|
||||
#ifdef __FreeBSD__
|
||||
struct mtx ifq_mtx;
|
||||
#endif
|
||||
|
||||
/* driver owned queue (used for bulk dequeue and prepend) UNLOCKED */
|
||||
struct mbuf *ifq_drv_head;
|
||||
|
Loading…
Reference in New Issue
Block a user