aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_ps.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_ps.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_ps.c b/drivers/net/wireless/wl12xx/wl1271_ps.c
index a5e60e0403e5..e3c332e2f97c 100644
--- a/drivers/net/wireless/wl12xx/wl1271_ps.c
+++ b/drivers/net/wireless/wl12xx/wl1271_ps.c
@@ -39,6 +39,9 @@ void wl1271_elp_work(struct work_struct *work)
39 39
40 mutex_lock(&wl->mutex); 40 mutex_lock(&wl->mutex);
41 41
42 if (unlikely(wl->state == WL1271_STATE_OFF))
43 goto out;
44
42 if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags) || 45 if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags) ||
43 (!test_bit(WL1271_FLAG_PSM, &wl->flags) && 46 (!test_bit(WL1271_FLAG_PSM, &wl->flags) &&
44 !test_bit(WL1271_FLAG_IDLE, &wl->flags))) 47 !test_bit(WL1271_FLAG_IDLE, &wl->flags)))
@@ -61,7 +64,7 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
61 test_bit(WL1271_FLAG_IDLE, &wl->flags)) { 64 test_bit(WL1271_FLAG_IDLE, &wl->flags)) {
62 cancel_delayed_work(&wl->elp_work); 65 cancel_delayed_work(&wl->elp_work);
63 ieee80211_queue_delayed_work(wl->hw, &wl->elp_work, 66 ieee80211_queue_delayed_work(wl->hw, &wl->elp_work,
64 msecs_to_jiffies(ELP_ENTRY_DELAY)); 67 msecs_to_jiffies(ELP_ENTRY_DELAY));
65 } 68 }
66} 69}
67 70
@@ -96,6 +99,7 @@ int wl1271_ps_elp_wakeup(struct wl1271 *wl, bool chip_awake)
96 &compl, msecs_to_jiffies(WL1271_WAKEUP_TIMEOUT)); 99 &compl, msecs_to_jiffies(WL1271_WAKEUP_TIMEOUT));
97 if (ret == 0) { 100 if (ret == 0) {
98 wl1271_error("ELP wakeup timeout!"); 101 wl1271_error("ELP wakeup timeout!");
102 ieee80211_queue_work(wl->hw, &wl->recovery_work);
99 ret = -ETIMEDOUT; 103 ret = -ETIMEDOUT;
100 goto err; 104 goto err;
101 } else if (ret < 0) { 105 } else if (ret < 0) {
@@ -121,7 +125,7 @@ out:
121} 125}
122 126
123int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode, 127int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
124 bool send) 128 u32 rates, bool send)
125{ 129{
126 int ret; 130 int ret;
127 131
@@ -129,7 +133,14 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
129 case STATION_POWER_SAVE_MODE: 133 case STATION_POWER_SAVE_MODE:
130 wl1271_debug(DEBUG_PSM, "entering psm"); 134 wl1271_debug(DEBUG_PSM, "entering psm");
131 135
132 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE, send); 136 ret = wl1271_acx_wake_up_conditions(wl);
137 if (ret < 0) {
138 wl1271_error("couldn't set wake up conditions");
139 return ret;
140 }
141
142 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE,
143 rates, send);
133 if (ret < 0) 144 if (ret < 0)
134 return ret; 145 return ret;
135 146
@@ -152,7 +163,8 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
152 if (ret < 0) 163 if (ret < 0)
153 return ret; 164 return ret;
154 165
155 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE, send); 166 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE,
167 rates, send);
156 if (ret < 0) 168 if (ret < 0)
157 return ret; 169 return ret;
158 170