Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Jes Sorensen <jes@trained-monkey.org>
Subject: [PATCH] mac80211: filter scan results on unusable channels
Date: Sun, 16 Mar 2008 18:42:44 +0100	[thread overview]
Message-ID: <1205689364.3878.9.camel@johannes.berg> (raw)

When you have an AP on channel 13, it will currently often enough
be listed in scan results even when the regulatory domain restricts
to channels 1-11. This is due to channel overlap. To avoid getting
very strange failures, don't show such APs in the scan results. The
failure mode will now go from "I can see the AP but not associate"
to "I can't see the AP although I know it's there" which is easier
to debug.

This problem was first really noticed by Jes Sorensen.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Jes Sorensen <jes@trained-monkey.org>
---
Depends on the previous patch adding the ieee80211_get_channel function.

 net/mac80211/ieee80211_sta.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- everything.orig/net/mac80211/ieee80211_sta.c	2008-03-16 18:17:24.000000000 +0100
+++ everything/net/mac80211/ieee80211_sta.c	2008-03-16 18:37:27.000000000 +0100
@@ -2356,6 +2356,7 @@ static void ieee80211_rx_bss_info(struct
 	struct sta_info *sta;
 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 	u64 beacon_timestamp, rx_timestamp;
+	struct ieee80211_channel *channel;
 	DECLARE_MAC_BUF(mac);
 	DECLARE_MAC_BUF(mac2);
 
@@ -2420,6 +2421,11 @@ static void ieee80211_rx_bss_info(struct
 	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(dev, elems.mesh_id,



                 reply	other threads:[~2008-03-16 17:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1205689364.3878.9.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=jes@trained-monkey.org \
    --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