diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-05-17 05:40:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-20 14:46:25 -0400 |
commit | 5bb644a0fd25a5e083ecbfaa92a211db99aa6ef7 (patch) | |
tree | d2a6d5ff2323db0c475be15c63bb8fc55482a1e2 /net/mac80211/ieee80211_i.h | |
parent | cc32abd494c0a8f76f2638e3f3a76e01c68bc9ea (diff) |
mac80211: cancel/restart all timers across suspend/resume
We forgot to cancel all timers in mac80211 when suspending.
In particular we forgot to deal with some things that can
cause hardware reconfiguration -- while it is down.
While at it we go ahead and add a warning in ieee80211_sta_work()
if its run while the suspend->resume cycle is in effect. This
should not happen and if it does it would indicate there is
a bug lurking in either mac80211 or mac80211 drivers.
With this now wpa_supplicant doesn't blink when I go to suspend
and resume where as before there where issues with some timers
running during the suspend->resume cycle. This caused a lot of
incorrect assumptions and would at times bring back the device
in an incoherent, but mostly recoverable, state.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index be9446551cf6..8db8d16d206c 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -293,6 +293,7 @@ struct ieee80211_if_managed { | |||
293 | int auth_tries; /* retries for auth req */ | 293 | int auth_tries; /* retries for auth req */ |
294 | int assoc_tries; /* retries for assoc req */ | 294 | int assoc_tries; /* retries for assoc req */ |
295 | 295 | ||
296 | unsigned long timers_running; /* used for quiesce/restart */ | ||
296 | bool powersave; /* powersave requested for this iface */ | 297 | bool powersave; /* powersave requested for this iface */ |
297 | 298 | ||
298 | unsigned long request; | 299 | unsigned long request; |
@@ -333,6 +334,9 @@ struct ieee80211_if_ibss { | |||
333 | 334 | ||
334 | unsigned long request; | 335 | unsigned long request; |
335 | unsigned long last_scan_completed; | 336 | unsigned long last_scan_completed; |
337 | |||
338 | bool timer_running; | ||
339 | |||
336 | bool fixed_bssid; | 340 | bool fixed_bssid; |
337 | bool fixed_channel; | 341 | bool fixed_channel; |
338 | 342 | ||
@@ -358,6 +362,8 @@ struct ieee80211_if_mesh { | |||
358 | struct timer_list mesh_path_timer; | 362 | struct timer_list mesh_path_timer; |
359 | struct sk_buff_head skb_queue; | 363 | struct sk_buff_head skb_queue; |
360 | 364 | ||
365 | unsigned long timers_running; | ||
366 | |||
361 | bool housekeeping; | 367 | bool housekeeping; |
362 | 368 | ||
363 | u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; | 369 | u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; |
@@ -609,6 +615,21 @@ struct ieee80211_local { | |||
609 | unsigned int filter_flags; /* FIF_* */ | 615 | unsigned int filter_flags; /* FIF_* */ |
610 | struct iw_statistics wstats; | 616 | struct iw_statistics wstats; |
611 | bool tim_in_locked_section; /* see ieee80211_beacon_get() */ | 617 | bool tim_in_locked_section; /* see ieee80211_beacon_get() */ |
618 | |||
619 | /* | ||
620 | * suspended is true if we finished all the suspend _and_ we have | ||
621 | * not yet come up from resume. This is to be used by mac80211 | ||
622 | * to ensure driver sanity during suspend and mac80211's own | ||
623 | * sanity. It can eventually be used for WoW as well. | ||
624 | */ | ||
625 | bool suspended; | ||
626 | |||
627 | /* | ||
628 | * quiescing is true during the suspend process _only_ to | ||
629 | * ease timer cancelling etc. | ||
630 | */ | ||
631 | bool quiescing; | ||
632 | |||
612 | int tx_headroom; /* required headroom for hardware/radiotap */ | 633 | int tx_headroom; /* required headroom for hardware/radiotap */ |
613 | 634 | ||
614 | /* Tasklet and skb queue to process calls from IRQ mode. All frames | 635 | /* Tasklet and skb queue to process calls from IRQ mode. All frames |
@@ -937,6 +958,8 @@ int ieee80211_max_network_latency(struct notifier_block *nb, | |||
937 | void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, | 958 | void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, |
938 | struct ieee80211_channel_sw_ie *sw_elem, | 959 | struct ieee80211_channel_sw_ie *sw_elem, |
939 | struct ieee80211_bss *bss); | 960 | struct ieee80211_bss *bss); |
961 | void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata); | ||
962 | void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); | ||
940 | 963 | ||
941 | /* IBSS code */ | 964 | /* IBSS code */ |
942 | void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); | 965 | void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); |
@@ -949,6 +972,8 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | |||
949 | int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, | 972 | int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata, |
950 | struct cfg80211_ibss_params *params); | 973 | struct cfg80211_ibss_params *params); |
951 | int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); | 974 | int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); |
975 | void ieee80211_ibss_quiesce(struct ieee80211_sub_if_data *sdata); | ||
976 | void ieee80211_ibss_restart(struct ieee80211_sub_if_data *sdata); | ||
952 | 977 | ||
953 | /* scan/BSS handling */ | 978 | /* scan/BSS handling */ |
954 | void ieee80211_scan_work(struct work_struct *work); | 979 | void ieee80211_scan_work(struct work_struct *work); |
@@ -959,6 +984,7 @@ int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, | |||
959 | int ieee80211_scan_results(struct ieee80211_local *local, | 984 | int ieee80211_scan_results(struct ieee80211_local *local, |
960 | struct iw_request_info *info, | 985 | struct iw_request_info *info, |
961 | char *buf, size_t len); | 986 | char *buf, size_t len); |
987 | void ieee80211_scan_cancel(struct ieee80211_local *local); | ||
962 | ieee80211_rx_result | 988 | ieee80211_rx_result |
963 | ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, | 989 | ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, |
964 | struct sk_buff *skb, | 990 | struct sk_buff *skb, |