* <rob@osinvestor.com> Return proper status instead of temperature warning
* Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls
* Fix CONFIG_WATCHDOG_NOWAYOUT
+ * 20020530 Joel Becker Add Matt Domsch's nowayout module option
+ *
*/
#include <linux/config.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/isapnp.h>
+#include <linux/pci.h>
#define SC1200_MODULE_VER "build 20020303"
#define SC1200_MODULE_NAME "sc1200wdt"
MODULE_PARM(timeout, "i");
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 */
{
int new_timeout;
static struct watchdog_info ident = {
- options: WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT,
- firmware_version: 0,
- identity: "PC87307/PC97307"
+ .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
+ .firmware_version = 0,
+ .identity = "PC87307/PC97307"
};
switch (cmd) {
return -ESPIPE;
if (len) {
-#ifndef CONFIG_WATCHDOG_NOWAYOUT
- size_t i;
+ if (!nowayout) {
+ size_t i;
- expect_close = 0;
+ expect_close = 0;
- for (i = 0; i != len; i++)
- {
- char c;
- if(get_user(c, data+i))
- return -EFAULT;
- if (c == 'V')
- expect_close = 42;
+ for (i = 0; i != len; i++) {
+ char c;
+
+ if (get_user(c, data+i))
+ return -EFAULT;
+ if (c == 'V')
+ expect_close = 42;
+ }
}
-#endif
+
sc1200wdt_write_data(WDTO, timeout);
return len;
}