From patchwork Sun Jun 24 19:44:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 10484843 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 2F8566023A for ; Sun, 24 Jun 2018 19:50:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BB5828469 for ; Sun, 24 Jun 2018 19:50:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1091A2886B; Sun, 24 Jun 2018 19:50:22 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 F22D628864 for ; Sun, 24 Jun 2018 19:50:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751851AbeFXTqz (ORCPT ); Sun, 24 Jun 2018 15:46:55 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:41624 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbeFXTqy (ORCPT ); Sun, 24 Jun 2018 15:46:54 -0400 Received: by mail-lj1-f195.google.com with SMTP id v12-v6so4451335ljj.8 for ; Sun, 24 Jun 2018 12:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FWQl/zT+FWGK4abGUeO1Stawi7fvRcm7agQL4sB9rEc=; b=QwboPzIVITZXnosbRhqgTwedGBts6lBM6JNBMWIMO8IYO0InrRGdrNYS/gOyCrd+Xe lHdNZ69qe6uCHUA7pc2PHrN8/9X5tfr5OTB7CwWfPFvDcnaydPR9B9VC4lQXp5GmXxsc Vq4Rk4veJnU/mUll6LAwzTOMdn64LjClg754cufR/QesGx8bcfrR7XdJWEmxghak7/oz fNK5usk5SRS0zcLKfeoGhp39qDaWrTkjvQvMp1NevdMHd62HWo58IiFLqPv6tL/+eSoL miCZaZgrgmFj1o78A//8XsVCQz154NHPZNO4jrp0CkiLqMb36Vs6L+4ziadRjUTvMmt5 YjbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FWQl/zT+FWGK4abGUeO1Stawi7fvRcm7agQL4sB9rEc=; b=UX4arpcOhloOm66jLbcjsbtuhGJlYANmZb4Nxm4Ovb2bau9j4e8TWpLOks6gJJLzOy 9wX/auJI7cYF7uGvWuzg/levSHCaFgIyW52FHl0h9roPb30MQ3ZAsUSE2ssPl2rZrotu F7/TfXrRV+A8aPWNqGwMqkpuZVXZCuz9fmDmT21IwSp6i+uIoNMdClUV0NH10VZHYTF5 SBG3lXGvRABQwhQFCIBPVsCbjKcVYjnsU0JY+7n5uCDwg/9IIoLUCJ7wlNqixbqnizSx E66PTiTcIEKxPiA+Li75bcjlqpPGNe/x6AEnMuDehQTQw/+zo4sfnxQTkkZtV0++tyvp 7Qhw== X-Gm-Message-State: APt69E2RmE9z24YxPH3+IQlnYFoUrR6DzANWlZN/oF89xwJyYAjUWYvt Cgnmw5OMVjcZ7QNDDdG/TQnimA== X-Google-Smtp-Source: ADUXVKLrUUlT/JYWWBBRqOpOhSx4kyg8uqOlEtOioRuJrmhWv15kx6DttwrHGnO149Gg+3DL04uWVw== X-Received: by 2002:a2e:94d7:: with SMTP id r23-v6mr6070751ljh.102.1529869613300; Sun, 24 Jun 2018 12:46:53 -0700 (PDT) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id r77-v6sm1320556lfe.43.2018.06.24.12.46.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Jun 2018 12:46:52 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo , Arend van Spriel Cc: Franky Lin , Hante Meuleman , Chi-Hsien Lin , Wright Feng , Pieter-Paul Giesberts , Chung-Hsien Hsu , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH V4 1/3] brcmfmac: detect firmware support for monitor interface Date: Sun, 24 Jun 2018 21:44:35 +0200 Message-Id: <20180624194437.28766-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 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: Rafał Miłecki Many/most of firmwares support creating monitor interface but only the most recent ones explicitly /announce/ it using a "monitor" entry in the list of capabilities. Check for that entry and store internally info about monitor mode support using a new feature flag. Once we sort out all details of handling monitor interface it will be used when reporting available interfaces to the cfg80211. Later some fallback detecion method may be added for older firmwares. For now just stick to the "monitor" capability which should be 100% reliable. Signed-off-by: Rafał Miłecki Acked-by: Arend van Spriel --- V3: Patch added to the series V4: Dropped fallback code as it was reported to be incorrect Updated new feature flag description as preferred by Arend --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 + drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c index 800a423c7bc2..a78b9bae44e0 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c @@ -48,6 +48,7 @@ static const struct brcmf_feat_fwcap brcmf_fwcap_map[] = { { BRCMF_FEAT_MBSS, "mbss" }, { BRCMF_FEAT_MCHAN, "mchan" }, { BRCMF_FEAT_P2P, "p2p" }, + { BRCMF_FEAT_MONITOR, "monitor" }, }; #ifdef DEBUG diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h index d1193825e559..3415d5d4d6b5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h @@ -33,6 +33,7 @@ * MFP: 802.11w Management Frame Protection. * GSCAN: enhanced scan offload feature. * FWSUP: Firmware supplicant. + * MONITOR: firmware can pass monitor packets to host. */ #define BRCMF_FEAT_LIST \ BRCMF_FEAT_DEF(MBSS) \ @@ -48,7 +49,8 @@ BRCMF_FEAT_DEF(WOWL_ARP_ND) \ BRCMF_FEAT_DEF(MFP) \ BRCMF_FEAT_DEF(GSCAN) \ - BRCMF_FEAT_DEF(FWSUP) + BRCMF_FEAT_DEF(FWSUP) \ + BRCMF_FEAT_DEF(MONITOR) /* * Quirks: