diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-01-11 04:02:40 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-01-11 04:02:40 +0000 |
commit | e47f00743fc4776491344f2c618cc8dc2c23bcbc (patch) | |
tree | 13e03a113a82a184c51c19c209867cfd3a59b3b9 /net | |
parent | b2ad5f821b1381492d792ca10b1eb7a107b48f14 (diff) |
Merge with Linux 2.4.0.
Diffstat (limited to 'net')
-rw-r--r-- | net/atm/Makefile | 4 | ||||
-rw-r--r-- | net/atm/common.c | 61 | ||||
-rw-r--r-- | net/atm/lane_mpoa_init.c | 58 | ||||
-rw-r--r-- | net/atm/lec.c | 18 | ||||
-rw-r--r-- | net/decnet/af_decnet.c | 6 | ||||
-rw-r--r-- | net/decnet/dn_table.c | 6 | ||||
-rw-r--r-- | net/ipv4/arp.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_LOG.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_timer.c | 2 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 4 | ||||
-rw-r--r-- | net/ipv6/icmp.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 | ||||
-rw-r--r-- | net/ipv6/udp.c | 2 | ||||
-rw-r--r-- | net/irda/irias_object.c | 2 | ||||
-rw-r--r-- | net/irda/irqueue.c | 73 | ||||
-rw-r--r-- | net/packet/af_packet.c | 2 | ||||
-rw-r--r-- | net/sched/sch_api.c | 2 |
19 files changed, 97 insertions, 155 deletions
diff --git a/net/atm/Makefile b/net/atm/Makefile index 40d63cc87..f122d1a62 100644 --- a/net/atm/Makefile +++ b/net/atm/Makefile @@ -11,7 +11,7 @@ include ../../.config O_TARGET= atm.o -export-objs = common.o atm_misc.o raw.o resources.o ipcommon.o proc.o lane_mpoa_init.o +export-objs = common.o atm_misc.o raw.o resources.o ipcommon.o proc.o multi-list = mpoa.o mpoa-objs = mpc.o mpoa_caches.o mpoa_proc.o @@ -33,7 +33,7 @@ ifeq ($(CONFIG_PROC_FS),y) obj-y += proc.o endif -obj-$(CONFIG_ATM_LANE) += lec.o lane_mpoa_init.o +obj-$(CONFIG_ATM_LANE) += lec.o obj-$(CONFIG_ATM_MPOA) += mpoa.o include $(TOPDIR)/Rules.make diff --git a/net/atm/common.c b/net/atm/common.c index ea0ad690a..b2bd5a624 100644 --- a/net/atm/common.c +++ b/net/atm/common.c @@ -5,6 +5,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/kmod.h> #include <linux/net.h> /* struct socket, struct net_proto, struct proto_ops */ #include <linux/atm.h> /* ATM stuff */ @@ -679,7 +680,7 @@ int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg) goto done; } if (atm_lane_ops.lecd_attach == NULL) - atm_lane_init(); + atm_lane_init(); if (atm_lane_ops.lecd_attach == NULL) { /* try again */ ret_val = -ENOSYS; goto done; @@ -1086,3 +1087,61 @@ int atm_getsockopt(struct socket *sock,int level,int optname, return -EINVAL; return atm_do_getsockopt(sock,level,optname,optval,len); } + + +/* + * lane_mpoa_init.c: A couple of helper functions + * to make modular LANE and MPOA client easier to implement + */ + +/* + * This is how it goes: + * + * if xxxx is not compiled as module, call atm_xxxx_init_ops() + * from here + * else call atm_mpoa_init_ops() from init_module() within + * the kernel when xxxx module is loaded + * + * In either case function pointers in struct atm_xxxx_ops + * are initialized to their correct values. Either they + * point to functions in the module or in the kernel + */ + +extern struct atm_mpoa_ops atm_mpoa_ops; /* in common.c */ +extern struct atm_lane_ops atm_lane_ops; /* in common.c */ + +#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) +void atm_mpoa_init(void) +{ +#ifndef CONFIG_ATM_MPOA_MODULE /* not module */ + atm_mpoa_init_ops(&atm_mpoa_ops); +#else + request_module("mpoa"); +#endif + + return; +} +#endif + +#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) +#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) +struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br, + unsigned char *addr) = NULL; +void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent) = NULL; +#if defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_BRIDGE_MODULE) +EXPORT_SYMBOL(br_fdb_get_hook); +EXPORT_SYMBOL(br_fdb_put_hook); +#endif /* defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_BRIDGE_MODULE) */ +#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ + +void atm_lane_init(void) +{ +#ifndef CONFIG_ATM_LANE_MODULE /* not module */ + atm_lane_init_ops(&atm_lane_ops); +#else + request_module("lec"); +#endif + + return; +} +#endif diff --git a/net/atm/lane_mpoa_init.c b/net/atm/lane_mpoa_init.c deleted file mode 100644 index 448826dd2..000000000 --- a/net/atm/lane_mpoa_init.c +++ /dev/null @@ -1,58 +0,0 @@ -#include <linux/config.h> -#include <linux/module.h> - -#include "mpc.h" -#include "lec.h" - -/* - * lane_mpoa_init.c: A couple of helper functions - * to make modular LANE and MPOA client easier to implement - */ - -/* - * This is how it goes: - * - * if xxxx is not compiled as module, call atm_xxxx_init_ops() - * from here - * else call atm_mpoa_init_ops() from init_module() within - * the kernel when xxxx module is loaded - * - * In either case function pointers in struct atm_xxxx_ops - * are initialized to their correct values. Either they - * point to functions in the module or in the kernel - */ - -extern struct atm_mpoa_ops atm_mpoa_ops; /* in common.c */ -extern struct atm_lane_ops atm_lane_ops; /* in common.c */ - -#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) -void atm_mpoa_init(void) -{ -#ifndef CONFIG_ATM_MPOA_MODULE /* not module */ - atm_mpoa_init_ops(&atm_mpoa_ops); -#endif - - return; -} -#endif - -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) -struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br, - unsigned char *addr) = NULL; -void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent) = NULL; -#if defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_BRIDGE_MODULE) -EXPORT_SYMBOL(br_fdb_get_hook); -EXPORT_SYMBOL(br_fdb_put_hook); -#endif /* defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_BRIDGE_MODULE) */ -#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ - -void atm_lane_init(void) -{ -#ifndef CONFIG_ATM_LANE_MODULE /* not module */ - atm_lane_init_ops(&atm_lane_ops); -#endif - - return; -} -#endif diff --git a/net/atm/lec.c b/net/atm/lec.c index 035058033..51be9f077 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -39,6 +39,7 @@ static unsigned char bridge_ula_lec[] = {0x01, 0x80, 0xc2, 0x00, 0x00}; /* Modular too */ #include <linux/module.h> +#include <linux/init.h> #include "lec.h" #include "lec_arpc.h" @@ -828,8 +829,7 @@ void atm_lane_init_ops(struct atm_lane_ops *ops) return; } -#ifdef MODULE -int init_module(void) +static int __init lane_module_init(void) { extern struct atm_lane_ops atm_lane_ops; @@ -838,17 +838,12 @@ int init_module(void) return 0; } -void cleanup_module(void) +static void __exit lane_module_cleanup(void) { int i; extern struct atm_lane_ops atm_lane_ops; struct lec_priv *priv; - if (MOD_IN_USE) { - printk(KERN_NOTICE "lec.c: module in use\n"); - return; - } - atm_lane_ops.lecd_attach = NULL; atm_lane_ops.mcast_attach = NULL; atm_lane_ops.vcc_attach = NULL; @@ -857,7 +852,9 @@ void cleanup_module(void) for (i = 0; i < MAX_LEC_ITF; i++) { if (dev_lec[i] != NULL) { priv = (struct lec_priv *)dev_lec[i]->priv; +#if defined(CONFIG_TR) unregister_trdev(dev_lec[i]); +#endif kfree(dev_lec[i]); dev_lec[i] = NULL; } @@ -865,7 +862,9 @@ void cleanup_module(void) return; } -#endif /* MODULE */ + +module_init(lane_module_init); +module_exit(lane_module_cleanup); /* * LANE2: 3.1.3, LE_RESOLVE.request @@ -2170,4 +2169,3 @@ lec_arp_check_empties(struct lec_priv *priv, lec_arp_put(priv->lec_arp_tables,entry); lec_arp_unlock(priv); } - diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index ca0850b4a..bc51b636d 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c @@ -2133,6 +2133,9 @@ __setup("decnet=", decnet_setup); static void __exit decnet_exit(void) { + sock_unregister(AF_DECnet); + dev_remove_pack(&dn_dix_packet_type); + #ifdef CONFIG_SYSCTL dn_unregister_sysctl(); #endif /* CONFIG_SYSCTL */ @@ -2148,9 +2151,6 @@ static void __exit decnet_exit(void) #endif /* CONFIG_DECNET_ROUTER */ proc_net_remove("decnet"); - - dev_remove_pack(&dn_dix_packet_type); - sock_unregister(AF_DECnet); } module_init(decnet_init); diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index 2e09a8507..ce7a3ac06 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c @@ -902,6 +902,10 @@ void __init dn_fib_table_init(void) void __exit dn_fib_table_cleanup(void) { + int i; + + for (i = 0; i < DN_NUM_TABLES + 1; ++i) + dn_fib_del_tree(i); + return; } - diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index b410d1de4..51592202a 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -292,7 +292,7 @@ static int arp_constructor(struct neighbour *neigh) neigh->output = neigh->ops->output; return 0; #endif - } + ;} #endif if (neigh->type == RTN_MULTICAST) { neigh->nud_state = NUD_NOARP; diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index bdb4fd99c..c7f9dfe37 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c @@ -288,7 +288,7 @@ ipt_log_target(struct sk_buff **pskb, if (in && !out) { /* MAC logging for input chain only. */ printk("MAC="); - if ((*pskb)->dev && (*pskb)->dev->hard_header_len && (*pskb)->mac.raw != iph) { + if ((*pskb)->dev && (*pskb)->dev->hard_header_len && (*pskb)->mac.raw != (void*)iph) { int i; unsigned char *p = (*pskb)->mac.raw; for (i = 0; i < (*pskb)->dev->hard_header_len; i++,p++) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index c2cc4815b..bbc8668d8 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1707,7 +1707,7 @@ do_time_wait: break; case TCP_TW_RST: goto no_tcp_socket; - case TCP_TW_SUCCESS: + case TCP_TW_SUCCESS:; } goto discard_it; } diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index f57aeb32e..27815dcb7 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -384,7 +384,7 @@ static void tcp_retransmit_timer(struct sock *sk) if (tp->retransmits > sysctl_tcp_retries1) __sk_dst_reset(sk); -out: +out:; } static void tcp_write_timer(unsigned long data) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index a4ff40d56..3d177c7c9 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -158,7 +158,7 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum) } while ((sk = sk->next) != NULL); best_size_so_far = size; best = result; - next: + next:; } result = best; for(;; result += UDP_HTABLE_SIZE) { diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index d342d5642..993165142 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -206,7 +206,7 @@ static void addrconf_mod_timer(struct inet6_ifaddr *ifp, case AC_RS: ifp->timer.function = addrconf_rs_timer; break; - default: + default:; } ifp->timer.expires = jiffies + when; add_timer(&ifp->timer); @@ -2015,7 +2015,7 @@ void __init addrconf_init(void) case ARPHRD_IEEE802_TR: addrconf_dev_config(dev); break; - default: + default:; /* Ignore all other */ } } diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 41ce4b997..0ca0d7f2e 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -542,7 +542,7 @@ int icmpv6_rcv(struct sk_buff *skb, unsigned long len) ntohs(daddr->in6_u.u6_addr16[7])); goto discard_it; } - default: + default:; /* CHECKSUM_UNNECESSARY */ }; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 1b0684987..8f452acc1 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1639,7 +1639,7 @@ do_time_wait: break; case TCP_TW_RST: goto no_tcp_socket; - case TCP_TW_SUCCESS: + case TCP_TW_SUCCESS:; } goto discard_it; } diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index fbf0c31f6..429e4052f 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -83,7 +83,7 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum) } while ((sk = sk->next) != NULL); best_size_so_far = size; best = result; - next: + next:; } result = best; for(;; result += UDP_HTABLE_SIZE) { diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 4a8fbed4c..65d1e4409 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c @@ -34,7 +34,7 @@ hashbin_t *objects = NULL; /* * Used when a missing value needs to be returned */ -struct ias_value missing = { IAS_MISSING, 0, 0, {0}}; +struct ias_value missing = { IAS_MISSING, 0, 0, 0}; /* * Function strdup (str) diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c index d2e4da720..d3f84e3ab 100644 --- a/net/irda/irqueue.c +++ b/net/irda/irqueue.c @@ -8,6 +8,8 @@ * Created at: Tue Jun 9 13:29:31 1998 * Modified at: Sun Dec 12 13:48:22 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> + * Modified at: Thu Jan 4 14:29:10 CET 2001 + * Modified by: Marc Zyngier <mzyngier@freesurf.fr> * * Copyright (C) 1998-1999, Aage Kvalnes <aage@cs.uit.no> * Copyright (C) 1998, Dag Brattli, @@ -142,69 +144,6 @@ int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func) } /* - * Function hashbin_lock (hashbin, hashv, name) - * - * Lock the hashbin - * - */ -void hashbin_lock(hashbin_t* hashbin, __u32 hashv, char* name, - unsigned long flags) -{ - int bin; - - IRDA_DEBUG(0, "hashbin_lock\n"); - - ASSERT(hashbin != NULL, return;); - ASSERT(hashbin->magic == HB_MAGIC, return;); - - /* - * Locate hashbin - */ - if (name) - hashv = hash(name); - bin = GET_HASHBIN(hashv); - - /* Synchronize */ - if ( hashbin->hb_type & HB_GLOBAL ) - spin_lock_irqsave(&hashbin->hb_mutex[ bin], flags); - else { - save_flags(flags); - cli(); - } -} - -/* - * Function hashbin_unlock (hashbin, hashv, name) - * - * Unlock the hashbin - * - */ -void hashbin_unlock(hashbin_t* hashbin, __u32 hashv, char* name, - unsigned long flags) -{ - int bin; - - IRDA_DEBUG(0, "hashbin_unlock()\n"); - - ASSERT(hashbin != NULL, return;); - ASSERT(hashbin->magic == HB_MAGIC, return;); - - /* - * Locate hashbin - */ - if (name ) - hashv = hash(name); - bin = GET_HASHBIN(hashv); - - /* Release lock */ - if ( hashbin->hb_type & HB_GLOBAL) - spin_unlock_irq( &hashbin->hb_mutex[ bin]); - else if (hashbin->hb_type & HB_LOCAL) { - restore_flags( flags); - } -} - -/* * Function hashbin_insert (hashbin, entry, name) * * Insert an entry into the hashbin @@ -258,7 +197,7 @@ void hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, __u32 hashv, char* /* Release lock */ if ( hashbin->hb_type & HB_GLOBAL) { - spin_unlock_irq( &hashbin->hb_mutex[ bin]); + spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags); } else if ( hashbin->hb_type & HB_LOCAL) { restore_flags( flags); @@ -327,7 +266,7 @@ void* hashbin_find( hashbin_t* hashbin, __u32 hashv, char* name ) /* Release lock */ if ( hashbin->hb_type & HB_GLOBAL) { - spin_unlock_irq( &hashbin->hb_mutex[ bin]); + spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags); } else if ( hashbin->hb_type & HB_LOCAL) { restore_flags( flags); @@ -436,7 +375,7 @@ void* hashbin_remove( hashbin_t* hashbin, __u32 hashv, char* name) /* Release lock */ if ( hashbin->hb_type & HB_GLOBAL) { - spin_unlock_irq( &hashbin->hb_mutex[ bin]); + spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags); } else if ( hashbin->hb_type & HB_LOCAL) { restore_flags( flags); @@ -511,7 +450,7 @@ void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry) /* Release lock */ if ( hashbin->hb_type & HB_GLOBAL) { - spin_unlock_irq( &hashbin->hb_mutex[ bin]); + spin_unlock_irqrestore( &hashbin->hb_mutex[ bin], flags); } else if ( hashbin->hb_type & HB_LOCAL) { restore_flags( flags); diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 576d6400e..790a57490 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1139,7 +1139,7 @@ static void packet_dev_mc(struct net_device *dev, struct packet_mclist *i, int w case PACKET_MR_ALLMULTI: dev_set_allmulti(dev, what); break; - default: + default:; } } diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 8a046514f..0b54fbde0 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1203,7 +1203,7 @@ int __init pktsched_init(void) #define INIT_QDISC(name) { \ extern struct Qdisc_ops name##_qdisc_ops; \ - register_qdisc(&##name##_qdisc_ops); \ + register_qdisc(& name##_qdisc_ops); \ } INIT_QDISC(pfifo); |