aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_ps.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_ps.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_ps.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_ps.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_ps.c b/drivers/net/wireless/wl12xx/wl1271_ps.c
index e407790f6771..29f670099d94 100644
--- a/drivers/net/wireless/wl12xx/wl1271_ps.c
+++ b/drivers/net/wireless/wl12xx/wl1271_ps.c
@@ -118,7 +118,8 @@ out:
118 return 0; 118 return 0;
119} 119}
120 120
121int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode) 121int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
122 bool send)
122{ 123{
123 int ret; 124 int ret;
124 125
@@ -126,21 +127,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode)
126 case STATION_POWER_SAVE_MODE: 127 case STATION_POWER_SAVE_MODE:
127 wl1271_debug(DEBUG_PSM, "entering psm"); 128 wl1271_debug(DEBUG_PSM, "entering psm");
128 129
129 /* enable beacon filtering */ 130 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE, send);
130 ret = wl1271_acx_beacon_filter_opt(wl, true);
131 if (ret < 0)
132 return ret;
133
134 /* enable beacon early termination */
135 ret = wl1271_acx_bet_enable(wl, true);
136 if (ret < 0)
137 return ret;
138
139 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE);
140 if (ret < 0)
141 return ret;
142
143 wl1271_ps_elp_sleep(wl);
144 if (ret < 0) 131 if (ret < 0)
145 return ret; 132 return ret;
146 133
@@ -163,7 +150,7 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode)
163 if (ret < 0) 150 if (ret < 0)
164 return ret; 151 return ret;
165 152
166 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE); 153 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE, send);
167 if (ret < 0) 154 if (ret < 0)
168 return ret; 155 return ret;
169 156