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 3/3] mac80211: BSS info: check channel first
Date: Mon, 08 Sep 2008 11:05:10 +0200	[thread overview]
Message-ID: <20080908090635.149921000@sipsolutions.net> (raw)
In-Reply-To: 20080908090507.641740000@sipsolutions.net

When we receive information about a BSS we check at some point
whether or not we think we're allowed to use the channel it is
on, but we do that fairly late. I don't think we should do it
that late, so do it earlier to avoid doing IBSS/mesh stuff on
that channel and then getting confused because it's disabled.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

--- everything.orig/net/mac80211/mlme.c	2008-09-08 10:21:17.000000000 +0200
+++ everything/net/mac80211/mlme.c	2008-09-08 10:21:25.000000000 +0200
@@ -2603,7 +2603,15 @@ static void ieee80211_rx_bss_info(struct
 	DECLARE_MAC_BUF(mac);
 	DECLARE_MAC_BUF(mac2);
 
-	beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp);
+	if (elems->ds_params && elems->ds_params_len == 1)
+		freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
+	else
+		freq = rx_status->freq;
+
+	channel = ieee80211_get_channel(local->hw.wiphy, freq);
+
+	if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
+		return;
 
 	if (ieee80211_vif_is_mesh(&sdata->vif) && elems->mesh_id &&
 	    elems->mesh_config && mesh_matches_local(elems, sdata)) {
@@ -2646,16 +2654,6 @@ static void ieee80211_rx_bss_info(struct
 		rcu_read_unlock();
 	}
 
-	if (elems->ds_params && elems->ds_params_len == 1)
-		freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
-	else
-		freq = rx_status->freq;
-
-	channel = ieee80211_get_channel(local->hw.wiphy, freq);
-
-	if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
-		return;
-
 #ifdef CONFIG_MAC80211_MESH
 	if (elems->mesh_config)
 		bss = ieee80211_rx_mesh_bss_get(local, elems->mesh_id,
@@ -2724,6 +2722,8 @@ static void ieee80211_rx_bss_info(struct
 
 	bss->band = band;
 
+	beacon_timestamp = le64_to_cpu(mgmt->u.beacon.timestamp);
+
 	bss->timestamp = beacon_timestamp;
 	bss->last_update = jiffies;
 	bss->signal = rx_status->signal;

-- 


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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08  9:05 [PATCH 0/3] small mac80211 updates Johannes Berg
2008-09-08  9:05 ` [PATCH 1/3] mac80211: move some RCU locking into an if branch Johannes Berg
2008-09-08  9:05 ` [PATCH 2/3] mac80211: make conf_tx non-atomic Johannes Berg
2008-09-08  9:05 ` Johannes Berg [this message]
2008-09-08 13:41 ` [PATCH 4/3] mac80211: fix action frame length checks Johannes Berg
2008-09-08 14:31 ` [PATCH 5/3] mac80211: fix typo in action frame handling Johannes Berg
2008-09-08 20:58   ` Tomas Winkler
2008-09-09  6:30     ` Johannes Berg
2008-09-08 14:40 ` [PATCH 6/3] mac80211: move IE parsing to util file 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=20080908090635.149921000@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).