7048d1c690f279afb7a8e080f3471ba085088b52
[openwrt/staging/blocktrron.git] /
1 From 011a56a3336a5de9c3152c169cd52ff79b8c3f89 Mon Sep 17 00:00:00 2001
2 From: Arend van Spriel <arend.vanspriel@broadcom.com>
3 Date: Thu, 11 Jul 2019 10:45:31 +0200
4 Subject: [PATCH] brcmfmac: enable DFS_OFFLOAD extended feature if supported
5
6 If the firmware supports 802.11h and the device can operate in 5GHz
7 band we can enable DFS_OFFLOAD extended feature.
8
9 Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
10 Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
11 Reviewed-by: Franky Lin <franky.lin@broadcom.com>
12 Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
13 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
14 ---
15 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 +++++
16 drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 +
17 drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++-
18 3 files changed, 9 insertions(+), 1 deletion(-)
19
20 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
21 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
22 @@ -6725,6 +6725,11 @@ static int brcmf_setup_wiphy(struct wiph
23 }
24 }
25
26 + if (wiphy->bands[NL80211_BAND_5GHZ] &&
27 + brcmf_feat_is_enabled(ifp, BRCMF_FEAT_DOT11H))
28 + wiphy_ext_feature_set(wiphy,
29 + NL80211_EXT_FEATURE_DFS_OFFLOAD);
30 +
31 wiphy_read_of_freq_limits(wiphy);
32
33 return 0;
34 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
35 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
36 @@ -39,6 +39,7 @@ static const struct brcmf_feat_fwcap brc
37 { BRCMF_FEAT_P2P, "p2p" },
38 { BRCMF_FEAT_MONITOR, "monitor" },
39 { BRCMF_FEAT_MONITOR_FMT_RADIOTAP, "rtap" },
40 + { BRCMF_FEAT_DOT11H, "802.11h" }
41 };
42
43 #ifdef DEBUG
44 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
45 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h
46 @@ -25,6 +25,7 @@
47 * MONITOR: firmware can pass monitor packets to host.
48 * MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header
49 * MONITOR_FMT_HW_RX_HDR: firmware provides monitor packets with hw/ucode header
50 + * DOT11H: firmware supports 802.11h
51 */
52 #define BRCMF_FEAT_LIST \
53 BRCMF_FEAT_DEF(MBSS) \
54 @@ -43,7 +44,8 @@
55 BRCMF_FEAT_DEF(FWSUP) \
56 BRCMF_FEAT_DEF(MONITOR) \
57 BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) \
58 - BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR)
59 + BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR) \
60 + BRCMF_FEAT_DEF(DOT11H)
61
62 /*
63 * Quirks: