watchdog: WatchDog Timer Driver Core - Add WDIOC_KEEPALIVE ioctl
This part add's the WDIOC_KEEPALIVE ioctl functionality to the WatchDog Timer Driver Core framework. Please note that the WDIOF_KEEPALIVEPING bit has to be set in the watchdog_info options field. Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
This commit is contained in:
@@ -120,6 +120,11 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
|
||||
return put_user(val, p);
|
||||
case WDIOC_GETBOOTSTATUS:
|
||||
return put_user(wdd->bootstatus, p);
|
||||
case WDIOC_KEEPALIVE:
|
||||
if (!(wdd->info->options & WDIOF_KEEPALIVEPING))
|
||||
return -EOPNOTSUPP;
|
||||
watchdog_ping(wdd);
|
||||
return 0;
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
Reference in New Issue
Block a user