summaryrefslogtreecommitdiffstats
path: root/sys/dev/ipmi
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/ipmi
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/ipmi')
-rw-r--r--sys/dev/ipmi/ipmi.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c
index 194f9d1..a82299c 100644
--- a/sys/dev/ipmi/ipmi.c
+++ b/sys/dev/ipmi/ipmi.c
@@ -649,25 +649,16 @@ ipmi_wd_event(void *arg, unsigned int cmd, int *error)
struct ipmi_softc *sc = arg;
unsigned int timeout;
- /* disable / enable */
- if (!(cmd & WD_ACTIVE)) {
- ipmi_set_watchdog(sc, 0);
- *error = 0;
- return;
- }
-
cmd &= WD_INTERVAL;
- /* convert from power-of-to-ns to WDT ticks */
- if (cmd >= 64) {
- *error = EINVAL;
- return;
+ if (cmd > 0 && cmd <= 63) {
+ timeout = ((uint64_t)1 << cmd) / 1800000000;
+ ipmi_set_watchdog(sc, timeout);
+ *error = 0;
+ } else {
+ ipmi_set_watchdog(sc, 0);
+ if (cmd > 0)
+ *error = 0;
}
- timeout = ((uint64_t)1 << cmd) / 1800000000;
-
- /* reload */
- ipmi_set_watchdog(sc, timeout);
-
- *error = 0;
}
#ifdef CLONING
OpenPOWER on IntegriCloud