1 /**	$MirOS: src/sys/net/netisr.h,v 1.6 2010/09/25 14:11:47 tg Exp $ */
2 /*	$OpenBSD: netisr.h,v 1.20 2004/11/28 23:39:45 canacar Exp $	*/
3 /*	$NetBSD: netisr.h,v 1.12 1995/08/12 23:59:24 mycroft Exp $	*/
4 
5 /*
6  * Copyright (c) 1980, 1986, 1989, 1993
7  *	The Regents of the University of California.  All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  *	@(#)netisr.h	8.1 (Berkeley) 6/10/93
34  */
35 
36 #ifndef _NET_NETISR_H_
37 #define _NET_NETISR_H_
38 /*
39  * The networking code runs off software interrupts.
40  *
41  * You can switch into the network by doing splsoftnet() and return by splx().
42  * The software interrupt level for the network is higher than the software
43  * level for the clock (so you can enter the network in routines called
44  * at timeout time).
45  *
46  * The routine to request a network software interrupt, setsoftnet(),
47  * is defined in the machine-specific include files.
48  */
49 
50 /*
51  * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
52  * word which is used to de-multiplex a single software
53  * interrupt used for scheduling the network code to calls
54  * on the lowest level routine of each protocol.
55  */
56 #define	NETISR_NOTRND	0		/* virtual */
57 #define	NETISR_RND	1
58 #define	NETISR_IP	2		/* same as AF_INET */
59 #define	NETISR_IMP	3		/* same as AF_IMPLINK */
60 #define	NETISR_NS	6		/* same as AF_NS */
61 #define	NETISR_ISO	7		/* same as AF_ISO */
62 #define	NETISR_CCITT	10		/* same as AF_CCITT */
63 /* 13..15 overlap with regular RND_SRC_NET (XXX this is stupid) */
64 #define	NETISR_ATALK	16		/* same as AF_APPLETALK */
65 #define	NETISR_ARP	18		/* same as AF_LINK */
66 #define	NETISR_IPX	23		/* same as AF_IPX */
67 #define	NETISR_IPV6	24		/* same as AF_INET6 */
68 #define	NETISR_ISDN	26		/* same as AF_E164 */
69 #define	NETISR_NATM	27		/* same as AF_ATM */
70 #define	NETISR_PPP	28		/* for PPP processing */
71 #define	NETISR_BRIDGE	29		/* for bridge processing */
72 #define	NETISR_PLIP	30		/* for PLIP processing */
73 #define	NETISR_PPPOE	31		/* for pppoe processing */
74 
75 #ifndef _LOCORE
76 #ifdef _KERNEL
77 extern int	netisr;			/* scheduling bits for network */
78 extern int	netrndintr_v;		/* same bits but for entropy */
79 
80 void	netrndintr(void);
81 void	arpintr(void);
82 void	ipintr(void);
83 void	ip6intr(void);
84 void	atintr(void);
85 void	nsintr(void);
86 void	ipxintr(void);
87 void	clnlintr(void);
88 void	natmintr(void);
89 void	pppintr(void);
90 void	ccittintr(void);
91 void	bridgeintr(void);
92 void	pppoeintr(void);
93 
94 #define schednetisr(anisr) do {					\
95 	netrndintr_v |= 1 << (anisr);				\
96 	netisr |= (1 << (anisr)) | (1 << NETISR_RND);		\
97 	setsoftnet();						\
98 } while (/* CONSTCOND */ 0)
99 #define schednetisr_virtual(anisr) do {				\
100 	netrndintr_v |= (1 << (anisr)) | (1 << NETISR_NOTRND);	\
101 	netisr |= 1 << (anisr);					\
102 	setsoftnet();						\
103 } while (/* CONSTCOND */ 0)
104 #endif
105 #endif
106 
107 #endif /* _NET_NETISR_H_ */
108