brcmfmac: use wiphy_read_of_freq_limits to respect limits from DT
authorRafał Miłecki <rafal@milecki.pl>
Tue, 17 Jan 2017 22:35:50 +0000 (23:35 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 7 Feb 2017 07:57:07 +0000 (09:57 +0200)
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.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

index 0e28d0710af5957abb5c911b21778cdd1542ecf1..10098b7586f3c95de1d2a5a5abc4396f5b13e319 100644 (file)
@@ -5908,6 +5908,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.
                 */
@@ -6509,6 +6512,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;
 }