From patchwork Tue Sep 19 12:33:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 112983 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp993531edb; Tue, 19 Sep 2017 05:33:30 -0700 (PDT) X-Received: by 10.99.95.71 with SMTP id t68mr1182367pgb.432.1505824410349; Tue, 19 Sep 2017 05:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505824410; cv=none; d=google.com; s=arc-20160816; b=d6i088beWrLbrkVHNLXdGbfWD0SJlmmHA/HNSZ9IBhX8l3VDF9OgHaCLeveuqkbEZn DiGoBoWethdLdRu0DiUPVodJ8WcDm96paAf0c/u3lgBAs5NawJk5Tu/u6Mz/AFBppVBB Sstwk/5RD7c4b2LHDc33H1AVjxuHR4EfLUCL25MpOI1XmDQ6of8NgUf1NyhHBNWUj5k/ lT16tl0riqvHZSW5uYb2mjPg6kXFR7maTzsaf3Cg6FOSjcWHEIjacJdFl63sHhWrhV+x LkWBJqMYkji/+YiV4MTqKfl5tzOgsfY1gEaMKqp9IJupWWRM6I5GZaEBTgop65OQpXwu qDHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=a9xFaROSBFLC32nVpgJAX3ezaLYNGYpa7+dVaz+kIko=; b=qDsLfCxKvwk6cyWSMBn0MqSZzCt7/BDDu/crbFUMED3X2AsyAIvQqD6xJaf7rF6BUU GeK5u+hQZKTPrHFYcS2ecGctvvPmYQW9RnvhqXkX0oUO7HoRgeu7Dllobik93A8lLVDq zKdXeZ43EtXdBtupChtTupL0n6RRxDGaXovS0tl488UDlsorWNNPSOW3HZt9pj/HSIIl iSvmaBhwSKqh4i1nVSaQ9HHJYeM1ABK9u02Xjdzc1ZJhm/6y3gUprehfI7IJ0R9tjUyk D4O+CPNTJXjD8JrNxiGkBJ1qbN0FdhbaxKHCu1VTJCo8eN/2fJ2ISL3BgnRVyfybIBOA 1/tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A+aO6C1w; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a185si1281487pge.117.2017.09.19.05.33.30; Tue, 19 Sep 2017 05:33:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A+aO6C1w; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751411AbdISMd2 (ORCPT + 1 other); Tue, 19 Sep 2017 08:33:28 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:44297 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751374AbdISMd1 (ORCPT ); Tue, 19 Sep 2017 08:33:27 -0400 Received: by mail-wm0-f52.google.com with SMTP id 189so18278971wmh.1 for ; Tue, 19 Sep 2017 05:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=a9xFaROSBFLC32nVpgJAX3ezaLYNGYpa7+dVaz+kIko=; b=A+aO6C1w90BslMC+W7fm0xr9I4fVye4z/kkjkwL/NqIonnAeKm9ViWMx2iMhqp19Bc 2q6BJNWkcZbM/puZyQ1gVjNAbgsKgM1Zms1dF0yDGG5EbM3Iar9nepE5PaerOib70s+1 wQj8mURBbTsa4sUeloBb0aYRUlg1mqOYBZSDo= 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; bh=a9xFaROSBFLC32nVpgJAX3ezaLYNGYpa7+dVaz+kIko=; b=Sk0VyhO0phJN0MfF3V48udO9mKSdggfo7vd8EQ2SaGAVkIaSpksQtImO7ftL2aZe8y K+cdy391IlJR+Yxv/Oju3e0t1rbNbbRGUgynseZ12luFgJNI6Rjx4czNj+PcHILGeerh OSX9FpBmaES2pBUtwUFKY8tTCB4RHy5yKFc3vdW3XvAziiQd8XN7LjwD6+FaSTiHryZO DZvF1g0F8P9X5o8XKybp55wQj6Qw4w4Z3iFqYCKe1AdlKNkrIle/qPzDgtib9Pq4wiGO R2lvxEVCiGx6AlqUetQRkmZromnURjafTw5p60QS/pRnFUQgFCuRax4xV+KRzmxelUTQ D+bw== X-Gm-Message-State: AHPjjUj74oIgBGZnqkElUSrwMNhGTY8RFDN4nhnKcHfgcRBhYr/U4q99 hMNON7Z5+KIQldbD7+RsSYYVXQ== X-Google-Smtp-Source: AOwi7QDTZWvHY+SjXYmSFUWIYzKJM1FViZE5EKgOvJUVGHlLHv3cBdOskgCYNmyXQxBPSBdI0NeGbQ== X-Received: by 10.28.91.75 with SMTP id p72mr961474wmb.89.1505824406123; Tue, 19 Sep 2017 05:33:26 -0700 (PDT) Received: from localhost.localdomain ([2a01:cb19:8345:1d00:add2:471c:7cb:4ccd]) by smtp.gmail.com with ESMTPSA id r6sm9998858wrg.40.2017.09.19.05.33.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 05:33:25 -0700 (PDT) From: Loic Poulain To: k.eugene.e@gmail.com, kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org, Loic Poulain Subject: [PATCH] wcn36xx: Disable 5GHz for wcn3620 Date: Tue, 19 Sep 2017 14:33:23 +0200 Message-Id: <1505824403-26798-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org wcn3620 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 wcn3620 id. Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/main.c | 12 +++++++++++- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index a9220b4..c3bc248 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1089,7 +1089,8 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn) BIT(NL80211_IFTYPE_MESH_POINT); wcn->hw->wiphy->bands[NL80211_BAND_2GHZ] = &wcn_band_2ghz; - wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz; + if (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; wcn->hw->wiphy->max_scan_ie_len = WCN36XX_MAX_SCAN_IE_LEN; @@ -1119,6 +1120,7 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn, struct platform_device *pdev) { struct device_node *mmio_node; + struct device_node *iris_node; struct resource *res; int index; int ret; @@ -1181,6 +1183,14 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn, goto unmap_ccu; } + /* External RF module */ + iris_node = of_find_node_by_name(mmio_node, "iris"); + if (iris_node) { + if (of_device_is_compatible(iris_node, "qcom,wcn3620")) + wcn->rf_id = RF_IRIS_WCN3620; + of_node_put(iris_node); + } + of_node_put(mmio_node); return 0; diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index b52b4da9..0643477 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -94,6 +94,9 @@ enum wcn36xx_ampdu_state { #define WCN36XX_FLAGS(__wcn) (__wcn->hw->flags) #define WCN36XX_MAX_POWER(__wcn) (__wcn->hw->conf.chandef.chan->max_power) +#define RF_UNKNOWN 0x0000 +#define RF_IRIS_WCN3620 0x3620 + static inline void buff_to_be(u32 *buf, size_t len) { int i; @@ -238,6 +241,9 @@ struct wcn36xx { struct sk_buff *tx_ack_skb; + /* RF module */ + unsigned rf_id; + #ifdef CONFIG_WCN36XX_DEBUGFS /* Debug file system entry */ struct wcn36xx_dfs_entry dfs;