diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-14 04:09:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:14 -0400 |
commit | f2753ddbadb0873a98421415882318251bbd9eaa (patch) | |
tree | daad40232be13d91835b30234e5743dfdd582f19 /net/mac80211/main.c | |
parent | a1c555802a62c845520d2486d783c9bb1d5e68a9 (diff) |
mac80211: add hardware restart function
Some hardware defects may require the hardware to be re-initialised
completely from scratch. Drivers would need much information (for
instance the current MAC address, crypto keys, beaconing information,
etc.) stored duplicated from mac80211 to be able to do this, so let
mac80211 help them.
The new ieee80211_restart_hw() function requires the same code as
resuming, so move that code into a new ieee80211_reconfig() function
in util.c and leave only the suspend code in pm.c.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r-- | net/mac80211/main.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index c1145be72da4..80c0e28bf549 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -696,6 +696,28 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
696 | } | 696 | } |
697 | EXPORT_SYMBOL(ieee80211_tx_status); | 697 | EXPORT_SYMBOL(ieee80211_tx_status); |
698 | 698 | ||
699 | static void ieee80211_restart_work(struct work_struct *work) | ||
700 | { | ||
701 | struct ieee80211_local *local = | ||
702 | container_of(work, struct ieee80211_local, restart_work); | ||
703 | |||
704 | rtnl_lock(); | ||
705 | ieee80211_reconfig(local); | ||
706 | rtnl_unlock(); | ||
707 | } | ||
708 | |||
709 | void ieee80211_restart_hw(struct ieee80211_hw *hw) | ||
710 | { | ||
711 | struct ieee80211_local *local = hw_to_local(hw); | ||
712 | |||
713 | /* use this reason, __ieee80211_resume will unblock it */ | ||
714 | ieee80211_stop_queues_by_reason(hw, | ||
715 | IEEE80211_QUEUE_STOP_REASON_SUSPEND); | ||
716 | |||
717 | schedule_work(&local->restart_work); | ||
718 | } | ||
719 | EXPORT_SYMBOL(ieee80211_restart_hw); | ||
720 | |||
699 | struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | 721 | struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, |
700 | const struct ieee80211_ops *ops) | 722 | const struct ieee80211_ops *ops) |
701 | { | 723 | { |
@@ -768,6 +790,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
768 | 790 | ||
769 | INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); | 791 | INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work); |
770 | 792 | ||
793 | INIT_WORK(&local->restart_work, ieee80211_restart_work); | ||
794 | |||
771 | INIT_WORK(&local->dynamic_ps_enable_work, | 795 | INIT_WORK(&local->dynamic_ps_enable_work, |
772 | ieee80211_dynamic_ps_enable_work); | 796 | ieee80211_dynamic_ps_enable_work); |
773 | INIT_WORK(&local->dynamic_ps_disable_work, | 797 | INIT_WORK(&local->dynamic_ps_disable_work, |