diff mbox

[V4,1/3] brcmfmac: detect firmware support for monitor interface

Message ID 20180624194437.28766-1-zajec5@gmail.com (mailing list archive)
State Accepted
Commit 01f69dfafdbe7deff58b58053bc3a4a75c6a570c
Delegated to: Kalle Valo
Headers show

Commit Message

Rafał Miłecki June 24, 2018, 7:44 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

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 <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
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(-)

Comments

Kalle Valo July 4, 2018, 3:07 p.m. UTC | #1
Rafał Miłecki wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> 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 <rafal@milecki.pl>
> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>

3 patches applied to wireless-drivers-next.git, thanks.

01f69dfafdbe brcmfmac: detect firmware support for monitor interface
e63410ac65e0 brcmfmac: detect firmware support for radiotap monitor frames
a8d7631858af brcmfmac: handle msgbuf packets marked with monitor mode flag
diff mbox

Patch

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: