ath9k: fix a regression in PS frame filter handling
authorFelix Fietkau <nbd@openwrt.org>
Tue, 10 May 2011 18:52:22 +0000 (20:52 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 11 May 2011 18:50:40 +0000 (14:50 -0400)
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>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/xmit.c

index 9dd72d8c78ec0cd3a76e0faddf72c211f5754865..33816091b4396bda949ee0f8a153f8e34867637b 100644 (file)
@@ -1782,6 +1782,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;
index 947d5b3b6e05eeed05ee824087e93b4345fa6ff4..41469d7a2cda0700daf3fd98634364dd46735563 100644 (file)
@@ -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);
 
        /*