linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2.6.39] ath9k: fix a regression in PS frame filter handling
@ 2011-05-10 18:52 Felix Fietkau
  2011-05-10 19:32 ` Ben Greear
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2011-05-10 18:52 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, lrodriguez, greearb

Only leave filtering enabled for AP or VLAN interfaces, clear the
destination mask for all other interfaces.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    5 +++++
 drivers/net/wireless/ath/ath9k/xmit.c |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 3de115d..3d999b7 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1778,6 +1778,11 @@ static int ath9k_sta_add(struct ieee80211_hw *hw,
 	struct ieee80211_key_conf ps_key = { };
 
 	ath_node_attach(sc, sta);
+
+	if (vif->type != NL80211_IFTYPE_AP &&
+	    vif->type != NL80211_IFTYPE_AP_VLAN)
+		return 0;
+
 	an->ps_key = ath_key_config(common, vif, sta, &ps_key);
 
 	return 0;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 744779d..97dd1fa 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1845,6 +1845,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_sta *sta = info->control.sta;
+	struct ieee80211_vif *vif = info->control.vif;
 	struct ath_softc *sc = hw->priv;
 	struct ath_txq *txq = txctl->txq;
 	struct ath_buf *bf;
@@ -1882,6 +1883,11 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
 		memmove(skb->data, skb->data + padsize, padpos);
 	}
 
+	if ((vif && vif->type != NL80211_IFTYPE_AP &&
+	            vif->type != NL80211_IFTYPE_AP_VLAN) ||
+	    !ieee80211_is_data(hdr->frame_control))
+		info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
+
 	setup_frame_info(hw, skb, frmlen);
 
 	/*
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 2.6.39] ath9k: fix a regression in PS frame filter handling
  2011-05-10 18:52 [PATCH v2 2.6.39] ath9k: fix a regression in PS frame filter handling Felix Fietkau
@ 2011-05-10 19:32 ` Ben Greear
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Greear @ 2011-05-10 19:32 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, linville, lrodriguez

On 05/10/2011 11:52 AM, Felix Fietkau wrote:
> Only leave filtering enabled for AP or VLAN interfaces, clear the
> destination mask for all other interfaces.

I did a quick test with 32 virtual stations and it seems to
work fine.

Tested-by: Ben Greear <greearb@candelatech.com>


Thanks,
Ben

>
> Signed-off-by: Felix Fietkau<nbd@openwrt.org>
> Reported-by: Ben Greear<greearb@candelatech.com>
> ---
>   drivers/net/wireless/ath/ath9k/main.c |    5 +++++
>   drivers/net/wireless/ath/ath9k/xmit.c |    6 ++++++
>   2 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
> index 3de115d..3d999b7 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -1778,6 +1778,11 @@ static int ath9k_sta_add(struct ieee80211_hw *hw,
>   	struct ieee80211_key_conf ps_key = { };
>
>   	ath_node_attach(sc, sta);
> +
> +	if (vif->type != NL80211_IFTYPE_AP&&
> +	    vif->type != NL80211_IFTYPE_AP_VLAN)
> +		return 0;
> +
>   	an->ps_key = ath_key_config(common, vif, sta,&ps_key);
>
>   	return 0;
> diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
> index 744779d..97dd1fa 100644
> --- a/drivers/net/wireless/ath/ath9k/xmit.c
> +++ b/drivers/net/wireless/ath/ath9k/xmit.c
> @@ -1845,6 +1845,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
>   	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
>   	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
>   	struct ieee80211_sta *sta = info->control.sta;
> +	struct ieee80211_vif *vif = info->control.vif;
>   	struct ath_softc *sc = hw->priv;
>   	struct ath_txq *txq = txctl->txq;
>   	struct ath_buf *bf;
> @@ -1882,6 +1883,11 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
>   		memmove(skb->data, skb->data + padsize, padpos);
>   	}
>
> +	if ((vif&&  vif->type != NL80211_IFTYPE_AP&&
> +	            vif->type != NL80211_IFTYPE_AP_VLAN) ||
> +	    !ieee80211_is_data(hdr->frame_control))
> +		info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
> +
>   	setup_frame_info(hw, skb, frmlen);
>
>   	/*


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-10 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10 18:52 [PATCH v2 2.6.39] ath9k: fix a regression in PS frame filter handling Felix Fietkau
2011-05-10 19:32 ` Ben Greear

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).