Commit 99e13f8b authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] wafer5823wdt.c - patch3

fix MODULE_PARM_DESC for timeout
add WDIOC_SETOPTIONS functionality
parent e73ae66c
......@@ -66,7 +66,7 @@ MODULE_PARM_DESC(wdt_start, "Wafer 5823 WDT 'start' io port (default 0x443)");
static int timeout = WD_TIMO; /* in seconds */
module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) ".");
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1;
......@@ -166,6 +166,26 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd
case WDIOC_GETTIMEOUT:
return put_user(timeout, (int *)arg);
case WDIOC_SETOPTIONS:
{
int options, retval = -EINVAL;
if (get_user(options, (int *)arg))
return -EFAULT;
if (options & WDIOS_DISABLECARD) {
wafwdt_start();
retval = 0;
}
if (options & WDIOS_ENABLECARD) {
wafwdt_stop();
retval = 0;
}
return retval;
}
default:
return -ENOTTY;
}
......
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