Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[cascardo/linux.git] / drivers / net / wireless / wl12xx / wl1251_main.c
index 63511ca..6aeffbe 100644 (file)
@@ -630,10 +630,6 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
                        goto out_sleep;
        }
 
-       ret = wl1251_build_null_data(wl);
-       if (ret < 0)
-               goto out_sleep;
-
        if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) {
                wl1251_debug(DEBUG_PSM, "psm enabled");
 
@@ -1116,6 +1112,21 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
        if (ret < 0)
                goto out;
 
+       if (changed & BSS_CHANGED_BSSID) {
+               memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN);
+
+               ret = wl1251_build_null_data(wl);
+               if (ret < 0)
+                       goto out;
+
+               if (wl->bss_type != BSS_TYPE_IBSS) {
+                       ret = wl1251_join(wl, wl->bss_type, wl->channel,
+                                         wl->beacon_int, wl->dtim_period);
+                       if (ret < 0)
+                               goto out_sleep;
+               }
+       }
+
        if (changed & BSS_CHANGED_ASSOC) {
                if (bss_conf->assoc) {
                        wl->beacon_int = bss_conf->beacon_int;
@@ -1175,23 +1186,6 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
                }
        }
 
-       if (changed & BSS_CHANGED_BSSID) {
-               memcpy(wl->bssid, bss_conf->bssid, ETH_ALEN);
-
-               ret = wl1251_build_null_data(wl);
-               if (ret < 0)
-                       goto out;
-
-               if (wl->bss_type != BSS_TYPE_IBSS) {
-                       ret = wl1251_join(wl, wl->bss_type, wl->channel,
-                                         wl->beacon_int, wl->dtim_period);
-                       if (ret < 0)
-                               goto out_sleep;
-                       wl1251_warning("Set ctsprotect failed %d", ret);
-                       goto out_sleep;
-               }
-       }
-
        if (changed & BSS_CHANGED_BEACON) {
                beacon = ieee80211_beacon_get(hw, vif);
                ret = wl1251_cmd_template_set(wl, CMD_BEACON, beacon->data,