diff mbox

When on a fixed channel in monitor mode, return what that fixed channel is.

Message ID BANLkTik+Ewz7MV2Lbg9zO+70oPJePDqGCg@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Nicholas Hockey June 23, 2011, 7:51 p.m. UTC
i was directed this way from the ubuntu kernel mailing list. When on a
fixed channel in monitor mode, the kernel does not return the current
channel, this should fix that.

Comments

Luis Rodriguez June 23, 2011, 7:53 p.m. UTC | #1
On Thu, Jun 23, 2011 at 12:51 PM, Nicholas Hockey <nhockey@gmail.com> wrote:
> i was directed this way from the ubuntu kernel mailing list. When on a
> fixed channel in monitor mode, the kernel does not return the current
> channel, this should fix that.

http://wireless.kernel.org/en/developers/Documentation/SubmittingPatches

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 17cd0c0..261ee32 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -82,10 +82,12 @@  int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
 {
 	struct ieee80211_channel *chan;
 	int result;
+    struct wireless_dev *mon_dev = NULL;
 
-	if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
+	if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) {
+        mon_dev = wdev;
 		wdev = NULL;
-
+    }
 	if (wdev) {
 		ASSERT_WDEV_LOCK(wdev);
 
@@ -131,5 +133,8 @@  int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
 	if (wdev)
 		wdev->channel = chan;
 
+    if (mon_dev)
+        mon_dev->channel = chan;
+
 	return 0;
 }