diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_event.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_event.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_event.c b/drivers/net/wireless/wl12xx/wl1271_event.c index 25ce2cd5e3f3..7b3f50382963 100644 --- a/drivers/net/wireless/wl12xx/wl1271_event.c +++ b/drivers/net/wireless/wl12xx/wl1271_event.c | |||
@@ -41,6 +41,9 @@ void wl1271_pspoll_work(struct work_struct *work) | |||
41 | 41 | ||
42 | mutex_lock(&wl->mutex); | 42 | mutex_lock(&wl->mutex); |
43 | 43 | ||
44 | if (unlikely(wl->state == WL1271_STATE_OFF)) | ||
45 | goto out; | ||
46 | |||
44 | if (!test_and_clear_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags)) | 47 | if (!test_and_clear_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags)) |
45 | goto out; | 48 | goto out; |
46 | 49 | ||
@@ -52,7 +55,7 @@ void wl1271_pspoll_work(struct work_struct *work) | |||
52 | * delivery failure occurred, and no-one changed state since, so | 55 | * delivery failure occurred, and no-one changed state since, so |
53 | * we should go back to powersave. | 56 | * we should go back to powersave. |
54 | */ | 57 | */ |
55 | wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, true); | 58 | wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, wl->basic_rate, true); |
56 | 59 | ||
57 | out: | 60 | out: |
58 | mutex_unlock(&wl->mutex); | 61 | mutex_unlock(&wl->mutex); |
@@ -70,7 +73,8 @@ static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl) | |||
70 | 73 | ||
71 | /* force active mode receive data from the AP */ | 74 | /* force active mode receive data from the AP */ |
72 | if (test_bit(WL1271_FLAG_PSM, &wl->flags)) { | 75 | if (test_bit(WL1271_FLAG_PSM, &wl->flags)) { |
73 | ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, true); | 76 | ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, |
77 | wl->basic_rate, true); | ||
74 | if (ret < 0) | 78 | if (ret < 0) |
75 | return; | 79 | return; |
76 | set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags); | 80 | set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags); |
@@ -91,6 +95,7 @@ static int wl1271_event_ps_report(struct wl1271 *wl, | |||
91 | bool *beacon_loss) | 95 | bool *beacon_loss) |
92 | { | 96 | { |
93 | int ret = 0; | 97 | int ret = 0; |
98 | u32 total_retries = wl->conf.conn.psm_entry_retries; | ||
94 | 99 | ||
95 | wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status); | 100 | wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status); |
96 | 101 | ||
@@ -104,10 +109,10 @@ static int wl1271_event_ps_report(struct wl1271 *wl, | |||
104 | break; | 109 | break; |
105 | } | 110 | } |
106 | 111 | ||
107 | if (wl->psm_entry_retry < wl->conf.conn.psm_entry_retries) { | 112 | if (wl->psm_entry_retry < total_retries) { |
108 | wl->psm_entry_retry++; | 113 | wl->psm_entry_retry++; |
109 | ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, | 114 | ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, |
110 | true); | 115 | wl->basic_rate, true); |
111 | } else { | 116 | } else { |
112 | wl1271_info("No ack to nullfunc from AP."); | 117 | wl1271_info("No ack to nullfunc from AP."); |
113 | wl->psm_entry_retry = 0; | 118 | wl->psm_entry_retry = 0; |
@@ -143,7 +148,7 @@ static int wl1271_event_ps_report(struct wl1271 *wl, | |||
143 | /* make sure the firmware goes to active mode - the frame to | 148 | /* make sure the firmware goes to active mode - the frame to |
144 | be sent next will indicate to the AP, that we are active. */ | 149 | be sent next will indicate to the AP, that we are active. */ |
145 | ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, | 150 | ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, |
146 | false); | 151 | wl->basic_rate, false); |
147 | break; | 152 | break; |
148 | case EVENT_EXIT_POWER_SAVE_SUCCESS: | 153 | case EVENT_EXIT_POWER_SAVE_SUCCESS: |
149 | default: | 154 | default: |