From patchwork Fri Jun 29 10:47:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 1131381 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8A08BDFF34 for ; Fri, 29 Jun 2012 10:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754750Ab2F2Kr3 (ORCPT ); Fri, 29 Jun 2012 06:47:29 -0400 Received: from ebb06.tieto.com ([131.207.168.38]:62843 "EHLO ebb06.tieto.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754402Ab2F2Kr1 (ORCPT ); Fri, 29 Jun 2012 06:47:27 -0400 X-AuditID: 83cfa826-b7cabae00000347a-c9-4fed87be631b Received: from FIVLA-EXHUB02.eu.tieto.com ( [131.207.136.42]) by ebb06.tieto.com (SMTP Mailer) with SMTP id 1A.D0.13434.EB78DEF4; Fri, 29 Jun 2012 13:47:26 +0300 (EEST) Received: from localhost (10.28.23.78) by inbound.tieto.com (131.207.136.49) with Microsoft SMTP Server id 8.3.245.1; Fri, 29 Jun 2012 13:47:26 +0300 From: Michal Kazior To: CC: , Michal Kazior Subject: [PATCH 08/13] cfg80211: refuse to .set_monitor_channel when non-monitors are present Date: Fri, 29 Jun 2012 12:47:03 +0200 Message-ID: <1340966828-22874-9-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1340966828-22874-1-git-send-email-michal.kazior@tieto.com> References: <1340966828-22874-1-git-send-email-michal.kazior@tieto.com> MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Having .set_monitor_channel work with non-monitor interfaces running would make interface combinations accounting ambiguous. Signed-off-by: Michal Kazior --- net/wireless/chan.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 167e7cb..019401b 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -85,6 +85,8 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, if (!rdev->ops->set_monitor_channel) return -EOPNOTSUPP; + if (!cfg80211_has_monitors_only(rdev)) + return -EBUSY; chan = rdev_freq_to_chan(rdev, freq, chantype); if (!chan)