From patchwork Sat Aug 29 03:39:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 11743979 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C17031575 for ; Sat, 29 Aug 2020 03:39:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA69F20872 for ; Sat, 29 Aug 2020 03:39:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Gqy8FQEz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727833AbgH2DjU (ORCPT ); Fri, 28 Aug 2020 23:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727115AbgH2DjE (ORCPT ); Fri, 28 Aug 2020 23:39:04 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56336C06121B for ; Fri, 28 Aug 2020 20:39:03 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id q9so878443wmj.2 for ; Fri, 28 Aug 2020 20:39:03 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=yBk3qb6esZU21s8yt3ET2KrYd742m2TmS8YznjO4lK8=; b=Gqy8FQEzfLCKK3RYqITztwv3hYVU9XwW6KBNpURG362FGIVMqWZjtVMA3tJp792u4l UVPXhhdPT1l8u9u2RvZGx6AOpU1846V9WQAMMPM/aFJfzLQDdBk/wwBYXQxMQFGgYGG2 MB8MnAEKdTlRFaPO29I14g7egmuRZKuAd/pjqJBD3xDnQkCiXJV4o+qWHv45fSoIaQMf PikAq3NwczwXu3g94C1nInAJBSbOMfvM8DFnor6CzQSjWtQRgWy8O+usIjgpVv/vy03t hRsTX8UirQQiQXnNnfr+1FsL/6h2RqDV8pCkM6PPLM4mBrjd5BqMiLM1Ee2FqgOAd36J MlQQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=yBk3qb6esZU21s8yt3ET2KrYd742m2TmS8YznjO4lK8=; b=evsPu6UxlUr/jJdxUE6eJYEslORq1NsQVO4bTIdbiHZVpSrslWd5GXG9s7ReeyyJmw IB8VO+93PSmmHpsxtQaO4hNoKljRcE8g9G5M0+upNZnwhUCfVhoM6HZUsko/P5YtlwJg H04AafDozQlVCGfzdrrMztEW4fXAEinF4rTVr55oh9bdA9ca3ekSlLtOCLltczLQnjcu T9LXkjYMqH7i9OVx8znLJee7Op+BoH1XmarBwlSbclBk6Ukd8qrSWjmJ0nm4T3NmMAOS HHvnZEd5/vv7vfH0WvGQPk1mtJglw7u/YHxw4LsfKRsqGIXhiZ9x82vs+Z4pM9UHKdpH UFkg== X-Gm-Message-State: AOAM531UmGaYiHnAsi/ktWXwP/YPFLqB9lY8+s9JNN7vkkvI4/+Vur+2 OzLyKyw8aGTVnQm3vXDr+baUcQ== X-Google-Smtp-Source: ABdhPJyapHdv2qIe61vmaviGiJBqETlaT0LE8VeX0YyYsJOjcuzlhukaygv61QEECVgMluZefFufcQ== X-Received: by 2002:a1c:544f:: with SMTP id p15mr1511069wmi.147.1598672342068; Fri, 28 Aug 2020 20:39:02 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id l9sm1732151wmh.1.2020.08.28.20.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:39:01 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Date: Sat, 29 Aug 2020 04:39:43 +0100 Message-Id: <20200829033947.2167817-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> References: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Adds HW_VALUE_CHANNEL(hw_value) an access macro that will be used to extract the channel number from struct ieee80211_channel->hw_value in preparation for also storing PHY settings for 802.11ac in the upper bits of hw_value. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 2da81d9926c4..ebce1ed7adf7 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -83,7 +83,9 @@ enum wcn36xx_ampdu_state { WCN36XX_AMPDU_OPERATIONAL, }; -#define WCN36XX_HW_CHANNEL(__wcn) (__wcn->hw->conf.chandef.chan->hw_value) +#define HW_VALUE_CHANNEL(hw_value) ((hw_value) & 0xFF) +#define WCN36XX_HW_CHANNEL(__wcn)\ + HW_VALUE_CHANNEL(__wcn->hw->conf.chandef.chan->hw_value) #define WCN36XX_BAND(__wcn) (__wcn->hw->conf.chandef.chan->band) #define WCN36XX_CENTER_FREQ(__wcn) (__wcn->hw->conf.chandef.chan->center_freq) #define WCN36XX_LISTEN_INTERVAL(__wcn) (__wcn->hw->conf.listen_interval) From patchwork Sat Aug 29 03:39:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 11743981 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35AF6109B for ; Sat, 29 Aug 2020 03:39:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D52F20872 for ; Sat, 29 Aug 2020 03:39:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Y790U8AJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727843AbgH2DjV (ORCPT ); Fri, 28 Aug 2020 23:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbgH2DjE (ORCPT ); Fri, 28 Aug 2020 23:39:04 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9D5C061264 for ; Fri, 28 Aug 2020 20:39:04 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id h15so848495wrt.12 for ; Fri, 28 Aug 2020 20:39:04 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=HF7pNf4fbKb1C6oMKd3EGPiCGGRyRUf2Kb2rIRMMGWI=; b=Y790U8AJA1GGX4VlxN9KQIZb/aM7dCIaSPkklN6wdO4pQ1G3P826sz5DnkiFt9dVrp VVTdjpmXpv5x3Rp/w2K+NDQTPAdgF6TRJkYZb7J4m1a5+JgCuOMMdIA+z4R2qnKKJHF7 59GVSR0YNDBDopQ+Jfvi34azbTU2OpWnziRT8+bda1MqPBqnwSGUT8GLUuHgfTCvf+ql yM7+NRW1d8PcwE1DyGyOZX5RPf569A4uSbecGBve43TX5YtQ+Zz2XUsE3iXu76HxnNZN Pr/4lwakm3jKO173h1CAF2v83JsX+KWsbaJrXTUYVZiA7/tdDHX9EFUqs3vXGEcE0CxK 1lgQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HF7pNf4fbKb1C6oMKd3EGPiCGGRyRUf2Kb2rIRMMGWI=; b=ZeX8K4YDCr/ou/MTWuGW0AaKHfZikAQtev/VuLZmviBt0AuaoCVLoJBLuJAMHkZ8/P ZSNY3QzzxAsjJTfx2SP5A9/lqwCIEjSUlSPl8MpUtkdd/Zg3zh4OW/kYleixtuBoxd48 yZhZ3i/onKGwYcfy7d9Ckttx/iRpKrSWog0JK66k+y3W8aHGj4WK/gud19Pes+7flQR5 L/k97GYS690/NDK65c56PYLfQ11svysFZU8todW7kf5VwETki6+yObatnRfO7vKhJPE9 WBFmXqA4Cx26juybaDYQMBUtegkeqCEHS+35LQLTT83kakB8zEQN7M5Teu0QROPNoVbE uyRw== X-Gm-Message-State: AOAM533ramc4ZcZeA9O7s9xnWD19OU3eTmamHsiwXFIDnTpWNORL/zEG Vj3gFe10XWTFU7FYWoJLOQ2b9w== X-Google-Smtp-Source: ABdhPJychLw759r+cgI4A3p0klLrp1xeZVIjsYf1tuV9w10Snvfs3IhTLZiMys+b7zzK0qMVHSPNuw== X-Received: by 2002:a5d:60c2:: with SMTP id x2mr1809740wrt.73.1598672343041; Fri, 28 Aug 2020 20:39:03 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id l9sm1732151wmh.1.2020.08.28.20.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:39:02 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 2/5] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Date: Sat, 29 Aug 2020 04:39:44 +0100 Message-Id: <20200829033947.2167817-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> References: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Uses HW_VALUE_CHANNEL() to extract the channel number from a struct ieee80211_channel->hw_value. Once done we can use the upper bits of the hw_value to encode PHY related data. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 2c58f7050836..729708d96586 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -764,8 +764,10 @@ int wcn36xx_smd_start_hw_scan(struct wcn36xx *wcn, struct ieee80211_vif *vif, msg_body->num_channel = min_t(u8, req->n_channels, sizeof(msg_body->channels)); - for (i = 0; i < msg_body->num_channel; i++) - msg_body->channels[i] = req->channels[i]->hw_value; + for (i = 0; i < msg_body->num_channel; i++) { + msg_body->channels[i] = + HW_VALUE_CHANNEL(req->channels[i]->hw_value); + } msg_body->header.len -= WCN36XX_MAX_SCAN_IE_LEN; From patchwork Sat Aug 29 03:39:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 11743983 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68F301575 for ; Sat, 29 Aug 2020 03:39:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5049120872 for ; Sat, 29 Aug 2020 03:39:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Okw/bFl+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727116AbgH2DjX (ORCPT ); Fri, 28 Aug 2020 23:39:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727000AbgH2DjF (ORCPT ); Fri, 28 Aug 2020 23:39:05 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53A0CC061232 for ; Fri, 28 Aug 2020 20:39:05 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id o4so906549wrn.0 for ; Fri, 28 Aug 2020 20:39:05 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=gyyyc+eVVPBc5oNmWeDufnX8Vdj7EzlctFSImbJVqV4=; b=Okw/bFl+1QURlf+DlpmTVa0gvxD/RbzvJ429LMzioPWrxukuqEZ+O7njYJhTMnGMhV 9wcB0ylpd69wM/+mKeIygft35AOcbZf5fPCqGtXFz2QDkmiw7JGcYoaPQBFDG8P0lEwJ PXzbaYgJApaUqhsxaSS1SrhxUA4cBVA9Y+81YBrceI8r7wPhkD+2EW2wf83oknGHAdr2 dSDf6ZJyHsZFonYTnSE9C5gCozdITixue6FJE9O0cT4PCqgUGI4Sc4HCAW+nBpYLzj+u YVCFgHlhbPKPZmNm5GBfRh+2H8fbg0gz1SNj3BTtw3gh2CunmVxmONTC5tYUhvVSODGv vhFA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gyyyc+eVVPBc5oNmWeDufnX8Vdj7EzlctFSImbJVqV4=; b=dBBNqaoYo6/Iz/nud1CmEHd3OXM7TCllBWZPaUiEAsoFc4uY8P5cH8ghWKYAAdAQov 7mrBRfmFWA7qHkbI2PLIFSZjvr+/Q8NKA/3rKwtPJjsKCPCqCdxkFXQALrqb3BFbSvKz AKOHaEN2kunV0F01lA+zSO+aXC5lEiXFp2H3qppZ3UIGEElv7udIhAvJT5Bl7KhH/sOD EuzLP/ophX71GZMTaXTqzJPMOrCmIMT7hXq+fB2WjmCvJJVPCVrdz5G0f/c3xDeJxM5u Op3/99ZQB1DpaZs6N1/+oLz/MJ8goRpKHwWbXV8ptvGWlV3JEKSfIgjj7xZG1uXR/jy9 dzag== X-Gm-Message-State: AOAM531Pjv1XuB2bWbk7BYabZnNc8/4KwrQs8KYxLySy9pZiTU+XuPJ/ J9WbWh9Yzca81EFLfd5romTxxA== X-Google-Smtp-Source: ABdhPJzKK1yFZQfCoDXNkGeLzk28YxVjYNR6IvqNGqCBWPcrfMX/+cAOx1eV3BFErs5Bo6hvhRUuMQ== X-Received: by 2002:adf:cc8c:: with SMTP id p12mr1150793wrj.92.1598672344017; Fri, 28 Aug 2020 20:39:04 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id l9sm1732151wmh.1.2020.08.28.20.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:39:03 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 3/5] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Date: Sat, 29 Aug 2020 04:39:45 +0100 Message-Id: <20200829033947.2167817-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> References: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Adds HW_VALUE_PHY(hw_value) an access macro that will be used to extract a hardware specific PHY setting for a given channel. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index ebce1ed7adf7..71fa9992b118 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -83,6 +83,8 @@ enum wcn36xx_ampdu_state { WCN36XX_AMPDU_OPERATIONAL, }; +#define HW_VALUE_PHY_SHIFT 8 +#define HW_VALUE_PHY(hw_value) ((hw_value) >> HW_VALUE_PHY_SHIFT) #define HW_VALUE_CHANNEL(hw_value) ((hw_value) & 0xFF) #define WCN36XX_HW_CHANNEL(__wcn)\ HW_VALUE_CHANNEL(__wcn->hw->conf.chandef.chan->hw_value) From patchwork Sat Aug 29 03:39:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 11743985 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0563E16B1 for ; Sat, 29 Aug 2020 03:39:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2C1F20872 for ; Sat, 29 Aug 2020 03:39:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kIVZi9oR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727848AbgH2DjX (ORCPT ); Fri, 28 Aug 2020 23:39:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgH2DjG (ORCPT ); Fri, 28 Aug 2020 23:39:06 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44399C061233 for ; Fri, 28 Aug 2020 20:39:06 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id z9so855988wmk.1 for ; Fri, 28 Aug 2020 20:39:06 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=yQy8OHTZ0idummaIvQ2bIiI3uqJoP/LErWU5Dq1ghsQ=; b=kIVZi9oRTiO/jlsjnSJGa1Ewk4JNmh/k5+zIOdrkGi3h63VS8T96KLGBVem9EiZLkq qSB64lE+d3sZYzeoq2i2wtvjyvcte3Q9eivrrjq6tleyUEAXz2lABbFP5sUtnr7NYDQK m0bwUPaJjMsrRKEb55+V4NF5lR6SAHFmoW5pnHwCUvjDxsOztZjxzVJ5qwfbK+IGNObi oKTXwRDG71Chq5hB6l8cAFJcDwqsRfzRxygRBgm5CcDfP4fXKs+ivin8Yjq0sYJiQdcb jo4hmhy4Onw7MRkDZ3hMUsLaXkujQczF6LgW7foTK+q7zlUMvM9lQt+VGAKUoBCUozaV vT6Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=yQy8OHTZ0idummaIvQ2bIiI3uqJoP/LErWU5Dq1ghsQ=; b=uEIDqKQmiN4pd1RaHc8XeAYyw9mFqV6PbwZOcASP2fezN7x9TWb13XLg12DanMtBSe KesXob1TODBr9itNsr0nlaCemCONgXbUEQWSLZ14GQbCJfzO981++YlpOEWmZxNnaK6A PGAgDXf8VUk2F8cQwIfCq5FBygMGpX7W8IEdrhdwDl57YvQyygCeC9BedbrEx9FO3Aq6 3Yxn7P8V9YCzIBKqbKrhqPaPXuON0zPi373AEsa+rpg4G38aBcAroXcBDT6CX60d3xC4 TrPWvT3Wg/D2lIIO3JyXHRRcjbmzHYjOwXn4D3Jfc518txqx8JVg/NKQVP01vJ6iRgMp CxRA== X-Gm-Message-State: AOAM530sZp1Fkd9JRkzcfMGZkW6EB5yYJdqvnZz9jOS7U9ObRiDIp/SR KzF6/kLu1mF7zAvbZNxfpQVKlA== X-Google-Smtp-Source: ABdhPJzSC3IZktFW/wx1T7A7lihijJoVSM2wXkoYlhF4O4XO2LgWlZDOWQiKqQAEssPTQBCl3Had8w== X-Received: by 2002:a7b:c399:: with SMTP id s25mr1548265wmj.13.1598672344983; Fri, 28 Aug 2020 20:39:04 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id l9sm1732151wmh.1.2020.08.28.20.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:39:04 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 4/5] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Date: Sat, 29 Aug 2020 04:39:46 +0100 Message-Id: <20200829033947.2167817-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> References: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This commit encodes the 802.11ac PHY mode for a given channel in the upper bits of the hw_value field. This allows for a neat read-out and application of the relevant PHY setting. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index e92907a33443..9e97513feeb5 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -39,10 +39,10 @@ MODULE_PARM_DESC(debug_mask, "Debugging mask"); .max_power = 25, \ } -#define CHAN5G(_freq, _idx) { \ +#define CHAN5G(_freq, _idx, _phy_val) { \ .band = NL80211_BAND_5GHZ, \ .center_freq = (_freq), \ - .hw_value = (_idx), \ + .hw_value = (_phy_val) << HW_VALUE_PHY_SHIFT | HW_VALUE_CHANNEL(_idx), \ .max_power = 25, \ } @@ -67,29 +67,29 @@ static struct ieee80211_channel wcn_2ghz_channels[] = { }; static struct ieee80211_channel wcn_5ghz_channels[] = { - CHAN5G(5180, 36), - CHAN5G(5200, 40), - CHAN5G(5220, 44), - CHAN5G(5240, 48), - CHAN5G(5260, 52), - CHAN5G(5280, 56), - CHAN5G(5300, 60), - CHAN5G(5320, 64), - CHAN5G(5500, 100), - CHAN5G(5520, 104), - CHAN5G(5540, 108), - CHAN5G(5560, 112), - CHAN5G(5580, 116), - CHAN5G(5600, 120), - CHAN5G(5620, 124), - CHAN5G(5640, 128), - CHAN5G(5660, 132), - CHAN5G(5700, 140), - CHAN5G(5745, 149), - CHAN5G(5765, 153), - CHAN5G(5785, 157), - CHAN5G(5805, 161), - CHAN5G(5825, 165) + CHAN5G(5180, 36, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5200, 40, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5220, 44, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5240, 48, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5260, 52, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5280, 56, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5300, 60, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5320, 64, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5500, 100, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5520, 104, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5540, 108, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5560, 112, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5580, 116, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5600, 120, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5620, 124, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5640, 128, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5660, 132, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5700, 140, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5745, 149, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW), + CHAN5G(5765, 153, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW), + CHAN5G(5785, 157, PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH), + CHAN5G(5805, 161, PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH), + CHAN5G(5825, 165, 0) }; #define RATE(_bitrate, _hw_rate, _flags) { \ From patchwork Sat Aug 29 03:39:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 11743987 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50AE7109B for ; Sat, 29 Aug 2020 03:39:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38E0720872 for ; Sat, 29 Aug 2020 03:39:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yhAvw0w3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727853AbgH2DjY (ORCPT ); Fri, 28 Aug 2020 23:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbgH2DjH (ORCPT ); Fri, 28 Aug 2020 23:39:07 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E85C061234 for ; Fri, 28 Aug 2020 20:39:07 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id c15so852366wrs.11 for ; Fri, 28 Aug 2020 20:39:07 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=+gz5nCyObldL5Gm9cjjoAI5bGBbxcrE8UnaMm3PvfTM=; b=yhAvw0w35tHzVG2StztQGtBFWWj+pdnd7KCWqy13B35Z2J1rwMFZKsHOWIXhQAmMzW 78Jh5t9kEE3gC8MBkhYHATVsIei4XWleRHuyPWUCcd5jsRTEVXUKmsTvhlVuXkoZLqBd 0lglK5kdX9ScMoht1EOKG2tXnPlYnPesL7Wjlafp8Pj6lq+rkWnr7dMqsOQelY/1cwh5 4fomDTtOC4MCAHNGYBkfEAMFUv/hxD5wzOs3VEu/n5Guphj1ITV5RmewzmE4jIFxcKiz wfNb+7BQJTHHC45eWZzJeVKtzWHnJ6Z8C3kqBEBhX9qj5Z0DbtOZn2IhsKX9E7dlFU3F 31aA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=+gz5nCyObldL5Gm9cjjoAI5bGBbxcrE8UnaMm3PvfTM=; b=uguLacfQMBtNiBiB9gjOZw5retSZDCsnMiwFUmV4DQIDK1XCDKoBkI551uDvz/+8Ak vPocAnFz8+XqrgZJHfS2T4NFejicLKDzycUcHeEZ7RqW2bMow+Ko7cd10TSD+EOWjuzW PqHyjj8NHSzEKfRm7ZqOoC4leKbFiv3U2kDPZRhQeibWJdnMujnFhFFM6qiRYLE/0uqO 8y9k64jpPsi1vlCtiy2tYLDFk4HafqSyH5dudId5Fhg5H9gmE90a4bnUZTKizNwKB7O9 CH3fubj+Kd5CPOg2GOPYJBvAOSV3HA+47+pn6Bv20UDN+APp0guDHfGkbQQTBPpO0rA4 2LHQ== X-Gm-Message-State: AOAM532b0cZFsu4/Qgg+woWiZBRpfsWzLWrpfJD2Gx/8+rjLGYbmJjZH iOTeiybGjx80FsJnAX/eaWipVg== X-Google-Smtp-Source: ABdhPJzAGieFfHLCjmPvS4/ik9ECFgcLwdWkYeI+da9WLk2sRZKNHjWdPsaHohAtxfjby2Jfyge/2A== X-Received: by 2002:adf:ab57:: with SMTP id r23mr1777893wrc.386.1598672345939; Fri, 28 Aug 2020 20:39:05 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id l9sm1732151wmh.1.2020.08.28.20.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:39:05 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width Date: Sat, 29 Aug 2020 04:39:47 +0100 Message-Id: <20200829033947.2167817-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> References: <20200829033947.2167817-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org For the 80MHz channel we need to set the PHY mode to one of four PHY modes that span the 80MHz range. This patch latches the hw_value PHY field previously defined for 5GHz channels directly to the parameter passed to the firmware. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 729708d96586..4b967f8ba949 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1493,6 +1493,7 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct wcn36xx_hal_config_bss_params_v1 *bss; struct wcn36xx_hal_config_bss_params bss_v0; struct wcn36xx_hal_config_sta_params_v1 *sta; + struct cfg80211_chan_def *chandef; int ret; msg_body = kzalloc(sizeof(*msg_body), GFP_KERNEL); @@ -1536,7 +1537,13 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, bss->dtim_period = bss_v0.dtim_period; bss->tx_channel_width_set = bss_v0.tx_channel_width_set; bss->oper_channel = bss_v0.oper_channel; - bss->ext_channel = bss_v0.ext_channel; + + if (wcn->hw->conf.chandef.width == NL80211_CHAN_WIDTH_80) { + chandef = &wcn->hw->conf.chandef; + bss->ext_channel = HW_VALUE_PHY(chandef->chan->hw_value); + } else { + bss->ext_channel = bss_v0.ext_channel; + } bss->reserved = bss_v0.reserved;