Skip to content

Commit

Permalink
cfg80211: add cfg80211_sched_scan_stopped_rtnl
Browse files Browse the repository at this point in the history
Add locked-version for cfg80211_sched_scan_stopped.
This is used for some users that might want to
call it when rtnl is already locked.

Fixes: d43c6b6 ("mac80211: reschedule sched scan after HW restart")
Cc: stable@vger.kernel.org (3.14+)
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Eliad Peller authored and Johannes Berg committed May 5, 2014
1 parent c1fbb25 commit 792e6aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 12 additions & 0 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3668,6 +3668,18 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy);
*/
void cfg80211_sched_scan_stopped(struct wiphy *wiphy);

/**
* cfg80211_sched_scan_stopped_rtnl - notify that the scheduled scan has stopped
*
* @wiphy: the wiphy on which the scheduled scan stopped
*
* The driver can call this function to inform cfg80211 that the
* scheduled scan had to be stopped, for whatever reason. The driver
* is then called back via the sched_scan_stop operation when done.
* This function should be called with rtnl locked.
*/
void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy);

/**
* cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame
*
Expand Down
12 changes: 10 additions & 2 deletions net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,22 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy)
}
EXPORT_SYMBOL(cfg80211_sched_scan_results);

void cfg80211_sched_scan_stopped(struct wiphy *wiphy)
void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy)
{
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);

ASSERT_RTNL();

trace_cfg80211_sched_scan_stopped(wiphy);

rtnl_lock();
__cfg80211_stop_sched_scan(rdev, true);
}
EXPORT_SYMBOL(cfg80211_sched_scan_stopped_rtnl);

void cfg80211_sched_scan_stopped(struct wiphy *wiphy)
{
rtnl_lock();
cfg80211_sched_scan_stopped_rtnl(wiphy);
rtnl_unlock();
}
EXPORT_SYMBOL(cfg80211_sched_scan_stopped);
Expand Down

0 comments on commit 792e6aa

Please sign in to comment.