From patchwork Fri Dec 26 11:00:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avinash Patil X-Patchwork-Id: 5542781 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19EB1BEEA8 for ; Fri, 26 Dec 2014 11:01:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D59220155 for ; Fri, 26 Dec 2014 11:01:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7034520154 for ; Fri, 26 Dec 2014 11:01:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751513AbaLZLBg (ORCPT ); Fri, 26 Dec 2014 06:01:36 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:39223 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbaLZLBf (ORCPT ); Fri, 26 Dec 2014 06:01:35 -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 sBQAxpqb024622 for ; Fri, 26 Dec 2014 03:01:35 -0800 Received: from sc-owa.marvell.com ([199.233.58.135]) by mx0b-0016f401.pphosted.com with ESMTP id 1rfdgcppsp-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Fri, 26 Dec 2014 03:01:35 -0800 Received: from maili.marvell.com (10.93.76.43) by SC-OWA.marvell.com (10.93.76.28) with Microsoft SMTP Server id 8.3.327.1; Fri, 26 Dec 2014 03:01:33 -0800 Received: from pe-lt101 (unknown [10.31.130.182]) by maili.marvell.com (Postfix) with ESMTP id D11013F703F; Fri, 26 Dec 2014 03:01:33 -0800 (PST) Received: from pe-lt101 (pe-lt077 [127.0.0.1]) by pe-lt101 (8.14.4/8.14.4) with ESMTP id sBQB0OKs004027; Fri, 26 Dec 2014 03:00:25 -0800 Received: (from root@localhost) by pe-lt101 (8.14.4/8.14.4/Submit) id sBQB0L6T004026; Fri, 26 Dec 2014 03:00:21 -0800 From: Avinash Patil To: CC: , , Avinash Patil Subject: [PATCH v2] cfg80211: check for carrier state only when offchanel CAC supported Date: Fri, 26 Dec 2014 03:00:13 -0800 Message-ID: <1419591613-3998-1-git-send-email-patila@marvell.com> X-Mailer: git-send-email 1.7.3.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-25_06:2014-12-24, 2014-12-25, 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-1412260118 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 provides this additional check of extended feature offchannel CAC support while checking for carrier state. Signed-off-by: Avinash Patil --- include/uapi/linux/nl80211.h | 3 +++ net/wireless/nl80211.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 735ab43..61f7daad 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -4205,11 +4205,14 @@ enum nl80211_feature_flags { /** * enum nl80211_ext_feature_index - bit index of extended features. * + * @NL80211_EXT_FEATURE_OFFCHAN_CAC: This device/driver supports + * offchannel Channel Availibility Check(CAC). * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ enum nl80211_ext_feature_index { + NL80211_EXT_FEATURE_OFFCHAN_CAC, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 39753de..b2abb37 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -6138,7 +6138,9 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, if (err) return err; - if (netif_carrier_ok(dev)) + if (wiphy_ext_feature_isset(&rdev->wiphy, + NL80211_EXT_FEATURE_OFFCHAN_CAC) && + netif_carrier_ok(dev)) return -EBUSY; if (wdev->cac_started)