From patchwork Wed Apr 5 11:36:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapathi Bhat X-Patchwork-Id: 9663805 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 358D7602B8 for ; Wed, 5 Apr 2017 11:39:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 175BA285A3 for ; Wed, 5 Apr 2017 11:39:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BB94285BE; Wed, 5 Apr 2017 11:39:09 +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 4C34F285A3 for ; Wed, 5 Apr 2017 11:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933125AbdDELjG (ORCPT ); Wed, 5 Apr 2017 07:39:06 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:42264 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933102AbdDELjE (ORCPT ); Wed, 5 Apr 2017 07:39:04 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v35BYWut025039 for ; Wed, 5 Apr 2017 04:39:03 -0700 Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 29m7fdqshg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 05 Apr 2017 04:39:03 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 5 Apr 2017 04:39:01 -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; Wed, 5 Apr 2017 04:39:01 -0700 Received: from localhost (unknown [10.31.130.228]) by maili.marvell.com (Postfix) with ESMTP id E06F23F703F; Wed, 5 Apr 2017 04:39:01 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by localhost (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id v35Bbfie011115; Wed, 5 Apr 2017 17:07:41 +0530 Received: (from root@localhost) by localhost (8.14.4/8.14.4/Submit) id v35Bbf6C011114; Wed, 5 Apr 2017 17:07:41 +0530 From: Ganapathi Bhat To: CC: Cathy Luo , Nishant Sarmukadam , Karthik Ananthapadmanabha , Amitkumar Karwar , Ganapathi Bhat Subject: [PATCH v2] mwifiex: apply radar flag Date: Wed, 5 Apr 2017 17:06:20 +0530 Message-ID: <1491392180-11078-1-git-send-email-gbhat@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-04-05_09:, , 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-1704050102 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 Ananthapadmanabha 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 Ananthapadmanabha Signed-off-by: Amitkumar Karwar Signed-off-by: Ganapathi Bhat --- v3: corrected author name --- 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: