Skip to content

Commit

Permalink
watchdog: WatchDog Timer Driver Core - Add WDIOC_KEEPALIVE ioctl
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Wolfram Sang <[email protected]>
  • Loading branch information
Wim Van Sebroeck committed Jul 28, 2011
1 parent 2fa0356 commit c2dc00e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Documentation/watchdog/watchdog-kernel-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ they are supported. These optional routines/operations are:
the watchdog timer driver core does: to send a keepalive ping to the watchdog
timer hardware it will either use the ping operation (when available) or the
start operation (when the ping operation is not available).
(Note: the WDIOC_KEEPALIVE ioctl call will only be active when the
WDIOF_KEEPALIVEPING bit has been set in the option field on the watchdog's
info structure).
* status: this routine checks the status of the watchdog timer device. The
status of the device is reported with watchdog WDIOF_* status flags/bits.

Expand Down
5 changes: 5 additions & 0 deletions drivers/watchdog/watchdog_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c2dc00e

Please sign in to comment.