forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
watchdog: Read device status through sysfs attributes
This patch adds following attributes to watchdog device's sysfs interface to read its different status. * state - reads whether device is active or not * identity - reads Watchdog device's identity string. * timeout - reads current timeout. * timeleft - reads timeleft before watchdog generates a reset * bootstatus - reads status of the watchdog device at boot * status - reads watchdog device's internal status bits * nowayout - reads whether nowayout feature was set or not Testing with iTCO_wdt: # cd /sys/class/watchdog/watchdog1/ # ls bootstatus dev device identity nowayout power state subsystem timeleft timeout uevent # cat identity iTCO_wdt # cat timeout 30 # cat state inactive # echo > /dev/watchdog1 # cat timeleft 26 # cat state active # cat bootstatus 0 # cat nowayout 0 Signed-off-by: Pratyush Anand <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
- Loading branch information
Pratyush Anand
authored and
Wim Van Sebroeck
committed
Dec 27, 2015
1 parent
906d7a5
commit 33b7112
Showing
4 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
What: /sys/class/watchdog/watchdogn/bootstatus | ||
Date: August 2015 | ||
Contact: Wim Van Sebroeck <[email protected]> | ||
Description: | ||
It is a read only file. It contains status of the watchdog | ||
device at boot. It is equivalent to WDIOC_GETBOOTSTATUS of | ||
ioctl interface. | ||
|
||
What: /sys/class/watchdog/watchdogn/identity | ||
Date: August 2015 | ||
Contact: Wim Van Sebroeck <[email protected]> | ||
Description: | ||
It is a read only file. It contains identity string of | ||
watchdog device. | ||
|
||
What: /sys/class/watchdog/watchdogn/nowayout | ||
Date: August 2015 | ||
Contact: Wim Van Sebroeck <[email protected]> | ||
Description: | ||
It is a read only file. While reading, it gives '1' if that | ||
device supports nowayout feature else, it gives '0'. | ||
|
||
What: /sys/class/watchdog/watchdogn/state | ||
Date: August 2015 | ||
Contact: Wim Van Sebroeck <[email protected]> | ||
Description: | ||
It is a read only file. It gives active/inactive status of | ||
watchdog device. | ||
|
||
What: /sys/class/watchdog/watchdogn/status | ||
Date: August 2015 | ||
Contact: Wim Van Sebroeck <[email protected]> | ||
Description: | ||
It is a read only file. It contains watchdog device's | ||
internal status bits. It is equivalent to WDIOC_GETSTATUS | ||
of ioctl interface. | ||
|
||
What: /sys/class/watchdog/watchdogn/timeleft | ||
Date: August 2015 | ||
Contact: Wim Van Sebroeck <[email protected]> | ||
Description: | ||
It is a read only file. It contains value of time left for | ||
reset generation. It is equivalent to WDIOC_GETTIMELEFT of | ||
ioctl interface. | ||
|
||
What: /sys/class/watchdog/watchdogn/timeout | ||
Date: August 2015 | ||
Contact: Wim Van Sebroeck <[email protected]> | ||
Description: | ||
It is a read only file. It is read to know about current | ||
value of timeout programmed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters