linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@iguana.be>
To: dd diasemi <dd.diasemi@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org
Subject: Re: [PATCHv3 7/11] WDT: Watchdog timer module of DA9052 device driver
Date: Wed, 26 Jan 2011 22:13:59 +0100	[thread overview]
Message-ID: <20110126211359.GA3790@infomag.iguana.be> (raw)
In-Reply-To: <AANLkTi=AvA-hOa=5vSoZLMQXsXHdWWieFmCCVx7-p+T4@mail.gmail.com>

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.


           reply	other threads:[~2011-01-26 21:14 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <AANLkTi=AvA-hOa=5vSoZLMQXsXHdWWieFmCCVx7-p+T4@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110126211359.GA3790@infomag.iguana.be \
    --to=wim@iguana.be \
    --cc=dd.diasemi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).