| /* Copyright (c) 2012 Coraid, Inc. See COPYING for GPL terms. */ |
| * Module initialization routines, discover timer |
| #include <linux/blkdev.h> |
| #include <linux/module.h> |
| #include <linux/skbuff.h> |
| MODULE_AUTHOR("Sam Hopkins <sah@coraid.com>"); |
| MODULE_DESCRIPTION("AoE block/char driver for 2.6.2 and newer 2.6 kernels"); |
| static struct timer_list timer; |
| static void discover_timer(struct timer_list *t) |
| mod_timer(t, jiffies + HZ * 60); /* one minute */ |
| aoecmd_cfg(0xffff, 0xff); |
| unregister_blkdev(AOE_MAJOR, DEVICE_NAME); |
| aoeblk_exit(); /* free cache after de-allocating bufs */ |
| ret = register_blkdev(AOE_MAJOR, DEVICE_NAME); |
| printk(KERN_ERR "aoe: can't register major\n"); |
| printk(KERN_INFO "aoe: AoE v%s initialised.\n", VERSION); |
| timer_setup(&timer, discover_timer, 0); |
| printk(KERN_INFO "aoe: initialisation failure.\n"); |