aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_event.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_event.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c
index 0a145afc9905..cecbae2ded35 100644
--- a/drivers/net/wireless/wl12xx/wl1271_event.c
+++ b/drivers/net/wireless/wl12xx/wl1271_event.c
@@ -78,24 +78,55 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
78 78
79 switch (mbox->ps_status) { 79 switch (mbox->ps_status) {
80 case EVENT_ENTER_POWER_SAVE_FAIL: 80 case EVENT_ENTER_POWER_SAVE_FAIL:
81 wl1271_debug(DEBUG_PSM, "PSM entry failed");
82
81 if (!test_bit(WL1271_FLAG_PSM, &wl->flags)) { 83 if (!test_bit(WL1271_FLAG_PSM, &wl->flags)) {
84 /* remain in active mode */
82 wl->psm_entry_retry = 0; 85 wl->psm_entry_retry = 0;
83 break; 86 break;
84 } 87 }
85 88
86 if (wl->psm_entry_retry < wl->conf.conn.psm_entry_retries) { 89 if (wl->psm_entry_retry < wl->conf.conn.psm_entry_retries) {
87 wl->psm_entry_retry++; 90 wl->psm_entry_retry++;
88 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE); 91 ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
92 true);
89 } else { 93 } else {
90 wl1271_error("PSM entry failed, giving up.\n"); 94 wl1271_error("PSM entry failed, giving up.\n");
95 /* make sure the firmware goes into active mode */
96 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
97 false);
91 wl->psm_entry_retry = 0; 98 wl->psm_entry_retry = 0;
92 } 99 }
93 break; 100 break;
94 case EVENT_ENTER_POWER_SAVE_SUCCESS: 101 case EVENT_ENTER_POWER_SAVE_SUCCESS:
95 wl->psm_entry_retry = 0; 102 wl->psm_entry_retry = 0;
103
104 /* enable beacon filtering */
105 ret = wl1271_acx_beacon_filter_opt(wl, true);
106 if (ret < 0)
107 break;
108
109 /* enable beacon early termination */
110 ret = wl1271_acx_bet_enable(wl, true);
111 if (ret < 0)
112 break;
113
114 /* go to extremely low power mode */
115 wl1271_ps_elp_sleep(wl);
116 if (ret < 0)
117 break;
96 break; 118 break;
97 case EVENT_EXIT_POWER_SAVE_FAIL: 119 case EVENT_EXIT_POWER_SAVE_FAIL:
98 wl1271_info("PSM exit failed"); 120 wl1271_debug(DEBUG_PSM, "PSM exit failed");
121
122 if (test_bit(WL1271_FLAG_PSM, &wl->flags)) {
123 wl->psm_entry_retry = 0;
124 break;
125 }
126
127 /* make sure the firmware goes to active mode */
128 ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
129 false);
99 break; 130 break;
100 case EVENT_EXIT_POWER_SAVE_SUCCESS: 131 case EVENT_EXIT_POWER_SAVE_SUCCESS:
101 default: 132 default: