summaryrefslogtreecommitdiffstats
path: root/sys/dev/mk48txx
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2006-12-15 21:44:49 +0000
committern_hibma <n_hibma@FreeBSD.org>2006-12-15 21:44:49 +0000
commitc98f016084f145e9f139ad1dfbc2cf59f8188f5e (patch)
tree787bbfce7ce18dfa578e01e209a342d73f933983 /sys/dev/mk48txx
parent705f242eca7e1a52b43a762cced4eaa8de4c0818 (diff)
downloadFreeBSD-src-c98f016084f145e9f139ad1dfbc2cf59f8188f5e.zip
FreeBSD-src-c98f016084f145e9f139ad1dfbc2cf59f8188f5e.tar.gz
Align the interfaces for the various watchdogs and make the interface
behave as expected. Also: - Return an error if WD_PASSIVE is passed in to the ioctl as only WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an explanation of the difference between WD_ACTIVE and WD_PASSIVE. - Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've lost your sense of humor, than don't add a define. Specific changes: i80321_wdog.c Don't roll your own passive watchdog tickle as this would defeat the purpose of an active (userland) watchdog tickle. ichwd.c / ipmi.c: WD_ACTIVE means active patting of the watchdog by a userland process, not whether the watchdog is active. See sys/watchdog.h. kern_clock.c: (software watchdog) Remove a check for WD_ACTIVE as this does not make sense here. This reverts r1.181.
Diffstat (limited to 'sys/dev/mk48txx')
-rw-r--r--sys/dev/mk48txx/mk48txx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/mk48txx/mk48txx.c b/sys/dev/mk48txx/mk48txx.c
index 00afc90..fbc03c4 100644
--- a/sys/dev/mk48txx/mk48txx.c
+++ b/sys/dev/mk48txx/mk48txx.c
@@ -297,7 +297,7 @@ mk48txx_watchdog(void *arg, u_int cmd, int *error)
wdog = 0;
t = cmd & WD_INTERVAL;
- if (cmd != 0 && t >= 26 && t <= 37) {
+ if (cmd > 0 && t >= 26 && t <= 37) {
if (t <= WD_TO_2SEC) {
wdog |= MK48TXX_WDOG_RB_1_16;
t -= 26;
@@ -317,6 +317,8 @@ mk48txx_watchdog(void *arg, u_int cmd, int *error)
if (sc->sc_flag & MK48TXX_WDOG_ENABLE_WDS)
wdog |= MK48TXX_WDOG_WDS;
*error = 0;
+ } else if (cmd > 0) {
+ *error = EINVAL;
}
mtx_lock(&sc->sc_mtx);
(*sc->sc_nvwr)(dev, sc->sc_clkoffset + MK48TXX_WDOG, wdog);
OpenPOWER on IntegriCloud