From b2ad5f821b1381492d792ca10b1eb7a107b48f14 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 10 Jan 2001 17:17:53 +0000 Subject: Merge with Linux 2.4.0-prerelease. Big Makefile rewrite, test your Makefiles. --- net/ax25/Makefile | 19 ++++++++----------- net/ax25/af_ax25.c | 15 +-------------- net/ax25/ax25_addr.c | 3 --- net/ax25/ax25_dev.c | 24 +++--------------------- net/ax25/ax25_ds_in.c | 3 --- net/ax25/ax25_ds_subr.c | 3 --- net/ax25/ax25_ds_timer.c | 4 ---- net/ax25/ax25_iface.c | 8 +++----- net/ax25/ax25_in.c | 2 -- net/ax25/ax25_ip.c | 2 -- net/ax25/ax25_out.c | 2 -- net/ax25/ax25_route.c | 13 +++---------- net/ax25/ax25_std_in.c | 4 ---- net/ax25/ax25_std_subr.c | 4 ---- net/ax25/ax25_std_timer.c | 4 ---- net/ax25/ax25_subr.c | 4 ---- net/ax25/ax25_timer.c | 3 --- net/ax25/ax25_uid.c | 12 ++---------- 18 files changed, 20 insertions(+), 109 deletions(-) (limited to 'net/ax25') diff --git a/net/ax25/Makefile b/net/ax25/Makefile index b89b517c7..379185077 100644 --- a/net/ax25/Makefile +++ b/net/ax25/Makefile @@ -9,20 +9,17 @@ O_TARGET := ax25.o -O_OBJS := ax25_addr.o ax25_dev.o ax25_iface.o ax25_in.o ax25_ip.o ax25_out.o \ - ax25_route.o ax25_std_in.o ax25_std_subr.o ax25_std_timer.o \ - ax25_subr.o ax25_timer.o ax25_uid.o -M_OBJS := $(O_TARGET) -OX_OBJS += af_ax25.o +export-objs := af_ax25.o + +obj-y := ax25_addr.o ax25_dev.o ax25_iface.o ax25_in.o ax25_ip.o ax25_out.o \ + ax25_route.o ax25_std_in.o ax25_std_subr.o ax25_std_timer.o \ + ax25_subr.o ax25_timer.o ax25_uid.o af_ax25.o -ifeq ($(CONFIG_AX25_DAMA_SLAVE),y) -O_OBJS += ax25_ds_in.o ax25_ds_subr.o ax25_ds_timer.o -endif +obj-m := $(O_TARGET) -ifeq ($(CONFIG_SYSCTL),y) -O_OBJS += sysctl_net_ax25.o -endif +obj-$(CONFIG_AX25_DAMA_SLAVE) += ax25_ds_in.o ax25_ds_subr.o ax25_ds_timer.o +obj-$(CONFIG_SYSCTL) += sysctl_net_ax25.o include $(TOPDIR)/Rules.make diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 8e34e42e2..b73b4e5f2 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -105,7 +105,6 @@ */ #include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -140,7 +139,7 @@ -ax25_cb *volatile ax25_list = NULL; +ax25_cb *volatile ax25_list; static struct proto_ops ax25_proto_ops; @@ -1853,15 +1852,11 @@ static int __init ax25_init(void) ax25_packet_type.type = htons(ETH_P_AX25); dev_add_pack(&ax25_packet_type); register_netdevice_notifier(&ax25_dev_notifier); -#ifdef CONFIG_SYSCTL ax25_register_sysctl(); -#endif -#ifdef CONFIG_PROC_FS proc_net_create("ax25_route", 0, ax25_rt_get_info); proc_net_create("ax25", 0, ax25_get_info); proc_net_create("ax25_calls", 0, ax25_uid_get_info); -#endif printk(KERN_INFO "NET4: G4KLX/GW4PTS AX.25 for Linux. Version 0.37 for Linux NET4.0\n"); return 0; @@ -1869,24 +1864,19 @@ static int __init ax25_init(void) module_init(ax25_init); -#ifdef MODULE MODULE_AUTHOR("Jonathan Naylor G4KLX "); MODULE_DESCRIPTION("The amateur radio AX.25 link layer protocol"); static void __exit ax25_exit(void) { -#ifdef CONFIG_PROC_FS proc_net_remove("ax25_route"); proc_net_remove("ax25"); proc_net_remove("ax25_calls"); -#endif ax25_rt_free(); ax25_uid_free(); ax25_dev_free(); -#ifdef CONFIG_SYSCTL ax25_unregister_sysctl(); -#endif unregister_netdevice_notifier(&ax25_dev_notifier); ax25_packet_type.type = htons(ETH_P_AX25); @@ -1895,6 +1885,3 @@ static void __exit ax25_exit(void) sock_unregister(PF_AX25); } module_exit(ax25_exit); -#endif /* MODULE */ - -#endif diff --git a/net/ax25/ax25_addr.c b/net/ax25/ax25_addr.c index 1b0f9da67..f96c65586 100644 --- a/net/ax25/ax25_addr.c +++ b/net/ax25/ax25_addr.c @@ -19,8 +19,6 @@ * AX.25 036 Jonathan(G4KLX) Split from ax25_subr.c. */ -#include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -303,4 +301,3 @@ void ax25_digi_invert(ax25_digi *in, ax25_digi *out) } } -#endif diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c index 0436db903..efeec64e0 100644 --- a/net/ax25/ax25_dev.c +++ b/net/ax25/ax25_dev.c @@ -17,7 +17,6 @@ */ #include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -39,8 +38,9 @@ #include #include #include +#include -ax25_dev *ax25_dev_list = NULL; +ax25_dev *ax25_dev_list; ax25_dev *ax25_dev_ax25dev(struct net_device *dev) { @@ -78,9 +78,7 @@ void ax25_dev_device_up(struct net_device *dev) return; } -#ifdef CONFIG_SYSCTL ax25_unregister_sysctl(); -#endif memset(ax25_dev, 0x00, sizeof(*ax25_dev)); @@ -107,9 +105,7 @@ void ax25_dev_device_up(struct net_device *dev) ax25_dev_list = ax25_dev; restore_flags(flags); -#ifdef CONFIG_SYSCTL ax25_register_sysctl(); -#endif } void ax25_dev_device_down(struct net_device *dev) @@ -120,9 +116,7 @@ void ax25_dev_device_down(struct net_device *dev) if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) return; -#ifdef CONFIG_SYSCTL ax25_unregister_sysctl(); -#endif save_flags(flags); cli(); @@ -141,9 +135,7 @@ void ax25_dev_device_down(struct net_device *dev) ax25_dev_list = s->next; restore_flags(flags); kfree(ax25_dev); -#ifdef CONFIG_SYSCTL ax25_register_sysctl(); -#endif return; } @@ -152,9 +144,7 @@ void ax25_dev_device_down(struct net_device *dev) s->next = ax25_dev->next; restore_flags(flags); kfree(ax25_dev); -#ifdef CONFIG_SYSCTL ax25_register_sysctl(); -#endif return; } @@ -162,9 +152,7 @@ void ax25_dev_device_down(struct net_device *dev) } restore_flags(flags); -#ifdef CONFIG_SYSCTL ax25_register_sysctl(); -#endif } int ax25_fwd_ioctl(unsigned int cmd, struct ax25_fwd_struct *fwd) @@ -209,12 +197,10 @@ struct net_device *ax25_fwd_dev(struct net_device *dev) return ax25_dev->forward; } -#ifdef MODULE - /* * Free all memory associated with device structures. */ -void ax25_dev_free(void) +void __exit ax25_dev_free(void) { ax25_dev *s, *ax25_dev = ax25_dev_list; @@ -225,7 +211,3 @@ void ax25_dev_free(void) kfree(s); } } - -#endif - -#endif diff --git a/net/ax25/ax25_ds_in.c b/net/ax25/ax25_ds_in.c index 3354206df..6c65baea5 100644 --- a/net/ax25/ax25_ds_in.c +++ b/net/ax25/ax25_ds_in.c @@ -22,8 +22,6 @@ * Joerg(DL1BKE) ax25->n2count never got reset */ -#include -#if defined(CONFIG_AX25_DAMA_SLAVE) #include #include #include @@ -312,4 +310,3 @@ int ax25_ds_frame_in(ax25_cb *ax25, struct sk_buff *skb, int type) return queued; } -#endif diff --git a/net/ax25/ax25_ds_subr.c b/net/ax25/ax25_ds_subr.c index 3a6f6c259..e3e88d771 100644 --- a/net/ax25/ax25_ds_subr.c +++ b/net/ax25/ax25_ds_subr.c @@ -22,8 +22,6 @@ * AX.25 037 Jonathan(G4KLX) New timer architecture. */ -#include -#if defined(CONFIG_AX25_DAMA_SLAVE) #include #include #include @@ -217,4 +215,3 @@ void ax25_dama_off(ax25_cb *ax25) ax25_dev_dama_off(ax25->ax25_dev); } -#endif diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c index 06135e9de..3c5b2ea9c 100644 --- a/net/ax25/ax25_ds_timer.c +++ b/net/ax25/ax25_ds_timer.c @@ -15,8 +15,6 @@ * AX.25 037 Jonathan(G4KLX) New timer architecture. */ -#include -#if defined(CONFIG_AX25_DAMA_SLAVE) #include #include #include @@ -224,5 +222,3 @@ void ax25_ds_t1_timeout(ax25_cb *ax25) ax25_calculate_t1(ax25); ax25_start_t1timer(ax25); } - -#endif diff --git a/net/ax25/ax25_iface.c b/net/ax25/ax25_iface.c index 2e53ad959..15ca9c453 100644 --- a/net/ax25/ax25_iface.c +++ b/net/ax25/ax25_iface.c @@ -14,7 +14,6 @@ */ #include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -40,18 +39,18 @@ static struct protocol_struct { struct protocol_struct *next; unsigned int pid; int (*func)(struct sk_buff *, ax25_cb *); -} *protocol_list = NULL; +} *protocol_list; static struct linkfail_struct { struct linkfail_struct *next; void (*func)(ax25_cb *, int); -} *linkfail_list = NULL; +} *linkfail_list; static struct listen_struct { struct listen_struct *next; ax25_address callsign; struct net_device *dev; -} *listen_list = NULL; +} *listen_list; int ax25_protocol_register(unsigned int pid, int (*func)(struct sk_buff *, ax25_cb *)) { @@ -267,4 +266,3 @@ int ax25_protocol_is_registered(unsigned int pid) return 0; } -#endif diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c index 6efbc57f2..ed5e6fbce 100644 --- a/net/ax25/ax25_in.c +++ b/net/ax25/ax25_in.c @@ -39,7 +39,6 @@ */ #include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -480,4 +479,3 @@ int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_typ return ax25_rcv(skb, dev, (ax25_address *)dev->dev_addr, ptype); } -#endif diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c index a298fb59d..e6dcda83d 100644 --- a/net/ax25/ax25_ip.c +++ b/net/ax25/ax25_ip.c @@ -14,7 +14,6 @@ */ #include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -210,4 +209,3 @@ int ax25_rebuild_header(struct sk_buff *skb) #endif -#endif diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c index e6b19f53b..231c170e7 100644 --- a/net/ax25/ax25_out.c +++ b/net/ax25/ax25_out.c @@ -35,7 +35,6 @@ */ #include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -408,4 +407,3 @@ int ax25_check_iframes_acked(ax25_cb *ax25, unsigned short nr) return 0; } -#endif diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index 32a7ab515..254ff36fb 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c @@ -41,8 +41,6 @@ * Arnaldo C. Melo s/suser/capable/ */ -#include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -64,8 +62,9 @@ #include #include #include +#include -static ax25_route *ax25_route_list = NULL; +static ax25_route *ax25_route_list; static ax25_route *ax25_find_route(ax25_address *, struct net_device *); @@ -434,12 +433,10 @@ struct sk_buff *ax25_rt_build_path(struct sk_buff *skb, ax25_address *src, ax25_ return skb; } -#ifdef MODULE - /* * Free all memory associated with routing structures. */ -void ax25_rt_free(void) +void __exit ax25_rt_free(void) { ax25_route *s, *ax25_rt = ax25_route_list; @@ -453,7 +450,3 @@ void ax25_rt_free(void) kfree(s); } } - -#endif - -#endif diff --git a/net/ax25/ax25_std_in.c b/net/ax25/ax25_std_in.c index 1e27580cf..d1cfc3ff9 100644 --- a/net/ax25/ax25_std_in.c +++ b/net/ax25/ax25_std_in.c @@ -37,8 +37,6 @@ * AX.25 037 Jonathan(G4KLX) New timer architecture. */ -#include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -467,5 +465,3 @@ int ax25_std_frame_in(ax25_cb *ax25, struct sk_buff *skb, int type) return queued; } - -#endif diff --git a/net/ax25/ax25_std_subr.c b/net/ax25/ax25_std_subr.c index 1b1d1c8bb..c868e0507 100644 --- a/net/ax25/ax25_std_subr.c +++ b/net/ax25/ax25_std_subr.c @@ -20,8 +20,6 @@ * AX.25 037 Jonathan(G4KLX) New timer architecture. */ -#include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -102,5 +100,3 @@ void ax25_std_timeout_response(ax25_cb *ax25) ax25->condition &= ~AX25_COND_ACK_PENDING; } - -#endif diff --git a/net/ax25/ax25_std_timer.c b/net/ax25/ax25_std_timer.c index 4e97c51b8..5a2d8771c 100644 --- a/net/ax25/ax25_std_timer.c +++ b/net/ax25/ax25_std_timer.c @@ -22,8 +22,6 @@ * AX.25 037 Jonathan(G4KLX) New timer architecture. */ -#include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -170,5 +168,3 @@ void ax25_std_t1timer_expiry(ax25_cb *ax25) ax25_calculate_t1(ax25); ax25_start_t1timer(ax25); } - -#endif diff --git a/net/ax25/ax25_subr.c b/net/ax25/ax25_subr.c index 97ef02d08..669789646 100644 --- a/net/ax25/ax25_subr.c +++ b/net/ax25/ax25_subr.c @@ -33,8 +33,6 @@ * AX.25 037 Jonathan(G4KLX) New timer architecture. */ -#include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -324,5 +322,3 @@ void ax25_disconnect(ax25_cb *ax25, int reason) ax25->sk->dead = 1; } } - -#endif diff --git a/net/ax25/ax25_timer.c b/net/ax25/ax25_timer.c index 08e190456..01e7596f3 100644 --- a/net/ax25/ax25_timer.c +++ b/net/ax25/ax25_timer.c @@ -26,7 +26,6 @@ */ #include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -255,5 +254,3 @@ static void ax25_idletimer_expiry(unsigned long param) #endif } } - -#endif diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index eb226b14c..603d8b8cc 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c @@ -13,8 +13,6 @@ * AX.25 036 Jonathan(G4KLX) Split from af_ax25.c. */ -#include -#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) #include #include #include @@ -48,7 +46,7 @@ * Callsign/UID mapper. This is in kernel space for security on multi-amateur machines. */ -static ax25_uid_assoc *ax25_uid_list = NULL; +static ax25_uid_assoc *ax25_uid_list; int ax25_uid_policy = 0; @@ -164,12 +162,10 @@ int ax25_uid_get_info(char *buffer, char **start, off_t offset, int length) return len; } -#ifdef MODULE - /* * Free all memory associated with UID/Callsign structures. */ -void ax25_uid_free(void) +void __exit ax25_uid_free(void) { ax25_uid_assoc *s, *ax25_uid = ax25_uid_list; @@ -180,7 +176,3 @@ void ax25_uid_free(void) kfree(s); } } - -#endif - -#endif -- cgit v1.2.3