Re: [DRIVER][RFC] SC1200 Watchdog driver

Joel Becker
2002-02-21T15:54:14Z

On Thu, Feb 21, 2002 at 01:57:43PM +0100, Christer Weinigel wrote:
> I'm not even sure if single-open sematics are neccesary at all, but I
> copied most of the interface from wdt285.c so I copied this too. The
> watchdog API seems to be a rather ad hoc thing. For example I just
> noticed that the WDIOC_SETTIMEOUT call probably takes a parameter
> which seems to be minutes, not seconds. "Someone (tm)" ought to write
> a more formal API specification.

WDIOC_SETTIMEOUT is defined as being in seconds. This is
commented in linux/watchdog.h against the WDIOF_SETTIMOUT flag. Where
you see funky math against the passed parameter is where a watchdog card
takes strange values on its hardware and the driver is computing the
proper strange value for the given amount of seconds.
Also note that WDIOC_SETTIMEOUT rounds up to the nearest second
interval the watchdog can handle if the watchdog cannot support the
passed interval. For this reason, it always returns the actual timeout
set in the passed int*. This is usually done with the fall-through to
the WDIOC_GETTIMEOUT code.
You don't see WDIOC_SETTIMEOUT in 2.4.17 because it was added in
2.4.18pre.

Joel

--

"To fall in love is to create a religion that has a fallible god."
-Jorge Luis Borges

http://www.jlbec.org/
jlbec@evilplan.org