linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 2/8] mac80211: use sdata pointer for scan interface
Date: Mon, 08 Sep 2008 17:44:23 +0200	[thread overview]
Message-ID: <20080908154441.240689000@sipsolutions.net> (raw)
In-Reply-To: 20080908154421.216772000@sipsolutions.net

Since we now use sdata pointers most of the time, using a netdev
pointer here is somewhat artificial, use an sdata pointer instead.
Replace a netdev-prefix in a few messages by a wiphy-prefix.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/ieee80211_i.h |    2 +-
 net/mac80211/main.c        |    2 +-
 net/mac80211/mlme.c        |   24 +++++++++++-------------
 3 files changed, 13 insertions(+), 15 deletions(-)

--- everything.orig/net/mac80211/ieee80211_i.h	2008-09-08 15:37:15.000000000 +0200
+++ everything/net/mac80211/ieee80211_i.h	2008-09-08 15:42:38.000000000 +0200
@@ -636,7 +636,7 @@ struct ieee80211_local {
 	enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
 	unsigned long last_scan_completed;
 	struct delayed_work scan_work;
-	struct net_device *scan_dev;
+	struct ieee80211_sub_if_data *scan_sdata;
 	struct ieee80211_channel *oper_channel, *scan_channel;
 	u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
 	size_t scan_ssid_len;
--- everything.orig/net/mac80211/main.c	2008-09-08 15:37:15.000000000 +0200
+++ everything/net/mac80211/main.c	2008-09-08 15:42:38.000000000 +0200
@@ -551,7 +551,7 @@ static int ieee80211_stop(struct net_dev
 		synchronize_rcu();
 		skb_queue_purge(&sdata->u.sta.skb_queue);
 
-		if (local->scan_dev == sdata->dev) {
+		if (local->scan_sdata == sdata) {
 			if (!local->ops->hw_scan) {
 				local->sta_sw_scanning = 0;
 				cancel_delayed_work(&local->scan_work);
--- everything.orig/net/mac80211/mlme.c	2008-09-08 15:42:36.000000000 +0200
+++ everything/net/mac80211/mlme.c	2008-09-08 15:42:38.000000000 +0200
@@ -3508,19 +3508,18 @@ static void ieee80211_restart_sta_timer(
 void ieee80211_scan_completed(struct ieee80211_hw *hw)
 {
 	struct ieee80211_local *local = hw_to_local(hw);
-	struct net_device *dev = local->scan_dev;
 	struct ieee80211_sub_if_data *sdata;
 	union iwreq_data wrqu;
 
 	local->last_scan_completed = jiffies;
 	memset(&wrqu, 0, sizeof(wrqu));
-	wireless_send_event(dev, SIOCGIWSCAN, &wrqu, NULL);
+	wireless_send_event(local->scan_sdata->dev, SIOCGIWSCAN, &wrqu, NULL);
 
 	if (local->sta_hw_scanning) {
 		local->sta_hw_scanning = 0;
 		if (ieee80211_hw_config(local))
 			printk(KERN_DEBUG "%s: failed to restore operational "
-			       "channel after scan\n", dev->name);
+			       "channel after scan\n", wiphy_name(local->hw.wiphy));
 		/* Restart STA timer for HW scan case */
 		rcu_read_lock();
 		list_for_each_entry_rcu(sdata, &local->interfaces, list)
@@ -3533,7 +3532,7 @@ void ieee80211_scan_completed(struct iee
 	local->sta_sw_scanning = 0;
 	if (ieee80211_hw_config(local))
 		printk(KERN_DEBUG "%s: failed to restore operational "
-		       "channel after scan\n", dev->name);
+		       "channel after scan\n", wiphy_name(local->hw.wiphy));
 
 
 	netif_tx_lock_bh(local->mdev);
@@ -3563,8 +3562,8 @@ void ieee80211_scan_completed(struct iee
 	}
 	rcu_read_unlock();
 
-done:
-	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ done:
+	sdata = local->scan_sdata;
 	if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
 		struct ieee80211_if_sta *ifsta = &sdata->u.sta;
 		if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) ||
@@ -3579,8 +3578,7 @@ void ieee80211_sta_scan_work(struct work
 {
 	struct ieee80211_local *local =
 		container_of(work, struct ieee80211_local, scan_work.work);
-	struct net_device *dev = local->scan_dev;
-	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	struct ieee80211_sub_if_data *sdata = local->scan_sdata;
 	struct ieee80211_supported_band *sband;
 	struct ieee80211_channel *chan;
 	int skip;
@@ -3628,7 +3626,7 @@ void ieee80211_sta_scan_work(struct work
 			local->scan_channel = chan;
 			if (ieee80211_hw_config(local)) {
 				printk(KERN_DEBUG "%s: failed to set freq to "
-				       "%d MHz for scan\n", dev->name,
+				       "%d MHz for scan\n", wiphy_name(local->hw.wiphy),
 				       chan->center_freq);
 				skip = 1;
 			}
@@ -3698,7 +3696,7 @@ static int ieee80211_sta_start_scan(stru
 	 */
 
 	if (local->sta_sw_scanning || local->sta_hw_scanning) {
-		if (local->scan_dev == scan_sdata->dev)
+		if (local->scan_sdata == scan_sdata)
 			return 0;
 		return -EBUSY;
 	}
@@ -3708,7 +3706,7 @@ static int ieee80211_sta_start_scan(stru
 					     ssid, ssid_len);
 		if (!rc) {
 			local->sta_hw_scanning = 1;
-			local->scan_dev = scan_sdata->dev;
+			local->scan_sdata = scan_sdata;
 		}
 		return rc;
 	}
@@ -3735,7 +3733,7 @@ static int ieee80211_sta_start_scan(stru
 	local->scan_state = SCAN_SET_CHANNEL;
 	local->scan_channel_idx = 0;
 	local->scan_band = IEEE80211_BAND_2GHZ;
-	local->scan_dev = scan_sdata->dev;
+	local->scan_sdata = scan_sdata;
 
 	netif_addr_lock_bh(local->mdev);
 	local->filter_flags |= FIF_BCN_PRBRESP_PROMISC;
@@ -3763,7 +3761,7 @@ int ieee80211_sta_req_scan(struct ieee80
 		return ieee80211_sta_start_scan(sdata, ssid, ssid_len);
 
 	if (local->sta_sw_scanning || local->sta_hw_scanning) {
-		if (local->scan_dev == sdata->dev)
+		if (local->scan_sdata == sdata)
 			return 0;
 		return -EBUSY;
 	}

-- 


  parent reply	other threads:[~2008-09-08 15:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08 15:44 [PATCH 0/8] mac80211 mlme cleanups Johannes Berg
2008-09-08 15:44 ` [PATCH 1/8] mac80211: reorder mlme code Johannes Berg
2008-09-08 15:44 ` Johannes Berg [this message]
2008-09-08 15:44 ` [PATCH 3/8] mac80211: remove useless non-NULL tests from scan results code Johannes Berg
2008-09-08 15:44 ` [PATCH 4/8] mac80211: start moving scan code from mlme Johannes Berg
2008-09-08 15:44 ` [PATCH 5/8] mac80211: refactor and move scan RX code Johannes Berg
2008-09-08 15:44 ` [PATCH 6/8] mac80211: move BSS handling to scan code Johannes Berg
2008-09-08 15:44 ` [PATCH 7/8] mac80211: move some HT code out of mlme.c Johannes Berg
2008-09-08 15:44 ` [PATCH 8/8] mac80211: move some HT code out of main.c Johannes Berg
2008-09-08 15:47 ` [PATCH 9/8] mac80211: clarify scan request Johannes Berg
2008-09-08 15:58 ` [PATCH 10/8] mac80211: simplify scan start Johannes Berg
2008-09-09  7:32 ` [PATCH 11/8] mac80211: remove useless 'ibss' parameter Johannes Berg
2008-09-09  8:57 ` [PATCH 12/8] mac80211: reorder frame code in mlme Johannes Berg
2008-09-09  8:58 ` [PATCH 13/8] mac80211: consolidate deauth/disassoc Johannes Berg
2008-09-09  9:43   ` Tomas Winkler
2008-09-09 10:54 ` [PATCH 14/8] mac80211: split ieee80211_sta_def_wmm_params 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=20080908154441.240689000@sipsolutions.net \
    --to=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;
as well as URLs for NNTP newsgroup(s).