From patchwork Thu Mar 29 06:20:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 10314545 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 4969360353 for ; Thu, 29 Mar 2018 06:21:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BB662A1F9 for ; Thu, 29 Mar 2018 06:21:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D1492A22E; Thu, 29 Mar 2018 06:21:15 +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 C80592A1F9 for ; Thu, 29 Mar 2018 06:21:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183AbeC2GVG (ORCPT ); Thu, 29 Mar 2018 02:21:06 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37754 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbeC2GVE (ORCPT ); Thu, 29 Mar 2018 02:21:04 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0F5FA6081A; Thu, 29 Mar 2018 06:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522304464; bh=sPWCYLTaqKUXewX1w/Hj37HDP7OX0UzIl1grl8/gosA=; h=From:To:Cc:Subject:Date:From; b=MEyQ1upmgWvi8O2J4BtZebiqwakkojJYUo+FK1gWrfcAMkmPfQe63m41qhZwtchXc 0nqofrCWz2+EknE3WR8U3PZ1zRcz024IyWk0fTjv+IuTw0GVus8YztUq+AlQzISnrS vhoZgg10dwkaJdfmgRYUHOAsU4q2v9mflv7Wi4jU= 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 A42DA60591; Thu, 29 Mar 2018 06:21:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522304463; bh=sPWCYLTaqKUXewX1w/Hj37HDP7OX0UzIl1grl8/gosA=; h=From:To:Cc:Subject:Date:From; b=dVexviyKs/3tpYVNSD8+kEifTpr0bpj2cRstS6QgekzXZU0kNlvYLK8f/+pvGiNU2 RaZHr94Q/PcKAIFjhsh1LVxQaDM1Bls0r0f1g8gtZaII8A94/Q8sLgYXWsBYhNPotk woob/6SHc/16JM6nK5Xhkanry6zo22+RuT1tA23Q= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A42DA60591 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] wcn36xx: Disable 5GHz for wcn3610 Date: Thu, 29 Mar 2018 09:20:58 +0300 Message-Id: <20180329062058.31340-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 --- 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_WCN3620; 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)