From patchwork Thu Jun 23 00:35:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: When on a fixed channel in monitor mode, return what that fixed channel is. Date: Wed, 22 Jun 2011 14:35:28 -0000 From: Nicholas Hockey X-Patchwork-Id: 101564 Message-Id: To: kernel-team@lists.ubuntu.com When on a fixed channel in monitor mode, the kernel does not return the current channel, this should fix that. --- Nicholas (Tilt) Hockey 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; }