ath9k: Fix improper beacon slot selection in IBSS
authorRajkumar Manoharan <rmanoharan@atheros.com>
Tue, 12 Apr 2011 11:59:29 +0000 (17:29 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 14 Apr 2011 19:35:07 +0000 (15:35 -0400)
Request a re-configuration of Beacon related timers
on the receipt of the first Beacon frame has to be set only
for station mode. Setting beacon sync for IBSS is causing
wrong beacon slot selection on beacon generation.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/beacon.c

index b56f69e7677b30f8ac759767390e1a4c805fc2fa..9193a385ceb20e222ba8f093f5b2eb592436a8c1 100644 (file)
@@ -744,7 +744,6 @@ void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
                cur_conf->dtim_period = 1;
 
        ath_set_beacon(sc);
-       sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
 }
 
 void ath_set_beacon(struct ath_softc *sc)
@@ -762,6 +761,12 @@ void ath_set_beacon(struct ath_softc *sc)
                break;
        case NL80211_IFTYPE_STATION:
                ath_beacon_config_sta(sc, cur_conf);
+               /*
+                * Request a re-configuration of Beacon related timers
+                * on the receipt of the first Beacon frame (i.e.,
+                * after time sync with the AP).
+                */
+               sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
                break;
        default:
                ath_dbg(common, ATH_DBG_CONFIG,