FreeBSD/Linux Kernel Cross Reference
sys/net/netisr.h
1 /* $NetBSD: netisr.h,v 1.32 2003/08/07 16:32:55 agc Exp $ */
2
3 /*
4 * Copyright (c) 1980, 1986, 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * @(#)netisr.h 8.1 (Berkeley) 6/10/93
32 */
33
34 #ifndef _NET_NETISR_H_
35 #define _NET_NETISR_H_ /* checked by netisr_dispatch.h */
36
37 /*
38 * The networking code runs off software interrupts.
39 *
40 * You can switch into the network by doing splsoftnet() and return by splx().
41 * The software interrupt level for the network is higher than the software
42 * level for the clock (so you can enter the network in routines called
43 * at timeout time).
44 *
45 * The routine to request a network software interrupt, setsoftnet(),
46 * is defined in the machine-specific include files.
47 */
48
49 #if defined(_KERNEL)
50
51 #if !defined(_LKM)
52 #include "opt_inet.h"
53 #include "opt_atalk.h"
54 #include "opt_ccitt.h"
55 #include "opt_iso.h"
56 #include "opt_ns.h"
57 #include "opt_natm.h"
58 #include "arp.h"
59 #ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
60 #include "sl.h"
61 #include "strip.h"
62 #include "ppp.h"
63 #endif
64 #endif /* !defined(_LKM) */
65
66 #if !defined(_LOCORE)
67
68 /* XXX struct sockaddr defn for for if.h, if_arp.h */
69 #include <sys/socket.h>
70
71 /*
72 * XXX IFNAMSIZE for if_ppp.h, natm.h; struct ifnet decl for in6.h, in.h;
73 * XXX struct mbuf decl for in6.h, in.h, route.h (via in_var.h).
74 */
75 #include <net/if.h>
76
77 #ifdef INET
78 #include <netinet/in.h>
79 #include <netinet/ip_var.h>
80 #if NARP > 0
81 #include <netinet/if_inarp.h>
82 #endif
83 #endif
84 #ifdef INET6
85 # ifndef INET
86 # include <netinet/in.h>
87 # endif
88 #include <netinet/ip6.h>
89 #include <netinet6/ip6_var.h>
90 #endif
91 #ifdef NS
92 #include <netns/ns_var.h>
93 #endif
94 #ifdef ISO
95 #include <netiso/iso.h>
96 #include <netiso/clnp.h>
97 #endif
98 #ifdef CCITT
99 #include <netccitt/x25isr.h>
100 #endif
101 #ifdef NATM
102 #include <netnatm/natm.h>
103 #endif
104 #ifdef NETATALK
105 #include <netatalk/at_extern.h>
106 #endif
107
108 #ifndef __HAVE_GENERIC_SOFT_INTERRUPTS /* XXX XXX XXX */
109 #if NSL > 0
110 extern void slnetisr(void);
111 #endif
112 #if NSTRIP > 0
113 extern void stripnetisr(void);
114 #endif
115 #if NPPP > 0
116 extern void pppnetisr(void);
117 #endif
118 #endif /* __HAVE_GENERIC_SOFT_INTERRUPTS */
119
120 #endif /* !defined(_LOCORE) */
121 #endif /* defined(_KERNEL) */
122
123
124 /*
125 * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
126 * word which is used to de-multiplex a single software
127 * interrupt used for scheduling the network code to calls
128 * on the lowest level routine of each protocol.
129 */
130 #define NETISR_IP 2 /* same as AF_INET */
131 #define NETISR_NS 6 /* same as AF_NS */
132 #define NETISR_ISO 7 /* same as AF_ISO */
133 #define NETISR_CCITT 10 /* same as AF_CCITT */
134 #define NETISR_ATALK 16 /* same as AF_APPLETALK */
135 #define NETISR_IPX 23 /* same as AF_IPX */
136 #define NETISR_IPV6 24 /* same as AF_INET6 */
137 #define NETISR_ISDN 26 /* same as AF_E164 */
138 #define NETISR_NATM 27 /* same as AF_NATM */
139 #define NETISR_ARP 28 /* same as AF_ARP */
140 #ifndef __HAVE_GENERIC_SOFT_INTERRUPTS
141 #define NETISR_SLIP 29 /* for SLIP processing */
142 #define NETISR_STRIP 30 /* for STRIP processing */
143 #define NETISR_PPP 31 /* for PPP processing */
144 #endif
145
146 #if defined(_KERNEL) && !defined(_LOCORE)
147
148 #ifndef schednetisr
149 #define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); }
150 #endif
151
152 extern int netisr; /* scheduling bits for network */
153
154 #endif /* defined(_KERNEL) && !defined(_LOCORE) */
155
156 #endif /* _NET_NETISR_H_ */
Cache object: a8819f5d14734ef386b008dd8e00656f
|