Re: [DRIVER][RFC] SC1200 Watchdog driver

From: Joel Becker (jlbec@evilplan.org)
Date: Thu Feb 21 2002 - 10:53:48 EST


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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:34 EST