15a975a3dSMatthew Dillon /* 25a975a3dSMatthew Dillon * Copyright (c) 2008 The DragonFly Project. All rights reserved. 35a975a3dSMatthew Dillon * 45a975a3dSMatthew Dillon * This code is derived from software contributed to The DragonFly Project 55a975a3dSMatthew Dillon * by Matthew Dillon <dillon@backplane.com> 65a975a3dSMatthew Dillon * 75a975a3dSMatthew Dillon * Redistribution and use in source and binary forms, with or without 85a975a3dSMatthew Dillon * modification, are permitted provided that the following conditions 95a975a3dSMatthew Dillon * are met: 105a975a3dSMatthew Dillon * 115a975a3dSMatthew Dillon * 1. Redistributions of source code must retain the above copyright 125a975a3dSMatthew Dillon * notice, this list of conditions and the following disclaimer. 135a975a3dSMatthew Dillon * 2. Redistributions in binary form must reproduce the above copyright 145a975a3dSMatthew Dillon * notice, this list of conditions and the following disclaimer in 155a975a3dSMatthew Dillon * the documentation and/or other materials provided with the 165a975a3dSMatthew Dillon * distribution. 175a975a3dSMatthew Dillon * 3. Neither the name of The DragonFly Project nor the names of its 185a975a3dSMatthew Dillon * contributors may be used to endorse or promote products derived 195a975a3dSMatthew Dillon * from this software without specific, prior written permission. 205a975a3dSMatthew Dillon * 215a975a3dSMatthew Dillon * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 225a975a3dSMatthew Dillon * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 235a975a3dSMatthew Dillon * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 245a975a3dSMatthew Dillon * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 255a975a3dSMatthew Dillon * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 265a975a3dSMatthew Dillon * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 275a975a3dSMatthew Dillon * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 285a975a3dSMatthew Dillon * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 295a975a3dSMatthew Dillon * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 305a975a3dSMatthew Dillon * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 315a975a3dSMatthew Dillon * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 325a975a3dSMatthew Dillon * SUCH DAMAGE. 335a975a3dSMatthew Dillon */ 345a975a3dSMatthew Dillon 35ba1e976fSNuno Antunes #include <sys/globaldata.h> /* curthread in mtx_assert() */ 365a975a3dSMatthew Dillon #include <sys/lock.h> 375a975a3dSMatthew Dillon 380147868eSNuno Antunes #define IFNET_RLOCK() crit_enter() 390147868eSNuno Antunes #define IFNET_RUNLOCK() crit_exit() 400147868eSNuno Antunes 41f0a26983SSepherosa Ziehau #define IFQ_LOCK(ifq) ALTQ_LOCK((ifq)) 42*66c898feSSascha Wildner #define IFQ_UNLOCK(ifq) ALTQ_UNLOCK((ifq)) 430147868eSNuno Antunes 445a975a3dSMatthew Dillon #define CTR1(ktr_line, ...) 455a975a3dSMatthew Dillon #define CTR2(ktr_line, ...) 465a975a3dSMatthew Dillon #define CTR3(ktr_line, ...) 475a975a3dSMatthew Dillon #define CTR4(ktr_line, ...) 485a975a3dSMatthew Dillon #define CTR5(ktr_line, ...) 495a975a3dSMatthew Dillon #define CTR6(ktr_line, ...) 505a975a3dSMatthew Dillon #define cpu_spinwait() cpu_pause() 515a975a3dSMatthew Dillon 520147868eSNuno Antunes #define SI_SUB_NETGRAPH SI_SUB_DRIVERS 53