From patchwork Tue Sep 8 18:25:10 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: 11763881 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 14C96138E for ; Tue, 8 Sep 2020 18:35:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB7202080C for ; Tue, 8 Sep 2020 18:35:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vfytRyIW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731820AbgIHSeu (ORCPT ); Tue, 8 Sep 2020 14:34:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731780AbgIHScq (ORCPT ); Tue, 8 Sep 2020 14:32:46 -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 AFA9BC0617B9 for ; Tue, 8 Sep 2020 11:24:29 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id k15so197891wrn.10 for ; Tue, 08 Sep 2020 11:24:29 -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=vfytRyIWj9sZ1Y6Pgz4Y1o9VVwDmzeiVbWWGa0+XVFHMhQ662ftEfe/xnNCbSdlgBF YNtKCqHg5p9RrjJkZXPMXXoPS/QhQ6qzEIwOlnTmndpCo+a/sNt8K+bRYKGdLvh2sw2m oaLAzdMD55kPkR6Hqxn8HxdQqyoe3O1XkLNVOiId35WEkHUaxM9H3gGUni/EsTj8sxVI X7UIvLBXaigqQax5r5PM0Ihrg4/oKSnFdgyvAA0SL6Ru3pHefBOSCp8tcRB/MupVkYN8 JNKRGGMhyPdbTRPC9VRbSHnMnXS4Axy8qOG8TxsXZjw878u9dhyWfnRGyZtB1ucgP+p7 pmvA== 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=s7f876VMgelzH+jpcRVi8W/9Kasjp6oY9F8qX3p5PGNFXTMFOSB/3tNme0979OWq6i NtgT6+k1NNCldHudzq7QuTddHQK2j4Ib9IDN3ugSeEuyfI6GP1p2KBhxoFJkFvUV6yhW UV2dWFlPnxlHA0apeNsAkI08+0e6TyUvDxbZjYU0ybEYVhzpW93KZOBS83rGwTaY6Go2 tNOSsSVQ3UF+UTgY/QMORLUuhH8MBjrUm8Wo/GlO80KkZ1RQsWVd20ewfns0jIWjmZRt tauk0R8qorC1TA154wElNMEvhdN7+EjyQexnZjpTVkV2CA3N/85NaD0K66dvbHjjodDq RBVg== X-Gm-Message-State: AOAM530ZFLgjAxmp1c5dJsvp8lQPrkQJzJcHikPKuJv0gBbKEnzYcDv5 Ju6bMMtafxY7sofiPUuLV1+5FA== X-Google-Smtp-Source: ABdhPJwWzTxq3WGFO6jHOZiBcCJxIIsjOWopIFtwn01+v5KJw6lajQm1vc5VXPpeMJoH+u6YoLu7nw== X-Received: by 2002:adf:fe42:: with SMTP id m2mr860212wrs.367.1599589468376; Tue, 08 Sep 2020 11:24:28 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id f14sm352447wrv.72.2020.09.08.11.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:27 -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 v3 1/5] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Date: Tue, 8 Sep 2020 19:25:10 +0100 Message-Id: <20200908182514.2870410-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182514.2870410-1-bryan.odonoghue@linaro.org> References: <20200908182514.2870410-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 Tue Sep 8 18:25:11 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: 11763861 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 A2BA6138E for ; Tue, 8 Sep 2020 18:34:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 870EF2080C for ; Tue, 8 Sep 2020 18:34:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ac8uAcsV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731475AbgIHSep (ORCPT ); Tue, 8 Sep 2020 14:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731856AbgIHScq (ORCPT ); Tue, 8 Sep 2020 14:32:46 -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 AB4FBC0617BA for ; Tue, 8 Sep 2020 11:24:30 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id a65so274437wme.5 for ; Tue, 08 Sep 2020 11:24:30 -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=gaKj9UYwL9cF8yxrv9sO92SpT2Gzz1dlnqtTFbOc6oo=; b=Ac8uAcsVs78nGTpERZdQVEDRlMPFk9nHjRFW8vO3Q8BY19VU8uIVYp1C4MmQLbl5r6 AfTE6qHyGR/yUSNBlYF3m5fpFYXNYSXbLf7dOOlPhUZQZXMzeTvW2j0hb9cnrGXdVnCh zVh3aK+L2yQlmZgyPeH10xOnHudgyMm7Kw5VBHYcLLIln6IRECY3iE0tw4MgxbKOx+26 ovkg6SbIqzPaKUwYW+atKVSBp6JQB9PxmFJuEmXoWIT9010T+a6twRQgj7ZIRmf0pLqf 65cq2eszl5i23tPZ03vS05vtjqWxUuoQ4MahTcGbNwxhG1yh7yDp4Qd40ShplOdHDkJs cQYw== 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=gaKj9UYwL9cF8yxrv9sO92SpT2Gzz1dlnqtTFbOc6oo=; b=Nst0OU3Fjt6tOa3E5uLnsEiTXfq+W4XtOfwDnmPt5TAYI8moXpUCt39+KeeFaJCYtI yRc4va58C+MWZzAHWfFwKW05BAjPH4i1aJk6KJBBOq6pC5wGUIUN9vf+SpodoscqI+lM Hs04Au22ik5brnWBIy9YpbJnWquPwNevArKR4lQwM4j2Q2O7oWLgdl3LtzO9tQqdyH1R Z/SqS67fPdfLZD3uWnAzy0zpJBdar1Fa/HHcDhEOnLJoPBa+SSDvLTgrQkK36ad+z6jM bCg9gPUhGQB6UCgayyE9+1f7rBN2yfFFW632b9pab/KvtvtzEY7bzw4yRn+cttz32WWV rtcQ== X-Gm-Message-State: AOAM530AuaE0PLx5TsGa5jZYNl1aMBZw538M0DCTOGI5DRg2dhxFwed/ NCbKrhBXJ6KWE+ORkZjbFYX+Cw== X-Google-Smtp-Source: ABdhPJwlXJWV7nT0SRO18bDFGzIOQViaMDmTqbjdXHgk9AN6V0e8qIlRfPg44snTMzvu31CJU26oYA== X-Received: by 2002:a05:600c:2146:: with SMTP id v6mr347813wml.159.1599589469352; Tue, 08 Sep 2020 11:24:29 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id f14sm352447wrv.72.2020.09.08.11.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:28 -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 v3 2/5] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Date: Tue, 8 Sep 2020 19:25:11 +0100 Message-Id: <20200908182514.2870410-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182514.2870410-1-bryan.odonoghue@linaro.org> References: <20200908182514.2870410-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 2bb1803ed06a..1496566ecb31 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -758,8 +758,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 Tue Sep 8 18:25:12 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: 11763889 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 33C47159A for ; Tue, 8 Sep 2020 18:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16FED2080C for ; Tue, 8 Sep 2020 18:35:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sJ3q/QCw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731449AbgIHSfU (ORCPT ); Tue, 8 Sep 2020 14:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731661AbgIHSc3 (ORCPT ); Tue, 8 Sep 2020 14:32:29 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ADA6C0617BD for ; Tue, 8 Sep 2020 11:24:34 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id b79so298726wmb.4 for ; Tue, 08 Sep 2020 11:24:34 -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=sJ3q/QCwIc5SBl90sX76a7rYUxHXmw/hI2OdDgqa5uMO6+nU0PVtWNBiGXjLUpnJRs 4DKButEsv7yhTfdhYOLclK/k1Z7zaFL+0dapLwIL36vAU9naeeQtEWstLCA6uHtJ8ADD Sm9csVq9dWl0ddjzV6ykuPGWVoSBHZFjHwStRBeAsZMjbwJQmO4w9hHS2qWTJgjnw3ka la6A6F010eJ6r+IWIk7vl1BUtg3+Wl1061az25RqR51HQdEQxRCgDaHex4CtgwkhTh76 Ba2W0NoiDL4Hyn22esZN7ZvoK2VuEYzUsgAOaiyE1bPJ1T3+3hCk+fwcVBQ2hJRAv0pi OVOA== 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=A3gEJNdGyORDx+Rur7kMuZeGl+2JC7IKxkIAXOVBETQcjJ/qKRHb/xPXHTI0rds1nh oYy27b6MpoAiczXmpcgW5FgqmqKm3HEgqlztfGKrxJqbvTcumdA1CG7gGxIlg8jYQB1o 1AlyME9NWsqo1F+lUe/Ug5OQ5QvwnFlwqozXsJjAChmWC14mT5PNxjKqVdmJVlrqqNJW ShvmYJ4ImqNY3Gc20KgUIHyqP1i8rhkODyWTN+gZ/CmsVY+z6v/QAGlD5/hGa2S46j08 zfXU9QrXenlwiaHQweBINxR/NO6RF7AGn1jWnUobznwTpMyYjm+1QOPJIyJHVBUD2idm Dk9Q== X-Gm-Message-State: AOAM533VB9VeivbC8VSIvsu5zRUhuW6wmmfOz/a2XEgcdIAj5bw6zu8i 6+rJPVJ4XN66F9gjNqpzdoqFALCLQ2LoOg== X-Google-Smtp-Source: ABdhPJzmyt/uV51YIHc0zyS98DTSsNe1JlzEbnvA3bA2DY5BMM8DqrD5sybmxvT3ffyyTuEXTgiItA== X-Received: by 2002:a1c:9ed8:: with SMTP id h207mr409361wme.116.1599589471144; Tue, 08 Sep 2020 11:24:31 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id f14sm352447wrv.72.2020.09.08.11.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:30 -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 v3 3/5] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Date: Tue, 8 Sep 2020 19:25:12 +0100 Message-Id: <20200908182514.2870410-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182514.2870410-1-bryan.odonoghue@linaro.org> References: <20200908182514.2870410-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 Tue Sep 8 18:25:13 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: 11763853 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 0803F159A for ; Tue, 8 Sep 2020 18:34:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E062B2080A for ; Tue, 8 Sep 2020 18:34:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eM/nGswS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731605AbgIHSeX (ORCPT ); Tue, 8 Sep 2020 14:34:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731865AbgIHScz (ORCPT ); Tue, 8 Sep 2020 14:32:55 -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 BBD3AC0617BC for ; Tue, 8 Sep 2020 11:24:33 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id a65so274540wme.5 for ; Tue, 08 Sep 2020 11:24:33 -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=mrTOqER7Ro+hee8gyXLo9S/3xLKcWq5aNxrYU4kgAEA=; b=eM/nGswSaJQtep9usH63Ja+wpPAhQ+zIKb8VCATdPqi3jbLtCrM2NZ3edq6PtLr1c2 UF7u+82n5N6B8CZjewP5FnNRH5gUVjrpuRRPrMyH7Fg2gfyJqMS8nVlUM/Y9zx1U2KxJ W15bk5wPavz5Vru0hyJyrqPYnj5Zchc2mVbtBSP3SCZtusYkNdxxaDK46Stl1gTwBolC OAskN1Jd8VayZnqzYdUAld5tHQSFu7258BkR7jPjonlfk/XxX3edXeboToXN1V5cn5n5 MV2rTOBnJztCJg6MxQlyqSfcAIwKTxSH9zDdAVU1N1TuxEWnOilolxPMp/3TvYJritXL ye5Q== 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=mrTOqER7Ro+hee8gyXLo9S/3xLKcWq5aNxrYU4kgAEA=; b=OiDsnzVDV3TYcQIGv7c5nFMXY3WojFiACl5Z04PvY2pM3zRQ8qnBDqqptKPSonT3vb JJh3vMcrIyi3Lwbgkdt2+1ve+jNDKZHEsjCFP1L3Zr/GXusBZCt2coR7WPhd+yTpLOOz gsFq8iq3u9xE/ksY9Bvtm52Jk7bnGeMzgMr49e1MgC9nX7swVnIwMUWaNhfij37luxeM x66FpDYvkaadGmviNkmdFogEXmsskfFo3aHL9Z3KonwQqD21PNAFgRhOBR+CkYICaonW UGMJ9MS4vXcRtynDkKKf+C9sxr/Vli5ifNyw+qRF92wzuHk2omLRr2q+vxLNE4UNRBpj xuMw== X-Gm-Message-State: AOAM531/BOzQd1Eg6/HI+Ijo4GdgDaF4w2EYgh8Lax8FmMvLuScpVjbi oZJ9AzjnbXjtWLAMJveXA/9CjA== X-Google-Smtp-Source: ABdhPJw4nf81vE4P6Spmz3/7sMFU8eOdN18QH0KpcXL0KWblbpJnZW60e634YJ9iba1aVp+VuCYbYA== X-Received: by 2002:a05:600c:2155:: with SMTP id v21mr422856wml.118.1599589472460; Tue, 08 Sep 2020 11:24:32 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id f14sm352447wrv.72.2020.09.08.11.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:31 -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 v3 4/5] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Date: Tue, 8 Sep 2020 19:25:13 +0100 Message-Id: <20200908182514.2870410-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182514.2870410-1-bryan.odonoghue@linaro.org> References: <20200908182514.2870410-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 ba37439352a7..2c2b6178c8cd 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 Tue Sep 8 18:25:14 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: 11763849 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 2EF1F1599 for ; Tue, 8 Sep 2020 18:34:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 157742080C for ; Tue, 8 Sep 2020 18:34:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l8+7oeDr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731558AbgIHSeV (ORCPT ); Tue, 8 Sep 2020 14:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731409AbgIHSdS (ORCPT ); Tue, 8 Sep 2020 14:33:18 -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 B030CC0617BE for ; Tue, 8 Sep 2020 11:24:34 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id w5so209131wrp.8 for ; Tue, 08 Sep 2020 11:24:34 -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=IRlqLg9pl8OW4kRzEvgaiZLGm2xa7Kg6ZD9o++l3c7g=; b=l8+7oeDru28u2/5tvVbKvdcQgatZk1l5v2+keKRJMkc3yev3c9OtYmO+gq4gF3L6RP zcy//DAVaJJ7Zo+Z0YyuS9u7Ds9xAMNQPbQdXHMkPYuiOnO0Jxm9CVkYdS0lU4qBNdYP 4wHhB63oHnZfQWitn4s5KA7yPZe3hIs4BG3iY0xHu5H7tsfrZli0qiMcS3DG3UQbW25o d5a9Mpw7r6Lg2k3ipiOoOq2nDovJmYGWpHLngoaAhVPFOIZNiVSa+b6/MppfyZZZYplm F9kXe3uSxR1rCFHhoJjS4iAaz+y5W8dP1RnST4lh6yxixDDbxYOPLZNRsTqm6J+mzlOd 5Kuw== 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=IRlqLg9pl8OW4kRzEvgaiZLGm2xa7Kg6ZD9o++l3c7g=; b=XUl1oX23Psg9DMqRCeYSbfpf+934Kxw3yr91n775CgXqh8YwQIwypoXFEkxI8tqBMi BEljsuT6Lu96cQ7XnVhZOqqgN9rAF36k3ZMXMQ8muYHlIKcd30duPguCKcthAl5ymCTj /0pxjZDcurTbZWOVLb6XSixK3WkBb3t8kN9kmuZPIEjZ8nydaCLod4NBtn39HTdSsq68 +XL5m59FEkjBsVuI+tbCVMNTsXt9TSnyyllRNteD3qxWZ3xDqzfxt6O7JZcKrOXktGUe mY+I2zw5RhgNUyQCEZ1qBjxjgUNHWaQccV4pq4jYAwNQSVr8xDXzU7Ml38V6tx1ChOGB 8MEA== X-Gm-Message-State: AOAM530rnivnaXDVxu4L3DfbSbw2X0z+v4VpWnAcZuN4jtynUjvmyi/L gALuOTe7L4a+M1088BfPJu2MHHwwDDIfbg== X-Google-Smtp-Source: ABdhPJzfUEwaMBYFy74pHISh9NGqprMivrTNbRxLwAq2hDVoRA9JiaDtX4nkYspwQNPaPL80oUe3Qg== X-Received: by 2002:adf:ed12:: with SMTP id a18mr989961wro.178.1599589473429; Tue, 08 Sep 2020 11:24:33 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id f14sm352447wrv.72.2020.09.08.11.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:32 -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 v3 5/5] wcn36xx: Set PHY into correct mode for 80MHz channel width Date: Tue, 8 Sep 2020 19:25:14 +0100 Message-Id: <20200908182514.2870410-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182514.2870410-1-bryan.odonoghue@linaro.org> References: <20200908182514.2870410-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 1496566ecb31..04822edaf631 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1485,6 +1485,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); @@ -1524,7 +1525,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;