From patchwork Thu Jun 23 00:35:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Hockey X-Patchwork-Id: 101564 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 4CE34B6F84 for ; Thu, 23 Jun 2011 10:35:44 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QZXtL-0001mC-F9; Thu, 23 Jun 2011 00:35:31 +0000 Received: from mail-fx0-f49.google.com ([209.85.161.49]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1QZXtI-0001m4-OP for kernel-team@lists.ubuntu.com; Thu, 23 Jun 2011 00:35:28 +0000 Received: by fxm14 with SMTP id 14so1189029fxm.8 for ; Wed, 22 Jun 2011 17:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=H7Hg5lWisPK6TwfiIwAyhoocN09jiBirbYpQAxEpn1M=; b=KRFi6pStlUAU+D14V46Fo+k4MfIic/ioIyDO8EpSDh/vawBVrDF5QCGoT6tvL6xdWf Hok3R8MUkvg1cRTLsB52vC39/dRUTrRP8JkWmQPYryDMwhqmPW1zFjFbbPRK4YA4ccS4 Y7Qo9+Lba3LPydSc/V19FbqOzMaCFQ47jaQhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LNQaj6EFTuuUm/XMtOyHrZNSem2Ggg61BLhmZo70jmP2t/WrgqYJuX0aVTrnI3rqnm jZ1tqzpXSbQbBov2gdHyQ3JAWTHUrzVO1lb60poBeuhCe2ZgcsWy9+RQBGyPj23hA/G7 kW4UnHnBuNdF2/8dKBnMIVsceZ0Gn0Uf1OFmY= MIME-Version: 1.0 Received: by 10.223.145.24 with SMTP id b24mr1693687fav.89.1308789328553; Wed, 22 Jun 2011 17:35:28 -0700 (PDT) Received: by 10.223.87.11 with HTTP; Wed, 22 Jun 2011 17:35:28 -0700 (PDT) Date: Wed, 22 Jun 2011 20:35:28 -0400 Message-ID: Subject: When on a fixed channel in monitor mode, return what that fixed channel is. From: Nicholas Hockey To: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@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; }