Commit 8e3bad65 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

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.


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: default avatarJohannes Berg <>
Signed-off-by: default avatarJohn W. Linville <>
parent 9b44fb89
......@@ -2341,7 +2341,6 @@ static void iwl_bg_alive_start(struct work_struct *data)
ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
static void iwl4965_bg_rf_kill(struct work_struct *work)
......@@ -6012,7 +6012,6 @@ static void iwl3945_bg_alive_start(struct work_struct *data)
ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
static void iwl3945_bg_rf_kill(struct work_struct *work)
......@@ -73,14 +73,6 @@
* not do so then mac80211 may add this under certain circumstances.
* enum ieee80211_notification_type - Low level driver notification
* @IEEE80211_NOTIFY_RE_ASSOC: start the re-association sequence
enum ieee80211_notification_types {
* struct ieee80211_ht_bss_info - describing BSS's HT characteristics
......@@ -1797,18 +1789,6 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
u16 tid);
* ieee80211_notify_mac - low level driver notification
* @hw: pointer as obtained from ieee80211_alloc_hw().
* @notif_type: enum ieee80211_notification_types
* This function must be called by low level driver to inform mac80211 of
* low level driver status change or force mac80211 to re-assoc for low
* level driver internal error that require re-assoc.
void ieee80211_notify_mac(struct ieee80211_hw *hw,
enum ieee80211_notification_types notif_type);
* ieee80211_find_sta - find a station
......@@ -2560,25 +2560,3 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local)
/* driver notification call */
void ieee80211_notify_mac(struct ieee80211_hw *hw,
enum ieee80211_notification_types notif_type)
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata;
switch (notif_type) {
list_for_each_entry(sdata, &local->interfaces, list) {
if (sdata->vif.type != NL80211_IFTYPE_STATION)
ieee80211_sta_req_auth(sdata, &sdata->u.sta);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment