linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: add pre- and post-scan hooks
@ 2008-06-22 15:43 Dan Williams
  2008-06-24  8:55 ` Johannes Berg
  2008-09-10  7:51 ` Johannes Berg
  0 siblings, 2 replies; 12+ messages in thread
From: Dan Williams @ 2008-06-22 15:43 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Johannes Berg

mrv8k has commands that get called before and after the scan has been
done to save and restore hardware state.  Add optional callbacks to
mac80211 to enable low-level drivers to know when the stack is about to
start scanning, and when it's done.

Signed-off-by: Dan Williams <dcbw@redhat.com>

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7ab4ff6..b84e8ac 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1139,6 +1139,10 @@ enum ieee80211_ampdu_mlme_action {
  * 	ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
  * 	is the first frame we expect to perform the action on. notice
  * 	that TX/RX_STOP can pass NULL for this parameter.
+ *
+ * @prescan: Notifies low level driver that a software scan is about to happen.
+ *
+ * @postscan: Notifies low level driver that software scanning is done.
  */
 struct ieee80211_ops {
 	int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1190,6 +1194,8 @@ struct ieee80211_ops {
 	int (*ampdu_action)(struct ieee80211_hw *hw,
 			    enum ieee80211_ampdu_mlme_action action,
 			    const u8 *addr, u16 tid, u16 *ssn);
+	int (*prescan)(struct ieee80211_hw *hw);
+	int (*postscan)(struct ieee80211_hw *hw);
 };
 
 /**
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 55659a7..4bee2a7 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3850,6 +3850,10 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
 
 	netif_tx_unlock_bh(local->mdev);
 
+	/* call postscan outside locks because drivers may need to sleep */
+	if (local->ops->postscan)
+		local->ops->postscan(local_to_hw(local));
+
 	rcu_read_lock();
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
 
@@ -4045,6 +4048,10 @@ static int ieee80211_sta_start_scan(struct net_device *dev,
 	local->scan_band = IEEE80211_BAND_2GHZ;
 	local->scan_dev = dev;
 
+	/* call prescan outside locks because drivers may need to sleep */
+	if (local->ops->prescan)
+		local->ops->prescan(local_to_hw(local));
+
 	netif_tx_lock_bh(local->mdev);
 	local->filter_flags |= FIF_BCN_PRBRESP_PROMISC;
 	local->ops->configure_filter(local_to_hw(local),


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-09-11 23:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-22 15:43 [PATCH] mac80211: add pre- and post-scan hooks Dan Williams
2008-06-24  8:55 ` Johannes Berg
2008-06-24 11:15   ` Dan Williams
2008-06-24 11:21     ` Johannes Berg
2008-06-24 14:45       ` Dan Williams
2008-06-24 14:53         ` Johannes Berg
2008-09-10  7:51 ` Johannes Berg
2008-09-10 13:09   ` Dan Williams
2008-09-10 21:38     ` Johannes Berg
2008-09-11 18:53   ` Johannes Berg
2008-09-11 20:35     ` Jouni Malinen
2008-09-11 23:26       ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).