watchdog: hpwdt: Add support for WDIOC_SETOPTIONS
PATCH v2 1/1 watchdog: hpwdt: Add support for WDIOC_SETOPTIONS
WDIOC_SETOPTIONS makes it possible to disable and re-enable the watchdog timer while the hpwdt driver is loaded.
Signed-off-by Jean Delvare <[email protected]>
Cc Wim Van Sebroeck <[email protected]>
---
Untested. It would be great if someone at HP (or anyone with the hardware, I guess) could test and review this patch. Thanks.
Changes since v1:
* Drop useless "ret = 0" statements as suggested by Guenter.
drivers/watchdog/hpwdt.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/watchdog/hpwdt.c +15 -1
@@ -588,7 +588,7 @@ static long hpwdt_ioctl(struct file *fil {void __user *argp = (void __user *)arg;int __user *p = argp; -int new_margin; +int new_margin, options;int ret = -ENOTTY ;switch (cmd) {
@@ -608,6 +608,20 @@ static long hpwdt_ioctl(struct file *fil ret =0 ;break ; +case WDIOC_SETOPTIONS : + ret =get_user (options, p); +if (ret) +break ; + +if (options &WDIOS_DISABLECARD ) +hpwdt_stop (); + +if (options &WDIOS_ENABLECARD ) { +hpwdt_start (); +hpwdt_ping (); + } +break ; +case WDIOC_SETTIMEOUT : ret =get_user (new_margin, p);if (ret)
Signature · 2 lines
Jean Delvare SUSE L3 Support
Quoted 5 lines · Jean Delvare
WDIOC_SETOPTIONSmakes it possible to disable and re-enable the watchdog timer while the hpwdt driver is loaded.Signed-off-by Jean Delvare <[email protected]>Cc Wim Van Sebroeck <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in