All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>, linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] ath9k: Handle multiple keys while setting tx filters
Date: Wed, 21 May 2014 14:26:44 +0200	[thread overview]
Message-ID: <537C9B84.7000002@openwrt.org> (raw)
In-Reply-To: <1400671759-30499-1-git-send-email-rmanohar@qti.qualcomm.com>

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(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index 47d442a..89be123 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -1494,6 +1498,19 @@ static int ath9k_sta_remove(struct ieee80211_hw *hw,
>  	return 0;
>  }
>  
> +static inline void ath9k_sta_set_tx_filter(struct ath_hw *ah,
> +					   struct ath_node *an,
> +					   bool set)
I'd suggest dropping the 'inline' - just let the compiler figure out if
it's worth inlining.

> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(an->key_idx); i++) {
> +		if (!an->key_idx[i])
> +			continue;
> +		ath9k_hw_set_tx_filter(ah, an->key_idx[i], set);
> +	}
> +}
> +
>  static void ath9k_sta_notify(struct ieee80211_hw *hw,
>  			 struct ieee80211_vif *vif,
>  			 enum sta_notify_cmd cmd,
> @@ -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.
You also need to add a break here to avoid the WARN_ON below.
Did you test this patch?

> +			}
> +			WARN_ON(i == ARRAY_SIZE(an->key_idx));
> +		}
>  		break;


  reply	other threads:[~2014-05-21 12:26 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 [this message]
2014-05-21 14:16   ` Rajkumar Manoharan
2014-05-21 20:52     ` Felix Fietkau

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=537C9B84.7000002@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.