patch-2.4.3 linux/drivers/net/wan/syncppp.c

Next file: linux/drivers/net/wan/syncppp.h
Previous file: linux/drivers/net/wan/sealevel.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/net/wan/syncppp.c linux/drivers/net/wan/syncppp.c
@@ -42,6 +42,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
+#include <linux/init.h>
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #include <linux/route.h>
@@ -51,7 +52,7 @@
 #include <linux/pkt_sched.h>
 #include <asm/byteorder.h>
 #include <linux/spinlock.h>
-#include "syncppp.h"
+#include <net/syncppp.h>
 
 #define MAXALIVECNT     6               /* max. alive packets */
 
@@ -147,7 +148,6 @@
 
 static int debug = 0;
 
-MODULE_PARM(debug,"1i");
 
 /*
  *	Interface down stub
@@ -208,7 +208,7 @@
 	
 	skb->dev=dev;
 	skb->mac.raw=skb->data;
-	
+
 	if (dev->flags & IFF_RUNNING)
 	{
 		/* Count received bytes, add FCS and one flag */
@@ -1391,28 +1391,25 @@
 };
 
 
-void sync_ppp_init(void)
+
+static int __init sync_ppp_init(void)
 {
+	if(debug)
+		debug=PP_DEBUG;
 	printk(KERN_INFO "Cronyx Ltd, Synchronous PPP and CISCO HDLC (c) 1994\n");
 	printk(KERN_INFO "Linux port (c) 1998 Building Number Three Ltd & Jan \"Yenya\" Kasprzak.\n");
 	spin_lock_init(&spppq_lock);
 	sppp_packet_type.type=htons(ETH_P_WAN_PPP);	
 	dev_add_pack(&sppp_packet_type);
-}
-
-#ifdef MODULE
-
-int init_module(void)
-{
-	if(debug)
-		debug=PP_DEBUG;
-	sync_ppp_init();
 	return 0;
 }
 
-void cleanup_module(void)
+
+static void __exit sync_ppp_cleanup(void)
 {
 	dev_remove_pack(&sppp_packet_type);
 }
 
-#endif
+module_init(sync_ppp_init);
+module_exit(sync_ppp_cleanup);
+MODULE_PARM(debug,"1i");

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)