wl1251: Add support for idle mode
[pandora-wifi.git] / drivers / net / wireless / wl12xx / wl1251_main.c
index 8ca7901..4ac24c5 100644 (file)
@@ -692,6 +692,22 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
                }
        }
 
+       if (changed & IEEE80211_CONF_CHANGE_IDLE) {
+               if (conf->flags & IEEE80211_CONF_IDLE) {
+                       ret = wl1251_ps_set_mode(wl, STATION_IDLE);
+                       if (ret < 0)
+                               goto out_sleep;
+               } else {
+                       ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE);
+                       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;
+               }
+       }
+
        if (conf->power_level != wl->power_level) {
                ret = wl1251_acx_tx_power(wl, conf->power_level);
                if (ret < 0)