linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] ath9k: Handle multiple keys while setting tx filters
Date: Wed, 21 May 2014 22:52:16 +0200	[thread overview]
Message-ID: <537D1200.1020700@openwrt.org> (raw)
In-Reply-To: <20140521141632.GA5922@qca.qualcomm.com>

On 2014-05-21 16:16, Rajkumar Manoharan wrote:
> On Wed, May 21, 2014 at 02:26:44PM +0200, Felix Fietkau wrote:
>> On 2014-05-21 13:29, Rajkumar Manoharan wrote:
>> > The keycache index is used to abort transmission for given station
>> > when it goes to sleep state. But the commit "ath9k_hw: Abort transmission
>> > for sleeping station" is not handling multi-key station. Fix that.
>> > 
>> > Cc: Felix Fietkau <nbd@openwrt.org>
>> > Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
>> > ---
>> >  drivers/net/wireless/ath/ath9k/ath9k.h |  1 +
>> >  drivers/net/wireless/ath/ath9k/main.c  | 52 +++++++++++++++++++++++++++-------
>> >  2 files changed, 42 insertions(+), 11 deletions(-)
>> > 
>> > @@ -1610,11 +1626,25 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
>> >  				key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
>> >  			ret = 0;
>> >  		}
>> > +		if (an && key->hw_key_idx) {
>> > +			for (i = 0; i < ARRAY_SIZE(an->key_idx); i++) {
>> > +				if (an->key_idx[i])
>> > +					continue;
>> > +				an->key_idx[i] = key->hw_key_idx;
>> I think this should be moved inside the ret >= 0 test.
> Since key->hw_key_idx is valid only when ret > 0, this change is moved
> out of ret check to avoid additional indentation.
That's my point. key->hw_key_idx is valid only when ret >= 0, are you
sure that it's always zero before attempting to set it in hw?

Not sure if a key can be disabled from mac80211 and then enabled again,
but that's one scenario I can come up with, where hw_key_idx might be stale.

It might be a good idea to initialize it to zero if adding the key
failed (and also when disabling it).

- Felix

      reply	other threads:[~2014-05-21 20:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21 11:29 [PATCH v2] ath9k: Handle multiple keys while setting tx filters Rajkumar Manoharan
2014-05-21 12:26 ` Felix Fietkau
2014-05-21 14:16   ` Rajkumar Manoharan
2014-05-21 20:52     ` Felix Fietkau [this message]

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=537D1200.1020700@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rmanohar@qti.qualcomm.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).