mirror of https://github.com/hak5/openwrt-owl.git
parent
32a37816c3
commit
8c17d160b3
|
@ -23,9 +23,11 @@
|
||||||
#include <linux/proc_fs.h>
|
#include <linux/proc_fs.h>
|
||||||
#include <linux/ioctl.h>
|
#include <linux/ioctl.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/watchdog.h>
|
||||||
|
#include <linux/miscdevice.h>
|
||||||
#include <asm-mips/ifxmips/ifxmips_wdt.h>
|
#include <asm-mips/ifxmips/ifxmips_wdt.h>
|
||||||
#include <asm-mips/ifxmips/ifxmips.h>
|
#include <asm-mips/ifxmips/ifxmips.h>
|
||||||
#include <linux/platform_device.h>
|
|
||||||
|
|
||||||
#define DRVNAME "ifxmips_wdt"
|
#define DRVNAME "ifxmips_wdt"
|
||||||
|
|
||||||
|
@ -251,28 +253,32 @@ ifxmips_wdt_register_proc_read (char *buf, char **start, off_t offset, int count
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct file_operations wdt_fops = {
|
static const struct file_operations ifxmips_wdt_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.ioctl = ifxmips_wdt_ioctl,
|
.llseek = no_llseek,
|
||||||
.open = ifxmips_wdt_open,
|
.ioctl = ifxmips_wdt_ioctl,
|
||||||
.release = ifxmips_wdt_release,
|
.open = ifxmips_wdt_open,
|
||||||
|
.release = ifxmips_wdt_release,
|
||||||
|
// .write = at91_wdt_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct miscdevice ifxmips_wdt_miscdev = {
|
||||||
|
.minor = WATCHDOG_MINOR,
|
||||||
|
.name = "ifxmips_wdt",
|
||||||
|
.fops = &ifxmips_wdt_fops,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ifxmips_wdt_probe (struct platform_device *pdev)
|
ifxmips_wdt_probe (struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
ifxmips_wdt_major = register_chrdev(0, "wdt", &wdt_fops);
|
int ret = misc_register(&ifxmips_wdt_miscdev);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
if (ifxmips_wdt_major < 0)
|
create_proc_read_entry(DRVNAME, 0, NULL, ifxmips_wdt_register_proc_read, NULL);
|
||||||
{
|
|
||||||
printk("cannot register watchdog device\n");
|
|
||||||
|
|
||||||
return -EINVAL;
|
printk(KERN_INFO DRVNAME ": ifxmips watchdog loaded\n");
|
||||||
}
|
|
||||||
|
|
||||||
create_proc_read_entry("ifxmips_wdt", 0, NULL, ifxmips_wdt_register_proc_read, NULL);
|
|
||||||
|
|
||||||
printk("ifxmips watchdog loaded\n");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -280,7 +286,7 @@ ifxmips_wdt_probe (struct platform_device *pdev)
|
||||||
static int
|
static int
|
||||||
ifxmips_wdt_remove (struct platform_device *pdev)
|
ifxmips_wdt_remove (struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
unregister_chrdev(ifxmips_wdt_major, "wdt");
|
misc_deregister(&ifxmips_wdt_miscdev);
|
||||||
remove_proc_entry(DRVNAME, NULL);
|
remove_proc_entry(DRVNAME, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -312,3 +318,8 @@ ifxmips_wdt_cleanup_module (void)
|
||||||
|
|
||||||
module_init(ifxmips_wdt_init_module);
|
module_init(ifxmips_wdt_init_module);
|
||||||
module_exit(ifxmips_wdt_cleanup_module);
|
module_exit(ifxmips_wdt_cleanup_module);
|
||||||
|
|
||||||
|
MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
|
||||||
|
MODULE_DESCRIPTION("Watchdog driver for infineon ifxmips family");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
|
||||||
|
|
Loading…
Reference in New Issue