linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Saravana <saravanad@posedge.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC] mac80211: add debugfs file for mic failure
Date: Tue, 04 Dec 2012 14:24:24 +0100	[thread overview]
Message-ID: <1354627464.9608.0.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <50BDF869.5030702@posedge.com>

On Tue, 2012-12-04 at 18:49 +0530, Saravana wrote:
> The mic failure count will provide the number of mic failure that 
> have happened without a countermeasure being started. Once the 
> countermeasure is started, the counter will be reset to 0.
> This count will be helpful when the consecutive 
> mic failure occur at intervals greater than 60 seconds regularly(frequently).
> 
> Signed-off-by: Saravana <saravanad@posedge.com>
> ---
>  net/mac80211/debugfs_key.c |   20 ++++++++++++++++++++
>  net/mac80211/key.h         |    3 +++
>  net/mac80211/wpa.c         |    2 ++
>  3 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
> index 2d42354..1cc262e 100644
> --- a/net/mac80211/debugfs_key.c
> +++ b/net/mac80211/debugfs_key.c
> @@ -199,6 +199,25 @@ static ssize_t key_icverrors_read(struct file *file, char __user *userbuf,
>  }
>  KEY_OPS(icverrors);
>  
> +static ssize_t key_mic_failures_read(struct file *file, char __user *userbuf,
> +				  size_t count, loff_t *ppos)

please fix indentation

> +{
> +	struct ieee80211_key *key = file->private_data;
> +	char buf[20];
> +	int len;
> +
> +	switch (key->conf.cipher) {
> +	case WLAN_CIPHER_SUITE_TKIP:
> +		len = scnprintf(buf, sizeof(buf), "%u\n",
> +				key->u.tkip.mic_failures);
> +		break;
> +	default:
> +		return 0;
> +	}

I think this should just be

if (key->conf.cipher != TKIP)
	return -EINVAL;

len = scnprintf(...)

> +	return simple_read_from_buffer(userbuf, count, ppos, buf, len);

Other than that looks fine.

johannes


  reply	other threads:[~2012-12-04 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 13:19 [RFC] mac80211: add debugfs file for mic failure Saravana
2012-12-04 13:24 ` Johannes Berg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-26 12:56 saravanad
2012-11-26 15:08 ` Johannes Berg
2012-11-27  5:57   ` Saravana
2012-11-29  6:29     ` Saravana

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=1354627464.9608.0.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=saravanad@posedge.com \
    /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).