mac80211: brcmfmac: backport scheduled scan cleanup and chip support
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 360-0003-brcmfmac-setup-wiphy-bands-after-registering-it-firs.patch
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Date: Sat, 7 Jan 2017 21:36:05 +0100
3 Subject: [PATCH] brcmfmac: setup wiphy bands after registering it first
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
7
8 During bands setup we disable all channels that firmware doesn't support
9 in the current regulatory setup. If we do this before wiphy_register
10 it will result in copying set flags (including IEEE80211_CHAN_DISABLED)
11 to the orig_flags which is supposed to be persistent. We don't want this
12 as regulatory change may result in enabling some channels. We shouldn't
13 mess with orig_flags then (by changing them or ignoring them) so it's
14 better to just take care of their proper values.
15
16 This patch cleanups code a bit (by taking orig_flags more seriously) and
17 allows further improvements like disabling really unavailable channels.
18 We will need that e.g. if some frequencies should be disabled for good
19 due to hardware setup (design).
20
21 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
22 Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
23 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
24 ---
25
26 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
27 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
28 @@ -6475,8 +6475,7 @@ static int brcmf_setup_wiphy(struct wiph
29 wiphy->bands[NL80211_BAND_5GHZ] = band;
30 }
31 }
32 - err = brcmf_setup_wiphybands(wiphy);
33 - return err;
34 + return 0;
35 }
36
37 static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
38 @@ -6841,6 +6840,12 @@ struct brcmf_cfg80211_info *brcmf_cfg802
39 goto priv_out;
40 }
41
42 + err = brcmf_setup_wiphybands(wiphy);
43 + if (err) {
44 + brcmf_err("Setting wiphy bands failed (%d)\n", err);
45 + goto wiphy_unreg_out;
46 + }
47 +
48 /* If cfg80211 didn't disable 40MHz HT CAP in wiphy_register(),
49 * setup 40MHz in 2GHz band and enable OBSS scanning.
50 */