ath9k: Remove redundant my beacon check at ath_rx_ps_beacon
Make use of the rx status's is_mybeacon in order to avoid redundant memcmp. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
185d1589cc
commit
f73c604cfb
|
@ -586,22 +586,11 @@ static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb)
|
||||||
|
|
||||||
static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
|
static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct ieee80211_mgmt *mgmt;
|
|
||||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||||
|
|
||||||
if (skb->len < 24 + 8 + 2 + 2)
|
if (skb->len < 24 + 8 + 2 + 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mgmt = (struct ieee80211_mgmt *)skb->data;
|
|
||||||
if (memcmp(common->curbssid, mgmt->bssid, ETH_ALEN) != 0) {
|
|
||||||
/* TODO: This doesn't work well if you have stations
|
|
||||||
* associated to two different APs because curbssid
|
|
||||||
* is just the last AP that any of the stations associated
|
|
||||||
* with.
|
|
||||||
*/
|
|
||||||
return; /* not from our current AP */
|
|
||||||
}
|
|
||||||
|
|
||||||
sc->ps_flags &= ~PS_WAIT_FOR_BEACON;
|
sc->ps_flags &= ~PS_WAIT_FOR_BEACON;
|
||||||
|
|
||||||
if (sc->ps_flags & PS_BEACON_SYNC) {
|
if (sc->ps_flags & PS_BEACON_SYNC) {
|
||||||
|
@ -637,7 +626,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
|
static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb, bool mybeacon)
|
||||||
{
|
{
|
||||||
struct ieee80211_hdr *hdr;
|
struct ieee80211_hdr *hdr;
|
||||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||||
|
@ -646,7 +635,7 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
|
||||||
|
|
||||||
/* Process Beacon and CAB receive in PS state */
|
/* Process Beacon and CAB receive in PS state */
|
||||||
if (((sc->ps_flags & PS_WAIT_FOR_BEACON) || ath9k_check_auto_sleep(sc))
|
if (((sc->ps_flags & PS_WAIT_FOR_BEACON) || ath9k_check_auto_sleep(sc))
|
||||||
&& ieee80211_is_beacon(hdr->frame_control))
|
&& mybeacon)
|
||||||
ath_rx_ps_beacon(sc, skb);
|
ath_rx_ps_beacon(sc, skb);
|
||||||
else if ((sc->ps_flags & PS_WAIT_FOR_CAB) &&
|
else if ((sc->ps_flags & PS_WAIT_FOR_CAB) &&
|
||||||
(ieee80211_is_data(hdr->frame_control) ||
|
(ieee80211_is_data(hdr->frame_control) ||
|
||||||
|
@ -1952,10 +1941,10 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
|
||||||
spin_lock_irqsave(&sc->sc_pm_lock, flags);
|
spin_lock_irqsave(&sc->sc_pm_lock, flags);
|
||||||
|
|
||||||
if ((sc->ps_flags & (PS_WAIT_FOR_BEACON |
|
if ((sc->ps_flags & (PS_WAIT_FOR_BEACON |
|
||||||
PS_WAIT_FOR_CAB |
|
PS_WAIT_FOR_CAB |
|
||||||
PS_WAIT_FOR_PSPOLL_DATA)) ||
|
PS_WAIT_FOR_PSPOLL_DATA)) ||
|
||||||
ath9k_check_auto_sleep(sc))
|
ath9k_check_auto_sleep(sc))
|
||||||
ath_rx_ps(sc, skb);
|
ath_rx_ps(sc, skb, rs.is_mybeacon);
|
||||||
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
|
||||||
|
|
||||||
if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx == 3)
|
if ((ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) && sc->ant_rx == 3)
|
||||||
|
|
Loading…
Reference in New Issue