From patchwork Thu Sep 10 15:07:07 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: 249651 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp826624ilk; Thu, 10 Sep 2020 08:06:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBuKUS7Feh2EC9hzNeVxJSy/3UALPcpfqaI41WNcLY4v3nYSW3FzQQLTFQqEt1oquN3Y7j X-Received: by 2002:a92:d902:: with SMTP id s2mr7745826iln.21.1599750392566; Thu, 10 Sep 2020 08:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750392; cv=none; d=google.com; s=arc-20160816; b=Vvl7DHS+wcmiKREP0oLA0gJ40DdifaAg34HtWRngel9CwTEP+Ij/LKe83FwyNc5bJI fIZ90cXhzFPKa/TVUgi2i07X5G9JUz3Th1HYBGqODC5fjsl6dbaItxzCxTBqxxjJQi1L X6weMkpqeUq3bR1gK5qhgaebBVXK8uyIEGw2rRfir1E/NX+cuSxVN7hrkicQl1KvnlJ9 Zf/pftsYiVsj00E8VWv3X6PawansUEBwGnkxf9y+//TvxtfdSN53C1y0dBUad3SxOitg 1n5iGpY1z7Yiy50WHX+IMp3L1z55vBTJYm6mPLIUappLUdQ4X0Cqa1YNL/kBAU4Com/9 QCbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=mZ+9Z5IM62SRNNDsj/7kgbbI+wzN+HdVOimUOJSajSQ=; b=HwpEs7vnFtMLKzWKbf5K8wK0RrcGlvFBFt9wyV03Nvo4kAtn5hbSTkngEKfZ+TTDOh e5D7GZahj2MtyltkcRA1pzl+ammP1tToA7W7guzdw/thKa3yXkzntqiUZzY7g8zKMEJr +KYrROJlo4yQvADJPGE9ePoGDqDBrhf8fAEBTlX7xEQ6XYFwHL0QflS3JhTx/DmiM8Au T+5tAu9fFATOxgHEULWaLAWOwVQ+iiXf6EiXHhvK3TP8enr3vIIJa0xiuDijB9fP5KUn Ds65BYZwjWm2h2GMGQ2stb3X55u7pFy6j8f4ROHuoe2vWxDq+9T5N0TnciE0JFoYXC6j tBHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=o+yoGHVa; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=mLUG+m2R; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id u27si3913965jap.115.2020.09.10.08.06.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:06:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=o+yoGHVa; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=mLUG+m2R; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mZ+9Z5IM62SRNNDsj/7kgbbI+wzN+HdVOimUOJSajSQ=; b=o+yoGHVaZgz086a1b6SmmVAD6 AcIxIPnMWUZrS29rDTR88ecFYYNwzfWe/KQg1FCVPn84xX4LZytGRizKYlS29JlV670t9CSqLpqbK XGYz0RZ5PQXeYMJo0xVk6W3NIKjCn+qFFI6NakeAnfwH5gs0IHYqSp/AryACRQCaZfofdC3kwuv6Y W1ebCuZXIYxJLo5lsPVd++ewvMsSvKsO9XgOQ0eTTpKTGQ6hySNDgTHxroKz8dCDT1TqyyAVxrCSd WG2MKDAhdLovfNZ4Zy3j7sBv+x+QngB0MR4oQOqTI+BEFYxes0bsxJNdOnte4w7i2oMITSTqrZwnd ZYIKy0FQQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO9c-0007r2-BU; Thu, 10 Sep 2020 15:06:28 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO9Z-0007p5-CX for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:06:26 +0000 Received: by mail-wm1-x342.google.com with SMTP id k18so361581wmj.5 for ; Thu, 10 Sep 2020 08:06:25 -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=mNr+Pfqwu/0aRFo1Po43D8D7g7/h15rV4ULpD0JgPO4=; b=mLUG+m2RMLYxd7+leQI+qGNm+14EZ05Cj539MxNHPEzvfR0Y/j63C+135xIHgv8k2v Bxna23J5ESOfrp/FVfyICxm9P3jBJiIrvuhJ9Ux/Tfjtc8Ivoi+hmL7ZoA7sk8XT6JLf xtv4U7hZsBjxSsrVanmUqcSwZpLJhph1N7uvYy6aePa3CG1CIF2MFM46bpxGvUHUhmGN lRN38DQwOw3MB0Aahg1whV902XAPZNvViZCvdDqKDYIdflfTXvlHILv3Lx1UBzA4QDTS RW6axvCy7GUgyta00Y4vSzyO9f8dRt6AjG1SkcvlwspdAwOjswil9bOQxBzfqvgvNMng WeQg== 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=mNr+Pfqwu/0aRFo1Po43D8D7g7/h15rV4ULpD0JgPO4=; b=MKxYMqeJK2dy0CVk9gydEmROKpuo6Q/Ost5swJXC9W3A19zFNam7LEVaJ6KTvqkQum sATiAXMWaSQ3LEwkez6hSl2xpn8ZQku9ZCHH/53F+PXTSzk4pS55k1bkgwuu7ZTuiPW3 ME8xQs3af2dtFjyOJIpQbfwUExQvG4zPk84t6SF4ZeV0QK81x0fMcBTa/cUPEFDW8olp VvXrQXWar37JPy4qWAiOHnrR0ruV8/Yzq7Er5lNcaPIQy6z92TuB/W6ELlTew1naGf32 90+9QoqonyzZC4Q7fgvnkOeRyhj8S3nFMvmiMAFVKbWg3sTal1H9Pq71uPbvUQIBqkAt Jikg== X-Gm-Message-State: AOAM530mIHpGHZorGAqAf6vGcIx+6mszLhnePR+RgekDyo7IWnjUXXc7 3rssvXvyqG9Op+vVvWqtpBva/A== X-Received: by 2002:a1c:cc0c:: with SMTP id h12mr411822wmb.57.1599750384590; Thu, 10 Sep 2020 08:06:24 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id i11sm8778906wre.32.2020.09.10.08.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:06:24 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 4/5] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Date: Thu, 10 Sep 2020 16:07:07 +0100 Message-Id: <20200910150708.2179043-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150708.2179043-1-bryan.odonoghue@linaro.org> References: <20200910150708.2179043-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200910_110625_466171_48C684C8 X-CRM114-Status: GOOD ( 12.67 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:342 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.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(-) -- 2.27.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index ab6685dc956b..36cfa7043bc3 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) { \