From patchwork Thu Mar 30 10:40:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 9653759 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D86076034C for ; Thu, 30 Mar 2017 10:41:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C41212857B for ; Thu, 30 Mar 2017 10:41:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8AB028581; Thu, 30 Mar 2017 10:41:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE49F2857B for ; Thu, 30 Mar 2017 10:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933653AbdC3KlW (ORCPT ); Thu, 30 Mar 2017 06:41:22 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:47676 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933333AbdC3KlS (ORCPT ); Thu, 30 Mar 2017 06:41:18 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2UAdP30029599 for ; Thu, 30 Mar 2017 03:41:17 -0700 Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 29h0ah81k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 30 Mar 2017 03:41:16 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 30 Mar 2017 03:41:15 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 30 Mar 2017 03:41:15 -0700 Received: from pe-lt949 (unknown [10.31.130.205]) by maili.marvell.com (Postfix) with ESMTP id 3474A3F703F; Thu, 30 Mar 2017 03:41:14 -0700 (PDT) Received: from pe-lt949 (piotr-probook.localdomain [127.0.0.1]) by pe-lt949 (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id v2UAewXZ006633; Thu, 30 Mar 2017 16:10:58 +0530 Received: (from root@localhost) by pe-lt949 (8.14.4/8.14.4/Submit) id v2UAew3l006632; Thu, 30 Mar 2017 16:10:58 +0530 From: Amitkumar Karwar To: CC: Ganapathi Bhat , Karthik D A , Amitkumar Karwar Subject: [PATCH] mwifiex: apply radar flag Date: Thu, 30 Mar 2017 16:10:50 +0530 Message-ID: <1490870450-6601-1-git-send-email-akarwar@marvell.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-30_07:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703300095 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Karthik D A When IEEE80211_CHAN_RADAR is set by cfg80211, passive scan must be performed. In mwifiex,active scan is performed even though flag is set from cfg80211. mwifiex_reg_apply_radar_flags() function added in this patch correctly uses radar flag. Signed-off-by: Karthik D A Signed-off-by: Amitkumar Karwar --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index 1e3bd43..44d0617 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -594,6 +594,24 @@ int mwifiex_send_domain_info_cmd_fw(struct wiphy *wiphy) return 0; } +static void mwifiex_reg_apply_radar_flags(struct wiphy *wiphy) +{ + struct ieee80211_supported_band *sband; + struct ieee80211_channel *chan; + unsigned int i; + + if (!wiphy->bands[NL80211_BAND_5GHZ]) + return; + sband = wiphy->bands[NL80211_BAND_5GHZ]; + + for (i = 0; i < sband->n_channels; i++) { + chan = &sband->channels[i]; + if ((!(chan->flags & IEEE80211_CHAN_DISABLED)) && + (chan->flags & IEEE80211_CHAN_RADAR)) + chan->flags |= IEEE80211_CHAN_NO_IR; + } +} + /* * CFG802.11 regulatory domain callback function. * @@ -613,6 +631,7 @@ static void mwifiex_reg_notifier(struct wiphy *wiphy, mwifiex_dbg(adapter, INFO, "info: cfg80211 regulatory domain callback for %c%c\n", request->alpha2[0], request->alpha2[1]); + mwifiex_reg_apply_radar_flags(wiphy); switch (request->initiator) { case NL80211_REGDOM_SET_BY_DRIVER: