aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c4
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.h4
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_event.c17
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c8
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_ps.c8
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_ps.h2
6 files changed, 28 insertions, 15 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 42e7d2f236c4..06b14f2abf55 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -390,7 +390,7 @@ out:
390 return ret; 390 return ret;
391} 391}
392 392
393int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send) 393int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send)
394{ 394{
395 struct wl1271_cmd_ps_params *ps_params = NULL; 395 struct wl1271_cmd_ps_params *ps_params = NULL;
396 int ret = 0; 396 int ret = 0;
@@ -407,7 +407,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send)
407 ps_params->send_null_data = send; 407 ps_params->send_null_data = send;
408 ps_params->retries = 5; 408 ps_params->retries = 5;
409 ps_params->hang_over_period = 1; 409 ps_params->hang_over_period = 1;
410 ps_params->null_data_rate = cpu_to_le32(wl->basic_rate_set); 410 ps_params->null_data_rate = cpu_to_le32(rates);
411 411
412 ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params, 412 ret = wl1271_cmd_send(wl, CMD_SET_PS_MODE, ps_params,
413 sizeof(*ps_params), 0); 413 sizeof(*ps_params), 0);
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h
index 92747cece15e..ff8e35e87d98 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h
@@ -38,7 +38,9 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
38int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); 38int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
39int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); 39int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
40int wl1271_cmd_data_path(struct wl1271 *wl, bool enable); 40int wl1271_cmd_data_path(struct wl1271 *wl, bool enable);
41int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send); 41int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, u32 rates, bool send);
42int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
43 size_t len);
42int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, 44int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
43 void *buf, size_t buf_len, int index, u32 rates); 45 void *buf, size_t buf_len, int index, u32 rates);
44int wl1271_cmd_build_null_data(struct wl1271 *wl); 46int wl1271_cmd_build_null_data(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c
index 25ce2cd5e3f3..bced8296a251 100644
--- a/drivers/net/wireless/wl12xx/wl1271_event.c
+++ b/drivers/net/wireless/wl12xx/wl1271_event.c
@@ -52,7 +52,7 @@ void wl1271_pspoll_work(struct work_struct *work)
52 * delivery failure occurred, and no-one changed state since, so 52 * delivery failure occurred, and no-one changed state since, so
53 * we should go back to powersave. 53 * we should go back to powersave.
54 */ 54 */
55 wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, true); 55 wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, wl->basic_rate, true);
56 56
57out: 57out:
58 mutex_unlock(&wl->mutex); 58 mutex_unlock(&wl->mutex);
@@ -70,7 +70,8 @@ static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl)
70 70
71 /* force active mode receive data from the AP */ 71 /* force active mode receive data from the AP */
72 if (test_bit(WL1271_FLAG_PSM, &wl->flags)) { 72 if (test_bit(WL1271_FLAG_PSM, &wl->flags)) {
73 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, true); 73 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
74 wl->basic_rate, true);
74 if (ret < 0) 75 if (ret < 0)
75 return; 76 return;
76 set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags); 77 set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags);
@@ -91,6 +92,8 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
91 bool *beacon_loss) 92 bool *beacon_loss)
92{ 93{
93 int ret = 0; 94 int ret = 0;
95 u32 total_retries = wl->conf.conn.psm_entry_retries;
96 u32 rates;
94 97
95 wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status); 98 wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status);
96 99
@@ -104,10 +107,14 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
104 break; 107 break;
105 } 108 }
106 109
107 if (wl->psm_entry_retry < wl->conf.conn.psm_entry_retries) { 110 if (wl->psm_entry_retry < total_retries) {
108 wl->psm_entry_retry++; 111 wl->psm_entry_retry++;
112 if (wl->psm_entry_retry == total_retries)
113 rates = wl->basic_rate;
114 else
115 rates = wl->basic_rate_set;
109 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, 116 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
110 true); 117 rates, true);
111 } else { 118 } else {
112 wl1271_info("No ack to nullfunc from AP."); 119 wl1271_info("No ack to nullfunc from AP.");
113 wl->psm_entry_retry = 0; 120 wl->psm_entry_retry = 0;
@@ -143,7 +150,7 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
143 /* make sure the firmware goes to active mode - the frame to 150 /* make sure the firmware goes to active mode - the frame to
144 be sent next will indicate to the AP, that we are active. */ 151 be sent next will indicate to the AP, that we are active. */
145 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, 152 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
146 false); 153 wl->basic_rate, false);
147 break; 154 break;
148 case EVENT_EXIT_POWER_SAVE_SUCCESS: 155 case EVENT_EXIT_POWER_SAVE_SUCCESS:
149 default: 156 default:
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 11e112ff79d6..81f92a0100d9 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1341,7 +1341,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
1341 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) { 1341 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {
1342 wl1271_debug(DEBUG_PSM, "psm enabled"); 1342 wl1271_debug(DEBUG_PSM, "psm enabled");
1343 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, 1343 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
1344 true); 1344 wl->basic_rate_set, true);
1345 } 1345 }
1346 } else if (!(conf->flags & IEEE80211_CONF_PS) && 1346 } else if (!(conf->flags & IEEE80211_CONF_PS) &&
1347 test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) { 1347 test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) {
@@ -1351,7 +1351,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
1351 1351
1352 if (test_bit(WL1271_FLAG_PSM, &wl->flags)) 1352 if (test_bit(WL1271_FLAG_PSM, &wl->flags))
1353 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, 1353 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
1354 true); 1354 wl->basic_rate_set, true);
1355 } 1355 }
1356 1356
1357 if (conf->power_level != wl->power_level) { 1357 if (conf->power_level != wl->power_level) {
@@ -1826,7 +1826,9 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1826 if (test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags) && 1826 if (test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags) &&
1827 !test_bit(WL1271_FLAG_PSM, &wl->flags)) { 1827 !test_bit(WL1271_FLAG_PSM, &wl->flags)) {
1828 mode = STATION_POWER_SAVE_MODE; 1828 mode = STATION_POWER_SAVE_MODE;
1829 ret = wl1271_ps_set_mode(wl, mode, true); 1829 ret = wl1271_ps_set_mode(wl, mode,
1830 wl->basic_rate_set,
1831 true);
1830 if (ret < 0) 1832 if (ret < 0)
1831 goto out_sleep; 1833 goto out_sleep;
1832 } 1834 }
diff --git a/drivers/net/wireless/wl12xx/wl1271_ps.c b/drivers/net/wireless/wl12xx/wl1271_ps.c
index 52a60959bb9c..f75668e413fd 100644
--- a/drivers/net/wireless/wl12xx/wl1271_ps.c
+++ b/drivers/net/wireless/wl12xx/wl1271_ps.c
@@ -121,7 +121,7 @@ out:
121} 121}
122 122
123int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode, 123int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
124 bool send) 124 u32 rates, bool send)
125{ 125{
126 int ret; 126 int ret;
127 127
@@ -135,7 +135,8 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
135 return ret; 135 return ret;
136 } 136 }
137 137
138 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE, send); 138 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE,
139 rates, send);
139 if (ret < 0) 140 if (ret < 0)
140 return ret; 141 return ret;
141 142
@@ -158,7 +159,8 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
158 if (ret < 0) 159 if (ret < 0)
159 return ret; 160 return ret;
160 161
161 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE, send); 162 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE,
163 rates, send);
162 if (ret < 0) 164 if (ret < 0)
163 return ret; 165 return ret;
164 166
diff --git a/drivers/net/wireless/wl12xx/wl1271_ps.h b/drivers/net/wireless/wl12xx/wl1271_ps.h
index 940276f517a4..6ba7b032736f 100644
--- a/drivers/net/wireless/wl12xx/wl1271_ps.h
+++ b/drivers/net/wireless/wl12xx/wl1271_ps.h
@@ -28,7 +28,7 @@
28#include "wl1271_acx.h" 28#include "wl1271_acx.h"
29 29
30int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode, 30int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,
31 bool send); 31 u32 rates, bool send);
32void wl1271_ps_elp_sleep(struct wl1271 *wl); 32void wl1271_ps_elp_sleep(struct wl1271 *wl);
33int wl1271_ps_elp_wakeup(struct wl1271 *wl, bool chip_awake); 33int wl1271_ps_elp_wakeup(struct wl1271 *wl, bool chip_awake);
34void wl1271_elp_work(struct work_struct *work); 34void wl1271_elp_work(struct work_struct *work);