1 /* Copyright (c) 2012 Coraid, Inc. See COPYING for GPL terms. */
4 * Module initialization routines, discover timer
7 #include <linux/hdreg.h>
8 #include <linux/blkdev.h>
9 #include <linux/module.h>
10 #include <linux/skbuff.h>
13 MODULE_LICENSE("GPL");
14 MODULE_AUTHOR("Sam Hopkins <sah@coraid.com>");
15 MODULE_DESCRIPTION("AoE block/char driver for 2.6.2 and newer 2.6 kernels");
16 MODULE_VERSION(VERSION
);
18 static struct timer_list timer
;
20 static void discover_timer(struct timer_list
*t
)
22 mod_timer(t
, jiffies
+ HZ
* 60); /* one minute */
24 aoecmd_cfg(0xffff, 0xff);
30 del_timer_sync(&timer
);
33 unregister_blkdev(AOE_MAJOR
, DEVICE_NAME
);
37 aoeblk_exit(); /* free cache after de-allocating bufs */
60 ret
= register_blkdev(AOE_MAJOR
, DEVICE_NAME
);
62 printk(KERN_ERR
"aoe: can't register major\n");
65 printk(KERN_INFO
"aoe: AoE v%s initialised.\n", VERSION
);
67 timer_setup(&timer
, discover_timer
, 0);
68 discover_timer(&timer
);
81 printk(KERN_INFO
"aoe: initialisation failure.\n");
85 module_init(aoe_init
);
86 module_exit(aoe_exit
);