b0eec163f1a630ea251f4b723b699343994ac225
[openwrt/staging/jogo.git] /
1 From 01f69dfafdbe7deff58b58053bc3a4a75c6a570c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Sun, 24 Jun 2018 21:44:35 +0200
4 Subject: [PATCH] brcmfmac: detect firmware support for monitor interface
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Many/most of firmwares support creating monitor interface but only the
10 most recent ones explicitly /announce/ it using a "monitor" entry in the
11 list of capabilities.
12
13 Check for that entry and store internally info about monitor mode
14 support using a new feature flag. Once we sort out all details of
15 handling monitor interface it will be used when reporting available
16 interfaces to the cfg80211.
17
18 Later some fallback detecion method may be added for older firmwares.
19 For now just stick to the "monitor" capability which should be 100%
20 reliable.
21
22 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
23 Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
24 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
25 ---
26 drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 +
27 drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++-
28 2 files changed, 4 insertions(+), 1 deletion(-)
29
30 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
31 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
32 @@ -48,6 +48,7 @@ static const struct brcmf_feat_fwcap brc
33 { BRCMF_FEAT_MBSS, "mbss" },
34 { BRCMF_FEAT_MCHAN, "mchan" },
35 { BRCMF_FEAT_P2P, "p2p" },
36 + { BRCMF_FEAT_MONITOR, "monitor" },
37 };
38
39 #ifdef DEBUG
40 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
41 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
42 @@ -33,6 +33,7 @@
43 * MFP: 802.11w Management Frame Protection.
44 * GSCAN: enhanced scan offload feature.
45 * FWSUP: Firmware supplicant.
46 + * MONITOR: firmware can pass monitor packets to host.
47 */
48 #define BRCMF_FEAT_LIST \
49 BRCMF_FEAT_DEF(MBSS) \
50 @@ -48,7 +49,8 @@
51 BRCMF_FEAT_DEF(WOWL_ARP_ND) \
52 BRCMF_FEAT_DEF(MFP) \
53 BRCMF_FEAT_DEF(GSCAN) \
54 - BRCMF_FEAT_DEF(FWSUP)
55 + BRCMF_FEAT_DEF(FWSUP) \
56 + BRCMF_FEAT_DEF(MONITOR)
57
58 /*
59 * Quirks: