From patchwork Thu Sep 10 15:07:04 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: 11768915 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 1CC77139F for ; Thu, 10 Sep 2020 19:35:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F23B621D81 for ; Thu, 10 Sep 2020 19:35:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oCOn9uu7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbgIJTfL (ORCPT ); Thu, 10 Sep 2020 15:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731396AbgIJPnh (ORCPT ); Thu, 10 Sep 2020 11:43:37 -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 08C55C0617B1 for ; Thu, 10 Sep 2020 08:06:23 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id s12so7053181wrw.11 for ; Thu, 10 Sep 2020 08:06:22 -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=oCOn9uu78jvK2Mxprh5yp4HQIcZPjab4XJthUN3hJp6aCzH1VASdy5T+C1nBdjXtAw dfMt4H3gindzAcYHdWnQVAPC+HFI5LtMqHLIkYmCK12Hr5LASFt/GtzUAyJ02dd3WBKg xTBW4RQDsLy6SugjCwHRhmVmL+tnW3Dq0ac+r1i8BXilFBFNw8/+rcVKL1UG+rd9SGoq 5fSNzmgTdnjQJux7v+Ok1/bO8lDW/iCYDGZZTa79UYdkUknW6p9///gLBbvqeEHX6lbF 2619aAQLrFk3Qc8pu3rFMhuim0FkpJ45I8ftAdxHlZYClI/byhPG2LFQZdM/CejfdE4l Ptdw== 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=mhOwKd6KeJRybingLzturA00lAU4GLLyNZUzuwwJ3JBgjDDcnh8PIIVDID7ksIKrmu K+sGAaP6Agxz23otlyWA7QT1+Dn9BUvqGorZOvYv6TUp10mEIWGggw1m51TU/cQmczvZ uL/ICz8z6rfAEaqFJxLL6d/CEiTBJcrqEBQZXzJdq3sL1L17kjr58eBNDl2uD53M4mfD 3Ill2OTiffwqiT06AZyeIHPkjN+JcyyT7Msk8fXXF8grfyfcIsnaIn6EiNU9/XWhBmxk uftaNekr57jB2UiMbtvwVIFxqfzgQLNgdYfrVA9USFbIUmU2aHDw1PQWxVLPx3Zeb/Da M1hg== X-Gm-Message-State: AOAM531CA/RDYE5jd4o9aDw/FYFu72bJvoFptXsoy6D1Dkm8H4pGQciR IVZlShLPZwHs2Veb8iQhGlTfQPgClP3Dug== X-Google-Smtp-Source: ABdhPJyOb5IJ9/etttDJSR+rJU06l+PWKyAWEaiXMyk7TxOq2tun4L0+cnZqjIyJXoI1AEwjHFahJQ== X-Received: by 2002:adf:df05:: with SMTP id y5mr10361317wrl.39.1599750381737; Thu, 10 Sep 2020 08:06:21 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:06:21 -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 v5 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Date: Thu, 10 Sep 2020 16:07:04 +0100 Message-Id: <20200910150708.2179043-2-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 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 Thu Sep 10 15:07:05 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: 11768423 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 8160D139F for ; Thu, 10 Sep 2020 17:43:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59B792067C for ; Thu, 10 Sep 2020 17:43:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L3MkbVXG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727794AbgIJRnV (ORCPT ); Thu, 10 Sep 2020 13:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727775AbgIJRmh (ORCPT ); Thu, 10 Sep 2020 13:42:37 -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 F2DF7C0617B9 for ; Thu, 10 Sep 2020 08:06:23 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id s13so368243wmh.4 for ; Thu, 10 Sep 2020 08:06:23 -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=NwCebeUlM9NmAaYhyXx/fGUpE3fedfQDauBCeR9/OgI=; b=L3MkbVXGJPurnYM3WDW1dF3eJa47VxzV+MKyRjLNW/5JJwOMxEOp7Lvsms+/L06oNq 6wO7i2QiP4x/HjG7VXaakOErwTgFkGWDZTbgHq1BBgPdhIzsQmhWzTZngTn8ZGwDi0cB t80Aw2mTdbqdjAmmy3Y578uJNHClTA/X534ct4YEKEdsoSz6HiE1ZHIaPBSrSblWj9+u fBMD/4e0XThL5j4zjSJBt1P0+BzuS+kumYJg1BupFawctkCQ8rGb8im5cWyE2nmS/4De itXIvvLLNcLuI1YpBm4xWmKwAqNAOvKzv3tD7dtYY73g4M9obxji5vWbaE4LuzjgiII+ thng== 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=NwCebeUlM9NmAaYhyXx/fGUpE3fedfQDauBCeR9/OgI=; b=l+4rsBwdo1FPH6Iy6/ZaFUit61ZkdKp3Fm/ORJl+5SpBQHUO8fLXhAKFf1+LYLa6qy U9Qj7WMiXM2Dp7sXgpZl8JjyU/+vYtQi9TBUNzcE08/XhT445J4WnVCudOrzsA2fjlaI mY4j1I0XRUnYcA8ooIy6d2jcBAelo40f6+FY3aNuordN57N5aMx6luo//QXvgOPcqKue wLVYiBjuLBBPpQ92fpwkw8dA8EcTcoSukJ9m5b39/NPrPj3sL8/L5paxWiWw9Vd5Zz4q g1J5e2pYpsV0mjUCL2cd6G6rk8EBIVzO4MTog6DRxtmKjS5rjrHEXWn9gKzqC1XFWnq9 11Sg== X-Gm-Message-State: AOAM532882r/Eh2VZliFF6EjWd4J2hx86NorgQ64BajM74i3VYiFmknV /zuYCY/5j3C5XBkt+mu64wLHc0ruuEEl0g== X-Google-Smtp-Source: ABdhPJxJI9aXfxjZE/mJPioohYp205Ok3rdrKBXqXlbuiXvuW2RQ14c13F7Z3GDoTS0xARWw++1Qpg== X-Received: by 2002:a7b:c768:: with SMTP id x8mr422223wmk.189.1599750382696; Thu, 10 Sep 2020 08:06:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:06:22 -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 v5 2/5] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Date: Thu, 10 Sep 2020 16:07:05 +0100 Message-Id: <20200910150708.2179043-3-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 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 05e5e079dab3..feeb27851f7a 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -773,8 +773,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 Thu Sep 10 15:07:06 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: 11768935 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 13BEC618 for ; Thu, 10 Sep 2020 19:39:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB22821556 for ; Thu, 10 Sep 2020 19:39:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o3eaOHXL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727981AbgIJTjJ (ORCPT ); Thu, 10 Sep 2020 15:39:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731295AbgIJPmg (ORCPT ); Thu, 10 Sep 2020 11:42:36 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0A00C0617BA for ; Thu, 10 Sep 2020 08:06:24 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id o5so7029651wrn.13 for ; Thu, 10 Sep 2020 08:06:24 -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=o3eaOHXLlTKZVJQusL0agAIXoJElOD7EcgoIE6ivOCT1Sun7E0GZt9W3fdTKMY8CzL PoguPeVbDKi8qqcvowUP3Ph/qoH3RlydHakEvdpyRXiMw4zO8YAUPsbEuesjxVdDez5D 81VxtJ8SeSzqJbsnhOr7YnakTET6/bpfWqScp8vb/nkC/VFxZ+Dtb3aeCcilgbQZTlr3 C41VGj92BKqJXAljTkRylPuBlI2vSb6mWbMVoDo8DgBRrHiQuHpfhtbsrygWDpTtC+vp pRbJ/eDqqckprTFJmkazUgNCA4hOWj97gfBO0vCQUUtSMCzsFjuPi/s3BFOBZoZ1M1A3 sAxQ== 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=Fs5s7jWIRURUvRwsBwJn232YeCx//QsR3XeUR2QGTbf9+9rN/4JX9Zy+E2MCEuRrR2 cZ+MfuVtT5MTdXHybWBDZdge/XjUCy8WE99piNIjEWsbvc3QaSow8/w8THNW8BDIpwUs Toq6janI56a9F9J8La9iedG+5qnsSxxrVDhj6VF66phtxnCSJM42fHnKkOTwDn8F+dLC gGBWWlYa6JTJNCz5uwq5aJQSuSpEJvcLM0gp8BorqcGoGPrBFRpI5oFAagMoNF4tvHOg RRkPNXvO9dz1RwLUkuZOtwzvsC+PD/658hvwqJBNWKUqa1wivlo30dgoCCRHIqRHv8ZI 4Xtw== X-Gm-Message-State: AOAM53092ndSEPf1vcdx5uibV292IkhKpXEybZPFjhOE/6DevZpNl7rm FoVApcraEJ9GSTriTcEuOVUysQ== X-Google-Smtp-Source: ABdhPJwYTsgwCZnuttOmQtA2H+1urIT3Bo1184StLUIQmZXAjBZaZGhTvZwRbtRQxQ65wCGELWXX8Q== X-Received: by 2002:a5d:4d8f:: with SMTP id b15mr9608394wru.341.1599750383661; Thu, 10 Sep 2020 08:06:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:06:23 -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 v5 3/5] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Date: Thu, 10 Sep 2020 16:07:06 +0100 Message-Id: <20200910150708.2179043-4-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 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 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: 11768143 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 BE72159D for ; Thu, 10 Sep 2020 16:30:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A05F920795 for ; Thu, 10 Sep 2020 16:30:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mLUG+m2R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725833AbgIJQaC (ORCPT ); Thu, 10 Sep 2020 12:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbgIJQ1u (ORCPT ); Thu, 10 Sep 2020 12:27:50 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB9AFC0617BB for ; Thu, 10 Sep 2020 08:06:25 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id b79so367784wmb.4 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=Wx9atAp+v9a/CVrhKJl5gs9BIXSI3/+ebcHGxeugB65cP7+6wKn9Yf+xa4OWAWHQTf th9/LsHnEf0K5P+9kb+BIEyA0zdYPgF5YCO1KjHeTRG3+UsxLv5Rde0hrw792VHC4znu 6Xeuh/XlxGxK4nOOGkhVHI3HBLi9Mv6DR5obA689SoPNSmHsVBKVlc1zbI9AmGqyxXsF k9thbfKSJPtB6zPJm7XEWPJBFCe7HQPBr5J1FYIas8Hw4+ZYnsiM5d7f+tKtK0YpDCR0 SAikPqvYtTl6ho1s6FBJZCj9XoByFkynpCHCxu7faAgKglI88F8q37/DX8Nb/7uGQD29 qyaA== X-Gm-Message-State: AOAM530lAQgiK1j2Vyw44NIQg2V/OJH8k5DZWBqgpsval/GQu2Oy1XNN vip0AJPUvhM30ragzIdf80DMCw== X-Google-Smtp-Source: ABdhPJzqIbA5VVfajo0eQCsOfEGM4QlsUQcd1AtV47G5v1LQzPqkRcgzOdkE3jnNKliOr/8MgEyckg== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 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 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) { \ From patchwork Thu Sep 10 15:07:08 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: 11768151 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 7D85D698 for ; Thu, 10 Sep 2020 16:30:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55C8720829 for ; Thu, 10 Sep 2020 16:30:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="U/XYFWpn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726978AbgIJQas (ORCPT ); Thu, 10 Sep 2020 12:30:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbgIJQ1g (ORCPT ); Thu, 10 Sep 2020 12:27:36 -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 C523CC0617BC for ; Thu, 10 Sep 2020 08:06:26 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id k15so7057896wrn.10 for ; Thu, 10 Sep 2020 08:06: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=kbuSpUHUK9Xf5kW5O/ETlw8jaTEXI5Gq5SIeCS+jaOg=; b=U/XYFWpntw9A4GcKyqUzPvxG99HZUxnQeS7+9JsXO8alW/1bYOJ4OnvAEUISI1Zzn/ m8D1VDmaL08oBdQojRiAPCQBb05ZaVsxLV6JajOLFYdb+yQeXnoz3slcz7cexpvjfLJr 6Rd/AJvjGRcbAJMfTQfHrwvyQfXnN4+maGPuEvtuvs+JDQGYYy5JqTRbs8VrKSgUq2bG Ye88eCMy1KntLfI2LblzmDLKWI6hME70yC4BTmkCv7BcW30IbtaRHWenrhi8wJH2ft68 co9/CsjrUCIlQJJ0do+yebvunCaJWInlHp1ParrKO9JdEBxpNmN0/J3ZzD78iyYyzEiN Ao9w== 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=kbuSpUHUK9Xf5kW5O/ETlw8jaTEXI5Gq5SIeCS+jaOg=; b=keCWmvMneFAeyF0jdhLWG9sC9KmzAo31l9rYlddmNH4DTetBA2rxRdoEuPwBdKo6sq NF7fB6YXnKj09AO7i8DPjNoA1N6hFEeE2odCtNzlgFnblpbzNOEn8q5LILNH/jPlqKyQ FcTLstGepCkUCeTrpD2QKuTT1R1VIIxEDc9EJkzo0v4spNsigarNcTMX+nBNrAmLUqv7 6vH6pxhCTV9iJ2ZiPykWLbj2iE2JeVesuEmlmBanEZC4Nqk9pqtp0PXRwPZuOZcNIJDL DQd8X0Y9lz7MGw5tqPoWcxnklGBvPB+guyP1w+J11wHRECN+sxxv0H9BZwGULqvNFlSR ugRw== X-Gm-Message-State: AOAM5323my6aKa0odopZF8fefYXyZXUpx3aHsU2IaQ6GOb5XQTo5yaga kAkwr9m9k1U+MlFQlGrv8HBfgg== X-Google-Smtp-Source: ABdhPJxpm0q+z0KtTU4wpy1PgkcIuvIbM16uMuqr1ZlCqljI7M04mfPWFYB5I9oDdc1tPGRcDc+r6A== X-Received: by 2002:adf:ef48:: with SMTP id c8mr9613696wrp.370.1599750385515; Thu, 10 Sep 2020 08:06:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:06:25 -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 v5 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width Date: Thu, 10 Sep 2020 16:07:08 +0100 Message-Id: <20200910150708.2179043-6-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 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 feeb27851f7a..7dada66b9f87 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1508,6 +1508,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, 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); @@ -1547,7 +1548,13 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, 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;