From patchwork Mon Aug 3 03:10:57 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: 11696999 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 9AE7D14B7 for ; Mon, 3 Aug 2020 03:10:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84CBA2076B for ; Mon, 3 Aug 2020 03:10:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SRIYC5YP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726785AbgHCDKu (ORCPT ); Sun, 2 Aug 2020 23:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbgHCDKt (ORCPT ); Sun, 2 Aug 2020 23:10:49 -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 47C9FC061756 for ; Sun, 2 Aug 2020 20:10:49 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id k8so14104551wma.2 for ; Sun, 02 Aug 2020 20:10:49 -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=7sW+j/XKYMsqDf8PANCMztexlMqz8lIFr2FXWlhrblQ=; b=SRIYC5YPQwH5A0WChBwU4DDJiNlPaS9OqnQduz6N14oYn0aPPzSy+Ec54lMITV4WWU gAkF+RzJK9135qQz7Wd9o8Xu20TXdm1UxtjOKvOvD5GiqbdOAzqqh+GO9+gFoDEmbaDS cX/luOGJ+jmQvmfXf3Rad+66Wi7b3Gw98ryZ8wHy1/sht7OLXfodh3zVUcFtqGan5Bjt Y0JCUgVJN61dOuTPBMQCc9pgAmaBQjTsk5E4vXh+1d26U/Gc2rZfveANyXOw6mpw0azm 4ldtldVqM9Lq5pHKQwhuIGeH/gCjfJwCojZ3wm6rBI2xMJc12C1Il7+w2z8CJIl29XXD jp9A== 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=7sW+j/XKYMsqDf8PANCMztexlMqz8lIFr2FXWlhrblQ=; b=IIYFWwprdf7EWijRjnrg0YaS+3ZQrmMSmEEeLY8A2zXWCORA12wSdMgyBnMP8fKIgE 5m5vOSKHESIDYVP4oGHVEOEyX7g/XvueGkOORZuvaCZTuOgvoVx5t3dONOOgj3WEYmyY XhsA0qdud3Fhf3lyQjaWoB3z/J9qT9iWTq4lRsrJq5fZkY1nPuq9HDl14PbfbWtRMHvm DANx6rjrs1kKLrDWziytksP77bkmW811fPevoSeHiyP0Q1bFV6k39df80s/ZXTCVBi2f v2cajA19B//ulpi2XfHk42lOTt9flInV4e7Ofy+XuKmk1OroizeVh/xO2zuxiNlhCt6J tlLw== X-Gm-Message-State: AOAM531zFBS5u9m8BCHIA5P9xPFup/OsW0qbTnlMYYTg7yKr1nv7tZ14 K8cfhKSfst957pWAKjhK91r+vg== X-Google-Smtp-Source: ABdhPJzmR81sbdPoi2CPGj0RhZkS7gJMwz5qLxF/0KsQe8emmVdAjdHWHUGIEH5+5ATiK6TrZpYpgw== X-Received: by 2002:a1c:9d53:: with SMTP id g80mr13691413wme.70.1596424247984; Sun, 02 Aug 2020 20:10:47 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:47 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 01/36] wcn36xx: Add ability to identify WCN3680 Date: Mon, 3 Aug 2020 04:10:57 +0100 Message-Id: <20200803031132.1427063-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 The WCN3680 has some specific behaviours that we want to capture to distinguish it from the WCN3620 and WCN3660 respectively. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 2 ++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index f389cd4676e3..73ba30a4d727 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1298,6 +1298,8 @@ static int wcn36xx_platform_get_resources(struct wcn36xx *wcn, if (iris_node) { if (of_device_is_compatible(iris_node, "qcom,wcn3620")) wcn->rf_id = RF_IRIS_WCN3620; + if (of_device_is_compatible(iris_node, "qcom,wcn3680")) + wcn->rf_id = RF_IRIS_WCN3680; of_node_put(iris_node); } diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 3221fed15620..821c4ce61afd 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -92,6 +92,7 @@ enum wcn36xx_ampdu_state { #define RF_UNKNOWN 0x0000 #define RF_IRIS_WCN3620 0x3620 +#define RF_IRIS_WCN3680 0x3680 static inline void buff_to_be(u32 *buf, size_t len) { From patchwork Mon Aug 3 03:10:58 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: 11697001 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 83B8214B7 for ; Mon, 3 Aug 2020 03:10:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D6DE2076B for ; Mon, 3 Aug 2020 03:10:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FCpFudld" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726804AbgHCDKv (ORCPT ); Sun, 2 Aug 2020 23:10:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbgHCDKu (ORCPT ); Sun, 2 Aug 2020 23:10: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 41CD5C06174A for ; Sun, 2 Aug 2020 20:10:50 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id p14so13026542wmg.1 for ; Sun, 02 Aug 2020 20:10:50 -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=cnyL/56H0ZY1bZCWnMx8pvkwuKGz4kOf8WM2bIlPthw=; b=FCpFudldTNINYGShwafjOQr1RJCRYvZdS1qEPhVcfW2PGS/ZdS/ucEkj4A3vaGOaZv AyGM5of5vVH2ydv4s6du+CJqot5dIt3q8Dzcrf8IomfrdNrkYbX33DLW77ucYgS7s/PC C56BnAKWfCQLxISSZt32xKs0pWhdPqs5dAl5Y1TCSLNSkicLRfB9tENlKf1bcsxDOaBJ QjQK5SzdQLWAYG6ZmwgCqqiwRuDZ7BmIkkY5Gyh4Mwou9GtahvXa8A7LJWC+CjCfzYkA reM/jWpDvOrMog4YeMUgxmoX987K5BqTf+IkIyCViGIt3hC5d+/lpo+MlocMYCtzmJab B2yg== 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=cnyL/56H0ZY1bZCWnMx8pvkwuKGz4kOf8WM2bIlPthw=; b=kCE1rK3P9GLs7JY6em7YircqTlulj8yNT+DOXI3YD7vjMzE6t/NTHeiP6eLxeQLfuC +pWjsqsDAdQwFv/FP35zpUdAUFyLYVfnaCy5rjcb1CPXgEC8kp80Fswgs/J6W8PoSERX lJ5R63b2aB/NjoEoW2gG5nL7505e9T+EFAnIESF+cY6Kv1TnXd60MavEy7/RwpomIyQF v/+hyfJcPyXCL7Lao8hkfDUBFASd4cyLvHZmTLbV7jKvr6yTj+h5++PFxVIsVbQYBReX WDE+CCeRyOGpCNYXTrg/VBtFbdeF+4YSnbn4kpVP895RUuT4rXwCPN4H6smdInu1r9kI 54Ow== X-Gm-Message-State: AOAM532Kd8nvObkV//z2isIsqiRvlXCNV3voosjvj3ZEF4nZFrdXLgVp oBbF8hlxIXt/6SM8GhR41rjJB8CbSCw= X-Google-Smtp-Source: ABdhPJzr4nUsWJfjTKAragy/dqX5g2UFyE+hAOnEmfXVV89xRAqoaWaumt9c4UZOtHSxTJV3xiBqJg== X-Received: by 2002:a05:600c:2904:: with SMTP id i4mr13253780wmd.126.1596424249054; Sun, 02 Aug 2020 20:10:49 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:48 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 02/36] wcn36xx: Add ieee802.11 VHT flags Date: Mon, 3 Aug 2020 04:10:58 +0100 Message-Id: <20200803031132.1427063-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 patch adds ieee802.11 VHT flags for the wcn3680b. - RX_STBC1 - SU Beamformee - VHT80 SGI - Single spatial stream RX LDPC is declared as supported in the datasheet but not enabled at this time. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 73ba30a4d727..3b27ff6f6dac 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1175,6 +1175,34 @@ static const struct ieee80211_ops wcn36xx_ops = { CFG80211_TESTMODE_CMD(wcn36xx_tm_cmd) }; +static void +wcn36xx_set_ieee80211_vht_caps(struct ieee80211_sta_vht_cap *vht_cap) +{ + vht_cap->vht_supported = true; + + vht_cap->cap = (IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 | + IEEE80211_VHT_CAP_SHORT_GI_80 | + IEEE80211_VHT_CAP_RXSTBC_1 | + IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE | + 3 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT | + 7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT); + + vht_cap->vht_mcs.rx_mcs_map = + cpu_to_le16(IEEE80211_VHT_MCS_SUPPORT_0_9 | + IEEE80211_VHT_MCS_NOT_SUPPORTED << 2 | + IEEE80211_VHT_MCS_NOT_SUPPORTED << 4 | + IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 | + IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 | + IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 | + IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 | + IEEE80211_VHT_MCS_NOT_SUPPORTED << 14); + + vht_cap->vht_mcs.rx_highest = cpu_to_le16(433); + vht_cap->vht_mcs.tx_highest = vht_cap->vht_mcs.rx_highest; + + vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map; +} + static int wcn36xx_init_ieee80211(struct wcn36xx *wcn) { static const u32 cipher_suites[] = { @@ -1201,6 +1229,9 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn) if (wcn->rf_id != RF_IRIS_WCN3620) wcn->hw->wiphy->bands[NL80211_BAND_5GHZ] = &wcn_band_5ghz; + if (wcn->rf_id == RF_IRIS_WCN3680) + wcn36xx_set_ieee80211_vht_caps(&wcn_band_5ghz.vht_cap); + wcn->hw->wiphy->max_scan_ssids = WCN36XX_MAX_SCAN_SSIDS; wcn->hw->wiphy->max_scan_ie_len = WCN36XX_MAX_SCAN_IE_LEN; From patchwork Mon Aug 3 03:10:59 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: 11697003 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 A311F14B7 for ; Mon, 3 Aug 2020 03:10:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87B7F20738 for ; Mon, 3 Aug 2020 03:10:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KOxLmaSt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgHCDKw (ORCPT ); Sun, 2 Aug 2020 23:10:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbgHCDKv (ORCPT ); Sun, 2 Aug 2020 23:10:51 -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 4EF44C06174A for ; Sun, 2 Aug 2020 20:10:51 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id q76so12875415wme.4 for ; Sun, 02 Aug 2020 20:10:51 -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=rkrUdfDvYsiZC6pLeKL7GcoMXiECZnaO2mZKUo9/A9Q=; b=KOxLmaStr2tx9QXivlWnBrnTFBehDtBsfnwhgzaCtWNb8qyMDXMzt7E2qB2iE1uzwW d4uqo6ISy/id003byB+MOG+mrn5zUk253p5b9CacQOqpsimOM4JPHaNLD/K2BYn4u7ot VGXc/pJR/SXBnh/qZDZm68kp+DskrEFkBvLoBd0r5Kjvl/RMW2eAsPbEyV4F/KfkM4xA 6+eqHsCUmgfTwX4kI4v332/Cr1xOQN5BiBiYJ9s2XjDXN1cLs2sEPzVPdqdwxW+N0Mi1 ebxfs9WFtO0mbXEV9EVg4e70dWg6WM7Eocq/QYYg0IC6fGsd4rtw/+PvNG8MDpmq384d sY7g== 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=rkrUdfDvYsiZC6pLeKL7GcoMXiECZnaO2mZKUo9/A9Q=; b=HSpiC6KpznLglnJxiF6XIDWRPTGU+L0QMbKBbAbeJ38Urhc/DAmiTp35d6ye1ps7wp oi+QkzRr2t8gGBWtAy4sF8jmIc6BrYwFCl5W1hzfw5w9RXru7u6+J8rIjq/SKsXgxCzy jUDAmnfLNbAJHl73oxxonlvdAaxEYG6vt/Fbbb37g6u4FXMx1JBKeFP4ro9Eje+6QZLa 8U1Z5tGGM4KO/D//EeLbwhDoDc5k/FVZHluPGsYXNkYv+F0Vp4pssMJohjDHqLjYhvL6 G8HGJ/bWpP1KQ3WMF/LsnLX5hLQPLJHFuPHi8U9lp4X5roex8Ql8lVZ4IqaEmKQqnAWk 772w== X-Gm-Message-State: AOAM531tcnnxcb1Uq3Prgs9UBU52IicaRYRnj5WMQS5/c3QJLpyoml7q i5zAYSlaKxBAMUp82vNJ2rA71w== X-Google-Smtp-Source: ABdhPJwBdmM2lg+SlQvxfNlnDwzzSHZCLZgAZ+yPT6et5pMATaAdYZEokAsEZsItsJz5O/9y8x/Cbg== X-Received: by 2002:a7b:ca4b:: with SMTP id m11mr13445313wml.120.1596424250015; Sun, 02 Aug 2020 20:10:50 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:49 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 03/36] wcn36xx: Add 802.11ac MCS rates Date: Mon, 3 Aug 2020 04:10:59 +0100 Message-Id: <20200803031132.1427063-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 incorporates the 802.11ac table defined in downstream into upstream wcn36xx. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/txrx.c | 109 +++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index e20dbe0271f8..05a84f82584c 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -114,7 +114,114 @@ static const struct wcn36xx_rate wcn36xx_rate_table[] = { { 1215, 6, RX_ENC_HT, RX_ENC_FLAG_HT_GF, RATE_INFO_BW_40 }, { 1350, 7, RX_ENC_HT, RX_ENC_FLAG_HT_GF, RATE_INFO_BW_40 }, - /* TODO: AC rates */ + /* 11ac reserved indices */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 20 MHz 800ns GI MCS 0-8 */ + { 65, 0, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 130, 1, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 195, 2, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 260, 3, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 390, 4, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 520, 5, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 585, 6, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 650, 7, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + { 780, 8, RX_ENC_HT, 0, RATE_INFO_BW_20 }, + + /* 11ac reserved indices */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 20 MHz 400ns SGI MCS 6-8 */ + { 655, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_20 }, + { 722, 7, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_20 }, + { 866, 8, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_20 }, + + /* 11ac reserved indices */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 40 MHz 800ns GI MCS 0-9 */ + { 135, 0, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 270, 1, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 405, 2, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 540, 3, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 810, 4, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 1080, 5, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 1215, 6, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 1350, 7, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 1350, 7, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 1620, 8, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + { 1800, 9, RX_ENC_HT, 0, RATE_INFO_BW_40 }, + + /* 11ac reserved indices */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 40 MHz 400ns SGI MCS 5-7 */ + { 1200, 5, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1500, 7, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac reserved index */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 40 MHz 400ns SGI MCS 5-7 */ + { 1800, 8, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 2000, 9, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac reserved index */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 80 MHz 800ns GI MCS 0-7 */ + { 292, 0, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 585, 1, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 877, 2, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 1170, 3, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 1755, 4, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 2340, 5, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 2632, 6, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 2925, 7, RX_ENC_HT, 0, RATE_INFO_BW_80}, + + /* 11 ac reserved index */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 80 MHz 800 ns GI MCS 8-9 */ + { 3510, 8, RX_ENC_HT, 0, RATE_INFO_BW_80}, + { 3900, 9, RX_ENC_HT, 0, RATE_INFO_BW_80}, + + /* 11 ac reserved indices */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 80 MHz 400 ns SGI MCS 6-7 */ + { 2925, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 }, + { 3250, 7, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 }, + + /* 11ac reserved index */ + { 1350, 6, RX_ENC_HT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_40 }, + + /* 11ac 80 MHz 400ns SGI MCS 8-9 */ + { 3900, 8, RX_ENC_VHT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 }, + { 4333, 9, RX_ENC_VHT, RX_ENC_FLAG_SHORT_GI, RATE_INFO_BW_80 }, }; int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) From patchwork Mon Aug 3 03:11:00 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: 11697005 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 1650F1392 for ; Mon, 3 Aug 2020 03:10:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F247B20738 for ; Mon, 3 Aug 2020 03:10:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OP5OGP19" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726935AbgHCDKx (ORCPT ); Sun, 2 Aug 2020 23:10:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbgHCDKw (ORCPT ); Sun, 2 Aug 2020 23:10:52 -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 28B72C06174A for ; Sun, 2 Aug 2020 20:10:52 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id x5so13013369wmi.2 for ; Sun, 02 Aug 2020 20:10:52 -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=3ombPAKmNa4Z6zut9RJcKKY/F0yxtyCaqxLuyUzdePk=; b=OP5OGP19qXV8Cyz+haelcC1eEkNq5GNBL8bAKpUhU5sCxJR5+00alX+tv8q9OdTjFv Qf960R9R6IO6gFfQVp4fsRNtHvmBXVFhSsNWj8i+BDX2TcoYCv52czsFdzDwsT9HYaaH du/4iE/CUEJTCxcwpOUgqhTopcbpiWR1fs1hVgag1oJAmZAh3dZJQGFKXc28g2rIcc9I f5b0jk/vpLfVoXuEQLPED1v2uKUScnymTM4IH5M8O9cSilvJOh88ul7BYEgQlclLt/wU zwuUW85ecC+U6VeQnGGWVhNNURDazagimWOKtVuaBsuB/U0iAfQj9pGVssAPx8o9JzPk FI9Q== 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=3ombPAKmNa4Z6zut9RJcKKY/F0yxtyCaqxLuyUzdePk=; b=M9gSxjkYI62TKyWh7AEsIduLRetkR0q8w4hSaN3RNDP2rzTb0NZqRycaMeJUmaIJ5L h6ohmhh6dVZ8yxDDGmP6VBEudKDWGuC2W5pyvptH2przLCV90P44bW7tGTZyn5rwZcUZ cvP3kzS7VCAT0LYz0jyxy3o+yhWXUSXLmTk69D92SKin2JhvqG53wzG/tUm/Yl6C5bHR GxVNQSlsQM47ssggFwmHAzxQBkeslozFfr0C4LxYh/ABaABX6oc0KQ7KGB7B+xkJXfpu 76DMizWLzQgLn2+Tg0JUXofVWRdQRB9ZxXE5VqcSCCRGQkWP/oJ/Jj/2Hpfj1lr2cyPs epzA== X-Gm-Message-State: AOAM5318ldGEAnwKH2u95ZndeSKnwqgLs2w/91bNhPep3EB8ZoUzHU8A HooQ9uS2ikBMfvmGdh9vlwuXyg== X-Google-Smtp-Source: ABdhPJzGY+/rlx5ixlRsoZ+RNNlnFy0gFEFPDt9JgaMAewIB/h083+UDE2rxifSb2HKXQt/mNX75KA== X-Received: by 2002:a1c:6106:: with SMTP id v6mr13576442wmb.178.1596424250947; Sun, 02 Aug 2020 20:10:50 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:50 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 04/36] wcn36xx: Specify ieee80211_rx_status.nss Date: Mon, 3 Aug 2020 04:11:00 +0100 Message-Id: <20200803031132.1427063-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 Specify the number of spatial streams in ieee80211_rx_status. For non VHT data-rates the wireless core doesn't care about this field, however for VHT data-rates it does. Every version of wcn36xx has one spatial stream, so specify nss for wcn3620, wcn3660 and wcn3680 now. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/txrx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 05a84f82584c..903b47b55728 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -272,6 +272,7 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) status.bw = rate->bw; status.rate_idx = rate->mcs_or_legacy_index; sband = wcn->hw->wiphy->bands[status.band]; + status.nss = 1; if (status.band == NL80211_BAND_5GHZ && status.encoding == RX_ENC_LEGACY && From patchwork Mon Aug 3 03:11:01 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: 11697007 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 A9DC714B7 for ; Mon, 3 Aug 2020 03:10:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9053520738 for ; Mon, 3 Aug 2020 03:10:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="K/c/7AYv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbgHCDKz (ORCPT ); Sun, 2 Aug 2020 23:10:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbgHCDKx (ORCPT ); Sun, 2 Aug 2020 23:10:53 -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 36067C06174A for ; Sun, 2 Aug 2020 20:10:53 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id k8so14104625wma.2 for ; Sun, 02 Aug 2020 20:10:53 -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=B5DLtbiyK3rd9edQe5gM8jvZmZ4OmlENPvYbGbm0j2Q=; b=K/c/7AYv8jxtEAqw4NRJLB9gp9r9K4vxkKvVMKLn3DAtS/TJMlAR5TgaZp8GpXhWCE I7ySMzZoM0eCF2G+K7PpRdTIUey55nTdPHtHVNJ218ahfD2tS9C7v1QlZYUPOdq4vnkT T19gY0G89Ww9F4XVNP/6JtC0K12nueY8Mi+Yg7OXG/RMk1joU4tU6DjhkD7cHG2Sorx4 EAQ4xUm2GwWbi3gSVnZ86c7FVyydp2XG4n2mr3LHoyTHAgk3qCqqqZY4chzYBEoNFpcm jz69nnR/Njp5jbcHSOJavQIRpZp9d/ac1Ljhp6ZxB7Pw+jbBoohDNQvgm1U9HxNJNPu2 zuJA== 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=B5DLtbiyK3rd9edQe5gM8jvZmZ4OmlENPvYbGbm0j2Q=; b=lwGjqGjTEwr1dEHkZB/iBipiZPnPW2nY1XnbHO2ofOcrX/0Ht+FEcVpRSbhwPCfVbH UdKFyinCPkE4yAPWhZaSOF5Lfnk4MzAynodFd2psVx0Qb238i4BEyhsXOF9+NjE1ov4f XFC7Jb8B4NINlQmzpTUQoQ7gTveFoj/5p+rpvPojXs2Db2bf2EfBNWa2QpjGxrSLPk8m kiMz2vxcubEiPfBxM49EyOTHer1tCKwQ+xeSK/xBJ09cQiggPnOQu5mf8mZco45oVAk+ CcQbd7WfKCaZ5/92Uc4gQUSYB4l8ebjACFUoC+iOjfmEf4Nw8Ivi2Hz61chTcUkiEEaF mGJA== X-Gm-Message-State: AOAM531gj7jsb8TjrslGbnL9lUM1ngSyWNFYcJ3sB6P9flejHyK4OFX/ qjan9XtSSUurMFIG5ppWdltztg== X-Google-Smtp-Source: ABdhPJzpClYtP+kjdzG8/Q0PUpuURcUNrRG2/ejg5Rc4PgtcqmXQ6TGz/TjG8R2DxaixrYTKp4jBcQ== X-Received: by 2002:a7b:c38e:: with SMTP id s14mr13683939wmj.124.1596424251970; Sun, 02 Aug 2020 20:10:51 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:51 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 05/36] wcn36xx: Add 802.11ac HAL param bitfields Date: Mon, 3 Aug 2020 04:11:01 +0100 Message-Id: <20200803031132.1427063-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 patch enumerates four previously unused bits in wcn36xx_hal_config_sta_params_v1 describing - HT LDPC enable - VHT LDPC enable - VHT TX BF enable - VHT MU Beamformee enable Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index aab5a58616fc..8df3184a348d 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -1507,7 +1507,11 @@ struct wcn36xx_hal_config_sta_params_v1 { u8 p2p; /* Reserved to align next field on a dword boundary */ - u8 reserved; + u8 ht_ldpc_enabled:1; + u8 vht_ldpc_enabled:1; + u8 vht_tx_bf_enabled:1; + u8 vht_tx_mu_beamformee_capable:1; + u8 reserved:4; /* These rates are the intersection of peer and self capabilities. */ struct wcn36xx_hal_supported_rates supported_rates; From patchwork Mon Aug 3 03:11:02 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: 11697009 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 4665014DD for ; Mon, 3 Aug 2020 03:10:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 309C42076B for ; Mon, 3 Aug 2020 03:10:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Saycvz9M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726985AbgHCDKz (ORCPT ); Sun, 2 Aug 2020 23:10:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbgHCDKy (ORCPT ); Sun, 2 Aug 2020 23:10:54 -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 5DEC1C06174A for ; Sun, 2 Aug 2020 20:10:54 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id a14so32806684wra.5 for ; Sun, 02 Aug 2020 20:10:54 -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=kqKg5fMNYtu+7rDsvVA0MaJs3YtAp5XzgNcl5s+4fd4=; b=Saycvz9MQ9Ohv0fJwdZdL/qyjUexJZnwD+Jrd/rK+5zUNqDDjy08AThpekjcgt5BuN 4D2EllRjUNbN5nh7iSUc9B7T71SRu5tzAbMyTMUs6IYJQRc67bOaBgwLMa6fX5iJzBvU LomJCMpSRXLHqK+YDCXXhozAPPR5ZkDtw1UC0H2oMAKsDh+FTeI8ThyUa3RSMBz/o3/a j+HOlWwhP4Nfj2PWP01tNP+jEA+Bavh1TU8/7e6ca4OHRl1+CZE31jr64yeYLVnACcSk ha8ew0Pj0Dj/97Vkd+wbGt48XimpsAipAS70CMMFhpsE6dJAosw4GL9h3EvbutQeP7da n7GA== 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=kqKg5fMNYtu+7rDsvVA0MaJs3YtAp5XzgNcl5s+4fd4=; b=buk1tptq8n8j6XdVXZZ6kwhz7TJ/WVl1wODOOXPjCRiCqEE8XHVw6sJOgue+tNlJfc vMDqgfJiFLyoi/j27awOsIokx4tTxzZtlsZGml3gVaoSZfbAf5+s4B32aF8Qh/KkGmdX EIYqhkLCQYSUKIXl7rj/jXhrhK9Ia9I6Mz0sa4NXWLTFqJpETna6yvmUoZvI8vb6ENRx K7hnaQ06fjO7mji1NrKSO4E5+YkAw7l7hfGYsydGz4DeVaPClLtsPDaREa7KcrcuK/cj Sd0TiHOXZJyOfCk9DvaKOfcLVDNqsKF5iSV3g5Elu7MWj1xYprIpfz95xuj6gYFFYEWJ S+yg== X-Gm-Message-State: AOAM530NBUtC1czRJOqjaqDaXtmaTqQUl1pgGxjvEqUxtmekuiAqnOL5 mkluxDAJpRuVyvu5KIQLvv5Yvw== X-Google-Smtp-Source: ABdhPJwCrPCJ79rBanCyISinoLx0gq5j/s+Qg9arBytY/gl29Ttb4g3I6rS0QRJTip2/8Dn0qmH8TQ== X-Received: by 2002:adf:aa9e:: with SMTP id h30mr12550541wrc.377.1596424253092; Sun, 02 Aug 2020 20:10:53 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:52 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 06/36] wcn36xx: Add Supported rates V1 structure Date: Mon, 3 Aug 2020 04:11:02 +0100 Message-Id: <20200803031132.1427063-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 adds the supported rates V1 structure as defined in Prima riva/inc/wlan_hal_msg.h Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 70 ++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 8df3184a348d..5daac448d4e2 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -1405,6 +1405,76 @@ struct wcn36xx_hal_config_sta_req_msg { struct wcn36xx_hal_config_sta_params sta_params; } __packed; +struct wcn36xx_hal_supported_rates_v1 { + /* For Self STA Entry: this represents Self Mode. + * For Peer Stations, this represents the mode of the peer. + * On Station: + * + * --this mode is updated when PE adds the Self Entry. + * + * -- OR when PE sends 'ADD_BSS' message and station context in BSS + * is used to indicate the mode of the AP. + * + * ON AP: + * + * -- this mode is updated when PE sends 'ADD_BSS' and Sta entry + * for that BSS is used to indicate the self mode of the AP. + * + * -- OR when a station is associated, PE sends 'ADD_STA' message + * with this mode updated. + */ + + enum sta_rate_mode op_rate_mode; + + /* 11b, 11a and aniLegacyRates are IE rates which gives rate in + * unit of 500Kbps + */ + u16 dsss_rates[WCN36XX_HAL_NUM_DSSS_RATES]; + u16 ofdm_rates[WCN36XX_HAL_NUM_OFDM_RATES]; + u16 legacy_rates[WCN36XX_HAL_NUM_POLARIS_RATES]; + u16 reserved; + + /* Taurus only supports 26 Titan Rates(no ESF/concat Rates will be + * supported) First 26 bits are reserved for those Titan rates and + * the last 4 bits(bit28-31) for Taurus, 2(bit26-27) bits are + * reserved + * Titan and Taurus Rates + */ + u32 enhanced_rate_bitmap; + + /* 0-76 bits used, remaining reserved + * bits 0-15 and 32 should be set. + */ + u8 supported_mcs_set[WCN36XX_HAL_MAC_MAX_SUPPORTED_MCS_SET]; + + /* RX Highest Supported Data Rate defines the highest data + * rate that the STA is able to receive, in unites of 1Mbps. + * This value is derived from "Supported MCS Set field" inside + * the HT capability element. + */ + u16 rx_highest_data_rate; + + /* Indicates the Maximum MCS that can be received for each spatial + * stream. + */ + u16 vht_rx_mcs_map; + + /* Indicates the highest VHT data rate that the STA is able to + * receive. + */ + u16 vht_rx_highest_data_rate; + + /* Indicates the Maximum MCS that can be transmitted for each spatial + * stream. + */ + u16 vht_tx_mcs_map; + + /* Indicates the highest VHT data rate that the STA is able to + * transmit. + */ + u16 vht_tx_highest_data_rate; +} __packed; + struct wcn36xx_hal_config_sta_params_v1 { /* BSSID of STA */ u8 bssid[ETH_ALEN]; From patchwork Mon Aug 3 03:11:03 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: 11697011 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 253621392 for ; Mon, 3 Aug 2020 03:10:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BFF62076B for ; Mon, 3 Aug 2020 03:10:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gBWc2vip" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726993AbgHCDK4 (ORCPT ); Sun, 2 Aug 2020 23:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbgHCDKz (ORCPT ); Sun, 2 Aug 2020 23:10:55 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54AEBC06174A for ; Sun, 2 Aug 2020 20:10:55 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id q76so12875486wme.4 for ; Sun, 02 Aug 2020 20:10:55 -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=sikUkIrUUUYDQIfnByPU/LmcIZ12zwkI3UVYfyuDjzw=; b=gBWc2vipv4uQatf9GMbAMQLNdYm/SL7Ww1x5Lk66em5Dg2oV6JKFhYKm4fU5SEHXi/ 5HVlmy5e32zZzLFnzPs5OjOZuIFc7TXRzRl2C63y5oV6Aouq6cheTPSvR0W0jgMzYXwA lzLu7oTrhqkW6h0jJhVVTTcirabTnKmFvPfSTkMn2eFt1NRD3Ht4kqjkLNj1Vrwl92XM F5Gr12zzg+TY5GrsOBBIgjS4A02HaGwCG4ZSukUHSKGo9/IH0Bo/6nLxEcofuf8IaDbm gUwPnPhEQlqoLYDmHTOGoGAgeuFBYTEryjURp8viFo3D6RO2Gx295Sx1eAajXDoTuA8w daXA== 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=sikUkIrUUUYDQIfnByPU/LmcIZ12zwkI3UVYfyuDjzw=; b=UN/jxggtxc4b/kFmYuzFvxaKNhLaatky+ln9wCYQnGVJTBT9Jkzc3gbArwSZBkQ/zO pYzjwtxkZ0eqa86Y+Ka+WjurwfnMryK+VkvLdRP4+jYybuUMuzO9eXsn9gbinA4lClPG Ehu9IZgqpA6WiduU+b4tkupMOW0QdGBLtiy/e11ua4BAaRxbefsMNRXyoiE9SmVzCzu9 Tb9dhJebQ07KpQ36iG20JQMxLfLUI2uwnMvIOWsaEHrLY61UKkIBYPklQezVJs1LpulW Yum6lWqL+J45vfww8EMC2mXRFQ0zEFPrBQC1KURjIm/N2N8J7F4Mh1siaSMBxnSvhr3O Gevw== X-Gm-Message-State: AOAM530VX6AbsZWDFy9ppeYbqVKA/fHGjRNfQBraE8MItGpAKEUcVmor Dj7sYF+4s+t5y31OMhTZopdx8h8xP7Q= X-Google-Smtp-Source: ABdhPJy8NAMLlKsWOCeJ0I04rPKXFJtiKJiEnW2clNO8F+TQStp2EayD2xoUKXWcFR62PMcUh+xa5w== X-Received: by 2002:a1c:2485:: with SMTP id k127mr13333234wmk.138.1596424254074; Sun, 02 Aug 2020 20:10:54 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:53 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 07/36] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1 Date: Mon, 3 Aug 2020 04:11:03 +0100 Message-Id: <20200803031132.1427063-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 Two pointers are already defined in this function "bss" and "sta" which point to fields within msg_body->bss_params. We can substantially reduce the amount of extraneous text in this function by making use of those pointers. This change makes the code easier to read and modify. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 110 +++++++++++-------------- 1 file changed, 47 insertions(+), 63 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 218f70283809..05835cf6e409 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1298,87 +1298,71 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, sta = &bss->sta; /* convert orig to v1 */ - memcpy(&msg_body->bss_params.bssid, - &orig->bss_params.bssid, ETH_ALEN); - memcpy(&msg_body->bss_params.self_mac_addr, - &orig->bss_params.self_mac_addr, ETH_ALEN); + memcpy(bss->bssid, &orig->bss_params.bssid, ETH_ALEN); + memcpy(bss->self_mac_addr, &orig->bss_params.self_mac_addr, ETH_ALEN); - msg_body->bss_params.bss_type = orig->bss_params.bss_type; - msg_body->bss_params.oper_mode = orig->bss_params.oper_mode; - msg_body->bss_params.nw_type = orig->bss_params.nw_type; + bss->bss_type = orig->bss_params.bss_type; + bss->oper_mode = orig->bss_params.oper_mode; + bss->nw_type = orig->bss_params.nw_type; - msg_body->bss_params.short_slot_time_supported = + bss->short_slot_time_supported = orig->bss_params.short_slot_time_supported; - msg_body->bss_params.lla_coexist = orig->bss_params.lla_coexist; - msg_body->bss_params.llb_coexist = orig->bss_params.llb_coexist; - msg_body->bss_params.llg_coexist = orig->bss_params.llg_coexist; - msg_body->bss_params.ht20_coexist = orig->bss_params.ht20_coexist; - msg_body->bss_params.lln_non_gf_coexist = - orig->bss_params.lln_non_gf_coexist; - - msg_body->bss_params.lsig_tx_op_protection_full_support = + bss->lla_coexist = orig->bss_params.lla_coexist; + bss->llb_coexist = orig->bss_params.llb_coexist; + bss->llg_coexist = orig->bss_params.llg_coexist; + bss->ht20_coexist = orig->bss_params.ht20_coexist; + bss->lln_non_gf_coexist = orig->bss_params.lln_non_gf_coexist; + + bss->lsig_tx_op_protection_full_support = orig->bss_params.lsig_tx_op_protection_full_support; - msg_body->bss_params.rifs_mode = orig->bss_params.rifs_mode; - msg_body->bss_params.beacon_interval = orig->bss_params.beacon_interval; - msg_body->bss_params.dtim_period = orig->bss_params.dtim_period; - msg_body->bss_params.tx_channel_width_set = - orig->bss_params.tx_channel_width_set; - msg_body->bss_params.oper_channel = orig->bss_params.oper_channel; - msg_body->bss_params.ext_channel = orig->bss_params.ext_channel; - - msg_body->bss_params.reserved = orig->bss_params.reserved; - - memcpy(&msg_body->bss_params.ssid, - &orig->bss_params.ssid, + bss->rifs_mode = orig->bss_params.rifs_mode; + bss->beacon_interval = orig->bss_params.beacon_interval; + bss->dtim_period = orig->bss_params.dtim_period; + bss->tx_channel_width_set = orig->bss_params.tx_channel_width_set; + bss->oper_channel = orig->bss_params.oper_channel; + bss->ext_channel = orig->bss_params.ext_channel; + + bss->reserved = orig->bss_params.reserved; + + memcpy(&bss->ssid, &orig->bss_params.ssid, sizeof(orig->bss_params.ssid)); - msg_body->bss_params.action = orig->bss_params.action; - msg_body->bss_params.rateset = orig->bss_params.rateset; - msg_body->bss_params.ht = orig->bss_params.ht; - msg_body->bss_params.obss_prot_enabled = - orig->bss_params.obss_prot_enabled; - msg_body->bss_params.rmf = orig->bss_params.rmf; - msg_body->bss_params.ht_oper_mode = orig->bss_params.ht_oper_mode; - msg_body->bss_params.dual_cts_protection = - orig->bss_params.dual_cts_protection; - - msg_body->bss_params.max_probe_resp_retry_limit = + bss->action = orig->bss_params.action; + bss->rateset = orig->bss_params.rateset; + bss->ht = orig->bss_params.ht; + bss->obss_prot_enabled = orig->bss_params.obss_prot_enabled; + bss->rmf = orig->bss_params.rmf; + bss->ht_oper_mode = orig->bss_params.ht_oper_mode; + bss->dual_cts_protection = orig->bss_params.dual_cts_protection; + + bss->max_probe_resp_retry_limit = orig->bss_params.max_probe_resp_retry_limit; - msg_body->bss_params.hidden_ssid = orig->bss_params.hidden_ssid; - msg_body->bss_params.proxy_probe_resp = - orig->bss_params.proxy_probe_resp; - msg_body->bss_params.edca_params_valid = - orig->bss_params.edca_params_valid; - - memcpy(&msg_body->bss_params.acbe, - &orig->bss_params.acbe, + bss->hidden_ssid = orig->bss_params.hidden_ssid; + bss->proxy_probe_resp = orig->bss_params.proxy_probe_resp; + bss->edca_params_valid = orig->bss_params.edca_params_valid; + + memcpy(&bss->acbe, &orig->bss_params.acbe, sizeof(orig->bss_params.acbe)); - memcpy(&msg_body->bss_params.acbk, - &orig->bss_params.acbk, + memcpy(&bss->acbk, &orig->bss_params.acbk, sizeof(orig->bss_params.acbk)); - memcpy(&msg_body->bss_params.acvi, - &orig->bss_params.acvi, + memcpy(&bss->acvi, &orig->bss_params.acvi, sizeof(orig->bss_params.acvi)); - memcpy(&msg_body->bss_params.acvo, - &orig->bss_params.acvo, + memcpy(&bss->acvo, &orig->bss_params.acvo, sizeof(orig->bss_params.acvo)); - msg_body->bss_params.ext_set_sta_key_param_valid = + bss->ext_set_sta_key_param_valid = orig->bss_params.ext_set_sta_key_param_valid; - memcpy(&msg_body->bss_params.ext_set_sta_key_param, + memcpy(&bss->ext_set_sta_key_param, &orig->bss_params.ext_set_sta_key_param, sizeof(orig->bss_params.acvo)); - msg_body->bss_params.wcn36xx_hal_persona = - orig->bss_params.wcn36xx_hal_persona; - msg_body->bss_params.spectrum_mgt_enable = - orig->bss_params.spectrum_mgt_enable; - msg_body->bss_params.tx_mgmt_power = orig->bss_params.tx_mgmt_power; - msg_body->bss_params.max_tx_power = orig->bss_params.max_tx_power; + bss->wcn36xx_hal_persona = orig->bss_params.wcn36xx_hal_persona; + bss->spectrum_mgt_enable = orig->bss_params.spectrum_mgt_enable; + bss->tx_mgmt_power = orig->bss_params.tx_mgmt_power; + bss->max_tx_power = orig->bss_params.max_tx_power; - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, - &msg_body->bss_params.sta); + wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, sta); PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); From patchwork Mon Aug 3 03:11: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: 11697013 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 54BE91392 for ; Mon, 3 Aug 2020 03:10:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3EE6E2076B for ; Mon, 3 Aug 2020 03:10:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BZ+f6ng/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727015AbgHCDK5 (ORCPT ); Sun, 2 Aug 2020 23:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbgHCDK4 (ORCPT ); Sun, 2 Aug 2020 23:10:56 -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 4D567C06174A for ; Sun, 2 Aug 2020 20:10:56 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id a15so32763733wrh.10 for ; Sun, 02 Aug 2020 20:10:56 -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=knVm+8FLghu9qeE3O2LdjPgoZ5rDzBCB84wEr1o4m5c=; b=BZ+f6ng/a4OZA97iEXzb6sErO+K8D1XjsxYz6Vwqipe0V42i5almhxdR+UfaCG21F9 0syUoyZsxS+YMpN1MuKUYI5cNrreBcHHLB6mzFQ6YpjfsscGAGYRPhRzkQjW/9So8OQo agL1h4SbS7FAi8Ueq31B2oSe9kg9b20e1p4rwuQkYhhydSk9J6nmQ05cR9pKkl1Iun/2 eli5fgSo4d7Xj49Dy1LzkSN0asTbYbDfcs+ghsY0wApR5Uw6z1OtSLCCdc3BVg364F7e OQi1inVlU4P+JnDvFE8EoU8O2myjtzFll8EiU2XZ8/vj8scThYyWObbF+ynxOOn3x4Oq XJvQ== 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=knVm+8FLghu9qeE3O2LdjPgoZ5rDzBCB84wEr1o4m5c=; b=C6loVpiDEYCrz4rQPM7eqo9+FQUkEyOrrr2/tv4H/F06x1o3+QLF/LzmX2UKG/HCYz +1Z6wo4c5JWmLGJDbEDTEIS6NtDoJtuo+0HCyAHrWk49KOei2hNl2PmVjHRyWAP45f2N jLk9aa+kFUXnTFRQsBTY66uI13WKL5LBYrB0VLREquGGRhAd36IaveROZJxfJ6Lo7Kq9 Sga3CJdBp30yTerXI7WWgTKLIcuyvpn1dsj5NPYqwTtPcIh8DyyzGIZxeeqKHD85gN5c 3TD9i25rN/c1Yus8LoJkazCF0guHWwHcXJeEQG1tDU6rN6zEyLRr/wi4UwDf1TtIpF1T tZ/w== X-Gm-Message-State: AOAM532049kY+yfZHAIiv9rQPHSjEOnx1o80q2khbTKzNvamIzbI0SWq k4qnmJXiwT5MKyVanMFgbw52tA== X-Google-Smtp-Source: ABdhPJxTDONg5+dWgcta3ywSHKdZENZd0eW4Jz2LI0SUMT2PfNSlYvowMKQFjguQ+4K3ecOA03r6oA== X-Received: by 2002:adf:f590:: with SMTP id f16mr12302790wro.98.1596424254997; Sun, 02 Aug 2020 20:10:54 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:54 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 08/36] wcn36xx: Set feature DOT11AC for wcn3680 Date: Mon, 3 Aug 2020 04:11:04 +0100 Message-Id: <20200803031132.1427063-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 In order for the firmware to process extended V1 parameters with the addtional VHT fields added we need to first enable the feature bit DOT11AC. Once done the version number in the HAL message header will be acted upon by the firmware. Extended V1 parameters are a prerequisite for 802.11ac speeds since we cannot communicate VHT parameters to the firmware absent the extended data structures. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 05835cf6e409..661742cba1c0 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2083,6 +2083,8 @@ int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) INIT_HAL_MSG(msg_body, WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ); set_feat_caps(msg_body.feat_caps, STA_POWERSAVE); + if (wcn->rf_id == RF_IRIS_WCN3680) + set_feat_caps(msg_body.feat_caps, DOT11AC); PREPARE_HAL_BUF(wcn->hal_buf, msg_body); From patchwork Mon Aug 3 03:11: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: 11697015 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 B9EDE14B7 for ; Mon, 3 Aug 2020 03:10:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A37142076B for ; Mon, 3 Aug 2020 03:10:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="r/GbBanJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727044AbgHCDK7 (ORCPT ); Sun, 2 Aug 2020 23:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727001AbgHCDK5 (ORCPT ); Sun, 2 Aug 2020 23:10:57 -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 47FF1C06174A for ; Sun, 2 Aug 2020 20:10:57 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id t14so8892836wmi.3 for ; Sun, 02 Aug 2020 20:10:57 -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=EwoIz5oOPNTb/qL6RMRIh7345sC6Mi9TvhmWF2vaLCY=; b=r/GbBanJDIYmUaGBv2/7j0+m5rftzO54eXf+YGA8Zw1wyD7pFx7ZQrD1oTH3FyW6gl JVelB3Kk/Xcbu0/3oKcpZBnssbGf/PeAjheFU1/mI0C1nTvNv7+MSogwMKq7BKHdApeR pYZhAhUbPPU8bXN3vLULG23+WuPncJjD72NzqZ7ntFq6kuDIC+tKpIDIAHgp/4lwQIup itnQkYpbKN50O2oaecvUZcuxNEHzoeH0Ams/xUfg2LYfiaUj4Q6+NOfoUbCAe1RM9P9v J4kH7vXzEbSI9qB9IoIqbDTvnJa8zEvCQtANqw5YCBiz1clifXBn55AUgdAUimd/z1eM lNyw== 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=EwoIz5oOPNTb/qL6RMRIh7345sC6Mi9TvhmWF2vaLCY=; b=AG7hgvsKbB4qL+z0NSXd7YXFWcjqiPpVmQ20/TrDH+lV1lxdZQNIHaA2yeraFEGjr/ tpOjlN1XG5hajY43BDaQX0XNCRbyDLY92QjRQrkj1KXnDDClmaf9dhmASklQF/QEqizD uwy/gvPhxuWvQKDGjR4a/NA8zkGRDgq7jVWvJSlx8yZXOekZNd7Euy8fThWpueIKw18H 2GoNebbRET5Tm4Ls/iARKpf648sqS0e0bSizfI5D0TJz9eVyXMGCspjlBrMicyZ6KZ+m uapsK1g8KZTxtE3+/fv+J81cdAgCqsATekXZHKs5zDu3UldGPoO36mesv55XPhNKdpUV XBlg== X-Gm-Message-State: AOAM531ACdwhPcnm3xgqUijfDNFI0efhzKOny4fvOF2D/gCYk1RlL5BW Lhbq7v02ZsnfRBoFYI92YRvpjDl6FcA= X-Google-Smtp-Source: ABdhPJwtaty2NX5DY9X9w+LAxXf0BMho6Sr44dDwgj0Tj7vaPEbjjRs7W9kxtY1lixlhlBXuHzM88Q== X-Received: by 2002:a1c:a9c6:: with SMTP id s189mr13009919wme.166.1596424256086; Sun, 02 Aug 2020 20:10:56 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:55 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 09/36] wcn36xx: Add VHT fields to parameter data structures Date: Mon, 3 Aug 2020 04:11:05 +0100 Message-Id: <20200803031132.1427063-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 In order to pass VHT parameters to wcn3680 we need to use a super-set of the V1 data-structures with additional VHT parameters tacked on. This patch adds the additional fields to the STA and BSS parameter structures with some utility macros to make calculation of the structure size easier. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 5daac448d4e2..10ce05110d11 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -1584,9 +1584,15 @@ struct wcn36xx_hal_config_sta_params_v1 { u8 reserved:4; /* These rates are the intersection of peer and self capabilities. */ - struct wcn36xx_hal_supported_rates supported_rates; + struct wcn36xx_hal_supported_rates_v1 supported_rates; + + u8 vht_capable; + u8 vht_tx_channel_width_set; + } __packed; +#define WCN36XX_DIFF_STA_PARAMS_V1_NOVHT 10 + struct wcn36xx_hal_config_sta_req_msg_v1 { struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_config_sta_params_v1 sta_params; @@ -2007,8 +2013,14 @@ struct wcn36xx_hal_config_bss_params_v1 { * "STA context" */ struct wcn36xx_hal_config_sta_params_v1 sta; + + u8 vht_capable; + u8 vht_tx_channel_width_set; + } __packed; +#define WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT (WCN36XX_DIFF_STA_PARAMS_V1_NOVHT + 2) + struct wcn36xx_hal_config_bss_req_msg_v1 { struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_config_bss_params_v1 bss_params; From patchwork Mon Aug 3 03:11: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: 11697017 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 BD90714B7 for ; Mon, 3 Aug 2020 03:11:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7DA12076B for ; Mon, 3 Aug 2020 03:11:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lSTTisHe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727062AbgHCDLA (ORCPT ); Sun, 2 Aug 2020 23:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727001AbgHCDK7 (ORCPT ); Sun, 2 Aug 2020 23:10:59 -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 DC6D7C06174A for ; Sun, 2 Aug 2020 20:10:58 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id l2so22235851wrc.7 for ; Sun, 02 Aug 2020 20:10:58 -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=PIUGdWACF4QakLBskliO4hK5XoeTeWQ0rH1gMULYYzI=; b=lSTTisHejqVgyFob6lCGtFivdaianmepW5eZaT6gi1E2MbVZQaOGuCmFzmbLabm/Z5 1ppcUw3IuXK7aV4iKRD/Oka64Wa8H3Hxi/U77Y6gVD/gLXouuRd8Wdb/5I6BeC8c3gFI pFRK0ev/7k5fvfuytKklk5PkQNPm8l9d9LijrosGuEHkmizSOlMr1rxWBj2cP43QE7YG m966+jQ7qB4kCwImb0WLvzCJfkt1MhwVNrpodoeSLgptg51aURO/xsU5OT8kktkIbv++ yANVItMY57yfKJ8oRrax9bHJEMwo+GRdK+1lBxIptez9WfYEyj/i761zCtkQ2e0zHUdJ edcw== 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=PIUGdWACF4QakLBskliO4hK5XoeTeWQ0rH1gMULYYzI=; b=oVF9vEq07nTr5KxRySH5Ck8O7PzcSoW8NmBXfMB+VYy3bA1kfjMh/xFQBKvMB2fVMN HafuEaL0/+6yB9neswO8+rsyBOgbZZPUv59avjIi+mtk4YSZyY9H8u0Pt8f2mlP64zy7 eE7vTOMX5cJwZ1DnyRbKUbXYRJMX146bNPID9qX1VbnoG2cMbn7U5OUbq6bl+2yGRdlf 2HkJqKBsLwcDspChdDHQhoTTZp9T8WrCsWcU+f4Gcs2PxCTGPA5KLRMxC0LJtzMndara 1yFiTx+sfVW4OPLSSKFI0RGKemB3rWI5vZFqt+MbiiDTt6Efrce4KaxAd4pUDgssShx+ jYdw== X-Gm-Message-State: AOAM533sgAV9aW3dzOlPKOLUUKiLL3SJ+Ale0Po+E9jJqX5W9UAVE+bW nYW3exWIYqZn25w6T2I0/cOK/w== X-Google-Smtp-Source: ABdhPJxHU1IeOqNxGvkDWP6pWvMA0B5HjdJSqUNB4GLSN42IsCkHdDygX32C5ja4Z2+eeZxEM1NjGQ== X-Received: by 2002:adf:a15c:: with SMTP id r28mr12968808wrr.151.1596424257705; Sun, 02 Aug 2020 20:10:57 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:56 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 10/36] wcn36xx: Use V1 data structure to store supported rates Date: Mon, 3 Aug 2020 04:11:06 +0100 Message-Id: <20200803031132.1427063-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 patch converts the internal data structure used to store data-rates from version 0 to version 1. This allows us to extend out the internal storage to represent VHT parameters. Using the extended version 1 data-structure allows us to avoid a whole raft of version 1 specific fixup functions. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 5 +++-- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 661742cba1c0..a4e45114991b 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -241,9 +241,10 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn, sta_params->aid = sta_priv->aid; wcn36xx_smd_set_sta_ht_params(sta, sta_params); memcpy(&sta_params->supported_rates, &sta_priv->supported_rates, - sizeof(sta_priv->supported_rates)); + sizeof(struct wcn36xx_hal_supported_rates)); } else { - wcn36xx_set_default_rates(&sta_params->supported_rates); + wcn36xx_set_default_rates((struct wcn36xx_hal_supported_rates *) + &sta_params->supported_rates); wcn36xx_smd_set_sta_default_ht_params(sta_params); } } diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 821c4ce61afd..c3615704b543 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -168,7 +168,7 @@ struct wcn36xx_sta { u8 bss_dpu_desc_index; bool is_data_encrypted; /* Rates */ - struct wcn36xx_hal_supported_rates supported_rates; + struct wcn36xx_hal_supported_rates_v1 supported_rates; spinlock_t ampdu_lock; /* protects next two fields */ enum wcn36xx_ampdu_state ampdu_state[16]; From patchwork Mon Aug 3 03:11: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: 11697019 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 896B31392 for ; Mon, 3 Aug 2020 03:11:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 738122076B for ; Mon, 3 Aug 2020 03:11:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Qxf5+W96" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbgHCDLB (ORCPT ); Sun, 2 Aug 2020 23:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgHCDLA (ORCPT ); Sun, 2 Aug 2020 23:11:00 -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 05F2BC06174A for ; Sun, 2 Aug 2020 20:11:00 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id z18so29222143wrm.12 for ; Sun, 02 Aug 2020 20:10:59 -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=vpNpHP9Fx27y3i+wK1ZfXMYtkK+cRyUpKFw3O+d/HP8=; b=Qxf5+W96Bx8CUdhG4VS8+T8paauRAgfFd2x8vEoOraaos5DudYtH2nT1ivpKhucGMT vY4Ew43dYwHt9PO8eKzuzzBxABKMg5P32XfK7korWZ4DqTRkHNjvBjhyrCrXBBIuYd4A zjKOdHQM2gsU3nsq4/cCXsDI+XX94LD68tTGAPGw/YXHNsPWq2MPSeXh/xgRbgye2tQj H8jBjhtqvvDETpNFJrB0+h3QiWYviHnXsPmuk3okU1jljTf3tj3LxorQXZ8YhdDfbGiq E+rKaeai3mOKML0KeskEZ1c9F04O25tVGKDBV+isCAOSBIgeroOAHp35pmznu+69hoOX Nqlw== 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=vpNpHP9Fx27y3i+wK1ZfXMYtkK+cRyUpKFw3O+d/HP8=; b=B5DGRnXv7cstrkJmpJdDuBVRLkvEu5vsIWYY3rkKBTZQHNPsJrMlb+vWcgWyxv+K6l ZXRwz/FA0bTBvk1ELGu66JuENTYk6qIyXibdJQUKgplnrB2YuXPX8/OONo7Hqv2OK1gq pC4q8rYuWCWH7lTqhxqB9zaUPJx2/yaQJ0aUIeSheJwzvgvW91ftwq5ouFiAX141SXdP d+K3wKxMRqABpt/w3cxZ3aznw5e8dLVR2rY3V+D8HeEet3hlh63XTqqJussRqtArdjV2 hMZNRp8PZbrLrSScBk3a6syaMt8ZXauEvztRsK6FboeAEiVv8dFoBHeHCqRMjrLPX26T XOOw== X-Gm-Message-State: AOAM5301DCKHAAla6MlMKjgY4Q22+G3gDSpAjuxqM7mEG+mt3mRL4DJ5 golptMvtFt1EmkbFndYD4Lp2bA== X-Google-Smtp-Source: ABdhPJxCgXa4O4lCr5jufMzLbid1hV31YZ6Ksyj6RMw1lKhNPd+vfhqnw2YtfCvj7Fslbau82j3MHg== X-Received: by 2002:a5d:526d:: with SMTP id l13mr12419614wrc.279.1596424258806; Sun, 02 Aug 2020 20:10:58 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:58 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 11/36] wcn36xx: Add wcn36xx_set_default_rates_v1 Date: Mon, 3 Aug 2020 04:11:07 +0100 Message-Id: <20200803031132.1427063-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 Add a routine to set some additional default parameters associated with the V1 data structure. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 8 ++++++++ drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 3b27ff6f6dac..9f56f1af6dc4 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -785,6 +785,14 @@ void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates) sizeof(*ofdm_rates) * WCN36XX_HAL_NUM_OFDM_RATES); rates->supported_mcs_set[0] = 0xFF; } + +void wcn36xx_set_default_rates_v1(struct wcn36xx_hal_supported_rates_v1 *rates) +{ + rates->op_rate_mode = STA_11ac; + rates->vht_rx_mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9; + rates->vht_tx_mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9; +} + static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index c3615704b543..18ccc6c31a38 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -270,6 +270,7 @@ static inline bool wcn36xx_is_fw_version(struct wcn36xx *wcn, wcn->fw_revision == revision); } void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates); +void wcn36xx_set_default_rates_v1(struct wcn36xx_hal_supported_rates_v1 *rates); static inline struct ieee80211_sta *wcn36xx_priv_to_sta(struct wcn36xx_sta *sta_priv) From patchwork Mon Aug 3 03:11: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: 11697021 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 47EA914B7 for ; Mon, 3 Aug 2020 03:11:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32B602076B for ; Mon, 3 Aug 2020 03:11:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sHbU4lid" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727098AbgHCDLC (ORCPT ); Sun, 2 Aug 2020 23:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbgHCDLB (ORCPT ); Sun, 2 Aug 2020 23:11:01 -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 806B5C06174A for ; Sun, 2 Aug 2020 20:11:01 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id 9so12987120wmj.5 for ; Sun, 02 Aug 2020 20:11:01 -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=HtHey7iAsoGrNcBMQl/5w9ghs+hy8e9VJSTGAKv138U=; b=sHbU4lidjcxZEGX9NBT70jWaIgwINlY8OFLsSCYKwoflkizeLRilTZFlI74xFu2mNh 84goftO4U82tK1bmEAQQigC7qJrKut7NH0yRPpnykug/zvTYk62onVcMFYYkfo/ZE+05 Qsy8LxX3r3JrcBSVcm4ELAwrZR7+XVLnZjn7bYB21Ai+oGigY9/DLE3UFxkKusl8vBvz 9ebf1bvnZuMqNwdZitvh1sxXeg+uk1GD7xUBbl9SAYeSVlTQF3/ufVGRrGSAgjhoBQBF E2jB6LHpedJwNMuMgh2+/9x8HAniqWkuMIiB7eUfTbjyI7bmBBcA3U7vxNz4GPjHkWVM rrWA== 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=HtHey7iAsoGrNcBMQl/5w9ghs+hy8e9VJSTGAKv138U=; b=DINmKMYnZkQL1xcqebNDxLcYQ8HJfQQGMYv7m6phNdUIw6UA0LPMkSfTC9kqzJHiad OPV8I7X0QwNtU7+cZalxfiYirb1Kvn12NJJrkWslQj5Vr35rde+MQMLpwAM/5+4afX7K Hoy/YKOgJCwGpAUWTmBn6EtlwYvL1FVIyHm1KS8PSdigWjmq23xkHinRs2WwngiJeHQJ L/GndAvHJ68XFitp6xNluWkv+eXzXJlX92KI3wcePyaPqMHOR3pGN5OGDHIld00zCsCr YVST+PmDomtIshiEWuT04Ut6TD3Ajxk9ZaW0NGSjjZiP/HJduYDX8uV5VSJRlg4yYz/g zN+w== X-Gm-Message-State: AOAM531J7GWQLxvg+ZHDehhcCym+oyPZ0U2SnxS5ALSC1y0Y3gA/9zFv fvBIe7H7YiuSbKS1zzsXop/rFA== X-Google-Smtp-Source: ABdhPJxwYw1EGkkF31iJjUFOTDFpKUZtYGSgTSthnLoIzCSsxwh6IzsjMlFdT4/KkZNZJZM/DA0d0g== X-Received: by 2002:a1c:9942:: with SMTP id b63mr4632698wme.12.1596424260000; Sun, 02 Aug 2020 20:11:00 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:10:59 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 12/36] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Date: Mon, 3 Aug 2020 04:11:08 +0100 Message-Id: <20200803031132.1427063-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 adds VHT rates to the wcn36xx_update_allowed_rates() routine. Thus allowing the driver to latch the declared rates and transmit them to the firmware in the same way as other 80211.n rates are. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 9f56f1af6dc4..6a85bb699d10 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -758,6 +758,14 @@ static void wcn36xx_update_allowed_rates(struct ieee80211_sta *sta, sta->ht_cap.mcs.rx_mask, sizeof(sta->ht_cap.mcs.rx_mask)); } + + if (sta->vht_cap.vht_supported) { + sta_priv->supported_rates.op_rate_mode = STA_11ac; + sta_priv->supported_rates.vht_rx_mcs_map = + sta->vht_cap.vht_mcs.rx_mcs_map; + sta_priv->supported_rates.vht_tx_mcs_map = + sta->vht_cap.vht_mcs.tx_mcs_map; + } } void wcn36xx_set_default_rates(struct wcn36xx_hal_supported_rates *rates) { From patchwork Mon Aug 3 03:11:09 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: 11697023 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 F364414B7 for ; Mon, 3 Aug 2020 03:11:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC1C42076B for ; Mon, 3 Aug 2020 03:11:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UkGqSwyU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727101AbgHCDLD (ORCPT ); Sun, 2 Aug 2020 23:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgHCDLC (ORCPT ); Sun, 2 Aug 2020 23:11:02 -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 49399C061756 for ; Sun, 2 Aug 2020 20:11:02 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id 88so32762264wrh.3 for ; Sun, 02 Aug 2020 20:11:02 -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=D0xU/dOb+LnLns/kX1ZtFyu9J+wVoP3941KcJL2LnEo=; b=UkGqSwyUC7NcETveDjLdMlQ7VI2NnUqmZvtN2Y4GXUD4mSChmF0z9utMz8Wl522Iub 0bNS1CduO9tCT0lS8+xKCSj6bJG/fkpd2QGuO+u4Bf/5EoCAwKmq/Nwb3QmpVZssTCbx Qe8oF0aFiW8Q0U1nN83X3ExRdsrYUt+sljBnur5VKSCZaL28kUeCZsoeTJo29OCS6G0P h1+xhZcvmKnG1c8ZXykKWufHX7AG3XLcM9/NUuiAKd3/VSUJ+7peHeaAp1WUfeTrDLsp za6a/EZUrOazQUHA1qPI/Plc2SlwRgiB+jJaHRt7sOjzxDAbC1xePilw0e8091oapoxQ MZ0Q== 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=D0xU/dOb+LnLns/kX1ZtFyu9J+wVoP3941KcJL2LnEo=; b=BfI1taTIGc2jkAAMUKNA20jeHDNJS4CAm+4Sp4uEcRl3suxxPmHGvkBv+/xi6Qsl3k L60fM9MGE8/pADuW/cgREkmZcrKV3DD72D7gtNqm/pHBjmDef7X3GJucW1TyQFBL7e6M n+bXu9N34Aj3TRLZYrEDgj3u6s1sksReSDLMhm385pcMT0o2MrnvTZTu0i3tMJYvZEDs cvJQmOHa8kldz/92AEla6rWAfLRp5lzECoA0B1Fp2gHWQHtlFris9Gws+6WTd6lLC+Fj J1K9VFpFH3xIAM79E9uLwGlOtsJ5rIAX9qmK/a+F0KwsM19kfwfOMy1bpPXuuY18vKpp XDGg== X-Gm-Message-State: AOAM530EnnEZq4l46p2xLk0IQteDy9Dit5gsLJ2H0jLiXpnvAol+wIm7 PnrEzRaTaKwgXpqkxD2NkL179A== X-Google-Smtp-Source: ABdhPJzFZNLt7i8K31NBSiGKiTBGOQv4as2fmUgxxUGyHIgq0bEbb6TljC1+3yezu1Gvhhc9VXuymw== X-Received: by 2002:adf:ea0f:: with SMTP id q15mr12756722wrm.113.1596424261097; Sun, 02 Aug 2020 20:11:01 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:00 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 13/36] wcn36xx: Add wcn36xx_smd_set_sta_default_vht_params() Date: Mon, 3 Aug 2020 04:11:09 +0100 Message-Id: <20200803031132.1427063-14-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 adds support for setting default VHT parameters, which are exposed by the extended version 1 STA parameter type. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index a4e45114991b..df7e2125b503 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -189,6 +189,22 @@ static void wcn36xx_smd_set_sta_default_ht_params( sta_params->dsss_cck_mode_40mhz = 1; } +static void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn, + struct wcn36xx_hal_config_sta_params_v1 *sta_params) +{ + if (wcn->rf_id == RF_IRIS_WCN3680) { + sta_params->vht_capable = 1; + sta_params->vht_tx_mu_beamformee_capable = 1; + } else { + sta_params->vht_capable = 0; + sta_params->vht_tx_mu_beamformee_capable = 0; + } + + sta_params->vht_ldpc_enabled = 0; + sta_params->vht_tx_channel_width_set = 0; + sta_params->vht_tx_bf_enabled = 0; +} + static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, From patchwork Mon Aug 3 03:11: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: 11697025 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 3F2AE1392 for ; Mon, 3 Aug 2020 03:11:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A3B52076B for ; Mon, 3 Aug 2020 03:11:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CrNG9EZk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726799AbgHCDLE (ORCPT ); Sun, 2 Aug 2020 23:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgHCDLD (ORCPT ); Sun, 2 Aug 2020 23:11:03 -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 5ABE4C06174A for ; Sun, 2 Aug 2020 20:11:03 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id 88so32762286wrh.3 for ; Sun, 02 Aug 2020 20:11: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=IsN/Tm5UUbnXfV08uwv1LnbG1GnG/9PP7eJ2Z/tnej0=; b=CrNG9EZkmha+mhtxCrzJFNWjl18boOBTZ24XTJFK5vskKYM488wv2t0kVKuEuqE4R8 2HI/6ttCevYELidGsrqeiHTA+aNsYablniD0PrYvmFS/pW0jFijkjvn+J2RoCK9mojAx HzfwJKMH0gjx3fc56xzaXrNMel7pWfgPk+qoFM7L3ezaNqvB2VcgOgLtRMQgy2T5GbkY 4fUZmwV/mbQ7wcsX+oMxWWhLsBeydL3QK3oCkl62xWqdeHZD/oLnLW0GEHdHjsYTaiGY bQOX7O8er1DWxhuiYBReTE7QVJ/97Q4zWVBrbw6uhoHHUmOxIWhjT8sxJzEUod24X1mR +NBw== 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=IsN/Tm5UUbnXfV08uwv1LnbG1GnG/9PP7eJ2Z/tnej0=; b=l8cNR9e7HtOWBrprPXdxfwAQZaNgAbdk/PkBsFBi9Ys0VohWTW1qh239Z9QuX8ids9 nmfBFgNYb/ZDffZ703V1MDyJBfqpVi438jz9dGtq19DelnpMb7i6NRBOkAYCKUAxmr08 WhjBF/Dq3NjndQawcsGO9eWX0b5wKyKLCK/6uQwL1gKlcOin4q2eyOJs9IeORXYs3gfD DmZMCG5JO1ZqmXHac6TF0G53GDW0rfb4tFMcxt5u5YWjPRr30gF8cQRlZohGTs5OwKOQ ME6zgzNGYXD5gf0BPxiJuWRpe9UkXUj0iqQs1QjGV1eiMtE6LRhA0XkrMvi4GSBGUNJz ST5A== X-Gm-Message-State: AOAM532wnC31GNIynQkPUKU2RGTKISZSgzjhgxtCLVlHFpkjMXFFsdwT 5rSOm0Q5rLFoh5hRfgECRpcJmQD94Y4= X-Google-Smtp-Source: ABdhPJz86mv/8MU7ZfODrE3zFw/cRfW7kYAqRepRy5liOfY4K99VPrtxftxStH5gxCUV4tv13ymQWg== X-Received: by 2002:adf:ea0c:: with SMTP id q12mr12658098wrm.382.1596424262105; Sun, 02 Aug 2020 20:11:02 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:01 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 14/36] wcn36xx: Add wcn36xx_smd_set_sta_default_ht_ldpc_params() Date: Mon, 3 Aug 2020 04:11:10 +0100 Message-Id: <20200803031132.1427063-15-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 Toggling the LDPC enabled bit is possible only via the extended V1 data-structure. This function provides a means of setting the default depending on chip-type. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index df7e2125b503..88fb4b7f1356 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -205,6 +205,15 @@ static void wcn36xx_smd_set_sta_default_vht_params(struct wcn36xx *wcn, sta_params->vht_tx_bf_enabled = 0; } +static void wcn36xx_smd_set_sta_default_ht_ldpc_params(struct wcn36xx *wcn, + struct wcn36xx_hal_config_sta_params_v1 *sta_params) +{ + if (wcn->rf_id == RF_IRIS_WCN3680) + sta_params->ht_ldpc_enabled = 1; + else + sta_params->ht_ldpc_enabled = 0; +} + static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, From patchwork Mon Aug 3 03:11: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: 11697033 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 21A8A1392 for ; Mon, 3 Aug 2020 03:11:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 085B22076B for ; Mon, 3 Aug 2020 03:11:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Yh6JHZpU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727785AbgHCDLJ (ORCPT ); Sun, 2 Aug 2020 23:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgHCDLI (ORCPT ); Sun, 2 Aug 2020 23:11:08 -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 9700DC06174A for ; Sun, 2 Aug 2020 20:11:08 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id k8so14104915wma.2 for ; Sun, 02 Aug 2020 20:11:08 -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=KouWK8WECSEN05fvf0840cgRztNjkH3BZYdSGFVlz4M=; b=Yh6JHZpUZHFpNMw4crydqKnCrTDn0LIZ1lQLiwLxzxqXYxfyGNVdErNj4/iayJjR+B I+SejTDrx05Z1bsi/qil7Y3iPnRCNVNeA/OACr+P/TsTjNJaBV1JnsUMTZWr4Kx8Anqy HVetXfy+ggXJs2UoFWLR0/oUlV7PfRh/nJ5s3eoMWdFzVehs0sCUzLthDJKl2VUpx0sA mN5uYuYR0Ki0PGBNREsSH48EYeYLqKHCX9tRSaQC2cb7WDI1QEqVqt3y/gHAm34vJ+Zh qAVLTkIXwpg0QvSr/6i8SonFOzr65peday6NQgHAen6QDJBZMRtpJ/MPrmNMjuGOjHY4 cNiQ== 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=KouWK8WECSEN05fvf0840cgRztNjkH3BZYdSGFVlz4M=; b=AgMoHlH62lBDi6dk3a/u2U+wnGvPVf/NOqqC5X846MHI+RarsE1zxrwEQA316pj9Ro rncfLQjq9RALIf2gIMDb8NuH4IYbRUg4uzNv57C/qn/VEPBgodj+kejiige64cpK+4mp qUix347hQYxuvxHjiVVrBy8wngVy/YqgOvlE5/ACb+aRaQSXuz0VTL3F2FHh/xCxiSXO DrpgzK+I3LRvpzf2Vu1WRjtV7SeHD0LKLt5USbYf3Fgb8AkaAxVRfQliMf39l4/wK8y6 mizZfGEr1vu+t4nAdSivmyXlV8rOlQjcSNHJ0BuDPxJb7r2wSv+ImPX4SIvBWNPKbTrM zF4Q== X-Gm-Message-State: AOAM530OMIli9cKI2xJvz8UPz3Wqd/PeIu70yZQ43iGCyI1gf2/kskal 1kEMoCwIZuzfleFEGPVw4bpKMQ== X-Google-Smtp-Source: ABdhPJypP/oGHzV7PccfNI+wKB7lwPYiNb4zun3Qm40qcZB/XnxP9FO69L3VK6xcAiNlEqY85UV3pQ== X-Received: by 2002:a1c:cc0c:: with SMTP id h12mr667020wmb.57.1596424263363; Sun, 02 Aug 2020 20:11:03 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:02 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 15/36] wcn36xx: Add wcn36xx_smd_set_sta_vht_params() Date: Mon, 3 Aug 2020 04:11:11 +0100 Message-Id: <20200803031132.1427063-16-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 adds support for setting VHT parameters based on the declared VHT capability bits in the VHT capability structure. The bit-field TX-BF is purposefully left out since wcn3680 is the only wcn36xx that can do VHT/80211.ac and is not TX beamformer capable. TX-BF is a dead bit. Similarly we cannot do 160MHz so VHT Channel width set should be zero. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 88fb4b7f1356..2632ea2ad9fa 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -173,6 +173,21 @@ static void wcn36xx_smd_set_sta_ht_params(struct ieee80211_sta *sta, } } +static void wcn36xx_smd_set_sta_vht_params(struct ieee80211_sta *sta, + struct wcn36xx_hal_config_sta_params_v1 *sta_params) +{ + if (sta->vht_cap.vht_supported) { + unsigned long caps = sta->vht_cap.cap; + + sta_params->vht_capable = sta->vht_cap.vht_supported; + sta_params->vht_ldpc_enabled = + is_cap_supported(caps, IEEE80211_VHT_CAP_RXLDPC); + sta_params->vht_tx_mu_beamformee_capable = + is_cap_supported(caps, IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); + sta_params->vht_tx_channel_width_set = 0; + } +} + static void wcn36xx_smd_set_sta_default_ht_params( struct wcn36xx_hal_config_sta_params *sta_params) { From patchwork Mon Aug 3 03:11: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: 11697027 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 DA5CB14B7 for ; Mon, 3 Aug 2020 03:11:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C51AC2076B for ; Mon, 3 Aug 2020 03:11:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KC6bgnUX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727118AbgHCDLG (ORCPT ); Sun, 2 Aug 2020 23:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgHCDLF (ORCPT ); Sun, 2 Aug 2020 23:11:05 -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 86452C06174A for ; Sun, 2 Aug 2020 20:11:05 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id 88so32762332wrh.3 for ; Sun, 02 Aug 2020 20:11: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=VtjPUnCQUJ2Xqmf1HBNfL/7o3eTpGJ7VqulMTNQ/Ev0=; b=KC6bgnUX94nR12VYj/AbBBrbijB1bxi+D66PsiUbvfpTkrjg4Hhe7I1Pg20yJQvE5g 55oSJ8HXXp0zG/Jso1ZfJf233vNTiHX+Sl6MqGfGhHGFTl84gUpk9ve3n72ZRhEEarr8 Cm9mQV86Q6/NE9ZdAH5WyOHtEzVOeFGEsiijHiKSwh8hK8EL6Mwh067fJ9u3IiSRv9Cs bBxEQW4b0CDETjtCYsku7a8laxPT64EKI982qdvxoSmtcYA/p1/0DGI2gpqCLJsu0L4x yVLce1lf1Ebuv+lGvnx16th/cOwc7NatSWcSe4JbHGCiYWCBZQZxSypTA9v4i6I/Nvvd WF/Q== 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=VtjPUnCQUJ2Xqmf1HBNfL/7o3eTpGJ7VqulMTNQ/Ev0=; b=t+fQlC3wqsXguFeZ64WAtCVSWYxiJ48Webg91B545eD6ENvLaqGYWgYz0mCupsylVy 8J/Jannovvof17V3AnEUASz3HYNnlE39/hMeWMu5xj1I4YdJ+Xb1pxPX6E/q5jSasFzK FuNs7E++79R6/Nn6EYBmggp8FUc+GLAvmLHCb0EQCqZwv6WahFC0Z7GHniBxf6co0+wJ daDEbDOIOhigXGP8XSK9r7LSOhYRhIhCSGUP7MYIJq4gEdjbI/sPC3NxI4LsrpLfCGmI KfUVTrLskXzn6Pjn605niXiIKc4YGs+aG+oNBzbwAztKAemg2G7GDf/vtTKbZW6Y7UIa Hsig== X-Gm-Message-State: AOAM533kOh//51rIgiD57JTjM2mZek8lQFRyUwCPSMVQWnNrQYYi/o9s hnEBCm0zvFbNoIv6ODZ2yCIjkA== X-Google-Smtp-Source: ABdhPJwIRMQpJ85MGX0gR8olJhcaCWEYMI/m9vI5J6ToPa3D/6Ed4YM3oCvuQEpN7ABDcG3wAppqtQ== X-Received: by 2002:a05:6000:118c:: with SMTP id g12mr12882764wrx.212.1596424264279; Sun, 02 Aug 2020 20:11:04 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:03 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 16/36] wcn36xx: Add wcn36xx_smd_set_sta_ht_ldpc_params() Date: Mon, 3 Aug 2020 04:11:12 +0100 Message-Id: <20200803031132.1427063-17-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 a routine to allow setting the LDPC bit for HT parameter passing inside the version 1 STA parameters data structure. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 2632ea2ad9fa..8bb24fe9bde3 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -188,6 +188,15 @@ static void wcn36xx_smd_set_sta_vht_params(struct ieee80211_sta *sta, } } +static void wcn36xx_smd_set_sta_ht_ldpc_params(struct ieee80211_sta *sta, + struct wcn36xx_hal_config_sta_params_v1 *sta_params) +{ + if (sta->ht_cap.ht_supported) { + sta_params->ht_ldpc_enabled = + is_cap_supported(sta->ht_cap.cap, IEEE80211_HT_CAP_LDPC_CODING); + } +} + static void wcn36xx_smd_set_sta_default_ht_params( struct wcn36xx_hal_config_sta_params *sta_params) { From patchwork Mon Aug 3 03:11: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: 11697029 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 53D6414B7 for ; Mon, 3 Aug 2020 03:11:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38B332076B for ; Mon, 3 Aug 2020 03:11:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qUj2SUbT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbgHCDLH (ORCPT ); Sun, 2 Aug 2020 23:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgHCDLG (ORCPT ); Sun, 2 Aug 2020 23:11:06 -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 7388AC06174A for ; Sun, 2 Aug 2020 20:11:06 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id t14so8893017wmi.3 for ; Sun, 02 Aug 2020 20:11: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=vrOV8j+dZUEpzVBAQmMgPqqjv//xk+FxMjpzH66IHaA=; b=qUj2SUbTycO2jZzjVCBEYnhjccDnQvme9JfD/u6FXYbQp54kMGQxwwDayznHIwgYzR GwZd/1dn3WUyz0p3t0ivQXEg/hXv1VGLx27U3TSPQlWaLV95GU+iGiwKyvQhamX1mG6B ggLI7wMIfq2ui19PrGUoO09V1daNJ4Fs6mzST1nL/wmT7VxCp9i6Plthac3X89I8cegE bWviszeCgHO94OUQFoVM9n95/WlpMv2BX6ejjhdN+Da2lPVAe9szLjRjA1dx1U/Xg4NZ DFUaI+E+kkO3TuSBnm9F8qExsD6GU+R2exmhgKWLfCFo4yoAFYR2zezJgdJ9XheHLjV+ Kuqw== 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=vrOV8j+dZUEpzVBAQmMgPqqjv//xk+FxMjpzH66IHaA=; b=YM47gzNng1bdqeSn2KJJjRwf5xk9lqog7cRuQik6BfSLrijkKpXYoJZIMgPdC7sr7G 9fxOnGiN8v8UUG3LCwNJSwUpQphEgFj3Upq5lN/iOa5hDNV1j+WggP1fasnItZcDpNfA uAMdVhEyq7XTjbnGcLkpOCcXvBIGy4bW22fhV8zO+s2QhTwoTk2P3vRTzPHOXD330oD8 CEo/HSz6+nof7flJTCUHzUuhMq6NQeSEbkCo8SF5+U/KxMfR+C/AB66uI2Sl7/bYWWqd Wzy+zQe1uZTFNe+UvY4EsrG5oSpxSjBvG40sbU+s7cW6htjds2CygJwovsLySNcoE3NZ POBg== X-Gm-Message-State: AOAM530v1B4fYtpfaNYHfp0Lpdjll+DepyZiO+mAzM67AgAwILROJ4U+ PnTaJI+OTl1+jHXsG6HMWwPbY95wX/c= X-Google-Smtp-Source: ABdhPJyOPm9oYLKHrYbOiFcZPBJPeG4IaBYuR5EDldFKRQMphE/DHTTcVPfDv98ejXBeH2IFHZQkHw== X-Received: by 2002:a05:600c:220b:: with SMTP id z11mr13516636wml.48.1596424265268; Sun, 02 Aug 2020 20:11:05 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:04 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 17/36] wcn36xx: Add wcn36xx_smd_set_bss_vht_params() Date: Mon, 3 Aug 2020 04:11:13 +0100 Message-Id: <20200803031132.1427063-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 adds wcn36xx_smd_set_bss_vht_params(). The job of this function is to decide if the BSS is VHT capable and if so set the appropriate bit in the BSS parameter structure for passing to the firmware. VHT Channel width set is not set since we don't support 160MHz. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 8bb24fe9bde3..ab9f0361aec4 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -145,6 +145,15 @@ static void wcn36xx_smd_set_bss_ht_params(struct ieee80211_vif *vif, } } +static void +wcn36xx_smd_set_bss_vht_params(struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct wcn36xx_hal_config_bss_params_v1 *bss) +{ + if (sta && sta->vht_cap.vht_supported) + bss->vht_capable = 1; +} + static void wcn36xx_smd_set_sta_ht_params(struct ieee80211_sta *sta, struct wcn36xx_hal_config_sta_params *sta_params) { From patchwork Mon Aug 3 03:11: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: 11697031 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 3E95E1392 for ; Mon, 3 Aug 2020 03:11:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27C262076B for ; Mon, 3 Aug 2020 03:11:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ft/Q1CIU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727775AbgHCDLI (ORCPT ); Sun, 2 Aug 2020 23:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgHCDLH (ORCPT ); Sun, 2 Aug 2020 23:11:07 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F479C06174A for ; Sun, 2 Aug 2020 20:11:07 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id x5so13013683wmi.2 for ; Sun, 02 Aug 2020 20:11: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=Dc68vpe0LVXUulWOmw+HiZxgDJO28qrPNtD0WWyi8Tc=; b=ft/Q1CIUiqx6ryiWMvkYWb2I/kUTLpSuMimOKZM2WxAdtJUdmOTc0RTQXr2EkgsS4J MP9Jk50dnN6r8AOvlzinkC2vPPGN7Rgx2aUCXxIIqP2AiYR2/UWHdQZu30for3XlpmA+ VD1d5jTP4/Pbz/lgx6HgvgeSaZm23VH3Rk7QDQp4e+4/S1OgAouMsmIQhcozXqKTPrNQ QIq7hcqQNMBjvQVhBTP1KIHG5Ko3NQzxT/qflnM1wgM/nyjgO+uBA2QuoJUeN81xgVeL m+Ke7ZGHk3w1aKfkBvoECjAxg1V6vwt+EYxmj5ZfCshPHk8aoH9zqNPeAqDaxMFuQ7SC mDKQ== 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=Dc68vpe0LVXUulWOmw+HiZxgDJO28qrPNtD0WWyi8Tc=; b=QwWuvg6EJaiyAhRTUoFkN64+vKRJBQ0ZXJtJLZe/Zu2KeDkvDoBEUIdfZ0p9PYXF4/ P2AuNH9QS55IjT+9s9xhb0KkOUKA25h1mus2XwJcIVC5M8xomNTzxxDQk8ItWjU9zewx ATaYYy01XkMeskETv/YliEWKjPLlVALcK64pEJtse+sal7ERzvvauMQ/rNhR84HLz98q hu70o2zDSc7CVM16Tsn14yzC3hLSUxVRbdu43PbqPUiECwdBZfdfZesrMIHRCeOUYzh3 Wlw89n28BXbNhawt6B/Qj/4lDCjFUuPNoam9auwUsZRTVqHD2FpOHHYoyF+CdnDRabmX 7VVA== X-Gm-Message-State: AOAM532rA09g4em5/IG/oQPzIsFOrslJVa1ycJAmUBgXkfLaQp8buxzQ /1drfWX+UI4g57qwNzF2gEOPWA== X-Google-Smtp-Source: ABdhPJxHDo/9yz1YSMlxv98Q1bFr7pWkf+ycR1vK5rO9n9c+4m2AH6b2oCcJiuw610zPctuwUxDY7A== X-Received: by 2002:a1c:740e:: with SMTP id p14mr13437098wmc.179.1596424266273; Sun, 02 Aug 2020 20:11:06 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:05 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 18/36] wcn36xx: Add wrapper function wcn36xx_smd_set_sta_params_v1() Date: Mon, 3 Aug 2020 04:11:14 +0100 Message-Id: <20200803031132.1427063-19-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 adds a wrapper function wcn36xx_smd_set_sta_params_v1() which calls into wcn36xx_smd_set_sta_params() and then subsequently sets version-1 specific parameters. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index ab9f0361aec4..f61516988953 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1241,6 +1241,31 @@ static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx *wcn, v1->p2p = orig->p2p; } +static void +wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct wcn36xx_hal_config_sta_params_v1 *sta_par) +{ + struct wcn36xx_sta *sta_priv = NULL; + struct wcn36xx_hal_config_sta_params sta_par_v0; + + wcn36xx_smd_set_sta_params(wcn, vif, sta, &sta_par_v0); + wcn36xx_smd_convert_sta_to_v1(wcn, &sta_par_v0, sta_par); + + if (sta) { + sta_priv = wcn36xx_sta_to_priv(sta); + wcn36xx_smd_set_sta_vht_params(sta, sta_par); + wcn36xx_smd_set_sta_ht_ldpc_params(sta, sta_par); + memcpy(&sta_par->supported_rates, &sta_priv->supported_rates, + sizeof(sta_par->supported_rates)); + } else { + wcn36xx_set_default_rates_v1(&sta_par->supported_rates); + wcn36xx_smd_set_sta_default_vht_params(wcn, sta_par); + wcn36xx_smd_set_sta_default_ht_ldpc_params(wcn, sta_par); + } +} + static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, struct ieee80211_sta *sta, void *buf, From patchwork Mon Aug 3 03:11:15 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: 11697035 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 F046D14B7 for ; Mon, 3 Aug 2020 03:11:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA97B2076B for ; Mon, 3 Aug 2020 03:11:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="I9ASwBhw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbgHCDLK (ORCPT ); Sun, 2 Aug 2020 23:11:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726824AbgHCDLJ (ORCPT ); Sun, 2 Aug 2020 23:11:09 -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 CDDCCC061756 for ; Sun, 2 Aug 2020 20:11:08 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id f7so32820304wrw.1 for ; Sun, 02 Aug 2020 20:11:08 -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=tYD10FZO8KhccbIhk1uqysdR2q5fPg1Yg+7P+eySpwo=; b=I9ASwBhwfZb3DoiFraFPtPwchqSItIhD79zECvHvQTdoVCkO8EwPvAXUmK9/KGGAtg jTXHThmWJXorf/ar5noQYN2/L5bvzKq/pXQqiDMZ+1hbzHA5+ZCU5kpEPR7gInQEuB5i JzFbcxOCpuNsUi6cQa8ABQYM/5Qc8Po9ntduUTg7kveLycm9eC+lbeFbv1hxZcDAhl1a mB2SyDxYBibgjEPofx/lcaVRG4SIN4zgm8xnH9GTIN4qVbRprhNcqb4pxrYgOjPHWSjM jJre9aZF2ldPMFbMUStMGv1n/RFFr5OXLd4+mcJxaiRcXSRL5g6VfYBXeH6kf9acBpCU Kmxw== 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=tYD10FZO8KhccbIhk1uqysdR2q5fPg1Yg+7P+eySpwo=; b=UiSP5Ig9NgWcD3soLXyhZwFlRFbZDzlejFEjeTesdlGEGc9OZBMd+ibpu2lZU0Warp VoAWPkj6/UuZkgPsx/ZkpeiE4Tso2eqIb/lx4BxZZmRwcwhPFsolMXHk5tbXcF9cxOEa EuiMi2VssHPxZvmAkospyNutAHF3SS+pZRMaTYrw/hK9JnU8SugBdM7u1YfC676sbSTO Jn49A9RRY2+d34Y1BCva63NukUkcQU2zzGe1V1uXd7LEaSeIVorF+ZOQWR7KwsTIk5SP VPzHvASrmEyjirK/xjzqmoIXuZPekUjvdXNrMjM2YZe0Bcc5Wv95+uhpgKUu6L9iYN9T GBkA== X-Gm-Message-State: AOAM531gZvPg6X2wCxPUB+k9DbIl18kU9vyVY4b3zuv1K2mrZJlDNEMl yRaUefamyJyIkj4uaaaRk1WH3w== X-Google-Smtp-Source: ABdhPJwZkJWZxJoaH4alTXKRcy9FS1Usey7pRhjXNDwb2OndQZvlINcGG0SbZW15MPYw4zRZcphPHQ== X-Received: by 2002:adf:fe0a:: with SMTP id n10mr12660332wrr.125.1596424267660; Sun, 02 Aug 2020 20:11:07 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:06 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 19/36] wcn36xx: Define INIT_HAL_MSG_V1() Date: Mon, 3 Aug 2020 04:11:15 +0100 Message-Id: <20200803031132.1427063-20-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 In order to pass 802.11ac VHT parameters from the SoC to wcn36xx we need to use the V1 data structures associated with BSS and STA parameters. The means of identifying a V1 data-structure is via the SMD version field. This patch defines a INIT_HAL_MSG_V1() which operates the same way as INIT_HAL_MSG() with the exception that it defines VERSION1 as opposed to VERSION0. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index f61516988953..6a03d5956fc2 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -349,14 +349,20 @@ static void init_hal_msg(struct wcn36xx_hal_msg_header *hdr, hdr->len = msg_size + sizeof(*hdr); } -#define INIT_HAL_MSG(msg_body, type) \ +#define __INIT_HAL_MSG(msg_body, type, version) \ do { \ memset(&msg_body, 0, sizeof(msg_body)); \ msg_body.header.msg_type = type; \ - msg_body.header.msg_version = WCN36XX_HAL_MSG_VERSION0; \ + msg_body.header.msg_version = version; \ msg_body.header.len = sizeof(msg_body); \ } while (0) \ +#define INIT_HAL_MSG(msg_body, type) \ + __INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION0) + +#define INIT_HAL_MSG_V1(msg_body, type) \ + __INIT_HAL_MSG(msg_body, type, WCN36XX_HAL_MSG_VERSION1) + #define INIT_HAL_PTT_MSG(p_msg_body, ppt_msg_len) \ do { \ memset(p_msg_body, 0, sizeof(*p_msg_body) + ppt_msg_len); \ From patchwork Mon Aug 3 03:11:16 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: 11697037 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 2598514B7 for ; Mon, 3 Aug 2020 03:11:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E3422076B for ; Mon, 3 Aug 2020 03:11:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="r8Kq4HnY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727793AbgHCDLL (ORCPT ); Sun, 2 Aug 2020 23:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727788AbgHCDLK (ORCPT ); Sun, 2 Aug 2020 23:11:10 -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 CAB12C06174A for ; Sun, 2 Aug 2020 20:11:09 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id y3so32789172wrl.4 for ; Sun, 02 Aug 2020 20:11:09 -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=KS5+23voL9WeTjkQBGek/Gfs7r3fmKSdew4Fk01OQj4=; b=r8Kq4HnYWyrKPARy+4a/zfw2tt0NKlmEV3VpnxQWmTDyVRN72NJdFs/1NhDwDUqIMi T7ZviP+AEwWZc9Em52VEIhAJ7t+Q4kQAn+mFffHpBB4YQnqTnnxF66cW0UD2S/0iCcC6 tWLmkRXkPHGVX9P+iSXH1nnIbnqidRgxl+/pMbUvfDCfpCy46zMCMzz83NSXViKlEULZ 1eOax+tr65lBBl/Q+MjD6SXUFdPv9Y4NeRZ6sQ0DgOocd4KWneSYiaRpB0+Ot/vcms3m MKrZ/FIlBxjuyZp2+3P5p7xVeBl9tnbE6fQKi+SUB3E1o1SPry55Mh9Kb+wtPvv6K5mc bMBg== 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=KS5+23voL9WeTjkQBGek/Gfs7r3fmKSdew4Fk01OQj4=; b=nrYuabqrYSrk6m7YK7A6diohPXxBs6+wlOFgGYseBH4rBuamEZOqlqVbKj3Ax6UIPu OJMwcBRhqENjoHVxc9EacVdSYpfWNkkpxppMY/LRY6zY/sfDGl88SyBTmSnSE6JAakRA pocy16GUH5yCpAzZFJJJNItdsv1oXoxdd1+bZHt4GltZTRsdz9cX9mdQ650Nq/a3PMDw 66Cytjq7/Kh/v2tm07UnNvxpNjBooOdW0Y0f/m0fewBcmj9fhaFnETRxHAixCjB1DCh5 xpEk6x8RTMAcMDOvxiEWrAlbEH+lND9iQ0dEicaVVXdc8m5az/UPUGGlRGpkrNbF8D2D wZnA== X-Gm-Message-State: AOAM531Go9+CKaYhFoJQB+5YY5CjFqwxDNPy1NiV4IQsKlhYSY+tzKXS qtf21JRLVHrbBEjEU8Y2piFAyQ== X-Google-Smtp-Source: ABdhPJwT5ifTtehVIu9EyL3eSM72q72nxV50Y5xhF1/p2uyHcH9WR+xvITvT6nJtkjjKYDTDgXNG5A== X-Received: by 2002:adf:ab05:: with SMTP id q5mr12495357wrc.46.1596424268620; Sun, 02 Aug 2020 20:11:08 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:08 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 20/36] wcn36xx: Convert to VHT parameter structure on wcn3680 Date: Mon, 3 Aug 2020 04:11:16 +0100 Message-Id: <20200803031132.1427063-21-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 In order to send VHT parameters to wcn3680 we need to pass the extended V1 parameter structures to the firmware. These commands need to have the version number set to 1. This patch makes the conversion. The conversion consists of 1. Setting the version number for wcn3680 or leaving it at 0 otherwise 2. Setting the sizeo of the packet header lower for wcn3620 and wcn3660 Once done all three chips can continue to use the same code to pass parameters to their respective firmware. In the case of the wcn3680 the passed structures will be slightly larger to accommodate communication of VHT descriptors. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 6a03d5956fc2..2d6779cfa59c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1311,7 +1311,12 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, struct wcn36xx_hal_config_sta_req_msg_v1 msg_body; struct wcn36xx_hal_config_sta_params_v1 *sta = &msg_body.sta_params; - INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); + if (wcn->rf_id == RF_IRIS_WCN3680) { + INIT_HAL_MSG_V1(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); + } else { + INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); + msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; + } wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, &msg_body.sta_params); @@ -1382,7 +1387,12 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, if (!msg_body) return -ENOMEM; - INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ); + if (wcn->rf_id == RF_IRIS_WCN3680) { + INIT_HAL_MSG_V1((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ); + } else { + INIT_HAL_MSG((*msg_body), WCN36XX_HAL_CONFIG_BSS_REQ); + msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT; + } bss = &msg_body->bss_params; sta = &bss->sta; From patchwork Mon Aug 3 03:11:17 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: 11697039 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 363811392 for ; Mon, 3 Aug 2020 03:11:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F48A2076B for ; Mon, 3 Aug 2020 03:11:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EjsU4MRG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727806AbgHCDLM (ORCPT ); Sun, 2 Aug 2020 23:11:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727792AbgHCDLL (ORCPT ); Sun, 2 Aug 2020 23:11:11 -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 C7B0FC06174A for ; Sun, 2 Aug 2020 20:11:10 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id f1so32234483wro.2 for ; Sun, 02 Aug 2020 20:11:10 -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=ax8SuSrL7632ouEAOv3sobptqn91JzKWsmm/Phaehw8=; b=EjsU4MRG2d7kjpTDDuIlyGLFVnyAVEUpcVS6Bf3qSVhleBvh7etYy/HmQfNwCPqV+V GSHkLwEwx3jnylTW8m3hdQUhQvMffYM70zvTXwtODWKcyXTC8pwvDVuvsGet0qDGo2CS 6hANX6h5LROc8VDsqoBX6Qm8bfetQhy+N3zSKdB37kxmUxToMqGlRV+D44x15u/gRZBT zHCsBDG5QJk1C3dcFZ7LYP5iNxC3DDL71mcOcrbqvBL+PRTLbGTeISHjv5liMy/HYVgT 5ikcn5cmcGvSdQJXvgWBo36QxYxaH8ny4OJsoKBALKrQU1Zu18Q+2lGLT+R3PW5zjLhD NCUA== 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=ax8SuSrL7632ouEAOv3sobptqn91JzKWsmm/Phaehw8=; b=CZPdtqsHeDgwQ7YKqKMkF48CY/EeQRQYzHbSzViiMBTwh468sLlxIJ+7OirqMHmbis u+XwNH244d8rH7KaxaXhhhgca81shmePfdDxbXx/nc6s7eQkAcA1RRjSyzHZHqSr0MMF Wtgxy0p6nWMm4Gk7u/VW05akvrAqKPo5Jp04V9WY5h//nRuAqKdmX60rsw/EL7SqCewH bglSFwtf7+YrtfMSvtCofXKLXJFO3XnPukWSWia6vrikYlpW1UJ47AaAhuDAlfbrAUDf xYRe1ny714vAuzud2vT09wIUC0besQ9Q4Q5z8Toge1iMRHMSgRWPGAWvW+uBsx3nQ+Ua icxQ== X-Gm-Message-State: AOAM532eqIMvA1iR3DyUkFRBTWW5pZSO+scuZXw03C4pgN22hX4Hx7tJ bNI/e62vWZUKhBtB5aaRFVHwMxqFW04= X-Google-Smtp-Source: ABdhPJwIs78GukpvbeHgIvlrg9X1CKWtIZnAEQX8yH2Sqmn7AX6xImVbY51I+qPsAP0hMLfdFgz36A== X-Received: by 2002:adf:a3d0:: with SMTP id m16mr12424041wrb.232.1596424269609; Sun, 02 Aug 2020 20:11:09 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:09 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 21/36] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Date: Mon, 3 Aug 2020 04:11:17 +0100 Message-Id: <20200803031132.1427063-22-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 functionally decomposes wcn36xx_smd_config_sta into a clearly defined wcn36xx_smd_config_sta_v0 and wcn36xx_smd_config_sta_v1 path. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 53 ++++++++++++++++---------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 2d6779cfa59c..7ad75faf8c4b 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1306,10 +1306,11 @@ static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, } static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, - const struct wcn36xx_hal_config_sta_req_msg *orig) + struct ieee80211_vif *vif, + struct ieee80211_sta *sta) { struct wcn36xx_hal_config_sta_req_msg_v1 msg_body; - struct wcn36xx_hal_config_sta_params_v1 *sta = &msg_body.sta_params; + struct wcn36xx_hal_config_sta_params_v1 *sta_params; if (wcn->rf_id == RF_IRIS_WCN3680) { INIT_HAL_MSG_V1(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); @@ -1318,46 +1319,56 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; } - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, - &msg_body.sta_params); + sta_params = &msg_body.sta_params; + + wcn36xx_smd_set_sta_params_v1(wcn, vif, sta, sta_params); PREPARE_HAL_BUF(wcn->hal_buf, msg_body); wcn36xx_dbg(WCN36XX_DBG_HAL, "hal config sta v1 action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", - sta->action, sta->sta_index, sta->bssid_index, - sta->bssid, sta->type, sta->mac, sta->aid); + sta_params->action, sta_params->sta_index, sta_params->bssid_index, + sta_params->bssid, sta_params->type, sta_params->mac, sta_params->aid); return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); } -int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, - struct ieee80211_sta *sta) +static int wcn36xx_smd_config_sta_v0(struct wcn36xx *wcn, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta) { struct wcn36xx_hal_config_sta_req_msg msg; struct wcn36xx_hal_config_sta_params *sta_params; - int ret; - mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg, WCN36XX_HAL_CONFIG_STA_REQ); sta_params = &msg.sta_params; wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); - if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { - ret = wcn36xx_smd_config_sta_v1(wcn, &msg); - } else { - PREPARE_HAL_BUF(wcn->hal_buf, msg); + PREPARE_HAL_BUF(wcn->hal_buf, msg); - wcn36xx_dbg(WCN36XX_DBG_HAL, - "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", - sta_params->action, sta_params->sta_index, - sta_params->bssid_index, sta_params->bssid, - sta_params->type, sta_params->mac, sta_params->aid); + wcn36xx_dbg(WCN36XX_DBG_HAL, + "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", + sta_params->action, sta_params->sta_index, + sta_params->bssid_index, sta_params->bssid, + sta_params->type, sta_params->mac, sta_params->aid); + + return wcn36xx_smd_send_and_wait(wcn, msg.header.len); +} + +int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, + struct ieee80211_sta *sta) +{ + int ret; + + mutex_lock(&wcn->hal_mutex); + + if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) + ret = wcn36xx_smd_config_sta_v1(wcn, vif, sta); + else + ret = wcn36xx_smd_config_sta_v0(wcn, vif, sta); - ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); - } if (ret) { wcn36xx_err("Sending hal_config_sta failed\n"); goto out; From patchwork Mon Aug 3 03:11:18 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: 11697041 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 003B014B7 for ; Mon, 3 Aug 2020 03:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC5242076B for ; Mon, 3 Aug 2020 03:11:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L1rhFRsE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727809AbgHCDLN (ORCPT ); Sun, 2 Aug 2020 23:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbgHCDLM (ORCPT ); Sun, 2 Aug 2020 23:11:12 -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 CB51DC06174A for ; Sun, 2 Aug 2020 20:11:11 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id r2so27705569wrs.8 for ; Sun, 02 Aug 2020 20:11:11 -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=8EodbAD856JPjKx6stA7m96iT9XaLUX9CNtoPFY/hAs=; b=L1rhFRsEfHLjnSsHVVaEBIxtc9NzrVr56RXmtApGJVLIyBuc/hoXN0d53Z0S/kfb0S I7vAIDHZZKsC1gTAc89oWpxfTMF9gDVZ8kX4cuJXHhhV3s6H3j7Jag5v/CMX1rG2DM1b HGByol3odBt5m5ujJbJjIGspKtYQkvqYa3KYytc/09zyv9+08/XA7Mv51D+kkBwYjBLx TwA1uPYRl6jH6V0rW+LQTSFwDztNdLYm547GlzVwR2cfydfw0qbpmd9UisMefBkp5gz9 dwe/X6Ra+Gf1r5WwyuQfmyPppydl4yKqBNVQfZ8Wpvw4quyPWHmav8xhb1aYrwE4Tzs5 BeRg== 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=8EodbAD856JPjKx6stA7m96iT9XaLUX9CNtoPFY/hAs=; b=aD7Fi4INGLBrA5UtFCpMA67MmhQ8H3IVtcDxf5BLrOIqPWuxsyxaQnuj/KLtmEIvlU RTmSmj8YkF+HerHZ1NW30qE2qPVXFQoSvvRqtQa1uq3oI1/s5uR6AeVnR+N1ANuId0mf 8smT2TUFnPoFoitgN/zsXwIxTlq78JasapXyW+qwK8UCDrsUajMrL1rtmc7Uwv/t+R9d yueYGGQ0CuXatg4XftWQf37Hq+auPqWSJdCQAwSXwREyf6cAjFRf0KP9qpgFb52daesu TvvG0SgvfwPpGcBZqG7qmPkGWsiFgrC9RQVxu3FpFrO9mGTAepH1LreklRYyvdjBk+cd Wczg== X-Gm-Message-State: AOAM531vYOiEuo97ooGTGOri0M0nTjonCuSEIHlnwgYfzUjT4Di89n0D xQ/vOrQnYYrFLiy1D4ry8l2H5Q== X-Google-Smtp-Source: ABdhPJzqKLUpAJrb7gnUWvNuAS6X4/LgBOiUHF35xEdaa0sqqwb9O422L+o3kfkIs5WepSDVBcnSZg== X-Received: by 2002:a5d:6a8b:: with SMTP id s11mr12993677wru.222.1596424270640; Sun, 02 Aug 2020 20:11:10 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:10 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 22/36] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Date: Mon, 3 Aug 2020 04:11:18 +0100 Message-Id: <20200803031132.1427063-23-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 In order to facilitate functional decomposition of wcn36xx_smd_config_bss() we need to move wcn36xx_smd_set_sta_params() later in function. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 7ad75faf8c4b..6232e64fb298 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1612,7 +1612,6 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; bss->reserved = 0; - wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); /* wcn->ssid is only valid in AP and IBSS mode */ bss->ssid.length = vif_priv->ssid.length; @@ -1638,6 +1637,8 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, vif_priv->bss_type = bss->bss_type; + wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); + wcn36xx_dbg(WCN36XX_DBG_HAL, "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", bss->bssid, bss->self_mac_addr, bss->bss_type, From patchwork Mon Aug 3 03:11:19 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: 11697043 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 CABF214B7 for ; Mon, 3 Aug 2020 03:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B09632076B for ; Mon, 3 Aug 2020 03:11:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tKG17mtp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbgHCDLO (ORCPT ); Sun, 2 Aug 2020 23:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgHCDLN (ORCPT ); Sun, 2 Aug 2020 23:11:13 -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 12E5EC06174A for ; Sun, 2 Aug 2020 20:11:13 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id t14so8893143wmi.3 for ; Sun, 02 Aug 2020 20:11:13 -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=MEUWUJFP24hT9x0knHQlZkJe347puz4cw8J1YAVzn7s=; b=tKG17mtpsX0klVMiQxGI+DP8DvKFoPtEXyU3w+gbF7kgs/CcT9tn4rfnfDfmx/t6vP w42UmnPwT2YHvcR35nSq+yH091rRmmax8QzcJocshpBtTnoznSEAsYr6wooHcl+6wfzT ciqxOfZigb68eWDjW16OLoFlXWpp/vnBrV95zo5z+whMuKhAIcPxcVe8cWzvaYseJXpR B6O4OtOnvI/WaCs4Epxanrv+QjH0Hj0Wpx497osNE+uosqgLJwTK+dOnIqXS1aXQg6SW DOZ45Y//xObl70MVlqN2iu0JOdb1XzuCLW0dqdwnu5UhOo0rmTsYysNN+EwUNgb63cm8 eCjA== 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=MEUWUJFP24hT9x0knHQlZkJe347puz4cw8J1YAVzn7s=; b=HlbJIYs+SFwikPYufF9ATAusnDuMELSHwv+AfqC5V60HclwZWsoYe68fl3QrlCRkfU Wzg7p4Bdmq6xOiK3ZX6kHdCIOCSK7BStOqPS3U1pvIExMUrhvQPH3DGYCKITQwEQXrZy xcATBQlXaI+wzyODkbhcwItx9UZYP7GQLCvNvd/VTHddNCAcFaB1q4HqkgsiMr+Q3BKI 6XeRQlUpI9VrSg8b64BqRuPMkMucU/rtHURg7aVFp1nnNIfNR08rvmAH+JpnYwhBPB50 mau63VlOk9D9ZkruckjsA2/x7ZjE4YntLbY7y45OX0ynpDM7tfPvvQnOZZxu/QKrjONy VTDQ== X-Gm-Message-State: AOAM530Ki3qYNRWKifl4caMReSu7m/8gmhOhmr0jm7iO1X1q2AcJ/Ey1 aFo1RjCVXuCLGNX0yA/XR6RfQA== X-Google-Smtp-Source: ABdhPJxLYCwePtcOWFEDNHrWIt1Ml/bVrbBUuyqayiVs73koqXKtREHF9HYW7k3GlHolH7uUcPdQaQ== X-Received: by 2002:a05:600c:2907:: with SMTP id i7mr13002404wmd.182.1596424271747; Sun, 02 Aug 2020 20:11:11 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:11 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 23/36] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Date: Mon, 3 Aug 2020 04:11:19 +0100 Message-Id: <20200803031132.1427063-24-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 moves BSS parameter setup to a separate function wcn36xx_smd_set_bss_params(). This will allow for further functional decomposition and fewer kzalloc() operations in subsequent patches. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 172 +++++++++++++------------ 1 file changed, 92 insertions(+), 80 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 6232e64fb298..5fda63f79ca7 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1386,6 +1386,97 @@ int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + const u8 *bssid, + bool update, + struct wcn36xx_hal_config_bss_params *bss) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_config_sta_params *sta_params; + + sta_params = &bss->sta; + + WARN_ON(is_zero_ether_addr(bssid)); + + memcpy(&bss->bssid, bssid, ETH_ALEN); + + memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN); + + if (vif->type == NL80211_IFTYPE_STATION) { + bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE; + + /* STA */ + bss->oper_mode = 1; + bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE; + } else if (vif->type == NL80211_IFTYPE_AP || + vif->type == NL80211_IFTYPE_MESH_POINT) { + bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE; + + /* AP */ + bss->oper_mode = 0; + bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE; + } else if (vif->type == NL80211_IFTYPE_ADHOC) { + bss->bss_type = WCN36XX_HAL_IBSS_MODE; + + /* STA */ + bss->oper_mode = 1; + } else { + wcn36xx_warn("Unknown type for bss config: %d\n", vif->type); + } + + if (vif->type == NL80211_IFTYPE_STATION) + wcn36xx_smd_set_bss_nw_type(wcn, sta, bss); + else + bss->nw_type = WCN36XX_HAL_11N_NW_TYPE; + + bss->short_slot_time_supported = vif->bss_conf.use_short_slot; + bss->lla_coexist = 0; + bss->llb_coexist = 0; + bss->llg_coexist = 0; + bss->rifs_mode = 0; + bss->beacon_interval = vif->bss_conf.beacon_int; + bss->dtim_period = vif_priv->dtim_period; + + wcn36xx_smd_set_bss_ht_params(vif, sta, bss); + + bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); + + if (conf_is_ht40_minus(&wcn->hw->conf)) + bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW; + else if (conf_is_ht40_plus(&wcn->hw->conf)) + bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; + else + bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; + + bss->reserved = 0; + + /* wcn->ssid is only valid in AP and IBSS mode */ + bss->ssid.length = vif_priv->ssid.length; + memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length); + + bss->obss_prot_enabled = 0; + bss->rmf = 0; + bss->max_probe_resp_retry_limit = 0; + bss->hidden_ssid = vif->bss_conf.hidden_ssid; + bss->proxy_probe_resp = 0; + bss->edca_params_valid = 0; + + /* FIXME: set acbe, acbk, acvi and acvo */ + + bss->ext_set_sta_key_param_valid = 0; + + /* FIXME: set ext_set_sta_key_param */ + + bss->spectrum_mgt_enable = 0; + bss->tx_mgmt_power = 0; + bss->max_tx_power = WCN36XX_MAX_POWER(wcn); + bss->action = update; + + vif_priv->bss_type = bss->bss_type; +} + static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, const struct wcn36xx_hal_config_bss_req_msg *orig) { @@ -1493,7 +1584,6 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, return ret; } - static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -1545,7 +1635,6 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct wcn36xx_hal_config_bss_req_msg *msg; struct wcn36xx_hal_config_bss_params *bss; struct wcn36xx_hal_config_sta_params *sta_params; - struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); int ret; mutex_lock(&wcn->hal_mutex); @@ -1559,84 +1648,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, bss = &msg->bss_params; sta_params = &bss->sta; - WARN_ON(is_zero_ether_addr(bssid)); - - memcpy(&bss->bssid, bssid, ETH_ALEN); - - memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN); - - if (vif->type == NL80211_IFTYPE_STATION) { - bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE; - - /* STA */ - bss->oper_mode = 1; - bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE; - } else if (vif->type == NL80211_IFTYPE_AP || - vif->type == NL80211_IFTYPE_MESH_POINT) { - bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE; - - /* AP */ - bss->oper_mode = 0; - bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE; - } else if (vif->type == NL80211_IFTYPE_ADHOC) { - bss->bss_type = WCN36XX_HAL_IBSS_MODE; - - /* STA */ - bss->oper_mode = 1; - } else { - wcn36xx_warn("Unknown type for bss config: %d\n", vif->type); - } - - if (vif->type == NL80211_IFTYPE_STATION) - wcn36xx_smd_set_bss_nw_type(wcn, sta, bss); - else - bss->nw_type = WCN36XX_HAL_11N_NW_TYPE; - - bss->short_slot_time_supported = vif->bss_conf.use_short_slot; - bss->lla_coexist = 0; - bss->llb_coexist = 0; - bss->llg_coexist = 0; - bss->rifs_mode = 0; - bss->beacon_interval = vif->bss_conf.beacon_int; - bss->dtim_period = vif_priv->dtim_period; - - wcn36xx_smd_set_bss_ht_params(vif, sta, bss); - - bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); - - if (conf_is_ht40_minus(&wcn->hw->conf)) - bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW; - else if (conf_is_ht40_plus(&wcn->hw->conf)) - bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; - else - bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; - - bss->reserved = 0; - - /* wcn->ssid is only valid in AP and IBSS mode */ - bss->ssid.length = vif_priv->ssid.length; - memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length); - - bss->obss_prot_enabled = 0; - bss->rmf = 0; - bss->max_probe_resp_retry_limit = 0; - bss->hidden_ssid = vif->bss_conf.hidden_ssid; - bss->proxy_probe_resp = 0; - bss->edca_params_valid = 0; - - /* FIXME: set acbe, acbk, acvi and acvo */ - - bss->ext_set_sta_key_param_valid = 0; - - /* FIXME: set ext_set_sta_key_param */ - - bss->spectrum_mgt_enable = 0; - bss->tx_mgmt_power = 0; - bss->max_tx_power = WCN36XX_MAX_POWER(wcn); - bss->action = update; - - vif_priv->bss_type = bss->bss_type; - + wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); wcn36xx_dbg(WCN36XX_DBG_HAL, From patchwork Mon Aug 3 03:11:20 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: 11697045 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 1B3161392 for ; Mon, 3 Aug 2020 03:11:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04ADB2076B for ; Mon, 3 Aug 2020 03:11:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pf0p2LqH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727829AbgHCDLP (ORCPT ); Sun, 2 Aug 2020 23:11:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbgHCDLO (ORCPT ); Sun, 2 Aug 2020 23:11:14 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D953EC06174A for ; Sun, 2 Aug 2020 20:11:13 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id p14so13026999wmg.1 for ; Sun, 02 Aug 2020 20:11:13 -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=5BTNqwjDKrrqUfjjYFYREgjuysuBsm6saZBOF6hQXB8=; b=pf0p2LqHvdoSu1NBezIFgTBQbH78N6H71VzMeBjbkBfD4cmjdcRRFaxVCaCZWkJLZo wzBYOriDhpZBpOJ7Uo+muXHglpta9YeXRUpIn87M+hFHV5sehqLv/ndl/3YESsyUMb0c RId4b3JXDVsJju67omiC1M/J/2H9E41BIMyLle3t5kt6d0MErFOUccCg4WQup5uCDNgW o/ji6LTq/HQq4YUqyzTLga8vtqaVaOLXFff5JE/Vll/pXgrXP/9y0h4pzdnwMJnu5cVb 5R2qmDmPX00YeKwJQM4eS6eem7snVnwf6g6tqxBXiGGWWoUofBPcARAe1+7Ju/L9oiGP tzwQ== 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=5BTNqwjDKrrqUfjjYFYREgjuysuBsm6saZBOF6hQXB8=; b=d6JZ6hByAecyzJFoZ4y6eUbQtqaMztEgyg7979W1NPuNC5XEmcIdqw90HONivBQeNe KNdEDfukwGrXU8iXrGS61I9u0pIUvSOtBPFmByIVPSfy7zSZ1z53vAlfuWMKMQgMsxTs h9hgAfAJFMz+B66rzaezuKQVRiGLKHtknnhjTiqs4snExyX2S/ZwX6HDb0VVgzcZDYMC H3DliYlUW8Q5uv0qTSl3MK/nu4aA3McvM4BKxBthyEHwb9g3V5+h2ueKDPFibfUXe5ak q3F906BNhCSCd69/l35qXILpalugc1LxPR0Pqi6MlURsHVJozQmxvArB8YV8OOFn1u0A es4w== X-Gm-Message-State: AOAM532pSvgRB41amLdbZSg8KhEgnG2UmVIBNLdV2smgXYu9QrVE7hQD 2wKNCPbkJUo3MwxaGxBCySVFRQ== X-Google-Smtp-Source: ABdhPJxBtVvbvulxHygOMmFH068tyq2AlfPvkr/uFN6OjsQ7+h2sKgrIySRcuWI5QNWqv/8TTYHj+g== X-Received: by 2002:a1c:a553:: with SMTP id o80mr13645349wme.50.1596424272685; Sun, 02 Aug 2020 20:11:12 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:12 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 24/36] wcn36xx: Add wcn36xx_smd_config_bss_v0 Date: Mon, 3 Aug 2020 04:11:20 +0100 Message-Id: <20200803031132.1427063-25-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 adds wcn36xx_smd_config_bss_v0() as a step along the road of functionally decomposing wcn36xx_smd_config_bss(). Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 5fda63f79ca7..43021b13b5b0 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1584,6 +1584,47 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, return ret; } +int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, const u8 *bssid, + bool update) +{ + struct wcn36xx_hal_config_bss_req_msg *msg; + struct wcn36xx_hal_config_bss_params *bss; + struct wcn36xx_hal_config_sta_params *sta_params; + int ret; + + msg = kzalloc(sizeof(*msg), GFP_KERNEL); + if (!msg) + return -ENOMEM; + + INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ); + + bss = &msg->bss_params; + sta_params = &bss->sta; + + wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); + wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); + + PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); + + wcn36xx_dbg(WCN36XX_DBG_HAL, + "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", + bss->bssid, bss->self_mac_addr, bss->bss_type, + bss->oper_mode, bss->nw_type); + + wcn36xx_dbg(WCN36XX_DBG_HAL, + "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", + sta_params->bssid, sta_params->action, + sta_params->sta_index, sta_params->bssid_index, + sta_params->aid, sta_params->type, + sta_params->mac); + + ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); + kfree(msg); + + return ret; +} + static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, From patchwork Mon Aug 3 03:11:21 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: 11697047 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 B82FE14DD for ; Mon, 3 Aug 2020 03:11:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E6D12076B for ; Mon, 3 Aug 2020 03:11:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="glKF7drX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727840AbgHCDLQ (ORCPT ); Sun, 2 Aug 2020 23:11:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgHCDLP (ORCPT ); Sun, 2 Aug 2020 23:11:15 -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 F2CF0C06174A for ; Sun, 2 Aug 2020 20:11:14 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id a14so32807058wra.5 for ; Sun, 02 Aug 2020 20:11:14 -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=pKx2vUsb2J83Nd1ElnjujJcXzTbgjOG6BmjNC2hrd9o=; b=glKF7drXVHhwTibsv3qDncmKpdlk6w4TMknv04P3xr8NhHbkqHl43KLlVhaPSMR9i6 YfgtMXZGTbyeWXHpu5iQV2rbl2Qx0aUP6S/U8IM0DcRBhAE1NVTWf696tb8nv/U3rJBA atU19kieY6k1GGhGAi6gb6iNL/HtYwZCZ4cweHqJuAp2FFMdP1Nls2RKfWGLieepsbwV GX/TaziX1wrxMH3icMRsyP1vxfIMBbBIvsyxb+kUbksGkkqFuQMJsAf+Q8AE1xD40RM5 z+zA7HL1CzwKwgYPSTNrpCu08cTkpYzGrB7gf4TpHWWF1DinAzqP2c6jerVW+0KwYK1J EqNA== 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=pKx2vUsb2J83Nd1ElnjujJcXzTbgjOG6BmjNC2hrd9o=; b=UtVUiCGU2OATFFiyt8hvFeCFzgEWpAwlEA0AY7uTgcFtC//ygQ9kyT7kJ+Uzer7kcn yCXBuLWB66zV8hsYEuTv9AGXwJ8iNkP8si73UqObAMchi72hssSl4cyW+8Z6NJ7//Sgz ZCVSpG4Mfi494kdN0DcB51IUv8WBxXmP1rJTK+GAStlgIE4HPB6fmsPaikFKnf1enEbE hv7yLMDENvX063z1M2xPQlebf7BODufw+An3NFTCllQKf7S7OnMYHgEgZNvl9Z9goDEg Dd2Lsvld5aa4NDOahdQ7wJA3+8eFrYYDo/kIzin49LXeuhp/2H0/eJaMlR+eK5LUmYLL 5rGg== X-Gm-Message-State: AOAM533VA5V/PJptT+V/hdaByx4tVRL3JNIByTqdshJvsLgrs1XT+tAJ iN4NFfjifjUP9npMM3SBBV7oVw== X-Google-Smtp-Source: ABdhPJwcRFXEvP2M40fIApkCMzlxVrz1o6WiK+LAiko+4IDJS8HSu/2KVBe9I9DicgkpPgqheuXF1w== X-Received: by 2002:a5d:55d2:: with SMTP id i18mr12585610wrw.378.1596424273692; Sun, 02 Aug 2020 20:11:13 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:13 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 25/36] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Date: Mon, 3 Aug 2020 04:11:21 +0100 Message-Id: <20200803031132.1427063-26-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 patch updates wcn36xx_smd_config_bss_v1() to update on internally derived parameters only, specifically making use of STA v1 wrapper routines previously added. Once done we no longer need to pass a struct wcn36xx_hal_config_bss_req_msg which gives us options in later patches to eliminate the kzalloc() in wcn36xx_smd_config_bss entirely. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 115 +++++++++++++------------ 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 43021b13b5b0..50559871d109 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1477,11 +1477,13 @@ static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn, vif_priv->bss_type = bss->bss_type; } -static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, - const struct wcn36xx_hal_config_bss_req_msg *orig) +int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, + struct ieee80211_sta *sta_80211, const u8 *bssid, + bool update) { struct wcn36xx_hal_config_bss_req_msg_v1 *msg_body; struct wcn36xx_hal_config_bss_params_v1 *bss; + struct wcn36xx_hal_config_bss_params bss_v0; struct wcn36xx_hal_config_sta_params_v1 *sta; int ret; @@ -1499,72 +1501,73 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, bss = &msg_body->bss_params; sta = &bss->sta; + wcn36xx_smd_set_bss_params(wcn, vif, sta_80211, bssid, update, &bss_v0); + wcn36xx_smd_set_sta_params_v1(wcn, vif, sta_80211, sta); + /* convert orig to v1 */ - memcpy(bss->bssid, &orig->bss_params.bssid, ETH_ALEN); - memcpy(bss->self_mac_addr, &orig->bss_params.self_mac_addr, ETH_ALEN); + memcpy(bss->bssid, &bss_v0.bssid, ETH_ALEN); + memcpy(bss->self_mac_addr, &bss_v0.self_mac_addr, ETH_ALEN); - bss->bss_type = orig->bss_params.bss_type; - bss->oper_mode = orig->bss_params.oper_mode; - bss->nw_type = orig->bss_params.nw_type; + bss->bss_type = bss_v0.bss_type; + bss->oper_mode = bss_v0.oper_mode; + bss->nw_type = bss_v0.nw_type; bss->short_slot_time_supported = - orig->bss_params.short_slot_time_supported; - bss->lla_coexist = orig->bss_params.lla_coexist; - bss->llb_coexist = orig->bss_params.llb_coexist; - bss->llg_coexist = orig->bss_params.llg_coexist; - bss->ht20_coexist = orig->bss_params.ht20_coexist; - bss->lln_non_gf_coexist = orig->bss_params.lln_non_gf_coexist; + bss_v0.short_slot_time_supported; + bss->lla_coexist = bss_v0.lla_coexist; + bss->llb_coexist = bss_v0.llb_coexist; + bss->llg_coexist = bss_v0.llg_coexist; + bss->ht20_coexist = bss_v0.ht20_coexist; + bss->lln_non_gf_coexist = bss_v0.lln_non_gf_coexist; bss->lsig_tx_op_protection_full_support = - orig->bss_params.lsig_tx_op_protection_full_support; - bss->rifs_mode = orig->bss_params.rifs_mode; - bss->beacon_interval = orig->bss_params.beacon_interval; - bss->dtim_period = orig->bss_params.dtim_period; - bss->tx_channel_width_set = orig->bss_params.tx_channel_width_set; - bss->oper_channel = orig->bss_params.oper_channel; - bss->ext_channel = orig->bss_params.ext_channel; - - bss->reserved = orig->bss_params.reserved; - - memcpy(&bss->ssid, &orig->bss_params.ssid, - sizeof(orig->bss_params.ssid)); - - bss->action = orig->bss_params.action; - bss->rateset = orig->bss_params.rateset; - bss->ht = orig->bss_params.ht; - bss->obss_prot_enabled = orig->bss_params.obss_prot_enabled; - bss->rmf = orig->bss_params.rmf; - bss->ht_oper_mode = orig->bss_params.ht_oper_mode; - bss->dual_cts_protection = orig->bss_params.dual_cts_protection; + bss_v0.lsig_tx_op_protection_full_support; + bss->rifs_mode = bss_v0.rifs_mode; + bss->beacon_interval = bss_v0.beacon_interval; + 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; + + bss->reserved = bss_v0.reserved; + + memcpy(&bss->ssid, &bss_v0.ssid, + sizeof(bss_v0.ssid)); + + bss->action = bss_v0.action; + bss->rateset = bss_v0.rateset; + bss->ht = bss_v0.ht; + bss->obss_prot_enabled = bss_v0.obss_prot_enabled; + bss->rmf = bss_v0.rmf; + bss->ht_oper_mode = bss_v0.ht_oper_mode; + bss->dual_cts_protection = bss_v0.dual_cts_protection; bss->max_probe_resp_retry_limit = - orig->bss_params.max_probe_resp_retry_limit; - bss->hidden_ssid = orig->bss_params.hidden_ssid; - bss->proxy_probe_resp = orig->bss_params.proxy_probe_resp; - bss->edca_params_valid = orig->bss_params.edca_params_valid; - - memcpy(&bss->acbe, &orig->bss_params.acbe, - sizeof(orig->bss_params.acbe)); - memcpy(&bss->acbk, &orig->bss_params.acbk, - sizeof(orig->bss_params.acbk)); - memcpy(&bss->acvi, &orig->bss_params.acvi, - sizeof(orig->bss_params.acvi)); - memcpy(&bss->acvo, &orig->bss_params.acvo, - sizeof(orig->bss_params.acvo)); + bss_v0.max_probe_resp_retry_limit; + bss->hidden_ssid = bss_v0.hidden_ssid; + bss->proxy_probe_resp = bss_v0.proxy_probe_resp; + bss->edca_params_valid = bss_v0.edca_params_valid; + + memcpy(&bss->acbe, &bss_v0.acbe, + sizeof(bss_v0.acbe)); + memcpy(&bss->acbk, &bss_v0.acbk, + sizeof(bss_v0.acbk)); + memcpy(&bss->acvi, &bss_v0.acvi, + sizeof(bss_v0.acvi)); + memcpy(&bss->acvo, &bss_v0.acvo, + sizeof(bss_v0.acvo)); bss->ext_set_sta_key_param_valid = - orig->bss_params.ext_set_sta_key_param_valid; + bss_v0.ext_set_sta_key_param_valid; memcpy(&bss->ext_set_sta_key_param, - &orig->bss_params.ext_set_sta_key_param, - sizeof(orig->bss_params.acvo)); - - bss->wcn36xx_hal_persona = orig->bss_params.wcn36xx_hal_persona; - bss->spectrum_mgt_enable = orig->bss_params.spectrum_mgt_enable; - bss->tx_mgmt_power = orig->bss_params.tx_mgmt_power; - bss->max_tx_power = orig->bss_params.max_tx_power; + &bss_v0.ext_set_sta_key_param, + sizeof(bss_v0.acvo)); - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, sta); + bss->wcn36xx_hal_persona = bss_v0.wcn36xx_hal_persona; + bss->spectrum_mgt_enable = bss_v0.spectrum_mgt_enable; + bss->tx_mgmt_power = bss_v0.tx_mgmt_power; + bss->max_tx_power = bss_v0.max_tx_power; PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); @@ -1705,7 +1708,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, sta_params->mac); if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { - ret = wcn36xx_smd_config_bss_v1(wcn, msg); + ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); } else { PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); From patchwork Mon Aug 3 03:11:22 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: 11697049 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 B9FCC14B7 for ; Mon, 3 Aug 2020 03:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0D7C2076B for ; Mon, 3 Aug 2020 03:11:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="s9l2/eO/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727846AbgHCDLR (ORCPT ); Sun, 2 Aug 2020 23:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727837AbgHCDLQ (ORCPT ); Sun, 2 Aug 2020 23:11:16 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA76CC06174A for ; Sun, 2 Aug 2020 20:11:15 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id g8so13015009wmk.3 for ; Sun, 02 Aug 2020 20:11:15 -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=zBh3ROPhrGIW2kesBf+bRTaWxVaasDDdtUrc0+Ft64o=; b=s9l2/eO/Zqk3vRbIoBFtoeYfeVNL2XnNhUFm46L50xRWa/qtInzNprqVb5kcvbMwK7 EgmgXuht6ZM5Fp1toNm69MyIa1mSUw6w3lAhVGdukvLosY0S8MlD/g/1IjyraKO5XWfr AlWuvJzCJCGThyKTCPm8FPTCyWRzhp1naQh/7eOuBA9jMmpvKRjcwGtX5MlrFQKvLhSn hewFIsJcHd/7Zu6uQPZ1pAzkKrGMHfycNfEWamQd74H8ReDz28G0MBhQ08sZKlVQzNGg wMoAzu4X/7PVb+nEy9rgBxdQBxMfeChmALMgNTz97at3P3g0g3QWj1mrdzG9KB67u6+o 4Caw== 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=zBh3ROPhrGIW2kesBf+bRTaWxVaasDDdtUrc0+Ft64o=; b=oh/Cf2CDo6K8Kt4xp9PfFzrosOtaiWGRUZIL8ybeeAtP9thztIg8MzRQ3rPmtyvOk9 mWweKd1DRj3WggOCWeGVL2L9y/QroslOagkJzBtMJ1N6sAWNu7cg5yra5AzECq+kFHG/ waU3kq3IRxygY/3Y9/Za3btFjf7bwwVTGXpvKwZvUIwtQmGBuhwcv6GhGnB39Fub8I4g 8dfOVqXK9OQ5qCIbDpDbejaJzVZ06Sw7fdGA3M58ZD6mfu6cO4WpN55l1iHU0ap5xcr4 5l3740pmO6PMQkBLvKI8uA5qXJQzCTx5pPUXj/PVvxA+VZY8ABo+2X9L7gwymelUMydB J+Pw== X-Gm-Message-State: AOAM531a0ioVZ7S0NwsPasPCH2Ep0Xnp2uzN3zRbuys+e8VkpO0r4//k i7niWDko4F4rO9/MohXM/zusMg== X-Google-Smtp-Source: ABdhPJwqTncYt4YwFMv8r39LMkRwhd3tWRbE0gotPujqphLWJr2dfAJgDaN2Es3TcxVveiAPw22Law== X-Received: by 2002:a1c:7918:: with SMTP id l24mr13642585wme.158.1596424274637; Sun, 02 Aug 2020 20:11:14 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:14 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 26/36] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Date: Mon, 3 Aug 2020 04:11:22 +0100 Message-Id: <20200803031132.1427063-27-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 A previous patch added wcn36xx_smd_config_bss_v0() this patch converts the version 0 data-path in wcn36xx_smd_config_bss() to use wcn36xx_smd_config_bss_v0(). Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 50559871d109..033afe52dd9c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1710,9 +1710,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); } else { - PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); - - ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); + ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update); } if (ret) { wcn36xx_err("Sending hal_config_bss failed\n"); From patchwork Mon Aug 3 03:11:23 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: 11697051 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 6D76D1392 for ; Mon, 3 Aug 2020 03:11:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 529B32076B for ; Mon, 3 Aug 2020 03:11:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="elbd9VM5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727837AbgHCDLS (ORCPT ); Sun, 2 Aug 2020 23:11:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727849AbgHCDLR (ORCPT ); Sun, 2 Aug 2020 23:11:17 -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 D185BC06174A for ; Sun, 2 Aug 2020 20:11:16 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id p14so13027050wmg.1 for ; Sun, 02 Aug 2020 20:11:16 -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=JZJJwTRfJFPBU3Vu91Q4/DbR77Wu6U4kNTpxlGREayg=; b=elbd9VM5vFPn0RwWyS8xk6xx97ocJlVW15ll+koqPbmbVJiUKCqe8IdD4YHZA/ipAe jkzzr8yLrxb+RPTswk59mDPdu8y9tuXQOwCe2K5kAhgbB+9eG7x2TkfeSu59e/yqHLPu ulsS4nIuvFW0Vd0KLeDbdZoEKAIR1MbyGBwq67tsqPa4onEMNkPihff+SJT75/WHNe2U JWn9dQt5UXqEiD/FJLkwp3p21Rbq05WUsz4hufjFj5HILQcXThdxUz/Oq/41/DV+NBHT QloEDSy1gtMquhxje0dHP7iPtzsstke6cWJSMMPSQ42Mw4xv7ZVwNChUVInO4R8aLjYM lI0A== 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=JZJJwTRfJFPBU3Vu91Q4/DbR77Wu6U4kNTpxlGREayg=; b=ASVWMBSgr7HhegzFZqyB08VCH/t73NE26TTpjEJQBOcyeKY2+DNV3xRg8HdiQbjAbQ HoGYhl9clG/88+BXgayfYiPgS2NAwIlZkMmaOCSnFZP5AF7KlLEol83ByrlFWH5WFjZ3 xw7LYmch/q/0FhVL0w44aKT5bpcmxm42U125MqD9vy9KVeOlFxeYUNFtaFD7UUEeZ8pL qq5xCg5JmpwW9W70LXO/OOo0sd1NnCdq8DMU3sTjsvxCCecM/kfGA3m16UPZRCrWhrRe Syr8xK63HW1UkEYg7ad298AIaA0LlIMmPLv+nBio8W5llND2vC7mMGPJVm2P83Femhar pzmQ== X-Gm-Message-State: AOAM530lZT43BPkD/T7QGJ7hX+31ZHdJtcep2E9W1t4DmzOM3aA4fRfZ Sw39heUbHItGGWR0dwqAsAJHhw== X-Google-Smtp-Source: ABdhPJzQO4ufKDR38zBgmY8KVO5EBlTEW4pAYrf2vNEpEd8018EyY0stLgy/t0LxT73hmNZKqB7Cog== X-Received: by 2002:a7b:c095:: with SMTP id r21mr13309557wmh.96.1596424275655; Sun, 02 Aug 2020 20:11:15 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:15 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 27/36] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Date: Mon, 3 Aug 2020 04:11:23 +0100 Message-Id: <20200803031132.1427063-28-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 wcn36xx_smd_config_bss_v0() and wcn36xx_smd_config_bss_v1() have been designed to operate in standalone fashion. As a result we can drop the dead code now present in wcn36xx_smd_config_bss() and happily remove one kzalloc from the BSS config path as we do so. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 39 ++++---------------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 033afe52dd9c..1eb13765e1f2 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1676,42 +1676,15 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, const u8 *bssid, bool update) { - struct wcn36xx_hal_config_bss_req_msg *msg; - struct wcn36xx_hal_config_bss_params *bss; - struct wcn36xx_hal_config_sta_params *sta_params; int ret; mutex_lock(&wcn->hal_mutex); - msg = kzalloc(sizeof(*msg), GFP_KERNEL); - if (!msg) { - ret = -ENOMEM; - goto out; - } - INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ); - - bss = &msg->bss_params; - sta_params = &bss->sta; - - wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); - wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); - - wcn36xx_dbg(WCN36XX_DBG_HAL, - "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", - bss->bssid, bss->self_mac_addr, bss->bss_type, - bss->oper_mode, bss->nw_type); - wcn36xx_dbg(WCN36XX_DBG_HAL, - "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", - sta_params->bssid, sta_params->action, - sta_params->sta_index, sta_params->bssid_index, - sta_params->aid, sta_params->type, - sta_params->mac); - - if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { + if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); - } else { + else ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update); - } + if (ret) { wcn36xx_err("Sending hal_config_bss failed\n"); goto out; @@ -1721,12 +1694,10 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, sta, wcn->hal_buf, wcn->hal_rsp_len); - if (ret) { + if (ret) wcn36xx_err("hal_config_bss response failed err=%d\n", ret); - goto out; - } + out: - kfree(msg); mutex_unlock(&wcn->hal_mutex); return ret; } From patchwork Mon Aug 3 03:11:24 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: 11697053 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 045AE14DD for ; Mon, 3 Aug 2020 03:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E26182076B for ; Mon, 3 Aug 2020 03:11:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="laCKwgH9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727865AbgHCDLT (ORCPT ); Sun, 2 Aug 2020 23:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727860AbgHCDLS (ORCPT ); Sun, 2 Aug 2020 23:11:18 -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 D130FC06174A for ; Sun, 2 Aug 2020 20:11:17 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id f18so10196039wmc.0 for ; Sun, 02 Aug 2020 20:11:17 -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=f/x0eExpVICVKXEktjj0SGBU1wjl5TjsRllYZDRNbK8=; b=laCKwgH931UpB6FaFWchH4vSzf5kAW/zaUI6nNweH62neq5EF3MYKPUJfQURyvf3Mi t8HyLhj6DErxSLI1eaAybNSb6ziIgVw4eMj3B+8N86Dz45Xn2L/5FkvfOrIL13hzqdsf qZddPGbw9JCPguNBhZVwLt/V+Oj6BOXNHtCe+YXecmE6LoydnvMmeXaLA4CI+8gkQk0b s/s6guDsLVEuMbtpap7qb7ZiYcwozsOk5vcIw1CheBztrFcusvuB1rfGJfN8ETnbiNXP 8sHITTDOQ5hnxf70yKq5qmwoDyNCO0w2Mk5LlEvC4o2NO65DLKE4lAeDImYu0aBDoUjM OEOA== 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=f/x0eExpVICVKXEktjj0SGBU1wjl5TjsRllYZDRNbK8=; b=jG0vKLCyu6iy/QGjJcusQjL1TXTFh1T3du2P3aFFojwrihDKEymNKnGBDi9EAHefLL vBw3I3gF1s93U3PSYjuC7n/pnbQLVwOZlM/kSYIyE9AX7QmMV8y91VLZOLJDgNV1aI9L 7fj3yCykmzPVkqodi6rJgwokOLIItTy8nZq9T8aChkkFs9Qy4JmSrU9JUaq4l+TNyDmP IOyqzI63LlIwAJv9uDdp42PJ7dFFNLRqcZIqdlCCitWDuAVfjGm/oINAsaxDOv4qlZRG tAKia/AtLF5bjEFKs6vIJPXQHbElRotj0G3Ype/Sp67vWXYYoEknpT8p0UBIa4kIn+fC mh8A== X-Gm-Message-State: AOAM5333j2Nnl0d3UXHvuZ/QBNcjVexxXH3WfcxlT3O1DXK6A/HptYpW +PsBv+q1gAQke5p/+xH6SY3PEg== X-Google-Smtp-Source: ABdhPJzXPbh8AE4RgmMHru4aSU1xEzx2iCsI/M9vTS9nkVAXz0wBq094cl1hiTNGX5DeMaY/53C7kQ== X-Received: by 2002:a7b:c14a:: with SMTP id z10mr12997055wmi.63.1596424276604; Sun, 02 Aug 2020 20:11:16 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:16 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 28/36] wcn36xx: Latch VHT specific BSS parameters to firmware Date: Mon, 3 Aug 2020 04:11:24 +0100 Message-Id: <20200803031132.1427063-29-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 makes use of wcn36xx_smd_set_bss_vht_params() to extract VHT parameters from the 80211_sta structure and latch appropriate bits in the bss_params_v1 structure for transmission to the wcnss firmware. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 1eb13765e1f2..cedf4391a69a 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1569,6 +1569,8 @@ int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, bss->tx_mgmt_power = bss_v0.tx_mgmt_power; bss->max_tx_power = bss_v0.max_tx_power; + wcn36xx_smd_set_bss_vht_params(vif, sta_80211, bss); + PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); wcn36xx_dbg(WCN36XX_DBG_HAL, From patchwork Mon Aug 3 03:11:25 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: 11697055 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 209771392 for ; Mon, 3 Aug 2020 03:11:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AC0C2076B for ; Mon, 3 Aug 2020 03:11:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YSnZELLi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727877AbgHCDLU (ORCPT ); Sun, 2 Aug 2020 23:11:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727849AbgHCDLT (ORCPT ); Sun, 2 Aug 2020 23:11:19 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0354C06174A for ; Sun, 2 Aug 2020 20:11:18 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id 9so12987440wmj.5 for ; Sun, 02 Aug 2020 20:11:18 -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=r9KmogYdjeDiArvHcPSK2BD1IBaC6ai9UQ+vtopjnEI=; b=YSnZELLiIpi4yphEV/LAs0Pr6WBG1CQBwIPnYh0gs1vqPCb0EkmXaCKqDS3ZCidx7C TwPjFCi8ts0mYmld8V+IHdpj29ab9RFXjt4sU8/AkjjXlE4O2ib3Sfg5gEkwTsj9uSsi Bfsb7P1EDcexR25z3Nka8o70Pp+1K2HHmU1nIfDQ7rvySz/mSBiydk4f93Wbd1xwjPVz +gIWPGC9tENEYFyrv8aXdAPBV9JpOA2Z9/43qSZaPLFyeSDNwb16KPVExmS0oc7X8czS Df6/sMx+ds6wgSdGW5xxgI/YqBlPe6e8IxD675T5r5oxXbOJZyTQe/k9F8imFum0j/xN WaqA== 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=r9KmogYdjeDiArvHcPSK2BD1IBaC6ai9UQ+vtopjnEI=; b=btcdkPV/e1Qu0lOqBEQFwBnfhf3j3f1YHMCxCR1DGr+HtKAorA19ahADb8A28N3pVc UNWK1yqe/BBrOokj5FzGA8/3LCUqF5njQcJhx+qcbunQ3AQC01qtZs/B8nIk/aGJrpic KzwsPoOUYl/IEk2eKGL9cSWWx2GxFbZyrp/RhQlbTpggde/IVBg4s8aPQsPCmeIEVHEu mOpaC0rZHMmwoIvQvOWQ8p7DsVpk2yhOF+TA/lH21ahdb1P82NBh6fH+viPmFHjshjbX QyEC7zcDUYfqdzuNUN8mNwC8YmP6QUt9Wo5MTmDWa10Mp+vMbu5SgxujQ1cEfHyoAu5s LQIw== X-Gm-Message-State: AOAM532VgQsWu3RjYMAfJSM01nfGozZzeMs3aIi8JO+DOENN5WVXR5YB ZSi59BQw2whhCHSCNOTGSag8YdZw3xo= X-Google-Smtp-Source: ABdhPJwJElN97xbrbgOGoLELYz8lJH1IsMWRUdU8RuGPyD7U+SCpdOBvX/+GW/ixyxwjksja+g244A== X-Received: by 2002:a1c:7e12:: with SMTP id z18mr2703516wmc.188.1596424277597; Sun, 02 Aug 2020 20:11:17 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:17 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 29/36] wcn36xx: Add accessor macro HW_VALUE_CHANNEL for hardware channels Date: Mon, 3 Aug 2020 04:11:25 +0100 Message-Id: <20200803031132.1427063-30-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 18ccc6c31a38..ae8bda76d573 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 Mon Aug 3 03:11:26 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: 11697057 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 7E1A61392 for ; Mon, 3 Aug 2020 03:11:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 675002076B for ; Mon, 3 Aug 2020 03:11:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yJSC1Hm+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727887AbgHCDLV (ORCPT ); Sun, 2 Aug 2020 23:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727860AbgHCDLU (ORCPT ); Sun, 2 Aug 2020 23:11:20 -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 EC966C06174A for ; Sun, 2 Aug 2020 20:11:19 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id f18so32795330wrs.0 for ; Sun, 02 Aug 2020 20:11:19 -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=Y0MUmRNnfJhqzV4htTrjwxN3KiW8rf6W51Q4u6sP/f4=; b=yJSC1Hm+ZkvCnyrpM0d1nYzEQ1c381CKbRUyCPL07S5o4w06eRWjHCCfBkZwFivB0A WGrlIU99UHW+viSdK2N5xqXWQqZf2tVsCK/uwQUaHc970LvJZ9fE4M6OY4dUMgf05SzL kj+EwyZtpIOaV+1TvLce46xV4HproflPrfT3GrnblyYgkDhMLJUMD71GGmgAsOONu1aV rwLEpRcXnBC6kMRmTa/CT6KRvENNZDUwQHJwdmJS8PvBEPVJqVq7RZrPcpT5LaEkfdYc tQ7Kllwrlrh8thpoPr+9bGV7kKKyx41vAS3tH5xkEjZweDsr0svgXmJBxmZDx5MkVULr w3/Q== 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=Y0MUmRNnfJhqzV4htTrjwxN3KiW8rf6W51Q4u6sP/f4=; b=WuF52VY2/kvqDDvRHVTtyDT7MST++GEz7a8HAErlxWHmTbQ5QDwIyYIC7FbuUNvx81 ZCL9w+8tIZW23eo+fT757FQPCoStGDEmrYwdUYOWM3O4mDPwsIRxmkVLHOZU8XM40RkN BSviJcuAPNkRnBKDGi0NZg0aAgKlNrVTnPWtuBgCvKfT3GOj8VVs1jdnPuF6FwynZ8KE eOShWGsf6zwzVtGbBa1i1uZ7//hBIYYFyYbttm/kcCsUdpLGHVkHMIw1bk4pnI52wDyf eJXwVlbvbtRAZvR+osxn+Xh7S/3GBDm2Y8bx1wAB82fy1CsBcdjhQo0djkbTYHIGv9wM aVZQ== X-Gm-Message-State: AOAM530ywgpT54hhIyhR0tuH3DgZaUa5OEr9h9Pmni86ASt0WFfyd/KH XqQ8LVHHck9Npmr6DANzLYGGTw== X-Google-Smtp-Source: ABdhPJz1FGg3rvHQKcIz6n0WqMd/bhjf7ve86KRnI7hDwM3F9ikgisZoe6Ly784hrExVQAUHYt/hrQ== X-Received: by 2002:a5d:40cf:: with SMTP id b15mr12845030wrq.319.1596424278690; Sun, 02 Aug 2020 20:11:18 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:18 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 30/36] wcn36xx: Use HW_VALUE_CHANNEL macro to get channel number Date: Mon, 3 Aug 2020 04:11:26 +0100 Message-Id: <20200803031132.1427063-31-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 cedf4391a69a..9a7e6f96f0b6 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 Mon Aug 3 03:11:27 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: 11697059 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 E37F814B7 for ; Mon, 3 Aug 2020 03:11:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC3C02076B for ; Mon, 3 Aug 2020 03:11:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KCazHJ0K" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727892AbgHCDLW (ORCPT ); Sun, 2 Aug 2020 23:11:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727884AbgHCDLV (ORCPT ); Sun, 2 Aug 2020 23:11:21 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4D42C061756 for ; Sun, 2 Aug 2020 20:11:20 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id d190so13001733wmd.4 for ; Sun, 02 Aug 2020 20:11:20 -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=azNHQsdJAoWWLTflM7Ey2S4srlS3jrEo8Q6zu9bfi9A=; b=KCazHJ0KESxu5Qe7sbtrF/XremK3VUToyVi0LwfpMO8oDZxM7fGX07Bcm4cSryBKdB slWxCeM99yTSQeq6/IBelaCC6JwQqBorw/13GflONbMLhKkOi98jlSXgHyE+nmG7N/xd kXuY3c39iP2nTHVCjRDcQTK/4OHWlI6ZhK3dLVNRboI7VGN2hoFro2hy27PuogjFPDbp 96lDOzlO0FfmERbTJI/b21FcZjoJUfhcMthqSH9vcc28L7rGd07We6WA3B5SOCbQWNwQ MpyQO81SH1uLA/9o0JKPxVgzlauxid9nZN2rP4OEJBsbON2ZXFKSIRndQqfoonYcclfb X8wA== 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=azNHQsdJAoWWLTflM7Ey2S4srlS3jrEo8Q6zu9bfi9A=; b=GJiZET+bPsamjqwY4ZMZCU6YiGk5mtj95JiGsqAEsZSaRvk44aeb0BPdK1u33vZRw7 sgUlZKDSlPCS+aQBiqU+zpZ5rm5lX8fVf6MbYTjqoIDXjQR/xWYKSZohX0Nilz0TGeRb Cr7oOOnysikaL59v6OHkM7koJ3PfPa6xcUEUQeBJDVQ/BsWE96FWeBwsXQMwZie75qjH 0Yehfu2TYURy9/bMKZiSgyJ4Y9pS4CONrbqPF/tYcAEMkx5khx66cujd+VNmHCn3vDE3 rt0SUnkvVkTh+wrfwXjNA3kq3FdKvWmOeKAQxS9uCtX0E+NkWqAnBGRNlMCglyBjc6gV hGPQ== X-Gm-Message-State: AOAM532n9cWktaqMc5JZ37GslrdOK0zkYeGStwRTznyC6/voEQBJ8R4g UfAdGW7PdkAgK7X9HTCJDXTUVVyNzgw= X-Google-Smtp-Source: ABdhPJzKvBmndB3oioXUfDIjkMS7361zuGvsMouEm1hJd/sl0eMIscXkgbd7tzDzibuAe+4Xur0BdQ== X-Received: by 2002:a1c:9d53:: with SMTP id g80mr13692876wme.70.1596424279680; Sun, 02 Aug 2020 20:11:19 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:19 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 31/36] wcn36xx: Add accessor macro HW_VALUE_PHY for PHY settings Date: Mon, 3 Aug 2020 04:11:27 +0100 Message-Id: <20200803031132.1427063-32-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 ae8bda76d573..38d68161d9fd 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 Mon Aug 3 03:11:28 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: 11697061 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 9C7FF14B7 for ; Mon, 3 Aug 2020 03:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 845F42076B for ; Mon, 3 Aug 2020 03:11:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="KBUtOVWl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726276AbgHCDLZ (ORCPT ); Sun, 2 Aug 2020 23:11:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727889AbgHCDLW (ORCPT ); Sun, 2 Aug 2020 23:11:22 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C405BC06174A for ; Sun, 2 Aug 2020 20:11:21 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id d190so13001753wmd.4 for ; Sun, 02 Aug 2020 20:11:21 -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=3Gog2znRpiQy6wPYsGUf9FYxk4e4/BYWwYaxty3ALVY=; b=KBUtOVWlteyuIsDzEt/d/MDfs/AKw1OQQlOaJ603BNQ4XExsJ40qfKSDUalWCA8QGH ktKso7OCM/X/NMbglI9KbLOCvObqAF7BEyJ/QvaRcsM0S+EgpxJOq3CCsoXbxOrgjWd0 l6dUtNbQVY44R23UmT53MF18EIWh8AinVH6+01DDSc2XrOl7nUHuK3xi6ie1xNzBpe6A /lc9hnmbDxPc7tpVn0/1BTDS3NaN3gL3+T2UJIxBcHjbtr8XIJIfL9kDOkPAXxJkfn4F d826u9coUlrTs/7IXbYI8Tv4LGc77DX41LaZE+NAMMFXyHkBTUdlzfE2NmkrTtsmANvv OKfA== 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=3Gog2znRpiQy6wPYsGUf9FYxk4e4/BYWwYaxty3ALVY=; b=swv78GyEqg4j2/rnIgRaAfjIg/GW0CKTClttVqMZm/P2k+al1Swh94yMEW6qFfBu9f ywMQ/jj+T6wFaYa6HmV+9V1ONQJt284ef04YXAcF9RD8OeH9pV6W4hRJr2/fQwr62ewg tV2LxheiVptdtNEWIcXtTCfAcY0nNs1Lq6KsYI8j1FOACofl9BuvYegEA3ei19ontkga mH9aAWc+9cnBB2tthiT7jWdPlJZ08495Z7d9zIVk1K0JscPqIFt7V1A8FC3kbAqyZeo7 hz3cO5tG2PAylJb2oGrl+8O4gAWG7s93aDGYjyGrERUVBnLkAKPspArdgYL9WN0l5KcH 7+pw== X-Gm-Message-State: AOAM532DeS3AbuIxwhRqSAYkcSDpqbKxS6rJpgwwODxE7YID2ur8qkMr mpLlhVAXWeQBx2SBu4PoyDMuNA== X-Google-Smtp-Source: ABdhPJwMVDmPdI3OkTf3Iwl1pL44EDQgD+h0uG/0RD9C9Zexi954Fs7dDUkkFtB9ulNS6fG07qpDFg== X-Received: by 2002:a05:600c:2904:: with SMTP id i4mr13255240wmd.126.1596424280597; Sun, 02 Aug 2020 20:11:20 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:20 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 32/36] wcn36xx: Encode PHY mode for 80MHz channel in hw_value Date: Mon, 3 Aug 2020 04:11:28 +0100 Message-Id: <20200803031132.1427063-33-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 6a85bb699d10..c96ae33a80d5 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 Mon Aug 3 03:11:29 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: 11697069 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 B567414DD for ; Mon, 3 Aug 2020 03:11:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9DE352076B for ; Mon, 3 Aug 2020 03:11:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TrwaFydT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727933AbgHCDLb (ORCPT ); Sun, 2 Aug 2020 23:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727884AbgHCDLX (ORCPT ); Sun, 2 Aug 2020 23:11:23 -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 C4A94C06174A for ; Sun, 2 Aug 2020 20:11:22 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id a15so32764232wrh.10 for ; Sun, 02 Aug 2020 20:11: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=bjS/i84B6ZPWvX9FfR+k97So50sjazJcZS53gCPXCDQ=; b=TrwaFydTgwuNUGglRyHoaXlS2rlOPAyEUpd0gn/m4RgMYqZ8r0QgcMVug/fVoFM1dX TNQj0y4qsMCVhl3xuIk20SrLPK/i6RC3IfG0+/4VhsAJO0eEFs44klu7/VZo97flHz6/ ymZDR+1By1n8Lrv6VO5c8aBfeCUDk+Qu4fY6u816UK4ynK4oXDZ6UBneovMhaDB5MFDQ rSAyl0V+PTb/j1i9hE0eX1akkaAL8QrPN/zYqfvS7bA+J9SbyqkS8xUMMOorbtTjGxw4 Qbzw+iJc8sm0Jihqck6TGAfXUAmOndgPHWvn6uvecVCcaerD3ryPv11ttyf8WPBYa6w7 iK8w== 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=bjS/i84B6ZPWvX9FfR+k97So50sjazJcZS53gCPXCDQ=; b=jQDpncxs//hs2mKR3jcf0DDD4CcQG5geRL8L6wUMdEzp7bdOKuQHbTWQHjyIwMv7nK cPyhjXPmkZbi42ZmfbGzTl8mKhRRFYak+ffFJIfm2H5h3huw8iJZD77D81cyDL7HEfSv eFcpQ1O0Za00Ed8xbPQb5TXJo4b5ozHp/u3m1Z+eu1VUPCv/Ub3xIJnYKV9jx7kBB1Uh tsPXEfHuCo++VRZknZpnizt1GXrgj+A9HfijU00fQDnsp8VPQP4uQt5BQBDTkijh4dQk uyv7Z1kDxxef3rF6gVPnPaa3/aWbhLT5EVue0zZHIU9dNXa5clU2s9Q/d8z/yOmKTzw2 hSWQ== X-Gm-Message-State: AOAM532RERktX/DXRBO07KNJsKMMX75jImNvNBXwIZs99Vsbwv7xsmng irU2w8aAEnkCrXlQ5VCd8BkUaQ== X-Google-Smtp-Source: ABdhPJwHzBw3eIHyTZ0a8oR8Y9U6FLhBp1yx7u+66SQHFJUP1gSTWjYTdz3ceRsOO0GqWqu8MWeoyw== X-Received: by 2002:a5d:5446:: with SMTP id w6mr12836617wrv.127.1596424281602; Sun, 02 Aug 2020 20:11:21 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:21 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 33/36] wcn36xx: Set PHY into correct mode for 80MHz channel width Date: Mon, 3 Aug 2020 04:11:29 +0100 Message-Id: <20200803031132.1427063-34-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 9a7e6f96f0b6..527da56a1386 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1487,6 +1487,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); @@ -1529,7 +1530,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; From patchwork Mon Aug 3 03:11:30 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: 11697067 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 3DFE31392 for ; Mon, 3 Aug 2020 03:11:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 228292076B for ; Mon, 3 Aug 2020 03:11:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GXFccykc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbgHCDLa (ORCPT ); Sun, 2 Aug 2020 23:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727898AbgHCDLY (ORCPT ); Sun, 2 Aug 2020 23:11:24 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5F49C061756 for ; Sun, 2 Aug 2020 20:11:23 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id b6so32766608wrs.11 for ; Sun, 02 Aug 2020 20:11: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=nI9SMi6ePF9rK/Ijds9YAMsR6E6CCi6sMz7MSQYkySc=; b=GXFccykcaGSjyE0f1HkfpEPr1zzZcb6ZzoxyUK7PIdyHldU5swpTe3HRcNZUHQRqeb glIiAQjzqYXI+XWrST0SQLCeaXHVJ+tCRsJEm5L9OzPzenCw7Wu0OaZC5PsgK8aMqJvL aUlaj3oPj1EvysvJ2+ZgdRoLt1OQxpRtc77aE69rw7A77usQKjQL2luZo4oDUHsTjxLs tHh4sbeThhIG3NvA/hNa4kk6hEm9wtw0qOZkkJo8BhZwwNhnJEnn9DmIxZi8Ionho0CO xJZrLITjduhPqTYEPxyyK1q5V2Lx5yfXw9Z9qDQGygtWucRopmVAQrnMpmAbOgYPUTkT fpSQ== 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=nI9SMi6ePF9rK/Ijds9YAMsR6E6CCi6sMz7MSQYkySc=; b=CikgAdlaghKtGrn2HluZC1Xn+3Im8TvttYmKAmOCNV5GPLf5H5N166E5X8iRUskAGk aQu16gmXyn41oswSOwubx3f7vStHKVrwi1i4nU3gz35NdeQ2GluiHKAfbZS9KxpxgLse nXnhEnm8HSmntTcBMzcjU4uQU8jKJvB4b0LcSEJkSeKww7r7TVh8J6xepiwVUzwa5BvM qS5tEM8qAvVXasEa8RLsEqEnyC9q6MieMjX5UOWn8yRgFTBPOSuNxCaH3zb2bAOsSCnH +K57iY0ucKWJmuKkSuWet+bQaS7Nn8pSEBFNCHXPnP0jo/HwJJDL41/bvo2pnuZDCwFC 712g== X-Gm-Message-State: AOAM532o0ptF0kcFHlEIEjdyRS3I1daFNUAnMJtbbmPU45R7PXrU2BEW M7aSvN6J5S1ATD5El3KFaujo2w== X-Google-Smtp-Source: ABdhPJwPapfkzXcIiJX2NS1f06CGsQmRjd7HCJwmwZOis5sdw745VcetX/8CqQahBmiZL9SsBzLOog== X-Received: by 2002:adf:e68f:: with SMTP id r15mr12843713wrm.196.1596424282551; Sun, 02 Aug 2020 20:11:22 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:22 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 34/36] wcn36xx: Extend HAL param config list Date: Mon, 3 Aug 2020 04:11:30 +0100 Message-Id: <20200803031132.1427063-35-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 In order to get 802.11ac working the way we want, additional parameters need to be passed down to the firmware. This patch takes the full remaining set of parameters defined in the downstream riva/inc/wlan_hal_cfg.h and imports them into hal.h with some minor name length adjustments. This addition will allow us to pass a larger firmware configuration set later on. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 124 ++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 10ce05110d11..35b72b1b9bbf 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -726,7 +726,129 @@ enum pe_stats_mask { #define WCN36XX_HAL_CFG_AP_LINK_MONITOR_TIMEOUT 102 #define WCN36XX_HAL_CFG_BTC_DWELL_TIME_MULTIPLIER 103 #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE 104 -#define WCN36XX_HAL_CFG_MAX_PARAMS 105 +#define WCN36XX_HAL_CFG_ENABLE_NAT_KEEP_ALIVE_FILTER 105 +#define WCN36XX_HAL_CFG_ENABLE_SAP_OBSS_PROT 106 +#define WCN36XX_HAL_CFG_PSPOLL_DATA_RECEP_TIMEOUT 107 +#define WCN36XX_HAL_CFG_TDLS_PUAPSD_BUFFER_STA_CAPABLE 108 +#define WCN36XX_HAL_CFG_TDLS_PUAPSD_MASK 109 +#define WCN36XX_HAL_CFG_TDLS_PUAPSD_INACTIVITY_TIME 110 +#define WCN36XX_HAL_CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD 111 +#define WCN36XX_HAL_CFG_ANTENNA_DIVERSITY 112 +#define WCN36XX_HAL_CFG_ATH_DISABLE 113 +#define WCN36XX_HAL_CFG_FLEXCONNECT_POWER_FACTOR 114 +#define WCN36XX_HAL_CFG_ENABLE_ADAPTIVE_RX_DRAIN 115 +#define WCN36XX_HAL_CFG_TDLS_OFF_CHANNEL_CAPABLE 116 +#define WCN36XX_HAL_CFG_MWS_COEX_V1_WAN_FREQ 117 +#define WCN36XX_HAL_CFG_MWS_COEX_V1_WLAN_FREQ 118 +#define WCN36XX_HAL_CFG_MWS_COEX_V1_CONFIG 119 +#define WCN36XX_HAL_CFG_MWS_COEX_V1_CONFIG2 120 +#define WCN36XX_HAL_CFG_MWS_COEX_V2_WAN_FREQ 121 +#define WCN36XX_HAL_CFG_MWS_COEX_V2_WLAN_FREQ 122 +#define WCN36XX_HAL_CFG_MWS_COEX_V2_CONFIG 123 +#define WCN36XX_HAL_CFG_MWS_COEX_V2_CONFIG2 124 +#define WCN36XX_HAL_CFG_MWS_COEX_V3_WAN_FREQ 125 +#define WCN36XX_HAL_CFG_MWS_COEX_V3_WLAN_FREQ 126 +#define WCN36XX_HAL_CFG_MWS_COEX_V3_CONFIG 127 +#define WCN36XX_HAL_CFG_MWS_COEX_V3_CONFIG2 128 +#define WCN36XX_HAL_CFG_MWS_COEX_V4_WAN_FREQ 129 +#define WCN36XX_HAL_CFG_MWS_COEX_V4_WLAN_FREQ 130 +#define WCN36XX_HAL_CFG_MWS_COEX_V4_CONFIG 131 +#define WCN36XX_HAL_CFG_MWS_COEX_V4_CONFIG2 132 +#define WCN36XX_HAL_CFG_MWS_COEX_V5_WAN_FREQ 133 +#define WCN36XX_HAL_CFG_MWS_COEX_V5_WLAN_FREQ 134 +#define WCN36XX_HAL_CFG_MWS_COEX_V5_CONFIG 135 +#define WCN36XX_HAL_CFG_MWS_COEX_V5_CONFIG2 136 +#define WCN36XX_HAL_CFG_MWS_COEX_V6_WAN_FREQ 137 +#define WCN36XX_HAL_CFG_MWS_COEX_V6_WLAN_FREQ 138 +#define WCN36XX_HAL_CFG_MWS_COEX_V6_CONFIG 139 +#define WCN36XX_HAL_CFG_MWS_COEX_V6_CONFIG2 140 +#define WCN36XX_HAL_CFG_MWS_COEX_V7_WAN_FREQ 141 +#define WCN36XX_HAL_CFG_MWS_COEX_V7_WLAN_FREQ 142 +#define WCN36XX_HAL_CFG_MWS_COEX_V7_CONFIG 143 +#define WCN36XX_HAL_CFG_MWS_COEX_V7_CONFIG2 144 +#define WCN36XX_HAL_CFG_MWS_COEX_V8_WAN_FREQ 145 +#define WCN36XX_HAL_CFG_MWS_COEX_V8_WLAN_FREQ 146 +#define WCN36XX_HAL_CFG_MWS_COEX_V8_CONFIG 147 +#define WCN36XX_HAL_CFG_MWS_COEX_V8_CONFIG2 148 +#define WCN36XX_HAL_CFG_MWS_COEX_V9_WAN_FREQ 149 +#define WCN36XX_HAL_CFG_MWS_COEX_V9_WLAN_FREQ 150 +#define WCN36XX_HAL_CFG_MWS_COEX_V9_CONFIG 151 +#define WCN36XX_HAL_CFG_MWS_COEX_V9_CONFIG2 152 +#define WCN36XX_HAL_CFG_MWS_COEX_V10_WAN_FREQ 153 +#define WCN36XX_HAL_CFG_MWS_COEX_V10_WLAN_FREQ 154 +#define WCN36XX_HAL_CFG_MWS_COEX_V10_CONFIG 155 +#define WCN36XX_HAL_CFG_MWS_COEX_V10_CONFIG2 156 +#define WCN36XX_HAL_CFG_MWS_COEX_MODEM_BACKOFF 157 +#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG1 158 +#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG2 159 +#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG3 160 +#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG4 161 +#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG5 162 +#define WCN36XX_HAL_CFG_MWS_COEX_CONFIG6 163 +#define WCN36XX_HAL_CFG_SAR_POWER_BACKOFF 164 +#define WCN36XX_HAL_CFG_GO_LINK_MONITOR_TIMEOUT 165 +#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_ACTIVE_WLAN_LEN 166 +#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_ACTIVE_BT_LEN 167 +#define WCN36XX_HAL_CFG_BTC_SAP_STATIC_OPP_ACTIVE_WLAN_LEN 168 +#define WCN36XX_HAL_CFG_BTC_SAP_STATIC_OPP_ACTIVE_BT_LEN 169 +#define WCN36XX_HAL_CFG_RMC_FIXED_RATE 170 +#define WCN36XX_HAL_CFG_ASD_PROBE_INTERVAL 171 +#define WCN36XX_HAL_CFG_ASD_TRIGGER_THRESHOLD 172 +#define WCN36XX_HAL_CFG_ASD_RTT_RSSI_HYST_THRESHOLD 173 +#define WCN36XX_HAL_CFG_BTC_CTS2S_ON_STA_DURING_SCO 174 +#define WCN36XX_HAL_CFG_SHORT_PREAMBLE 175 +#define WCN36XX_HAL_CFG_SHORT_SLOT_TIME 176 +#define WCN36XX_HAL_CFG_DELAYED_BA 177 +#define WCN36XX_HAL_CFG_IMMEDIATE_BA 178 +#define WCN36XX_HAL_CFG_DOT11_MODE 179 +#define WCN36XX_HAL_CFG_HT_CAPS 180 +#define WCN36XX_HAL_CFG_AMPDU_PARAMS 181 +#define WCN36XX_HAL_CFG_TX_BF_INFO 182 +#define WCN36XX_HAL_CFG_ASC_CAP_INFO 183 +#define WCN36XX_HAL_CFG_EXT_HT_CAPS 184 +#define WCN36XX_HAL_CFG_QOS_ENABLED 185 +#define WCN36XX_HAL_CFG_WME_ENABLED 186 +#define WCN36XX_HAL_CFG_WSM_ENABLED 187 +#define WCN36XX_HAL_CFG_WMM_ENABLED 188 +#define WCN36XX_HAL_CFG_UAPSD_PER_AC_BITMASK 189 +#define WCN36XX_HAL_CFG_MCS_RATES 190 +#define WCN36XX_HAL_CFG_VHT_CAPS 191 +#define WCN36XX_HAL_CFG_VHT_RX_SUPP_MCS 192 +#define WCN36XX_HAL_CFG_VHT_TX_SUPP_MCS 193 +#define WCN36XX_HAL_CFG_RA_FILTER_ENABLE 194 +#define WCN36XX_HAL_CFG_RA_RATE_LIMIT_INTERVAL 195 +#define WCN36XX_HAL_CFG_BTC_FATAL_HID_NSNIFF_BLK 196 +#define WCN36XX_HAL_CFG_BTC_CRITICAL_HID_NSNIFF_BLK 197 +#define WCN36XX_HAL_CFG_BTC_DYN_A2DP_TX_QUEUE_THOLD 198 +#define WCN36XX_HAL_CFG_BTC_DYN_OPP_TX_QUEUE_THOLD 199 +#define WCN36XX_HAL_CFG_LINK_FAIL_TIMEOUT 200 +#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_SP 201 +#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_RX_CNT 202 +#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_TX_CNT 203 +#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW 204 +#define WCN36XX_HAL_CFG_MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW 205 +#define WCN36XX_HAL_CFG_MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE 206 +#define WCN36XX_HAL_CFG_MAX_UAPSD_INACTIVITY_INTERVALS 207 +#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_WMMPS 208 +#define WCN36XX_HAL_CFG_BURST_MODE_BE_TXOP_VALUE 209 +#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE 210 +#define WCN36XX_HAL_CFG_BTC_FAST_WLAN_CONN_PREF 211 +#define WCN36XX_HAL_CFG_ENABLE_RTSCTS_HTVHT 212 +#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN 213 +#define WCN36XX_HAL_CFG_BTC_STATIC_OPP_WLAN_IDLE_BT_LEN 214 +#define WCN36XX_HAL_CFG_LINK_FAIL_TX_CNT 215 +#define WCN36XX_HAL_CFG_TOGGLE_ARP_BDRATES 216 +#define WCN36XX_HAL_CFG_OPTIMIZE_CA_EVENT 217 +#define WCN36XX_HAL_CFG_EXT_SCAN_CONC_MODE 218 +#define WCN36XX_HAL_CFG_BAR_WAKEUP_HOST_DISABLE 219 +#define WCN36XX_HAL_CFG_SAR_BOFFSET_CORRECTION_ENABLE 220 +#define WCN36XX_HAL_CFG_UNITS_OF_BCN_WAIT_TIME 221 +#define WCN36XX_HAL_CFG_CONS_BCNMISS_COUNT 222 +#define WCN36XX_HAL_CFG_BTC_DISABLE_WLAN_LINK_CRITICAL 223 +#define WCN36XX_HAL_CFG_DISABLE_SCAN_DURING_SCO 224 +#define WCN36XX_HAL_CFG_TRIGGER_NULLFRAME_BEFORE_HB 225 +#define WCN36XX_HAL_CFG_ENABLE_POWERSAVE_OFFLOAD 226 +#define WCN36XX_HAL_CFG_MAX_PARAMS 227 /* Message definitons - All the messages below need to be packed */ From patchwork Mon Aug 3 03:11:31 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: 11697065 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 7A08814B7 for ; Mon, 3 Aug 2020 03:11:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E29F20738 for ; Mon, 3 Aug 2020 03:11:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yUqKY0kb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727920AbgHCDL0 (ORCPT ); Sun, 2 Aug 2020 23:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727899AbgHCDLZ (ORCPT ); Sun, 2 Aug 2020 23:11:25 -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 98745C061757 for ; Sun, 2 Aug 2020 20:11:24 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id f1so32234724wro.2 for ; Sun, 02 Aug 2020 20:11: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=LSnn0LuGUOx2Z2N9RvyUQexCHbiNUTojEbR97kkWDC8=; b=yUqKY0kbVgIHXY02N+fCcyagWZnyqdB8gpqWqXkEzBYjZgIwALrliBSAAB7VQ7wrI+ HVlQ2l6jOK6bramvgih8F2SsGPWdptunS/k0E0NFXczI9pRhukKUASnLHlyx28gpBPBr SBfKFA5mkEpJXIiFHjUNrPGzwFf+XCtEz3BOfEMOte02gmm2lmzTTFHJT4Tgq/UdYDK5 ms5HTDc6qRzyMU7flYYLgr/ZOGDW4SK5ce/MJfIcN7NLGGAvueBezuOisZ7v2gy9j1Bj OjO8AyQf2EqoVS62fBbmCj35ZJ2JjRL0gTHPAQHV1WM6AZ4bI/sSHEECK+gg78DKqBc8 kyYQ== 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=LSnn0LuGUOx2Z2N9RvyUQexCHbiNUTojEbR97kkWDC8=; b=EMxCvpFNk8C1wbkyLrmwNoRDj8EZYPNr90Ebu+JhaZUNPVwwT3hn31ZTa4ZYkLP4Oi x9LNTFHjvK8j/GLl7npe66tNpEmgwx7DTUjo96cZhfYj8VM640H7rwLpyLh3aEGI76UH Yr3UaVvDZVHQxo0yRdg6d+cK/hkktSM8DR0FC2SHTuAmHuIBGaFXIP3T4eXHQwYbrfbH lHlTjrRdtcrrNWxiRT4vrEcHoyR6/ngOh/tHJ+aJOznmZ9xwqR8pbs9O0xW4j6IjnRnz rohNp1RurmsCfWdHe0Gd4CL4SEgwkaDUrOzGumPRCfJvdHIFFYYFrGrIVeYRXyr+h2ZZ sYAw== X-Gm-Message-State: AOAM533zyIfwhRcGwY41M3+uEcm7g0wefm9s08yQt5r19oMkzxIW5HLS S7XqZVkgY+V/23Tmb9g51XE7CP+zJ40= X-Google-Smtp-Source: ABdhPJxSHqLnpaG5O/UAD656HTSsIfQanYpdnio/zfKnViPzfKYs+4wZRmy+F5YavbOps6CTxbW6Bg== X-Received: by 2002:adf:d84f:: with SMTP id k15mr12481848wrl.176.1596424283406; Sun, 02 Aug 2020 20:11:23 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:22 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 35/36] wcn36xx: Define wcn3680 specific firmware parameters Date: Mon, 3 Aug 2020 04:11:31 +0100 Message-Id: <20200803031132.1427063-36-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 defines a firmware configuration for the wcn3680 which represents a working downstream configuration. This configuration has been successfully applied to the upstream driver with antecedent patches resulting in the same or better through-put in comparison to the downstream driver on the test hardware. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 96 ++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 527da56a1386..925d82dc0e88 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -79,6 +79,102 @@ static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = { WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0), }; +static struct wcn36xx_cfg_val wcn3680_cfg_vals[] = { + WCN36XX_CFG_VAL(CURRENT_TX_ANTENNA, 1), + WCN36XX_CFG_VAL(CURRENT_RX_ANTENNA, 1), + WCN36XX_CFG_VAL(LOW_GAIN_OVERRIDE, 0), + WCN36XX_CFG_VAL(POWER_STATE_PER_CHAIN, 785), + WCN36XX_CFG_VAL(CAL_PERIOD, 5), + WCN36XX_CFG_VAL(CAL_CONTROL, 1), + WCN36XX_CFG_VAL(PROXIMITY, 0), + WCN36XX_CFG_VAL(NETWORK_DENSITY, 3), + WCN36XX_CFG_VAL(MAX_MEDIUM_TIME, 4096), + WCN36XX_CFG_VAL(MAX_MPDUS_IN_AMPDU, 64), + WCN36XX_CFG_VAL(RTS_THRESHOLD, 2347), + WCN36XX_CFG_VAL(SHORT_RETRY_LIMIT, 15), + WCN36XX_CFG_VAL(LONG_RETRY_LIMIT, 15), + WCN36XX_CFG_VAL(FRAGMENTATION_THRESHOLD, 8000), + WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ZERO, 5), + WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_ONE, 10), + WCN36XX_CFG_VAL(DYNAMIC_THRESHOLD_TWO, 15), + WCN36XX_CFG_VAL(FIXED_RATE, 0), + WCN36XX_CFG_VAL(RETRYRATE_POLICY, 4), + WCN36XX_CFG_VAL(RETRYRATE_SECONDARY, 0), + WCN36XX_CFG_VAL(RETRYRATE_TERTIARY, 0), + WCN36XX_CFG_VAL(FORCE_POLICY_PROTECTION, 5), + WCN36XX_CFG_VAL(FIXED_RATE_MULTICAST_24GHZ, 1), + WCN36XX_CFG_VAL(FIXED_RATE_MULTICAST_5GHZ, 5), + WCN36XX_CFG_VAL(DEFAULT_RATE_INDEX_24GHZ, 1), + WCN36XX_CFG_VAL(DEFAULT_RATE_INDEX_5GHZ, 5), + WCN36XX_CFG_VAL(MAX_BA_SESSIONS, 40), + WCN36XX_CFG_VAL(PS_DATA_INACTIVITY_TIMEOUT, 200), + WCN36XX_CFG_VAL(PS_ENABLE_BCN_FILTER, 1), + WCN36XX_CFG_VAL(PS_ENABLE_RSSI_MONITOR, 1), + WCN36XX_CFG_VAL(NUM_BEACON_PER_RSSI_AVERAGE, 20), + WCN36XX_CFG_VAL(STATS_PERIOD, 10), + WCN36XX_CFG_VAL(CFP_MAX_DURATION, 30000), + WCN36XX_CFG_VAL(FRAME_TRANS_ENABLED, 0), + WCN36XX_CFG_VAL(BA_THRESHOLD_HIGH, 128), + WCN36XX_CFG_VAL(MAX_BA_BUFFERS, 2560), + WCN36XX_CFG_VAL(DYNAMIC_PS_POLL_VALUE, 0), + WCN36XX_CFG_VAL(TX_PWR_CTRL_ENABLE, 1), + WCN36XX_CFG_VAL(ENABLE_CLOSE_LOOP, 1), + WCN36XX_CFG_VAL(ENABLE_LPWR_IMG_TRANSITION, 0), + WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_BT, 120000), + WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000), + WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10), + WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0), + WCN36XX_CFG_VAL(TDLS_PUAPSD_MASK, 0), + WCN36XX_CFG_VAL(TDLS_PUAPSD_BUFFER_STA_CAPABLE, 1), + WCN36XX_CFG_VAL(TDLS_PUAPSD_INACTIVITY_TIME, 0), + WCN36XX_CFG_VAL(TDLS_PUAPSD_RX_FRAME_THRESHOLD, 10), + WCN36XX_CFG_VAL(TDLS_OFF_CHANNEL_CAPABLE, 1), + WCN36XX_CFG_VAL(ENABLE_ADAPTIVE_RX_DRAIN, 1), + WCN36XX_CFG_VAL(FLEXCONNECT_POWER_FACTOR, 0), + WCN36XX_CFG_VAL(ANTENNA_DIVERSITY, 3), + WCN36XX_CFG_VAL(ATH_DISABLE, 0), + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_ACTIVE_WLAN_LEN, 60000), + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_ACTIVE_BT_LEN, 90000), + WCN36XX_CFG_VAL(BTC_SAP_STATIC_OPP_ACTIVE_WLAN_LEN, 30000), + WCN36XX_CFG_VAL(BTC_SAP_STATIC_OPP_ACTIVE_BT_LEN, 30000), + WCN36XX_CFG_VAL(ASD_PROBE_INTERVAL, 50), + WCN36XX_CFG_VAL(ASD_TRIGGER_THRESHOLD, -60), + WCN36XX_CFG_VAL(ASD_RTT_RSSI_HYST_THRESHOLD, 3), + WCN36XX_CFG_VAL(BTC_CTS2S_ON_STA_DURING_SCO, 0), + WCN36XX_CFG_VAL(RA_FILTER_ENABLE, 0), + WCN36XX_CFG_VAL(RA_RATE_LIMIT_INTERVAL, 60), + WCN36XX_CFG_VAL(BTC_FATAL_HID_NSNIFF_BLK, 2), + WCN36XX_CFG_VAL(BTC_CRITICAL_HID_NSNIFF_BLK, 1), + WCN36XX_CFG_VAL(BTC_DYN_A2DP_TX_QUEUE_THOLD, 0), + WCN36XX_CFG_VAL(BTC_DYN_OPP_TX_QUEUE_THOLD, 1), + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_SP, 10), + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_RX_CNT, 50), + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_TX_CNT, 50), + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_TX_CNT_MEAS_WINDOW, 500), + WCN36XX_CFG_VAL(MAX_UAPSD_CONSEC_RX_CNT_MEAS_WINDOW, 500), + WCN36XX_CFG_VAL(MAX_PSPOLL_IN_WMM_UAPSD_PS_MODE, 0), + WCN36XX_CFG_VAL(MAX_UAPSD_INACTIVITY_INTERVALS, 10), + WCN36XX_CFG_VAL(ENABLE_DYNAMIC_WMMPS, 1), + WCN36XX_CFG_VAL(BURST_MODE_BE_TXOP_VALUE, 0), + WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 0), + WCN36XX_CFG_VAL(BTC_FAST_WLAN_CONN_PREF, 1), + WCN36XX_CFG_VAL(ENABLE_RTSCTS_HTVHT, 0), + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_WLAN_LEN, 30000), + WCN36XX_CFG_VAL(BTC_STATIC_OPP_WLAN_IDLE_BT_LEN, 120000), + WCN36XX_CFG_VAL(LINK_FAIL_TX_CNT, 200), + WCN36XX_CFG_VAL(TOGGLE_ARP_BDRATES, 0), + WCN36XX_CFG_VAL(OPTIMIZE_CA_EVENT, 0), + WCN36XX_CFG_VAL(EXT_SCAN_CONC_MODE, 0), + WCN36XX_CFG_VAL(BAR_WAKEUP_HOST_DISABLE, 0), + WCN36XX_CFG_VAL(SAR_BOFFSET_CORRECTION_ENABLE, 0), + WCN36XX_CFG_VAL(BTC_DISABLE_WLAN_LINK_CRITICAL, 5), + WCN36XX_CFG_VAL(DISABLE_SCAN_DURING_SCO, 2), + WCN36XX_CFG_VAL(CONS_BCNMISS_COUNT, 0), + WCN36XX_CFG_VAL(UNITS_OF_BCN_WAIT_TIME, 0), + WCN36XX_CFG_VAL(TRIGGER_NULLFRAME_BEFORE_HB, 0), + WCN36XX_CFG_VAL(ENABLE_POWERSAVE_OFFLOAD, 0), +}; + static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value) { struct wcn36xx_hal_cfg *entry; From patchwork Mon Aug 3 03:11:32 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: 11697063 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 D171A1392 for ; Mon, 3 Aug 2020 03:11:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA8DB20774 for ; Mon, 3 Aug 2020 03:11:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hWXQ530S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727899AbgHCDL1 (ORCPT ); Sun, 2 Aug 2020 23:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727909AbgHCDL0 (ORCPT ); Sun, 2 Aug 2020 23:11:26 -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 ABF05C06174A for ; Sun, 2 Aug 2020 20:11:25 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z18so29222610wrm.12 for ; Sun, 02 Aug 2020 20:11: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=fZoFBHbiMDr3m9OWHf8AVF21Nakmli1eSwjE2dyRsIQ=; b=hWXQ530Suvyx18R5slJjFBMAu5Yu1/M6Hv9gVzKw+P3DYUCEKtmxPH04xYYuDPWyYv VexaJc0nbTMJCZ7nuslAd72+UZ+WTW6jTwqz5EUVNb8ngwtjBNU7r+HtqFdvgrsqIKOv 3zHlD8wtDixB6oycL91C3ryNDjDnY9uZyV862m9vKP4RQ0lcDnFu+EgqNGVRPHlGMv13 SOFTpISuD27v8DNyTZhIPQM4yhIv/Z7eYtGJXPAgtS1agAkbL83gGq+wOnOBB9lLiRt8 YULzjuG2M3rrlwkkmkm8dVw4CPW7Fry/rjLwhOAOpPf1duiKp15T9QPw5yEJK3A64+mc UxDw== 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=fZoFBHbiMDr3m9OWHf8AVF21Nakmli1eSwjE2dyRsIQ=; b=NLXstQL8e+UN1f19xK7uApviRpSi8heqPPJVtt4kxnUXREkNa18jJjKfs+Gk4sX92I YR6ntxHn2v6lc/McpZ0GBnjThgk5Ksw+OUAuPfIBEyF4r5rRDYrjczNC3BHk7XpVQcg6 zmKW5FcTiQxK1FxApffuZnovsv84L7tzox6q9Nd1pg2zF85UUAotzF2WQWEI8TFnOUt5 QwU9gg/NDG7CdQU3wQDzPgEUFjI9R9AHsNEe1DxfmIqCBtwjvdHy2aYKa8YudF17WK40 y/9nI1a3LFxbt7KETLXp1Yl4wIeL6TfBucSJqw0v72tAAYg9D41NDv+F6p4Gpwf15pN0 kr1Q== X-Gm-Message-State: AOAM532r7D/biNNdyPfSTELgitMUSYc0oPZomI4gaUqRb3DRPbys7T6b btpwY+DnsoLoFOrPf+yEslkAaA== X-Google-Smtp-Source: ABdhPJz4nQVphLKxDdSZlSgkw4AMS27xzVPJHFMIL13hXvnKXlTdKMqI0S9ZyB711WnC5SGmdq9Isg== X-Received: by 2002:a05:6000:150:: with SMTP id r16mr12875781wrx.63.1596424284449; Sun, 02 Aug 2020 20:11:24 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id q2sm21956857wro.8.2020.08.02.20.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 20:11:23 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, shawn.guo@linaro.org Subject: [PATCH 36/36] wcn36xx: Add ability to download wcn3680 specific firmware parameters Date: Mon, 3 Aug 2020 04:11:32 +0100 Message-Id: <20200803031132.1427063-37-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200803031132.1427063-1-bryan.odonoghue@linaro.org> References: <20200803031132.1427063-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 modifies wcn36xx_smd_start() so that it can download wcn3680 specific firmware parameters if we are talking to the wcn3680. If not the original generic firmware parameter table should continue to be used for wcn3620 and wcn3660. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 925d82dc0e88..542c5d160ebe 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -610,6 +610,8 @@ int wcn36xx_smd_start(struct wcn36xx *wcn) int ret; int i; size_t len; + int cfg_elements; + static struct wcn36xx_cfg_val *cfg_vals; mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg_body, WCN36XX_HAL_START_REQ); @@ -622,9 +624,17 @@ int wcn36xx_smd_start(struct wcn36xx *wcn) body = (struct wcn36xx_hal_mac_start_req_msg *)wcn->hal_buf; len = body->header.len; - for (i = 0; i < ARRAY_SIZE(wcn36xx_cfg_vals); i++) { - ret = put_cfg_tlv_u32(wcn, &len, wcn36xx_cfg_vals[i].cfg_id, - wcn36xx_cfg_vals[i].value); + if (wcn->rf_id == RF_IRIS_WCN3680) { + cfg_vals = wcn3680_cfg_vals; + cfg_elements = ARRAY_SIZE(wcn3680_cfg_vals); + } else { + cfg_vals = wcn36xx_cfg_vals; + cfg_elements = ARRAY_SIZE(wcn36xx_cfg_vals); + } + + for (i = 0; i < cfg_elements; i++) { + ret = put_cfg_tlv_u32(wcn, &len, cfg_vals[i].cfg_id, + cfg_vals[i].value); if (ret) goto out; }