| Latchesar Ionkov | bd238fb | 2007-07-10 17:57:28 -0500 | [diff] [blame] | 1 | /* | 
 | 2 |  *  net/9p/9p.c | 
 | 3 |  * | 
 | 4 |  *  9P entry point | 
 | 5 |  * | 
 | 6 |  *  Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net> | 
 | 7 |  *  Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> | 
 | 8 |  *  Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov> | 
 | 9 |  * | 
 | 10 |  *  This program is free software; you can redistribute it and/or modify | 
 | 11 |  *  it under the terms of the GNU General Public License version 2 | 
 | 12 |  *  as published by the Free Software Foundation. | 
 | 13 |  * | 
 | 14 |  *  This program is distributed in the hope that it will be useful, | 
 | 15 |  *  but WITHOUT ANY WARRANTY; without even the implied warranty of | 
 | 16 |  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
 | 17 |  *  GNU General Public License for more details. | 
 | 18 |  * | 
 | 19 |  *  You should have received a copy of the GNU General Public License | 
 | 20 |  *  along with this program; if not, write to: | 
 | 21 |  *  Free Software Foundation | 
 | 22 |  *  51 Franklin Street, Fifth Floor | 
 | 23 |  *  Boston, MA  02111-1301  USA | 
 | 24 |  * | 
 | 25 |  */ | 
 | 26 |  | 
 | 27 | #include <linux/module.h> | 
 | 28 | #include <linux/moduleparam.h> | 
 | 29 | #include <net/9p/9p.h> | 
 | 30 |  | 
 | 31 | #ifdef CONFIG_NET_9P_DEBUG | 
 | 32 | unsigned int p9_debug_level = 0;	/* feature-rific global debug level  */ | 
 | 33 | EXPORT_SYMBOL(p9_debug_level); | 
 | 34 | module_param_named(debug, p9_debug_level, uint, 0); | 
 | 35 | MODULE_PARM_DESC(debug, "9P debugging level"); | 
 | 36 | #endif | 
 | 37 |  | 
 | 38 | extern int p9_mux_global_init(void); | 
 | 39 | extern void p9_mux_global_exit(void); | 
 | 40 | extern int p9_sysctl_register(void); | 
 | 41 | extern void p9_sysctl_unregister(void); | 
 | 42 |  | 
 | 43 | /** | 
 | 44 |  * v9fs_init - Initialize module | 
 | 45 |  * | 
 | 46 |  */ | 
 | 47 | static int __init init_p9(void) | 
 | 48 | { | 
 | 49 | 	int ret; | 
 | 50 |  | 
 | 51 | 	p9_error_init(); | 
 | 52 | 	printk(KERN_INFO "Installing 9P2000 support\n"); | 
 | 53 | 	ret = p9_mux_global_init(); | 
 | 54 | 	if (ret) { | 
 | 55 | 		printk(KERN_WARNING "9p: starting mux failed\n"); | 
 | 56 | 		return ret; | 
 | 57 | 	} | 
 | 58 |  | 
 | 59 | 	ret = p9_sysctl_register(); | 
 | 60 | 	if (ret) { | 
 | 61 | 		printk(KERN_WARNING "9p: registering sysctl failed\n"); | 
 | 62 | 		return ret; | 
 | 63 | 	} | 
 | 64 |  | 
 | 65 | 	return ret; | 
 | 66 | } | 
 | 67 |  | 
 | 68 | /** | 
 | 69 |  * v9fs_init - shutdown module | 
 | 70 |  * | 
 | 71 |  */ | 
 | 72 |  | 
 | 73 | static void __exit exit_p9(void) | 
 | 74 | { | 
 | 75 | 	p9_sysctl_unregister(); | 
 | 76 | 	p9_mux_global_exit(); | 
 | 77 | } | 
 | 78 |  | 
 | 79 | module_init(init_p9) | 
 | 80 | module_exit(exit_p9) | 
 | 81 |  | 
 | 82 | MODULE_AUTHOR("Latchesar Ionkov <lucho@ionkov.net>"); | 
 | 83 | MODULE_AUTHOR("Eric Van Hensbergen <ericvh@gmail.com>"); | 
 | 84 | MODULE_AUTHOR("Ron Minnich <rminnich@lanl.gov>"); | 
 | 85 | MODULE_LICENSE("GPL"); |