aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl1251/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl1251/main.c')
-rw-r--r--drivers/net/wireless/wl1251/main.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 12c9e635a6d6..a14a48c99cdc 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -497,7 +497,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw)
497 wl->rx_last_id = 0; 497 wl->rx_last_id = 0;
498 wl->next_tx_complete = 0; 498 wl->next_tx_complete = 0;
499 wl->elp = false; 499 wl->elp = false;
500 wl->psm = 0; 500 wl->station_mode = STATION_ACTIVE_MODE;
501 wl->tx_queue_stopped = false; 501 wl->tx_queue_stopped = false;
502 wl->power_level = WL1251_DEFAULT_POWER_LEVEL; 502 wl->power_level = WL1251_DEFAULT_POWER_LEVEL;
503 wl->rssi_thold = 0; 503 wl->rssi_thold = 0;
@@ -632,13 +632,29 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
632 632
633 wl->psm_requested = false; 633 wl->psm_requested = false;
634 634
635 if (wl->psm) { 635 if (wl->station_mode != STATION_ACTIVE_MODE) {
636 ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE); 636 ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE);
637 if (ret < 0) 637 if (ret < 0)
638 goto out_sleep; 638 goto out_sleep;
639 } 639 }
640 } 640 }
641 641
642 if (changed & IEEE80211_CONF_CHANGE_IDLE) {
643 if (conf->flags & IEEE80211_CONF_IDLE) {
644 ret = wl1251_ps_set_mode(wl, STATION_IDLE);
645 if (ret < 0)
646 goto out_sleep;
647 } else {
648 ret = wl1251_ps_set_mode(wl, STATION_ACTIVE_MODE);
649 if (ret < 0)
650 goto out_sleep;
651 ret = wl1251_join(wl, wl->bss_type, wl->channel,
652 wl->beacon_int, wl->dtim_period);
653 if (ret < 0)
654 goto out_sleep;
655 }
656 }
657
642 if (conf->power_level != wl->power_level) { 658 if (conf->power_level != wl->power_level) {
643 ret = wl1251_acx_tx_power(wl, conf->power_level); 659 ret = wl1251_acx_tx_power(wl, conf->power_level);
644 if (ret < 0) 660 if (ret < 0)
@@ -1384,7 +1400,7 @@ struct ieee80211_hw *wl1251_alloc_hw(void)
1384 wl->rx_config = WL1251_DEFAULT_RX_CONFIG; 1400 wl->rx_config = WL1251_DEFAULT_RX_CONFIG;
1385 wl->rx_filter = WL1251_DEFAULT_RX_FILTER; 1401 wl->rx_filter = WL1251_DEFAULT_RX_FILTER;
1386 wl->elp = false; 1402 wl->elp = false;
1387 wl->psm = 0; 1403 wl->station_mode = STATION_ACTIVE_MODE;
1388 wl->psm_requested = false; 1404 wl->psm_requested = false;
1389 wl->tx_queue_stopped = false; 1405 wl->tx_queue_stopped = false;
1390 wl->power_level = WL1251_DEFAULT_POWER_LEVEL; 1406 wl->power_level = WL1251_DEFAULT_POWER_LEVEL;