From patchwork Tue Jan 17 22:35:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9522069 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E864D6020B for ; Tue, 17 Jan 2017 22:43:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBB9D285A2 for ; Tue, 17 Jan 2017 22:43:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE7C128602; Tue, 17 Jan 2017 22:43:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B3A2285A2 for ; Tue, 17 Jan 2017 22:43:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbdAQWns (ORCPT ); Tue, 17 Jan 2017 17:43:48 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33846 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbdAQWnr (ORCPT ); Tue, 17 Jan 2017 17:43:47 -0500 Received: by mail-lf0-f68.google.com with SMTP id q89so18009391lfi.1 for ; Tue, 17 Jan 2017 14:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+3bDYj9OFe4wO8/VUc+jNUD7Z2QrsNXYF/e9Jn+cVFY=; b=k545duR2i+B/x3bENa9maDQvNrtF2oDcO7Ds01v8Lv8ifx+9sD/+5NBupQL/sD5JTb T98HSjqyBSvviy3oQF0coh9Q+edkTWKsu5LxR42GnsBhxcZ3jqWeqaCq9AGwBqiq4SOC j0g8vEOBt4hzK1MCFQ0SFeMa6AwpIVIdKrCYCUaJA82SDEMFe4QrQszqqNwNVgUEKxTL UFqKZ+mebFlnr+sg0hNIfpF7LW+q96nauWxlRZnPHnm+rjlf5/q3IN+m3omxFizV3FQa nsRyRy2Sqaewt4aba+u0MI/aRdkaTNwFoyOHkGyq5ubxhOa1zJ3q8/gZNSeUlyvXxi3k /W1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+3bDYj9OFe4wO8/VUc+jNUD7Z2QrsNXYF/e9Jn+cVFY=; b=M2T3VZsr61bsIucfUz0m1PkV5rEmcVPjJoLQhXmybagsJAML8C4dHcwlondAhcB5T3 NUY48vWIke72TRUjUHOnW8hcQyTAjTI8mVcVLoCcrEoZ2Kt/Gyb6AxoQMxm7MhJH4+vo fXDAbVYE/AXXN87y4Cj/7wKUjbLZzpUYpb353gkSJC7fY3QEQ60RoiKTVA7/sxD87s1D SDeRzilw8BuchXa7apnivooj4qwLEnJsMHvjCtVR2XxgisRtjHrK6WMjcj9Or92UrNlT VAVQ/38SI8d3qE5XeBB+MugBKtcrTVrbDwgrHdTsUTPmUR/1+GaJiUl/4IOcbSEav2PC La3w== X-Gm-Message-State: AIkVDXKxYFKvrNe/QxKjIluKr8kz0ApJgvhNAkd0jXZLY+h4Z1dKdnzgml1JKxgZzN4qgw== X-Received: by 10.25.24.152 with SMTP id 24mr12117lfy.12.1484692570377; Tue, 17 Jan 2017 14:36:10 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id h23sm5288612lji.34.2017.01.17.14.36.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 14:36:09 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH] brcmfmac: use wiphy_read_of_freq_limits to respect limits from DT Date: Tue, 17 Jan 2017 23:35:50 +0100 Message-Id: <20170117223550.12114-1-zajec5@gmail.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki 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 --- 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(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index ec1171c..b96fc88 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -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; }