public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH] mac80211: add pre- and post-scan hooks
Date: Sun, 22 Jun 2008 11:43:21 -0400	[thread overview]
Message-ID: <1214149401.8585.2.camel@localhost.localdomain> (raw)

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),


             reply	other threads:[~2008-06-22 15:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 15:43 Dan Williams [this message]
2008-06-24  8:55 ` [PATCH] mac80211: add pre- and post-scan hooks 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1214149401.8585.2.camel@localhost.localdomain \
    --to=dcbw@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox