Commit 15e13a00 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[WATCHDOG] SC1200WDT nowayout fixes from 2.4

parent 3e0b5757
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* <rob@osinvestor.com> Return proper status instead of temperature warning * <rob@osinvestor.com> Return proper status instead of temperature warning
* Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls * Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls
* Fix CONFIG_WATCHDOG_NOWAYOUT * Fix CONFIG_WATCHDOG_NOWAYOUT
* 20020530 Joel Becker Add Matt Domsch's nowayout module option
*
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/isapnp.h> #include <linux/isapnp.h>
#include <linux/pci.h>
#define SC1200_MODULE_VER "build 20020303" #define SC1200_MODULE_VER "build 20020303"
#define SC1200_MODULE_NAME "sc1200wdt" #define SC1200_MODULE_NAME "sc1200wdt"
...@@ -86,6 +89,15 @@ MODULE_PARM_DESC(io, "io port"); ...@@ -86,6 +89,15 @@ MODULE_PARM_DESC(io, "io port");
MODULE_PARM(timeout, "i"); MODULE_PARM(timeout, "i");
MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1"); MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1");
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1;
#else
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
/* Read from Data Register */ /* Read from Data Register */
...@@ -161,9 +173,9 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int ...@@ -161,9 +173,9 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int
{ {
int new_timeout; int new_timeout;
static struct watchdog_info ident = { static struct watchdog_info ident = {
options: WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT, .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
firmware_version: 0, .firmware_version = 0,
identity: "PC87307/PC97307" .identity = "PC87307/PC97307"
}; };
switch (cmd) { switch (cmd) {
...@@ -246,20 +258,21 @@ static ssize_t sc1200wdt_write(struct file *file, const char *data, size_t len, ...@@ -246,20 +258,21 @@ static ssize_t sc1200wdt_write(struct file *file, const char *data, size_t len,
return -ESPIPE; return -ESPIPE;
if (len) { if (len) {
#ifndef CONFIG_WATCHDOG_NOWAYOUT if (!nowayout) {
size_t i; size_t i;
expect_close = 0; expect_close = 0;
for (i = 0; i != len; i++) for (i = 0; i != len; i++) {
{ char c;
char c;
if(get_user(c, data+i)) if (get_user(c, data+i))
return -EFAULT; return -EFAULT;
if (c == 'V') if (c == 'V')
expect_close = 42; expect_close = 42;
}
} }
#endif
sc1200wdt_write_data(WDTO, timeout); sc1200wdt_write_data(WDTO, timeout);
return len; return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment