From patchwork Tue Mar 3 11:50:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 216379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CBD4C3F2CD for ; Tue, 3 Mar 2020 11:50:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AE2720866 for ; Tue, 3 Mar 2020 11:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729091AbgCCLug (ORCPT ); Tue, 3 Mar 2020 06:50:36 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:59758 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728350AbgCCLug (ORCPT ); Tue, 3 Mar 2020 06:50:36 -0500 Received: from localhost.localdomain (unknown [141.24.207.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 816D8580074; Tue, 3 Mar 2020 12:50:34 +0100 (CET) From: Markus Theil To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, nbd@nbd.name, lorenzo@kernel.org, Markus Theil Subject: [PATCH 2/3] mac80211: conditionally allow scan in monitor mode Date: Tue, 3 Mar 2020 12:50:16 +0100 Message-Id: <20200303115017.9845-2-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200303115017.9845-1-markus.theil@tu-ilmenau.de> References: <20200303115017.9845-1-markus.theil@tu-ilmenau.de> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This patch checks the monitor mode scan feature flag and conditionally allows scanning in monitor mode for hw which supports this. Signed-off-by: Markus Theil --- net/mac80211/cfg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 7b654d2b8bb2..01a20f2dbf86 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2313,6 +2313,12 @@ static int ieee80211_scan(struct wiphy *wiphy, !(req->flags & NL80211_SCAN_FLAG_AP))) return -EOPNOTSUPP; break; + case NL80211_IFTYPE_MONITOR: + if (wiphy_ext_feature_isset(wiphy, + NL80211_EXT_FEATURE_MONITOR_MODE_SCAN)) + break; + else + return -EOPNOTSUPP; case NL80211_IFTYPE_NAN: default: return -EOPNOTSUPP;