linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCHv3 7/11] WDT: Watchdog timer module of DA9052 device driver
       [not found] <AANLkTi=AvA-hOa=5vSoZLMQXsXHdWWieFmCCVx7-p+T4@mail.gmail.com>
@ 2011-01-26 21:13 ` Wim Van Sebroeck
  0 siblings, 0 replies; only message in thread
From: Wim Van Sebroeck @ 2011-01-26 21:13 UTC (permalink / raw)
  To: dd diasemi; +Cc: linux-kernel, linux-watchdog

Hi,

> +static long da9052_wdt_ioctl(struct file *file, unsigned int cmd,
> +				unsigned long arg)
> +{
> +	struct da9052_wdt *wdt = get_wdt_da9052();
> +	void __user *argp = (void __user *)arg;
> +	int __user *p = argp;
> +	unsigned char new_value;
> +
> +	switch (cmd) {
> +
> +	case WDIOC_GETSUPPORT:
> +		return copy_to_user(argp, &da9052_wdt_info,
> +			sizeof(da9052_wdt_info)) ? -EFAULT : 0;
> +	case WDIOC_GETSTATUS:
> +	case WDIOC_GETBOOTSTATUS:
> +		return put_user(0, p);
> +	case WDIOC_SETOPTIONS:
> +		if (get_user(new_value, p))
> +			return -EFAULT;
> +		if (new_value & DA9052_STROBING_FILTER_ENABLE)
> +			da9052_sm_set_strobing_filter(wdt, ENABLE);
> +		if (new_value & DA9052_STROBING_FILTER_DISABLE)
> +			da9052_sm_set_strobing_filter(wdt, DISABLE);
> +		if (new_value & DA9052_SET_STROBING_MODE_MANUAL)
> +			da9052_sm_set_strobing_mode(DA9052_STROBE_MANUAL);
> +		if (new_value & DA9052_SET_STROBING_MODE_AUTO)
> +			da9052_sm_set_strobing_mode(DA9052_STROBE_AUTO);
> +		return 0;

The ioctl WDIOC_SETOPTIONS call is not in line with the watchdog API.
the supported options are:
#define	WDIOS_DISABLECARD	0x0001	/* Turn off the watchdog timer */
#define	WDIOS_ENABLECARD	0x0002	/* Turn on the watchdog timer */
#define	WDIOS_TEMPPANIC		0x0004	/* Kernel panic on temperature trip */

Your options are:
#define DA9052_STROBING_FILTER_ENABLE	0x0001
#define DA9052_STROBING_FILTER_DISABLE	0x0002
#define DA9052_SET_STROBING_MODE_MANUAL	0x0004
#define DA9052_SET_STROBING_MODE_AUTO	0x0008

Please explain what you want to do.

Thanks in advance,
Wim.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-26 21:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <AANLkTi=AvA-hOa=5vSoZLMQXsXHdWWieFmCCVx7-p+T4@mail.gmail.com>
2011-01-26 21:13 ` [PATCHv3 7/11] WDT: Watchdog timer module of DA9052 device driver Wim Van Sebroeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).