revert between 56095 -> 55830 in arch
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / net / netisr.c
blob5b1cbdf86e1a60932b03b3fb602844943f6d85e9
1 /*
2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
5 * Copyright (C) 2005 Neil Cafferkey
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 * MA 02111-1307, USA.
23 #include <conf.h>
25 #include <sys/param.h>
26 #include <kern/amiga_includes.h> /* This is needed by sys/synch.h */
27 #include <sys/synch.h>
29 #include <net/netisr.h>
32 extern struct MsgPort *SanaPort;
34 ULONG netisr = 0L;
37 * scnednetisr(): schedule net "interrupt"
38 * This routine signals TCP/IP task to run net_poll via sana_poll
40 void schednetisr(int isr)
42 netisr |= 1<<isr;
43 Signal(SanaPort->mp_SigTask, 1<<SanaPort->mp_SigBit);
46 void schednetisr_nosignal(int isr)
48 netisr |= 1<<isr;
51 /*
52 * net_poll(): run scheduled network level protocols
53 * this routine is called from sana_poll
55 void
56 net_poll(void)
58 extern void ipintr(void);
59 extern void impintr(void);
60 extern void isointr(void);
61 extern void ccittintr(void);
62 extern void nsintr(void);
64 spl_t s = splimp();
65 int n = netisr;
66 netisr = 0;
67 splx(s);
69 if (!n) return;
70 #if INET
71 if (n & (1<<NETISR_IP)) {
72 ipintr();
74 #endif /* INET */
75 #if NIMP > 0
76 if (n & (1<<NETISR_IMP)) {
77 impintr();
79 #endif /* NIMP > 0 */
80 #if ISO
81 if (n & (1<<NETISR_ISO)) {
82 isointr();
84 #endif /* ISO */
85 #if CCITT
86 if (n & (1<<NETISR_CCITT)) {
87 ccittintr();
89 #endif /* CCITT */
90 #if NS
91 if (n & (1<<NETISR_NS)) {
92 nsintr();
94 #endif /* NS */
95 #if 0
96 /* raw input do not go through the isr */
97 if (n & (1<<NETISR_RAW)) {
98 rawintr();
100 #endif