diff options
author | msmith <msmith@FreeBSD.org> | 2002-01-08 10:34:03 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 2002-01-08 10:34:03 +0000 |
commit | ea9c5a8d4c59a02cf0cf32205c2b86de18bbfe9d (patch) | |
tree | 4291f6f5e80438f96ec530927cfa8f763951e05f /sys | |
parent | 825021e8a0b29ed7d72004b4d7067d9f3b82cf6e (diff) | |
download | FreeBSD-src-ea9c5a8d4c59a02cf0cf32205c2b86de18bbfe9d.zip FreeBSD-src-ea9c5a8d4c59a02cf0cf32205c2b86de18bbfe9d.tar.gz |
Initialise the intrq_present fields at runtime, not link time. This allows
us to load protocols at runtime, and avoids the use of common variables.
Also fix the ip6_intrq assignment so that it works at all.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/intrq.c | 20 | ||||
-rw-r--r-- | sys/net/intrq.h | 9 | ||||
-rw-r--r-- | sys/netatm/atm_subr.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 2 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 2 | ||||
-rw-r--r-- | sys/netipx/ipx_input.c | 2 | ||||
-rw-r--r-- | sys/netnatm/natm_proto.c | 3 | ||||
-rw-r--r-- | sys/netns/ns_input.c | 3 |
8 files changed, 26 insertions, 19 deletions
diff --git a/sys/net/intrq.c b/sys/net/intrq.c index 89f9159..bae00e4 100644 --- a/sys/net/intrq.c +++ b/sys/net/intrq.c @@ -41,17 +41,17 @@ /* * If the appropriate intrq_present variable is zero, don't use * the queue (as it'll never get processed). - * When defined, each of the network stacks declares their own - * *intrq_present variable to be non-zero. + * Each of the active network stacks sets their own + * *intrq_present variable non-zero. */ -const int atintrq1_present; -const int atintrq2_present; -const int atmintrq_present; -const int ipintrq_present; -const int ip6intrq_present; -const int ipxintrq_present; -const int natmintrq_present; -const int nsintrq_present; +int atintrq1_present; +int atintrq2_present; +int atmintrq_present; +int ipintrq_present; +int ip6intrq_present; +int ipxintrq_present; +int natmintrq_present; +int nsintrq_present; struct ifqueue atintrq1; struct ifqueue atintrq2; diff --git a/sys/net/intrq.h b/sys/net/intrq.h index c17cafd..6316be0 100644 --- a/sys/net/intrq.h +++ b/sys/net/intrq.h @@ -30,6 +30,15 @@ #define _NET_INTRQ_H_ #ifdef _KERNEL +extern int atintrq1_present; +extern int atintrq2_present; +extern int atmintrq_present; +extern int ipintrq_present; +extern int ip6intrq_present; +extern int ipxintrq_present; +extern int natmintrq_present; +extern int nsintrq_present; + extern int family_enqueue __P((sa_family_t, struct mbuf *)); #endif diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c index 25003e6..871d299 100644 --- a/sys/netatm/atm_subr.c +++ b/sys/netatm/atm_subr.c @@ -79,7 +79,6 @@ int atm_dev_print = 0; int atm_print_data = 0; int atm_version = ATM_VERSION; struct timeval atm_debugtime = {0, 0}; -const int atmintrq_present = 1; struct sp_info atm_attributes_pool = { "atm attributes pool", /* si_name */ @@ -133,9 +132,10 @@ atm_initialize() return; atm_init = 1; - atm_intrq.ifq_maxlen = ATM_INTRQ_MAX; mtx_init(&atm_intrq.ifq_mtx, "atm_inq", MTX_DEF); + atmintrq_present = 1; + #ifdef sgi atm_intr_index = register_isr(atm_intr); #endif diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index c75cd1b..dec4d94 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -171,7 +171,6 @@ SYSCTL_STRUCT(_net_inet_ip, IPCTL_STATS, stats, CTLFLAG_RW, static TAILQ_HEAD(ipqhead, ipq) ipq[IPREASS_NHASH]; static int nipq = 0; /* total # of reass queues */ static int maxnipq; -const int ipintrq_present = 1; #ifdef IPCTL_DEFMTU SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, @@ -255,6 +254,7 @@ ip_init() #endif ipintrq.ifq_maxlen = ipqmaxlen; mtx_init(&ipintrq.ifq_mtx, "ip_inq", MTX_DEF); + ipintrq_present = 1; register_netisr(NETISR_IP, ipintr); } diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 77557f3..cfee62b 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -135,7 +135,6 @@ extern struct callout in6_tmpaddrtimer_ch; int ip6_forward_srcrt; /* XXX */ int ip6_sourcecheck; /* XXX */ int ip6_sourcecheck_interval; /* XXX */ -const int int6intrq_present = 1; int ip6_ours_check_algorithm; @@ -183,6 +182,7 @@ ip6_init() ip6_protox[pr->pr_protocol] = pr - inet6sw; ip6intrq.ifq_maxlen = ip6qmaxlen; mtx_init(&ip6intrq.ifq_mtx, "ip6_inq", MTX_DEF); + ip6intrq_present = 1; register_netisr(NETISR_IPV6, ip6intr); nd6_init(); frag6_init(); diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index ed78acf..d912bdc 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -89,7 +89,6 @@ struct ipxpcb ipxrawpcb; static int ipxqmaxlen = IFQ_MAXLEN; long ipx_pexseq; -const int ipxintrq_present = 1; static int ipx_do_route(struct ipx_addr *src, struct route *ro); static void ipx_undo_route(struct route *ro); @@ -108,6 +107,7 @@ ipx_init() read_random(&ipx_pexseq, sizeof ipx_pexseq); ipxintrq.ifq_maxlen = ipxqmaxlen; mtx_init(&ipxintrq.ifq_mtx, "ipx_inq", MTX_DEF); + ipxintrq_present = 1; ipxpcb.ipxp_next = ipxpcb.ipxp_prev = &ipxpcb; ipxrawpcb.ipxp_next = ipxrawpcb.ipxp_prev = &ipxrawpcb; diff --git a/sys/netnatm/natm_proto.c b/sys/netnatm/natm_proto.c index ef657f1..3843f81 100644 --- a/sys/netnatm/natm_proto.c +++ b/sys/netnatm/natm_proto.c @@ -114,8 +114,6 @@ u_int natm_sookcnt = 0; /* # mbufs ok */ u_int natm_sookbytes = 0; /* # of bytes ok */ #endif -const int natmintrq_present = 1; - void natm_init() @@ -124,6 +122,7 @@ void natm_init() bzero(&natmintrq, sizeof(natmintrq)); natmintrq.ifq_maxlen = natmqmaxlen; mtx_init(&natmintrq.ifq_mtx, "natm_inq", MTX_DEF); + natmintrq_present = 1; } diff --git a/sys/netns/ns_input.c b/sys/netns/ns_input.c index 4d26a9d..7006540 100644 --- a/sys/netns/ns_input.c +++ b/sys/netns/ns_input.c @@ -79,8 +79,6 @@ int nsqmaxlen = IFQ_MAXLEN; int idpcksum = 1; long ns_pexseq; -const int nsintrq_present = 1; - ns_init() { extern struct timeval time; @@ -91,6 +89,7 @@ ns_init() nsrawpcb.nsp_next = nsrawpcb.nsp_prev = &nsrawpcb; nsintrq.ifq_maxlen = nsqmaxlen; mtx_init(&nsintrq.ifq_mtx, "ns_inq", MTX_DEF); + nsintrq_present = 1; ns_pexseq = time.tv_usec; ns_netmask.sns_len = 6; ns_netmask.sns_addr.x_net = ns_broadnet; |