brcmfmac: use wiphy_read_of_freq_limits to respect limits from DT
PATCH 1/1 brcmfmac: use wiphy_read_of_freq_limits to respect limits from DT
From: Rafał Miłecki <[email protected]>
This new helper reads extra frequency limits specified in DT and disables unavailable chanels. This is useful for devices (like home routers) with chipsets limited e.g. by board design.
In order to respect info read from DT we simply need to check for IEEE80211_CHAN_DISABLED bit when constructing channel info.
---
This patch requires e691ac2f75b6 ("cfg80211: support ieee80211-freq-limit DT property") that is currently in net-next.
Kalle: feel free to postpone this until merging net-next one day.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +6 -0
@@ -5886,6 +5886,9 @@ static int brcmf_construct_chaninfo(struct brcmf_cfg80211_info *cfg,continue ; } +if (channel->orig_flags &IEEE80211_CHAN_DISABLED ) +continue ; +/* assuming the chanspecs order is HT20, * HT40 upper, HT40 lower, and VHT80. */
@@ -6477,6 +6480,9 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) wiphy->bands[NL80211_BAND_5GHZ ] = band; } } + +wiphy_read_of_freq_limits (wiphy); +return 0 ; }
Signature · 1 line
2.10.1
kbuild test robot
build botreproduce:
Hi Rafał,
[auto build test ERROR on wireless-drivers-next/master]
[cannot apply to v4.10-rc4 next-20170117]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/brcmfmac-use-wiphy_read_of_freq_limits-to-respect-limits-from-DT/20170118-122222 base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master config: x86_64-randconfig-x013-201703 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function 'brcmf_setup_wiphy':
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:6484:2: error: implicit declaration of function 'wiphy_read_of_freq_limits' [-Werror=implicit-function-declaration]
wiphy_read_of_freq_limits(wiphy);
^~~~~~~~~~~~~~~~~~~~~~~~~cc1: some warnings being treated as errors
vim +/wiphy_read_of_freq_limits +6484 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
6478
6479 band->n_channels = ARRAY_SIZE(__wl_5ghz_channels);
6480 wiphy->bands[NL80211_BAND_5GHZ] = band;
6481 }
6482 }
6483
> 6484 wiphy_read_of_freq_limits(wiphy);
6485
6486 return 0;
6487 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Quoted 5 lines · kbuild test robot
Hi Rafa=C5=82,
[auto build test ERROR on wireless-drivers-next/master] [cannot apply to v4.10-rc4 next-20170117]
[if your patch is applied to the wrong git tree, please drop us a note to=
help improve the system]
Quoted 2 lines
url: https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/brcmfmac-us=
e-wiphy_read_of_freq_limits-to-respect-limits-from-DT/20170118-122222
Quoted 1 line
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-dr=
ivers-next.git master
Quoted 9 lines
config: x86_64-randconfig-x013-201703 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:# save the attached .config to linux build tree make ARCH=3Dx86_64=20All errors (new ones prefixed by >>):
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In functi=
on 'brcmf_setup_wiphy':
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:6484:2: err=
or: implicit declaration of function 'wiphy_read_of_freq_limits' [-Werror= =3Dimplicit-function-declaration]
Quoted 2 lines
wiphy_read_of_freq_limits(wiphy);
^~~~~~~~~~~~~~~~~~~~~~~~~The compiler error is expected as this depends on a cfg80211 patch not yet in wireless-drivers-next.
--=20
Kalle Valo
Quoted 6 lines · Rafa=C5=82 Mi=C5=82ecki <[email protected]> writes:
From: Rafa=C5=82 Mi=C5=82ecki <[email protected]>
This new helper reads extra frequency limits specified in DT and disables unavailable chanels. This is useful for devices (like home routers) with chipsets limited e.g. by board design.
Quoted 6 lines
In order to respect info read from DT we simply need to check for
IEEE80211_CHAN_DISABLEDbit when constructing channel info.Signed-off-by Rafa=C5=82 Mi=C5=82ecki <[email protected]>---
This patch requirese691ac2f75b6("cfg80211: support ieee80211-freq-limit=
DT
Quoted 3 lines
property") that is currently in net-next.
Kalle: feel free to postpone this until merging net-next one day.
Thanks for documenting the dependency perfectly, makes my work a lot easier. I'm expecting to merge net-next after my next pull request, most likely early next week.
--=20
Kalle Valo
Quoted 10 lines · Rafał Miłecki
From: Rafał Miłecki <[email protected]>
This new helper reads extra frequency limits specified in DT and disables unavailable chanels. This is useful for devices (like home routers) with chipsets limited e.g. by board design.
In order to respect info read from DT we simply need to check for
IEEE80211_CHAN_DISABLEDbit when constructing channel info.Signed-off-by Rafał Miłecki <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
0f83ff697356 brcmfmac: use wiphy_read_of_freq_limits to respect limits from DT
Signature · 6 lines
https://patchwork.kernel.org/patch/9522069/ Documentation about submitting wireless patches and checking status from patchwork: https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches