linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gnedt <david.gnedt@davizone.at>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH] cfg80211: fix WEXT ioctl GIWFREQ for monitor interfaces
Date: Mon, 19 Jul 2010 20:41:43 +0200	[thread overview]
Message-ID: <4C449C67.6010004@davizone.at> (raw)

The cfg80211_set_freq function now also saves the channel for monitor
interfaces.
This fixes a issue were the WEXT ioctl GIWFREQ doesn't report the correct
channel when the channel was switched in monitor mode.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
---
 net/wireless/chan.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index d0c92dd..fd05938 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -51,9 +51,6 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
 	struct ieee80211_channel *chan;
 	int result;

-	if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
-		wdev = NULL;
-
 	if (wdev) {
 		ASSERT_WDEV_LOCK(wdev);

@@ -69,7 +66,9 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
 		return -EINVAL;

 	result = rdev->ops->set_channel(&rdev->wiphy,
-					wdev ? wdev->netdev : NULL,
+					wdev && wdev->iftype !=
+						NL80211_IFTYPE_MONITOR ?
+							wdev->netdev : NULL,
 					chan, channel_type);
 	if (result)
 		return result;
-- 
1.6.3.3


             reply	other threads:[~2010-07-19 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 18:41 David Gnedt [this message]
2010-07-19 20:12 ` [PATCH] cfg80211: fix WEXT ioctl GIWFREQ for monitor interfaces Gábor Stefanik
2010-07-19 20:27 ` Johannes Berg
2010-07-19 21:06   ` Gábor Stefanik
2010-07-19 23:28     ` David Gnedt
2010-07-20 13:04       ` Johannes Berg
2010-07-20 16:49         ` Gábor Stefanik

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=4C449C67.6010004@davizone.at \
    --to=david.gnedt@davizone.at \
    --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;
as well as URLs for NNTP newsgroup(s).