aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-02-18 06:25:36 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-19 15:52:42 -0500
commitd8c42c0c282a5edd9ea2eef4c929d9cec2798653 (patch)
tree63af39e5de1c1c878d3abc72e42c380289704f39 /drivers/net/wireless/wl12xx/wl1271_main.c
parente2117cea27c6b27e1a379acac5eb0433eeb7033a (diff)
wl1271: Fix PSM entry
Currently the PSM entry function assumes successful operation, and enables ELP, BET and beacon filtering right away. This is bad, because the PSM entry may fail due to environmental issues, which will cause the ELP, BET and beacon filtering to be illegally enabled (because FW remains in active state.) Fix this by enabling ELP, BET and beacon filtering only after successful entry, and by ensuring the firmware is in active mode after the failure. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index e4867b895c4..6f026fe63d7 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1248,7 +1248,8 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
1248 */ 1248 */
1249 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) { 1249 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
1250 wl1271_info("psm enabled"); 1250 wl1271_info("psm enabled");
1251 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE); 1251 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
1252 true);
1252 } 1253 }
1253 } else if (!(conf->flags & IEEE80211_CONF_PS) && 1254 } else if (!(conf->flags & IEEE80211_CONF_PS) &&
1254 test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) { 1255 test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) {
@@ -1257,7 +1258,8 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
1257 clear_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags); 1258 clear_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags);
1258 1259
1259 if (test_bit(WL1271_FLAG_PSM, &wl->flags)) 1260 if (test_bit(WL1271_FLAG_PSM, &wl->flags))
1260 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE); 1261 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
1262 true);
1261 } 1263 }
1262 1264
1263 if (conf->power_level != wl->power_level) { 1265 if (conf->power_level != wl->power_level) {
@@ -1637,7 +1639,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1637 if (test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags) && 1639 if (test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags) &&
1638 !test_bit(WL1271_FLAG_PSM, &wl->flags)) { 1640 !test_bit(WL1271_FLAG_PSM, &wl->flags)) {
1639 mode = STATION_POWER_SAVE_MODE; 1641 mode = STATION_POWER_SAVE_MODE;
1640 ret = wl1271_ps_set_mode(wl, mode); 1642 ret = wl1271_ps_set_mode(wl, mode, true);
1641 if (ret < 0) 1643 if (ret < 0)
1642 goto out_sleep; 1644 goto out_sleep;
1643 } 1645 }