]> git.karo-electronics.de Git - linux-beck.git/commitdiff
wlcore: reconfigure rate policy on association
authorEliad Peller <eliad@wizery.com>
Tue, 20 Nov 2012 11:20:09 +0000 (13:20 +0200)
committerLuciano Coelho <coelho@ti.com>
Tue, 27 Nov 2012 08:49:10 +0000 (10:49 +0200)
When first configuring the rate policy, before auth,
we still don't have the correct rates that were
agreed during association.

Reconfigure the rate policy on association in order
to update them.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/ti/wlcore/main.c

index ef1fd0435947ed0b9c791b0e86153ecf06bba420..87fa426c46f288336ddec87f70726f4883aa8e0e 100644 (file)
@@ -2553,7 +2553,8 @@ static int wlcore_set_ssid(struct wl1271 *wl, struct wl12xx_vif *wlvif)
 }
 
 static int wlcore_set_assoc(struct wl1271 *wl, struct wl12xx_vif *wlvif,
-                           struct ieee80211_bss_conf *bss_conf)
+                           struct ieee80211_bss_conf *bss_conf,
+                           u32 sta_rate_set)
 {
        int ieoffset;
        int ret;
@@ -2619,6 +2620,18 @@ static int wlcore_set_assoc(struct wl1271 *wl, struct wl12xx_vif *wlvif,
         * setting is off (ACTIVE), so sync the fw with the correct value.
         */
        ret = wl1271_ps_set_mode(wl, wlvif, STATION_ACTIVE_MODE);
+       if (ret < 0)
+               return ret;
+
+       if (sta_rate_set) {
+               wlvif->rate_set =
+                       wl1271_tx_enabled_rates_get(wl,
+                                                   sta_rate_set,
+                                                   wlvif->band);
+               ret = wl1271_acx_sta_rate_policies(wl, wlvif);
+               if (ret < 0)
+                       return ret;
+       }
 
        return ret;
 }
@@ -3912,7 +3925,8 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
                wlvif->rssi_thold = bss_conf->cqm_rssi_thold;
        }
 
-       if (changed & (BSS_CHANGED_BSSID | BSS_CHANGED_HT)) {
+       if (changed & (BSS_CHANGED_BSSID | BSS_CHANGED_HT |
+                      BSS_CHANGED_ASSOC)) {
                rcu_read_lock();
                sta = ieee80211_find_sta(vif, bss_conf->bssid);
                if (!sta)
@@ -3982,7 +3996,8 @@ sta_not_found:
 
        if (changed & BSS_CHANGED_ASSOC) {
                if (bss_conf->assoc) {
-                       ret = wlcore_set_assoc(wl, wlvif, bss_conf);
+                       ret = wlcore_set_assoc(wl, wlvif, bss_conf,
+                                              sta_rate_set);
                        if (ret < 0)
                                goto out;