aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-11-17 04:59:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-18 17:26:26 -0500
commit8e3bad65a59915f2ddc40f62a180ad81695d8440 (patch)
treed54daf1d8d09192afdccfe913c0a22a6b0c0c5f5
parent9b44fb89cab6e01816cdc05d6b59fdcf8100b8c3 (diff)
mac80211: remove ieee80211_notify_mac
Before ieee80211_notify_mac() was added, it was presented with the use case of using it to tell mac80211 that the association may have been lost because the firmware crashed/reset. Since then, it has also been used by iwlwifi to (slightly) speed up re-association after resume, a workaround around the fact that mac80211 has no suspend/resume handling yet. It is also not used by any other drivers, so clearly it cannot be necessary for "good enough" suspend/resume. Unfortunately, the callback suffers from a severe problem: It only works for station mode. If suspend/resume happens while in IBSS or any other mode (but station), then the callback is pointless. Recently, it has created a number of locking issues, first because it required rtnl locking rather than RCU due to calling sleeping functions within the critical section, and now because it's called by iwlwifi from the mac80211 workqueue that may not use the rtnl because it is flushed under rtnl. (cf. http://bugzilla.kernel.org/show_bug.cgi?id=12046) I think, therefore, that we should take a step back, remove it entirely for now and add the small feature it provided properly. For suspend and resume we will need to introduce new hooks, and for the case where the firmware was reset the driver will probably simply just pretend it has done a suspend/resume cycle to get mac80211 to reprogram the hardware completely, not just try to connect to the current AP again in station mode. When doing so, we will need to take into account locking issues and possibly defer to schedule_work from within mac80211 for the resume operation, while the suspend operation must be done directly. Proper suspend/resume should also not necessarily try to reconnect to the current AP, the time spent in suspend may have been short enough to not be disconnected from the AP, mac80211 will detect that the AP went out of range quickly if it did, and if the association is lost then the AP will disassoc as soon as a data frame is sent. We might also take into account WWOL then, and have mac80211 program the hardware into such a mode where it is available and requested. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c1
-rw-r--r--include/net/mac80211.h20
-rw-r--r--net/mac80211/mlme.c22
4 files changed, 0 insertions, 44 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 8d690a0eb1a..6751bb2b8ae 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2341,7 +2341,6 @@ static void iwl_bg_alive_start(struct work_struct *data)
2341 mutex_lock(&priv->mutex); 2341 mutex_lock(&priv->mutex);
2342 iwl_alive_start(priv); 2342 iwl_alive_start(priv);
2343 mutex_unlock(&priv->mutex); 2343 mutex_unlock(&priv->mutex);
2344 ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
2345} 2344}
2346 2345
2347static void iwl4965_bg_rf_kill(struct work_struct *work) 2346static void iwl4965_bg_rf_kill(struct work_struct *work)
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 285b53e7e26..45a6b0c3569 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6012,7 +6012,6 @@ static void iwl3945_bg_alive_start(struct work_struct *data)
6012 mutex_lock(&priv->mutex); 6012 mutex_lock(&priv->mutex);
6013 iwl3945_alive_start(priv); 6013 iwl3945_alive_start(priv);
6014 mutex_unlock(&priv->mutex); 6014 mutex_unlock(&priv->mutex);
6015 ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
6016} 6015}
6017 6016
6018static void iwl3945_bg_rf_kill(struct work_struct *work) 6017static void iwl3945_bg_rf_kill(struct work_struct *work)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 8856e2d60e9..73d81bc6aa7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -74,14 +74,6 @@
74 */ 74 */
75 75
76/** 76/**
77 * enum ieee80211_notification_type - Low level driver notification
78 * @IEEE80211_NOTIFY_RE_ASSOC: start the re-association sequence
79 */
80enum ieee80211_notification_types {
81 IEEE80211_NOTIFY_RE_ASSOC,
82};
83
84/**
85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics 77 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
86 * 78 *
87 * This structure describes most essential parameters needed 79 * This structure describes most essential parameters needed
@@ -1798,18 +1790,6 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1798 u16 tid); 1790 u16 tid);
1799 1791
1800/** 1792/**
1801 * ieee80211_notify_mac - low level driver notification
1802 * @hw: pointer as obtained from ieee80211_alloc_hw().
1803 * @notif_type: enum ieee80211_notification_types
1804 *
1805 * This function must be called by low level driver to inform mac80211 of
1806 * low level driver status change or force mac80211 to re-assoc for low
1807 * level driver internal error that require re-assoc.
1808 */
1809void ieee80211_notify_mac(struct ieee80211_hw *hw,
1810 enum ieee80211_notification_types notif_type);
1811
1812/**
1813 * ieee80211_find_sta - find a station 1793 * ieee80211_find_sta - find a station
1814 * 1794 *
1815 * @hw: pointer as obtained from ieee80211_alloc_hw() 1795 * @hw: pointer as obtained from ieee80211_alloc_hw()
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 14d165f0df7..409bb771623 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2560,25 +2560,3 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local)
2560 ieee80211_restart_sta_timer(sdata); 2560 ieee80211_restart_sta_timer(sdata);
2561 rcu_read_unlock(); 2561 rcu_read_unlock();
2562} 2562}
2563
2564/* driver notification call */
2565void ieee80211_notify_mac(struct ieee80211_hw *hw,
2566 enum ieee80211_notification_types notif_type)
2567{
2568 struct ieee80211_local *local = hw_to_local(hw);
2569 struct ieee80211_sub_if_data *sdata;
2570
2571 switch (notif_type) {
2572 case IEEE80211_NOTIFY_RE_ASSOC:
2573 rtnl_lock();
2574 list_for_each_entry(sdata, &local->interfaces, list) {
2575 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2576 continue;
2577
2578 ieee80211_sta_req_auth(sdata, &sdata->u.sta);
2579 }
2580 rtnl_unlock();
2581 break;
2582 }
2583}
2584EXPORT_SYMBOL(ieee80211_notify_mac);