ath5k: enable Power-Save Polls by setting the association ID
[linux-2.6.git] / drivers / net / wireless / ath / ath5k / base.c
index 01da83d75ef4b6d530aa5ab9483ebc401c681d66..07c1e52b5a0c9f190f87370801e96ce909d68ab1 100644 (file)
@@ -3211,8 +3211,7 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
        if (changes & BSS_CHANGED_BSSID) {
                /* Cache for later use during resets */
                memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
-               /* XXX: assoc id is set to 0 for now, mac80211 doesn't have
-                * a clean way of letting us retrieve this yet. */
+               common->curaid = 0;
                ath5k_hw_set_associd(ah);
                mmiowb();
        }
@@ -3226,6 +3225,14 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
                        set_beacon_filter(hw, sc->assoc);
                ath5k_hw_set_ledstate(sc->ah, sc->assoc ?
                        AR5K_LED_ASSOC : AR5K_LED_INIT);
+               if (bss_conf->assoc) {
+                       ATH5K_DBG(sc, ATH5K_DEBUG_ANY,
+                                 "Bss Info ASSOC %d, bssid: %pM\n",
+                                 bss_conf->aid, common->curbssid);
+                       common->curaid = bss_conf->aid;
+                       ath5k_hw_set_associd(ah);
+                       /* Once ANI is available you would start it here */
+               }
        }
 
        if (changes & BSS_CHANGED_BEACON) {