wl1251: change wake_up_conditions config
[pandora-kernel.git] / drivers / net / wireless / wl1251 / main.c
index 3bd786a..6077432 100644 (file)
@@ -510,6 +510,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw)
        wl->channel = WL1251_DEFAULT_CHANNEL;
        wl->monitor_present = false;
        wl->joined = false;
+       wl->long_doze_mode_set = false;
 
        wl1251_debugfs_reset(wl);
 
@@ -758,8 +759,13 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
                 * This leaves the tx path disabled in firmware, whereas
                 * the usual JOIN command seems to transmit some frames
                 * at firmware level.
+                *
+                * Note that bss_type must be BSS_TYPE_STA_BSS, also at least
+                * one join has to be performed before CMD_ENABLE_RX can
+                * properly switch channels (join will be done by CONF_IDLE).
                 */
                if (wl->vif == NULL) {
+                       wl->bss_type = BSS_TYPE_STA_BSS;
                        wl->joined = false;
                        ret = wl1251_cmd_data_path_rx(wl, wl->channel, 1);
                } else {
@@ -815,16 +821,6 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
                wl->power_level = conf->power_level;
        }
 
-       /*
-        * Tell stack that connection is lost because hw encryption isn't
-        * supported in monitor mode.
-        * This requires temporary enabling of the hw connection monitor flag
-        */
-       if ((changed & IEEE80211_CONF_CHANGE_MONITOR) && wl->vif) {
-               wl->hw->flags |= IEEE80211_HW_CONNECTION_MONITOR;
-               ieee80211_connection_loss(wl->vif);
-       }
-
 out_sleep:
        wl1251_ps_elp_sleep(wl);
 
@@ -1194,6 +1190,7 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
 {
        struct wl1251 *wl = hw->priv;
        struct sk_buff *beacon, *skb;
+       bool do_join = false;
        bool enable;
        int ret;
 
@@ -1228,17 +1225,11 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
                        if (ret < 0)
                                goto out_sleep;
 
-                       ret = wl1251_join(wl, wl->bss_type, wl->channel,
-                                         wl->beacon_int, wl->dtim_period);
-                       if (ret < 0)
-                               goto out_sleep;
+                       do_join = true;
                }
        }
 
        if (changed & BSS_CHANGED_ASSOC) {
-               /* Disable temporary enabled hw connection monitor flag */
-               wl->hw->flags &= ~IEEE80211_HW_CONNECTION_MONITOR;
-
                if (bss_conf->assoc) {
                        wl->beacon_int = bss_conf->beacon_int;
 
@@ -1323,9 +1314,12 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
                if (ret < 0)
                        goto out_sleep;
 
-               ret = wl1251_join(wl, wl->bss_type, wl->beacon_int,
-                                 wl->channel, wl->dtim_period);
+               do_join = true;
+       }
 
+       if (do_join) {
+               ret = wl1251_join(wl, wl->bss_type, wl->channel,
+                                 wl->beacon_int, wl->dtim_period);
                if (ret < 0)
                        goto out_sleep;
        }