* [PATCH] ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep
@ 2010-05-19 0:31 Vasanthakumar Thiagarajan
2010-05-22 19:08 ` Kalle Valo
0 siblings, 1 reply; 3+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-05-19 0:31 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index f0f5f5e..146e79d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -18,6 +18,9 @@
#include "ar9003_mac.h"
#define SKB_CB_ATHBUF(__skb) (*((struct ath_buf **)__skb->cb))
+#define ATH9K_CHECK_AUTO_SLEEP(__sc) \
+ (__sc->ps_enabled && \
+ (__sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc,
struct ieee80211_hdr *hdr)
@@ -616,8 +619,8 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
hdr = (struct ieee80211_hdr *)skb->data;
/* Process Beacon and CAB receive in PS state */
- if ((sc->ps_flags & PS_WAIT_FOR_BEACON) &&
- ieee80211_is_beacon(hdr->frame_control))
+ if (((sc->ps_flags & PS_WAIT_FOR_BEACON) || ATH9K_CHECK_AUTO_SLEEP(sc))
+ && ieee80211_is_beacon(hdr->frame_control))
ath_rx_ps_beacon(sc, skb);
else if ((sc->ps_flags & PS_WAIT_FOR_CAB) &&
(ieee80211_is_data(hdr->frame_control) ||
@@ -945,9 +948,10 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
sc->rx.rxotherant = 0;
}
- if (unlikely(sc->ps_flags & (PS_WAIT_FOR_BEACON |
- PS_WAIT_FOR_CAB |
- PS_WAIT_FOR_PSPOLL_DATA)))
+ if (unlikely(ATH9K_CHECK_AUTO_SLEEP(sc) ||
+ (sc->ps_flags & (PS_WAIT_FOR_BEACON |
+ PS_WAIT_FOR_CAB |
+ PS_WAIT_FOR_PSPOLL_DATA))))
ath_rx_ps(sc, skb);
ath_rx_send_to_mac80211(hw, sc, skb, rxs);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep
2010-05-19 0:31 [PATCH] ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep Vasanthakumar Thiagarajan
@ 2010-05-22 19:08 ` Kalle Valo
2010-05-23 6:48 ` Vasanthakumar Thiagarajan
0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2010-05-22 19:08 UTC (permalink / raw)
To: Vasanthakumar Thiagarajan; +Cc: linville, linux-wireless
Vasanthakumar Thiagarajan <vasanth@atheros.com> writes:
> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Please describe more, this isn't very informative (if any). Especially
try to answer in the commit log:
o What was the original bug? How and why did it happen?
o How was it visible to the user?
o How does the fix actually fix the issue?
o In what version was the bug introduced? This helps backporters.
Powersave in 802.11 is very fragile and more information there is, the
easier it is to handle the issues.
> +#define ATH9K_CHECK_AUTO_SLEEP(__sc) \
> + (__sc->ps_enabled && \
> + (__sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
Like Andrew Morton says: use C instead of CPP. Meaning that this can
be an inline function instead of a macro.
--
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep
2010-05-22 19:08 ` Kalle Valo
@ 2010-05-23 6:48 ` Vasanthakumar Thiagarajan
0 siblings, 0 replies; 3+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-05-23 6:48 UTC (permalink / raw)
To: Kalle Valo
Cc: Vasanth Thiagarajan, linville@tuxdriver.com,
linux-wireless@vger.kernel.org
On Sun, May 23, 2010 at 12:38:48AM +0530, Kalle Valo wrote:
> Vasanthakumar Thiagarajan <vasanth@atheros.com> writes:
>
> > Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
>
> Please describe more, this isn't very informative (if any). Especially
> try to answer in the commit log:
>
> o What was the original bug? How and why did it happen?
> o How was it visible to the user?
> o How does the fix actually fix the issue?
Sure.
> o In what version was the bug introduced? This helps backporters.
This patch is only for ar9003 and its support is added only
recently. No released kernel has the support for this chip.
>
> > +#define ATH9K_CHECK_AUTO_SLEEP(__sc) \
> > + (__sc->ps_enabled && \
> > + (__sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
>
> Like Andrew Morton says: use C instead of CPP. Meaning that this can
> be an inline function instead of a macro.
will do, thanks.
Vasanth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-23 6:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 0:31 [PATCH] ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep Vasanthakumar Thiagarajan
2010-05-22 19:08 ` Kalle Valo
2010-05-23 6:48 ` Vasanthakumar Thiagarajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox