aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/watchdog/watchdog-api.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/watchdog/watchdog-api.txt')
-rw-r--r--Documentation/watchdog/watchdog-api.txt30
1 files changed, 29 insertions, 1 deletions
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt
index 21ed51173662..7dc2c1c6f779 100644
--- a/Documentation/watchdog/watchdog-api.txt
+++ b/Documentation/watchdog/watchdog-api.txt
@@ -110,7 +110,31 @@ current timeout using the GETTIMEOUT ioctl.
110 ioctl(fd, WDIOC_GETTIMEOUT, &timeout); 110 ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
111 printf("The timeout was is %d seconds\n", timeout); 111 printf("The timeout was is %d seconds\n", timeout);
112 112
113Envinronmental monitoring: 113Pretimeouts:
114
115Some watchdog timers can be set to have a trigger go off before the
116actual time they will reset the system. This can be done with an NMI,
117interrupt, or other mechanism. This allows Linux to record useful
118information (like panic information and kernel coredumps) before it
119resets.
120
121 pretimeout = 10;
122 ioctl(fd, WDIOC_SETPRETIMEOUT, &pretimeout);
123
124Note that the pretimeout is the number of seconds before the time
125when the timeout will go off. It is not the number of seconds until
126the pretimeout. So, for instance, if you set the timeout to 60 seconds
127and the pretimeout to 10 seconds, the pretimout will go of in 50
128seconds. Setting a pretimeout to zero disables it.
129
130There is also a get function for getting the pretimeout:
131
132 ioctl(fd, WDIOC_GETPRETIMEOUT, &timeout);
133 printf("The pretimeout was is %d seconds\n", timeout);
134
135Not all watchdog drivers will support a pretimeout.
136
137Environmental monitoring:
114 138
115All watchdog drivers are required return more information about the system, 139All watchdog drivers are required return more information about the system,
116some do temperature, fan and power level monitoring, some can tell you 140some do temperature, fan and power level monitoring, some can tell you
@@ -169,6 +193,10 @@ The watchdog saw a keepalive ping since it was last queried.
169 193
170 WDIOF_SETTIMEOUT Can set/get the timeout 194 WDIOF_SETTIMEOUT Can set/get the timeout
171 195
196The watchdog can do pretimeouts.
197
198 WDIOF_PRETIMEOUT Pretimeout (in seconds), get/set
199
172 200
173For those drivers that return any bits set in the option field, the 201For those drivers that return any bits set in the option field, the
174GETSTATUS and GETBOOTSTATUS ioctls can be used to ask for the current 202GETSTATUS and GETBOOTSTATUS ioctls can be used to ask for the current