aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/watchdog.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/watchdog.h')
-rw-r--r--include/linux/watchdog.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index d74a0e907b9e..027b1f43f12d 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -24,8 +24,8 @@ struct watchdog_device;
24 * @stop: The routine for stopping the watchdog device. 24 * @stop: The routine for stopping the watchdog device.
25 * @ping: The routine that sends a keepalive ping to the watchdog device. 25 * @ping: The routine that sends a keepalive ping to the watchdog device.
26 * @status: The routine that shows the status of the watchdog device. 26 * @status: The routine that shows the status of the watchdog device.
27 * @set_timeout:The routine for setting the watchdog devices timeout value. 27 * @set_timeout:The routine for setting the watchdog devices timeout value (in seconds).
28 * @get_timeleft:The routine that get's the time that's left before a reset. 28 * @get_timeleft:The routine that gets the time left before a reset (in seconds).
29 * @ref: The ref operation for dyn. allocated watchdog_device structs 29 * @ref: The ref operation for dyn. allocated watchdog_device structs
30 * @unref: The unref operation for dyn. allocated watchdog_device structs 30 * @unref: The unref operation for dyn. allocated watchdog_device structs
31 * @ioctl: The routines that handles extra ioctl calls. 31 * @ioctl: The routines that handles extra ioctl calls.
@@ -33,7 +33,7 @@ struct watchdog_device;
33 * The watchdog_ops structure contains a list of low-level operations 33 * The watchdog_ops structure contains a list of low-level operations
34 * that control a watchdog device. It also contains the module that owns 34 * that control a watchdog device. It also contains the module that owns
35 * these operations. The start and stop function are mandatory, all other 35 * these operations. The start and stop function are mandatory, all other
36 * functions are optonal. 36 * functions are optional.
37 */ 37 */
38struct watchdog_ops { 38struct watchdog_ops {
39 struct module *owner; 39 struct module *owner;
@@ -59,9 +59,9 @@ struct watchdog_ops {
59 * @info: Pointer to a watchdog_info structure. 59 * @info: Pointer to a watchdog_info structure.
60 * @ops: Pointer to the list of watchdog operations. 60 * @ops: Pointer to the list of watchdog operations.
61 * @bootstatus: Status of the watchdog device at boot. 61 * @bootstatus: Status of the watchdog device at boot.
62 * @timeout: The watchdog devices timeout value. 62 * @timeout: The watchdog devices timeout value (in seconds).
63 * @min_timeout:The watchdog devices minimum timeout value. 63 * @min_timeout:The watchdog devices minimum timeout value (in seconds).
64 * @max_timeout:The watchdog devices maximum timeout value. 64 * @max_timeout:The watchdog devices maximum timeout value (in seconds).
65 * @driver-data:Pointer to the drivers private data. 65 * @driver-data:Pointer to the drivers private data.
66 * @lock: Lock for watchdog core internal use only. 66 * @lock: Lock for watchdog core internal use only.
67 * @status: Field that contains the devices internal status bits. 67 * @status: Field that contains the devices internal status bits.
@@ -119,8 +119,15 @@ static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool noway
119/* Use the following function to check if a timeout value is invalid */ 119/* Use the following function to check if a timeout value is invalid */
120static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t) 120static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t)
121{ 121{
122 return ((wdd->max_timeout != 0) && 122 /*
123 (t < wdd->min_timeout || t > wdd->max_timeout)); 123 * The timeout is invalid if
124 * - the requested value is smaller than the configured minimum timeout,
125 * or
126 * - a maximum timeout is configured, and the requested value is larger
127 * than the maximum timeout.
128 */
129 return t < wdd->min_timeout ||
130 (wdd->max_timeout && t > wdd->max_timeout);
124} 131}
125 132
126/* Use the following functions to manipulate watchdog driver specific data */ 133/* Use the following functions to manipulate watchdog driver specific data */