diff options
Diffstat (limited to 'drivers/net/wireless/wl1251/ps.c')
-rw-r--r-- | drivers/net/wireless/wl1251/ps.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl1251/ps.c b/drivers/net/wireless/wl1251/ps.c index 9cc514703d2a..db719f7d2692 100644 --- a/drivers/net/wireless/wl1251/ps.c +++ b/drivers/net/wireless/wl1251/ps.c | |||
@@ -39,7 +39,7 @@ void wl1251_elp_work(struct work_struct *work) | |||
39 | 39 | ||
40 | mutex_lock(&wl->mutex); | 40 | mutex_lock(&wl->mutex); |
41 | 41 | ||
42 | if (wl->elp || !wl->psm) | 42 | if (wl->elp || wl->station_mode == STATION_ACTIVE_MODE) |
43 | goto out; | 43 | goto out; |
44 | 44 | ||
45 | wl1251_debug(DEBUG_PSM, "chip to elp"); | 45 | wl1251_debug(DEBUG_PSM, "chip to elp"); |
@@ -57,7 +57,7 @@ void wl1251_ps_elp_sleep(struct wl1251 *wl) | |||
57 | { | 57 | { |
58 | unsigned long delay; | 58 | unsigned long delay; |
59 | 59 | ||
60 | if (wl->psm) { | 60 | if (wl->station_mode != STATION_ACTIVE_MODE) { |
61 | delay = msecs_to_jiffies(ELP_ENTRY_DELAY); | 61 | delay = msecs_to_jiffies(ELP_ENTRY_DELAY); |
62 | ieee80211_queue_delayed_work(wl->hw, &wl->elp_work, delay); | 62 | ieee80211_queue_delayed_work(wl->hw, &wl->elp_work, delay); |
63 | } | 63 | } |
@@ -104,7 +104,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl) | |||
104 | return 0; | 104 | return 0; |
105 | } | 105 | } |
106 | 106 | ||
107 | int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode) | 107 | int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_station_mode mode) |
108 | { | 108 | { |
109 | int ret; | 109 | int ret; |
110 | 110 | ||
@@ -128,15 +128,24 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode) | |||
128 | if (ret < 0) | 128 | if (ret < 0) |
129 | return ret; | 129 | return ret; |
130 | 130 | ||
131 | ret = wl1251_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE); | 131 | ret = wl1251_cmd_ps_mode(wl, CHIP_POWER_SAVE_MODE); |
132 | if (ret < 0) | 132 | if (ret < 0) |
133 | return ret; | 133 | return ret; |
134 | 134 | ||
135 | ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_ELP); | 135 | ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_ELP); |
136 | if (ret < 0) | 136 | if (ret < 0) |
137 | return ret; | 137 | return ret; |
138 | break; | ||
139 | case STATION_IDLE: | ||
140 | wl1251_debug(DEBUG_PSM, "entering idle"); | ||
138 | 141 | ||
139 | wl->psm = 1; | 142 | ret = wl1251_acx_sleep_auth(wl, WL1251_PSM_ELP); |
143 | if (ret < 0) | ||
144 | return ret; | ||
145 | |||
146 | ret = wl1251_cmd_template_set(wl, CMD_DISCONNECT, NULL, 0); | ||
147 | if (ret < 0) | ||
148 | return ret; | ||
140 | break; | 149 | break; |
141 | case STATION_ACTIVE_MODE: | 150 | case STATION_ACTIVE_MODE: |
142 | default: | 151 | default: |
@@ -163,13 +172,13 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode) | |||
163 | if (ret < 0) | 172 | if (ret < 0) |
164 | return ret; | 173 | return ret; |
165 | 174 | ||
166 | ret = wl1251_cmd_ps_mode(wl, STATION_ACTIVE_MODE); | 175 | ret = wl1251_cmd_ps_mode(wl, CHIP_ACTIVE_MODE); |
167 | if (ret < 0) | 176 | if (ret < 0) |
168 | return ret; | 177 | return ret; |
169 | 178 | ||
170 | wl->psm = 0; | ||
171 | break; | 179 | break; |
172 | } | 180 | } |
181 | wl->station_mode = mode; | ||
173 | 182 | ||
174 | return ret; | 183 | return ret; |
175 | } | 184 | } |