From patchwork Tue Dec 23 20:05:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avinash Patil X-Patchwork-Id: 5533861 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9AF7D9F1CD for ; Tue, 23 Dec 2014 14:36:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B270C2017D for ; Tue, 23 Dec 2014 14:36:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA82E20165 for ; Tue, 23 Dec 2014 14:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755921AbaLWOgn (ORCPT ); Tue, 23 Dec 2014 09:36:43 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:49227 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750983AbaLWOgm (ORCPT ); Tue, 23 Dec 2014 09:36:42 -0500 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.14.5/8.14.5) with SMTP id sBNEZLw6024721; Tue, 23 Dec 2014 06:36:36 -0800 Received: from sc-owa04.marvell.com ([199.233.58.150]) by mx0b-0016f401.pphosted.com with ESMTP id 1rd602qxjr-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 23 Dec 2014 06:36:36 -0800 Received: from maili.marvell.com (10.93.76.43) by sc-owa02.marvell.com (10.93.76.33) with Microsoft SMTP Server id 8.3.327.1; Tue, 23 Dec 2014 06:36:35 -0800 Received: from pe-lt950 (unknown [10.31.131.41]) by maili.marvell.com (Postfix) with ESMTP id 6D66C3F703F; Tue, 23 Dec 2014 06:36:35 -0800 (PST) Received: from pe-lt950.marvell.com (localhost [127.0.0.1]) by pe-lt950 (8.14.7/8.14.7) with ESMTP id sBNK6ILl006617; Wed, 24 Dec 2014 01:36:18 +0530 Received: (from root@localhost) by pe-lt950.marvell.com (8.14.7/8.14.7/Submit) id sBNK69xF006616; Wed, 24 Dec 2014 01:36:09 +0530 From: Avinash Patil To: CC: , , , , Avinash Patil Subject: [PATCH] cfg80211: check for carrier state only when offchanel CAC supported Date: Wed, 24 Dec 2014 01:35:59 +0530 Message-ID: <1419365159-6577-1-git-send-email-patila@marvell.com> X-Mailer: git-send-email 1.8.1.4 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68, 1.0.33, 0.0.0000 definitions=2014-12-23_05:2014-12-23, 2014-12-23, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1412230147 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Checking for carrier state during start_radar_detection is needed only for devices which support offchannel CAC. This patch adds one more condition while checking for carrier state to see if offchanel CAC is supported, else we need not check carrier state. Signed-off-by: Avinash Patil --- include/net/cfg80211.h | 2 ++ net/wireless/nl80211.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 4ebb816..1b80302 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -2740,6 +2740,7 @@ struct cfg80211_ops { * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels. * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in * beaconing mode (AP, IBSS, Mesh, ...). + * @WIPHY_FLAG_OFFCHAN_CAC: Device supports offchannel CAC. */ enum wiphy_flags { /* use hole at 0 */ @@ -2765,6 +2766,7 @@ enum wiphy_flags { WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21), WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23), + WIPHY_FLAG_OFFCHAN_CAC = BIT(24), }; /** diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index a17d6bc..40290a5 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -6133,7 +6133,8 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, if (err) return err; - if (netif_carrier_ok(dev)) + if ((rdev->wiphy.flags & WIPHY_FLAG_OFFCHAN_CAC) && + netif_carrier_ok(dev)) return -EBUSY; if (wdev->cac_started)