From patchwork Thu Mar 29 06:58:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 10314563 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 0094F60353 for ; Thu, 29 Mar 2018 06:58:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E58912A233 for ; Thu, 29 Mar 2018 06:58:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D89692A235; Thu, 29 Mar 2018 06:58:42 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 8D2302A233 for ; Thu, 29 Mar 2018 06:58:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751211AbeC2G63 (ORCPT ); Thu, 29 Mar 2018 02:58:29 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44660 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbeC2G62 (ORCPT ); Thu, 29 Mar 2018 02:58:28 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id B7B146070A; Thu, 29 Mar 2018 06:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522306707; bh=Cck1KFmdAODl4fLXfw7CnILbKtezcB4oWyWYAwuxzMU=; h=From:To:Cc:Subject:Date:From; b=ALj78ztqwEKFQii6bCd0Hy/sbGbqrG+8Zhk7507Z7CZCL/Mf9N/OeHOYHLanhTs4s cItZBydRtj006nblSiEoHG6ILLRPEzKORX2DAAHW5DNG8BWRwwmfFNTZe/1dQdGueR v1IAiPitqfD4niK/VEBqOzCkDAxexHopRO5CaGhs= Received: from lx-rfried.mea.qualcomm.com (unknown [185.23.60.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rfried@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4FABC6028D; Thu, 29 Mar 2018 06:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522306707; bh=Cck1KFmdAODl4fLXfw7CnILbKtezcB4oWyWYAwuxzMU=; h=From:To:Cc:Subject:Date:From; b=ALj78ztqwEKFQii6bCd0Hy/sbGbqrG+8Zhk7507Z7CZCL/Mf9N/OeHOYHLanhTs4s cItZBydRtj006nblSiEoHG6ILLRPEzKORX2DAAHW5DNG8BWRwwmfFNTZe/1dQdGueR v1IAiPitqfD4niK/VEBqOzCkDAxexHopRO5CaGhs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4FABC6028D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rfried@codeaurora.org From: Ramon Fried To: kvalo@codeaurora.org, loic.poulain@linaro.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ramon Fried Subject: [PATCH v2] wcn36xx: Disable 5GHz for wcn3610 Date: Thu, 29 Mar 2018 09:58:18 +0300 Message-Id: <20180329065818.9338-1-rfried@codeaurora.org> X-Mailer: git-send-email 2.15.1 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 wcn3610 can only operate on 2.4GHz band due to RF limitation. If wcn36xx digital block is associated with an external IRIS RF module, retrieve the id and disable 5GHz band in case of wcn3610 id. Signed-off-by: Ramon Fried --- v2: fixed wrong assignment, which is logically introduces the same behaviour, but for correctness. drivers/net/wireless/ath/wcn36xx/main.c | 4 +++- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index ab5be6d2c691..833531a68c95 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1146,7 +1146,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn) BIT(NL80211_IFTYPE_MESH_POINT); wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz; - if (wcn->rf_id != RF_IRIS_WCN3620) + if (wcn->rf_id != RF_IRIS_WCN3610 && wcn->rf_id != RF_IRIS_WCN3620) wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz; wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS; @@ -1248,6 +1248,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn, if (iris_node) { if (of_device_is_compatible(iris_node, "qcom,wcn3620")) wcn->rf_id = RF_IRIS_WCN3620; + else if (of_device_is_compatible(iris_node, "qcom,wcn3610")) + wcn->rf_id = RF_IRIS_WCN3610; of_node_put(iris_node); } diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 81017e6703b4..bc4d1a10d90e 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -95,6 +95,7 @@ enum wcn36xx_ampdu_state { #define WCN36XX_MAX_POWER(__wcn) (__wcn->hw->conf.chandef.chan->max_power) #define RF_UNKNOWN 0x0000 +#define RF_IRIS_WCN3610 0x3610 #define RF_IRIS_WCN3620 0x3620 static inline void buff_to_be(u32 *buf, size_t len)