aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-05-23 02:58:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-24 15:07:43 -0400
commitededf1f82ac8f06a0311097a68ccb582d32e70d5 (patch)
tree28109d81b558d3548cdc004a352c9930b1ab7f7d /drivers/net/wireless
parenta0c9101c05389e69a5382967667ca686a8d8fbd3 (diff)
ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep
The functionality to keep the device awake until it is done with the rx of any mcast/bcast frames which are pending on AP should also be added to the hardwares which support auto sleep feature. This patch fixes frequent failures in ARP resolution when it is initiated by the other end. Currently auto sleep is enabled only for ar9003 in ath9k. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ba139132c85f..ca6065b71b46 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -19,6 +19,12 @@
19 19
20#define SKB_CB_ATHBUF(__skb) (*((struct ath_buf **)__skb->cb)) 20#define SKB_CB_ATHBUF(__skb) (*((struct ath_buf **)__skb->cb))
21 21
22static inline bool ath9k_check_auto_sleep(struct ath_softc *sc)
23{
24 return sc->ps_enabled &&
25 (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP);
26}
27
22static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc, 28static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc,
23 struct ieee80211_hdr *hdr) 29 struct ieee80211_hdr *hdr)
24{ 30{
@@ -616,8 +622,8 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
616 hdr = (struct ieee80211_hdr *)skb->data; 622 hdr = (struct ieee80211_hdr *)skb->data;
617 623
618 /* Process Beacon and CAB receive in PS state */ 624 /* Process Beacon and CAB receive in PS state */
619 if ((sc->ps_flags & PS_WAIT_FOR_BEACON) && 625 if (((sc->ps_flags & PS_WAIT_FOR_BEACON) || ath9k_check_auto_sleep(sc))
620 ieee80211_is_beacon(hdr->frame_control)) 626 && ieee80211_is_beacon(hdr->frame_control))
621 ath_rx_ps_beacon(sc, skb); 627 ath_rx_ps_beacon(sc, skb);
622 else if ((sc->ps_flags & PS_WAIT_FOR_CAB) && 628 else if ((sc->ps_flags & PS_WAIT_FOR_CAB) &&
623 (ieee80211_is_data(hdr->frame_control) || 629 (ieee80211_is_data(hdr->frame_control) ||
@@ -932,9 +938,10 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
932 sc->rx.rxotherant = 0; 938 sc->rx.rxotherant = 0;
933 } 939 }
934 940
935 if (unlikely(sc->ps_flags & (PS_WAIT_FOR_BEACON | 941 if (unlikely(ath9k_check_auto_sleep(sc) ||
936 PS_WAIT_FOR_CAB | 942 (sc->ps_flags & (PS_WAIT_FOR_BEACON |
937 PS_WAIT_FOR_PSPOLL_DATA))) 943 PS_WAIT_FOR_CAB |
944 PS_WAIT_FOR_PSPOLL_DATA))))
938 ath_rx_ps(sc, skb); 945 ath_rx_ps(sc, skb);
939 946
940 ath_rx_send_to_mac80211(hw, sc, skb, rxs); 947 ath_rx_send_to_mac80211(hw, sc, skb, rxs);