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: 248698 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602872ilg; Fri, 28 Aug 2020 20:39:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8o2E06GePYexqPcpS76sdSmOJse4TcQUfXntBmaPW3kQGERvDmmXepjcAVEurumc55Rqo X-Received: by 2002:a02:95ab:: with SMTP id b40mr3765792jai.14.1598672351504; Fri, 28 Aug 2020 20:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672351; cv=none; d=google.com; s=arc-20160816; b=uaN0NADBxbwNh5dMHPIkVnc5DmPWVpIsY54obM5af8kS9+qaSxOrfRiz0ePF93GV69 ixr2HHHrZHRt5Rxfqth8M/qSDOoRQuQ3hrkOYc/Sh6aSowkQB+xEuUlJ0RO5yvX/70U+ BmAK5hapaDCDHylwL87NU2iuLLJbnhh5q8USJP4imdXKSKlKWH6Cu/JE8YFNAAaQLgWM VxJj/DHHG0qzzcyge5arkadqNH4C9TGUpzZyuIqBy7gZ1h8lnFJUuACJdmU5drOlXYH+ LhwBrOy3fbd5QiphcrsCZYrKOgTEaEJOdOfA/t++HllMHjE4VjAmzzgB192RbOzUNHYx XmNg== 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=eXTfreOHVpXiZmuJnZzIGrW6KqZOQyk2MDoju+JBr4I=; b=sXmKs6itoDDKCgjN0CrUhPJSsvkom07IJDj1Ejw0UOF9H2pzx2YpxvOJjiitHhRcYS mUkVOpo84v5XMTRuNIz02GfabVOGXOLMYUCFIRUOOx1wN2Nne15D0vt0Ll+rusA2K7qT BKjgPv3Ct7AWih0vudrcfTQeFZ4aw3MrgC0VPwPqpxFOFyA/Bp2XyytzDwgzYFdl7Kpb i3zkLE6luJtOrvjKEdsaXUFVyAmY8KCXtA3AM7MdWv0827ZmssmJ2Bz8xeMVc1eD/PSc NeTcNLFUpHb599qE/Su8dOZFlr0jGfK2t2A6kdPqoivp/fmov2g+nj+aEo8hRMNnLS0O 1PKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=2EIdfIMG; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kIVZi9oR; 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 h7si1099981ile.15.2020.08.28.20.39.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:39:11 -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=2EIdfIMG; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kIVZi9oR; 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=eXTfreOHVpXiZmuJnZzIGrW6KqZOQyk2MDoju+JBr4I=; b=2EIdfIMGCwmT8HwvIf0DxbjkQ cPTEpxL4aFC3tUuzLiLgi4HK+AzEIhGdFjtcjQ0K/OPHpSbK6jRPjwACPGD6NOSnz7ICwSJRYNhUp HAl7IyIf4KcYHonS/TeKVDCZ9syr4CZijtP94ELlmOQG+NFVyGjGLhhVvGy9ITERarAjmtITIIJ4A rTpVFHMFv7goCvM5ynzTS6F5M1WNnLVpRg/tS1TzmBhtGtOVNbTSQWQamBiy6b8zUNqqlw9sILGbm O2gaBANYVSoFAFRXp/KTpn6iurrUH9mR4vggYSrNoVGmOlekvw8v+6r6rwvEBWLV0SwmECodtIqFZ UJAPE7GIw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhs-0002cY-5s; Sat, 29 Aug 2020 03:39:08 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhp-0002am-TS for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:39:06 +0000 Received: by mail-wm1-x343.google.com with SMTP id b79so838289wmb.4 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=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=Oaj5iys3CvQ5T9POS5qISdEkEkh+fE7quchf+pLXkhOQeRfTgpik5wCgtm89NwQwct UfzVuib/4RAi02LT79U8CVsDu+PhKxgP+ls+989OpguRdVLvJYW+G2cCysgSkwCE7JeA jINsAmjYhHEv17gXAZYSjJoCaFXWxeWFA2oZa1aKEESNNntEeuWZ9kG/5qPey2KeD8MS txFmAbDqdbY+hwDHoUGHRZUAd04rPZaVPX54e/Gl+k36c9kllDJtFezlAIXeqq7X9eJR EMy2dDtT50W2xmNoDdbEVYa/167F9Qy1R/6KdHWZyJQbvjrporqUXnkuHNeo9dAWOlNT jVRQ== X-Gm-Message-State: AOAM533mzl2B4YfVc4XTMlyk8RUqal5W+RiLaW5zc895LXpz+mF/h/a2 jOQ4oixyZX9ijHnZQK0ai1ugPA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_233906_043662_4975B13F X-CRM114-Status: GOOD ( 13.34 ) 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:343 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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 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 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 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) { \