From patchwork Sat Aug 29 03:38:37 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: 11743917 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 520FB1575 for ; Sat, 29 Aug 2020 03:38:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ABD520838 for ; Sat, 29 Aug 2020 03:38:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="me3BugrB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbgH2DiM (ORCPT ); Fri, 28 Aug 2020 23:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbgH2DiG (ORCPT ); Fri, 28 Aug 2020 23:38:06 -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 CD733C061264 for ; Fri, 28 Aug 2020 20:38:05 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id v4so119528wmj.5 for ; Fri, 28 Aug 2020 20:38: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=fNiRhwwJnyA0HvHB3u89nvaZihjCiD7YGV/okY3OW5A=; b=me3BugrBOWQV+U6/VJGef1fddYUJf7bH3pdjQjOn/eOkhKniFHu7/9wc+zXVr4VN6G zyXO5OVMKbO7Fzuy0RjSKmXYu+RCCZ07S1ophjow7zYMVz8iHJ8LtKk5m11/tm2Zsdus nOX2ESe90GjPdhL4wFDRgDxg8/+k5JIJzRRdLiy9g+saIyeuMOLdyIATP+2noLvlWCtT lX1+mdOofQH900EC/JI3TPWVzs56niK+Kn16yFD4VpeR010xlvI65RXlSi+jzljsMlsh ImfzWUKYJ0D7qwP0MqmNzDqCFU+dPh72KVK5c5NnCD0NT1Rq6DqTv0WLCeJ0SzNFRlDF Vz6w== 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=fNiRhwwJnyA0HvHB3u89nvaZihjCiD7YGV/okY3OW5A=; b=B6N3z1CCGiE/CxheINwx4IXFQP+OUc6wpgweQOPS4bn2gqDgQG0+2X9ltZMeYcfakb WyzPhTOmHTYieDIgiUn4/3G/5OUltRpwCRF8Tm830q1ReWG5oBgI4f8nJsVuoeP6VJ6F IoqhkeXQzeTE+gTy8rifuoujvi0pAfHI7EAlh1hFRCOwGlkEM9ULaQIo9iPNDEBS0fbG seMwuGRrfNZvNFJdHd4T7iomLNHeu2AgsA8FGQm7+K5sHatXulYvIL8pHVn2vDlcocwU 2dOpEXLHwCZHbWcnRRZGSPWGC7ceCoU8xt43rDI0wT7ok+iPjuKf2ffeWAOdS66ac4qt E9KA== X-Gm-Message-State: AOAM531u0MVByufV6htvkeULgbMy3oRNp88O4mANQAhTodhiiIpEpi5k PSS9o3Tf94glxX4F3BeW1RBvzA== X-Google-Smtp-Source: ABdhPJyND+NDLTAbJfnSUUiMt4Ke8v2HSWWNBrq/AMJojuRk+fkw+sQoc9c4C7VSOKbI0NyJ6gIxuw== X-Received: by 2002:a1c:105:: with SMTP id 5mr1570159wmb.83.1598672284491; Fri, 28 Aug 2020 20:38:04 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:04 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 01/10] wcn36xx: Add a chip identifier for WCN3680 Date: Sat, 29 Aug 2020 04:38:37 +0100 Message-Id: <20200829033846.2167619-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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. Add an identifier for this purpose. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 719a6daf9298..342ca0ae7e28 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 Sat Aug 29 03:38:38 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: 11743919 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 07045109B for ; Sat, 29 Aug 2020 03:38:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3FF320838 for ; Sat, 29 Aug 2020 03:38:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zkoSQL7W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbgH2DiO (ORCPT ); Fri, 28 Aug 2020 23:38:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbgH2DiH (ORCPT ); Fri, 28 Aug 2020 23:38:07 -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 C085FC06121B for ; Fri, 28 Aug 2020 20:38:06 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id w5so867262wrp.8 for ; Fri, 28 Aug 2020 20:38: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=vXKEi/HoMMsHZxH4yOeDvKa0RuCCtL95AFd9xgH5tmA=; b=zkoSQL7WX9g1fDWQx8gKsqkXSmOkkyl2rUtJC/8+ekwNenOYXPwZWnYqU4b6yRMmaW YSGzXNGuxrbGGv43NWMJkycrNayItjj1aCJtllCOepPVKC8Nkv/ur3DO57l0J2sRPCz7 y1r7AewhrxW5X1QkS/h0hnEb9pyqa+5/DjRp7oelBHRJglhAchi7SOor7qJ86EXENH4V KTJR3rEusaAxO9nWENfhc23pkD6xPijqEmGSQc6KS5+pVyrqWYbwP/h14iL6R5udoJF0 aPwBOCklO79YhsyHY5RoNrTkqjy2U71DYKvW0RAUXARt9ZePDt+sFWDXAqe1IOqDkqGE Pyrw== 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=vXKEi/HoMMsHZxH4yOeDvKa0RuCCtL95AFd9xgH5tmA=; b=Oq0onL2GYnCPbg6OSkOAo244QreGjf3HykF6keIhik5035Nx1/JpyJH06MNlWe7wh6 0bDdBg1JqiTm1XRZTxY5lojn984+CP0NiyfYdbapy6cfKhcINzJ7a1KzXp94IoVj0iME R6+yxjbdZtRuPEIIS3kNC8MoeDHWgdAKDdHwX0EmdgAN+SuEpyQ6t0VNcMYVST5+0ooi ofhKNwEE8WP0ImpThgkVT3B/Frch9T1cMXlC5maH+3dZfQNU2jSudLVnu6EiUc4Ez68O rrXyAflNJ04luWcT/SYaWqEE5DwTx+OIw8L9DaBcryv2UYsIlwnLlT4tW6EhnMZ6xVY6 txWA== X-Gm-Message-State: AOAM532avbRlj1LmVYYRpokjsUOEUrmkp9RRN50WQz+n7ytCF1IZaBeQ fFBqpYnVVpDnB10On88X1u9Tvg== X-Google-Smtp-Source: ABdhPJz/5+6bOGPykNIHRbS48PbvYX2D7h8eyrnMNUnWJ46MhlKIokwL/PLSkg+v3USehKVRZe9E+g== X-Received: by 2002:adf:81e1:: with SMTP id 88mr1831849wra.57.1598672285502; Fri, 28 Aug 2020 20:38:05 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:04 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 02/10] wcn36xx: Hook and identify RF_IRIS_WCN3680 Date: Sat, 29 Aug 2020 04:38:38 +0100 Message-Id: <20200829033846.2167619-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 If DT indicates we are dealing with a WCN3680 mark the rf_id field as RF_IRIS_WCN3680 allowing for further chip-specific logic. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index 44b8707d3fe9..eb518bd88870 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1309,6 +1309,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); } From patchwork Sat Aug 29 03:38:39 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: 11743921 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 D977C1575 for ; Sat, 29 Aug 2020 03:38:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2B3720838 for ; Sat, 29 Aug 2020 03:38:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MEatZ4qk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726900AbgH2DiU (ORCPT ); Fri, 28 Aug 2020 23:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbgH2DiI (ORCPT ); Fri, 28 Aug 2020 23:38: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 C328CC061232 for ; Fri, 28 Aug 2020 20:38:07 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id y8so802547wma.0 for ; Fri, 28 Aug 2020 20:38: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=eyueDL1HpZcFmjns3DJaD8rZWh8gy/SLzoJpbodUmaQ=; b=MEatZ4qkA3Q5ErPunm5qnR+0+uYbnen5AD2b3OXNCtfvC7vCDCWns5XLYdaoQauP0s jEpTEwuv8b6M0HTTgulbRXzg9B+++8FgB2u1sAXzawA0Uwl2ikDVW8azUFyTYm82kBy8 0O87/yKp73EnZKcTPv350uJSJOwi4ciMPcSiFNtb5ivqbQM9WiRNoDYlk6/6LgIhM4nO hbRJZlk48wrX1wzn32kTHCDfxDDnSKIfpY6n99HpE8vQbb5Q6Bn2mT8mjAnBM6ahVPXF ZBT0WGJ1R/DZZGyhOVr2KwS4akt516nmokgOSf5ODC4V6sCWUdyRbn4pMVYsJd+OUDzs JHaA== 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=eyueDL1HpZcFmjns3DJaD8rZWh8gy/SLzoJpbodUmaQ=; b=kJ5+Z1Lo8kwVroytSYcSHzpLXDcq+8gPvuhn/oCrXTmcOt2Hyvm1o0YLdkiEmjdXrj HbTGQz+fozlVw8ZWQdffpetgVocppIdbEpA5+sDmZAUA9mbbLRX9bPJMODmmWK20pHn6 Q/NQWE6Vu3fBOVbIoIiVZ/CndWuvfM5rWjmgUm/KvnsrG+Tf/iaffuT3OF1cowDZ276T JDRzuRDukPy31+gurnaFQtBOahe9/hx4eqgttyR9m7NNWEnwZLgnEQS3u8xaVWPMaAj9 7AEcFnVWWDBpDU3DX9f5Vig79G2LMAbimYhwTL4kA782bUOz+UKZeuESfIYwS9bpg2vn Rusw== X-Gm-Message-State: AOAM5336+GL8ri2vHlMlbybPfpDyei+Gzafm/oScXnyFMgeN5WfETuUi WRWDmLSx99t+qBX0b93ddmW73g== X-Google-Smtp-Source: ABdhPJw1M5xH8mcu0/vIdlGkg8dkTqw/putpUvCkXz/FipR8FUR1OYmWG59UlYUXqhj8YGYvY3w12Q== X-Received: by 2002:a1c:1904:: with SMTP id 4mr1431433wmz.119.1598672286424; Fri, 28 Aug 2020 20:38:06 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:05 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 03/10] wcn36xx: Add ieee802.11 VHT flags Date: Sat, 29 Aug 2020 04:38:39 +0100 Message-Id: <20200829033846.2167619-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 - MU 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 | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index eb518bd88870..08e23dbb60fb 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1184,6 +1184,35 @@ 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 | + IEEE80211_VHT_CAP_MU_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[] = { @@ -1212,6 +1241,9 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn) 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 Sat Aug 29 03:38:40 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: 11743923 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 50FBF1575 for ; Sat, 29 Aug 2020 03:38:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3458320872 for ; Sat, 29 Aug 2020 03:38:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ug6KpVaQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbgH2DiW (ORCPT ); Fri, 28 Aug 2020 23:38:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbgH2DiJ (ORCPT ); Fri, 28 Aug 2020 23:38:09 -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 C6E7CC061233 for ; Fri, 28 Aug 2020 20:38:08 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id e16so894246wrm.2 for ; Fri, 28 Aug 2020 20:38: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=WZEQmynoQoGqql5uWz9R80ak6n6NCB+2pwYHU1F/YXI=; b=Ug6KpVaQEsn9IqxnjJSB/dU0b2hStJjSEx1mpkJAm3huL5fWGENXCX5gu7UKvHmzvE uRWE0ETy7awWup2LWk2FkwD1pOseIR+dpv8ocy2rlvasUqJmcAaDZCvZT8z49iKlfk6Q DIvuHrPfbpNOIrGdUXcifOCWCuIcARpr9+m0nCMgBZH8DXLoo5csz80QPulHQRGMqVYF frD//UDx9QOYf1Nwy3CanXLRslsx8TNIoKL/GUZgMrnCfRDEYYI9TpGQtdwYA8Ftj1Ny BIM6CmwpAXHSqvwNafhHh7BjB0B2ZD/6r79kF3DFA3Q9AIKZN+BJNn11C19imKPqsISq bouw== 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=WZEQmynoQoGqql5uWz9R80ak6n6NCB+2pwYHU1F/YXI=; b=Kl6eCPmMMxtRzb79G4uLGLeiLx1aFZENcB52kRd4iRaJad0JisGOlvpJZZZHU3mDE0 u5TSpWZ3R69oCUPMYJjLf1j3iBaD+rs74Lczmisno/8F3B6jN7W7Izqwr74h2m958MUL ifgtY4p4/hk7XRhWxEG6J9yHuAjgdSGu4fBj4UZNJy+tAq7FLa1/9H2xfums8FaSxRbk CInlhWYVYySEewDh0i+8QaZh/zlrsR9f7oN0CCPPCpUe5n7nQGKiD5xcKBZcU2Ugm0sq hOZrn6fkOT5v2vw6hbbjEiGG20uuGqYsB2ZOLuQ8U4yVTG2ftlph3bcuqWly86EyP7QG CFWA== X-Gm-Message-State: AOAM531OghPC/A5Dv8o2pFwG/Dp5Rhdd90mriXD0T5AoEVmPHAs0G0ww tTgIiKEpJJzQzmPIaFm5bouTbQ== X-Google-Smtp-Source: ABdhPJy0o6Cjmm+lIDQ74XQz8UkFhiDUK8CADj3r3mh7aIxmaefBwM1I+fXGNCOKEy9PrEOslkdBJQ== X-Received: by 2002:a5d:54c1:: with SMTP id x1mr1600087wrv.231.1598672287438; Fri, 28 Aug 2020 20:38:07 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:07 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 04/10] wcn36xx: Add 802.11ac MCS rates Date: Sat, 29 Aug 2020 04:38:40 +0100 Message-Id: <20200829033846.2167619-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 564130d6b8cb..80e96c2296af 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 Sat Aug 29 03:38:41 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: 11743925 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 C4758109B for ; Sat, 29 Aug 2020 03:38:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB58520838 for ; Sat, 29 Aug 2020 03:38:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BTOXWD/U" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbgH2Di1 (ORCPT ); Fri, 28 Aug 2020 23:38:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726791AbgH2DiK (ORCPT ); Fri, 28 Aug 2020 23:38:10 -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 CB8B7C061234 for ; Fri, 28 Aug 2020 20:38:09 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id b18so872051wrs.7 for ; Fri, 28 Aug 2020 20:38: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=rfxnSLFpws95ZzTiN2qtFlrCYz6/oakRsVyvq/HcoY4=; b=BTOXWD/U3EBW10PEULQgKuppUzxzpqwMLd1PFkYrGZxjdvFELVtGb6a095Ep6a3G0O 6zY6dna0rwjkqN0qJs+yA1Qb3qTuhwztHV0FIR+Wg1R+JusLIbtZsdBESwvjt1aI6Ep5 mdaEHRKUAbWNKihjqS/4omaemGaGzKHHDMuLDztE1+CN66qn0cJAkLujj+W7qv8zmtvF YLymhRAAIGnHoB6NC7hYym9FrUQlaYslPMrDoNfUojEqdJ7/PvrPKaiqBgWpMz8pmbMw cb7HgdSu2eygYcgKX/9B26oeSjODezaHp6OlAaHUVs8dN/kyVjUE6Ql0KmVs0GQ61wgO GKZA== 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=rfxnSLFpws95ZzTiN2qtFlrCYz6/oakRsVyvq/HcoY4=; b=f4waw5m+QVUUZHP7I2oMLHZY2sHaewpFKbWxxkQiYDO7jXlBJ8wqTnDd6aHs2BEXjB GGxt/SLFu9x94TJm/Sif7BxZaa320F8bvjNp5bmfOzuxqqajCklFFHzF6yM3va4tr9Fk mzrLKiItT8E14mBP8A7ZJML+z2SPyE8PYXCNjUklxZIXdtchJvO5YRyaw7VNDY02Dz7x xWY/SXH+/4oFi+Ukgrd0A7QrsDVT2AHLaXXwRggu4fwRSU2HTxr+9JM/mQS1tZ7sbNiG mXDmZ4TFducSbpYmAPI895rzqKNShykhZ8BXxf2ApxJt0OcXhTV7GpoXqD78ULUiYGoQ XPQw== X-Gm-Message-State: AOAM532bRHXYw4aggVOSSkKmrDRMbv3D0D7E+NN8Si96Z1axyDkJmNqs Oyvh4B+f7mAabG9T6yIAn6FjXQ== X-Google-Smtp-Source: ABdhPJy0ApS1Um4sQFTjG9NUvWR4aGw+L+pPPYB0JF3fXvQCPSjrHZPLiR7nFNp7GCt+tUpB3aep4g== X-Received: by 2002:adf:f507:: with SMTP id q7mr1708154wro.343.1598672288484; Fri, 28 Aug 2020 20:38:08 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:08 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 05/10] wcn36xx: Fix warning due to bad rate_idx Date: Sat, 29 Aug 2020 04:38:41 +0100 Message-Id: <20200829033846.2167619-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 From: Loic Poulain The rate_idx is the index of the bitrate in the supported rate table. However the 5Ghz band has a smaller legacy bitrate table than 2.4Ghz since it does not have the DSSS bitrates (1, 2, 5.5, 11). So in 5Ghz band the index should adjusted accrodingly (-4). Signed-off-by: Loic Poulain [bod: Made sure fix is only applied if the rate_idx > n_bitrates] Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/txrx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/ath/wcn36xx/txrx.c b/drivers/net/wireless/ath/wcn36xx/txrx.c index 80e96c2296af..05a84f82584c 100644 --- a/drivers/net/wireless/ath/wcn36xx/txrx.c +++ b/drivers/net/wireless/ath/wcn36xx/txrx.c @@ -230,6 +230,7 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) const struct wcn36xx_rate *rate; struct ieee80211_hdr *hdr; struct wcn36xx_rx_bd *bd; + struct ieee80211_supported_band *sband; u16 fc, sn; /* @@ -270,6 +271,14 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb) status.enc_flags = rate->encoding_flags; status.bw = rate->bw; status.rate_idx = rate->mcs_or_legacy_index; + sband = wcn->hw->wiphy->bands[status.band]; + + if (status.band == NL80211_BAND_5GHZ && + status.encoding == RX_ENC_LEGACY && + status.rate_idx >= sband->n_bitrates) { + /* no dsss rates in 5Ghz rates table */ + status.rate_idx -= 4; + } } else { status.encoding = 0; status.bw = 0; From patchwork Sat Aug 29 03:38:42 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: 11743927 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 84C39109B for ; Sat, 29 Aug 2020 03:38:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6BC0C20872 for ; Sat, 29 Aug 2020 03:38:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IMCX8icD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726995AbgH2Di3 (ORCPT ); Fri, 28 Aug 2020 23:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726797AbgH2DiL (ORCPT ); Fri, 28 Aug 2020 23:38:11 -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 D0021C061235 for ; Fri, 28 Aug 2020 20:38:10 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id u18so876240wmc.3 for ; Fri, 28 Aug 2020 20:38: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=3ombPAKmNa4Z6zut9RJcKKY/F0yxtyCaqxLuyUzdePk=; b=IMCX8icDForxzG9FE+bBTFQyGhkCMFVE0MKRM+c5KrhIacr5VdhHjw8tWi6LwK6qdB rzaRms0G/00jSp4Sbx0ZrGMa2lEfxUQJVQ+SJ/G0t2wwGePXX4QfhQcU+3Nrcp8seegt r+YEsTwJXHGWCtEy244gzhoBGDPvcQOPtnMSC3dIDLnb3mUdwwiNAysSiT0XyyGiHcYx MSsp9loY2yFCfZO71WSazI7pvwLHQEFzgv21ZFROQyyEwFY4OHjFVg+7OMMFeHEIvg8p boo0p2o7Srsh71HEE6V7O83aPfvyuhgfRf6HgUMBHs5AJO/8eZ5fvF/ZoUqcUYYZCjJW Gxww== 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=ryW6k6vt/3Of9iiEsyCPG5E8Wwk36zJwGVnl/AvbKclg5avbdGDMrYIME5NUinc3Fc 6EVuDqeOe2QhohaGDB8/M9drd0woDA4LQhJpnVBO9tVhXKouHa+rh0HxIbO3TlmyCj/W H9pdNX4HsGlBOmyT/SEjMi+/UyqN/OHySA/Y3fi7riBHs9mg+oFwSVc1QF/6AsE7r42D J7Gy82ztuAUd9+tw+P7IDJy/oFy6+kFiMDondeerBh5psxXe+wX1qPS0OomCImf15r9w 6ImAhsc0/msULPFZTPI/JhStfIQAq0qbBqvxDmt14Nxs7pA4rLbtrGaH96J+6gYl0a33 98Wg== X-Gm-Message-State: AOAM531u2lIm4vrpStX2rMHAGfue5M7zVo90uiXDf2l5HXkY75VpjOCF VhKF8pg3QIAF2zerZa7TnTBCzw== X-Google-Smtp-Source: ABdhPJyE/P5cRdxFv5yjxbP0L7wsHmfzX2dn5YDu7kOar3UTTQaBlx7pQYBHFYJ2OMZonrahUbETjg== X-Received: by 2002:a7b:c116:: with SMTP id w22mr1509152wmi.149.1598672289482; Fri, 28 Aug 2020 20:38:09 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:09 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 06/10] wcn36xx: Specify ieee80211_rx_status.nss Date: Sat, 29 Aug 2020 04:38:42 +0100 Message-Id: <20200829033846.2167619-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 Sat Aug 29 03:38:43 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: 11743929 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 8683A109B for ; Sat, 29 Aug 2020 03:38:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B06D20872 for ; Sat, 29 Aug 2020 03:38:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vvG6htBB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726878AbgH2Dib (ORCPT ); Fri, 28 Aug 2020 23:38:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726798AbgH2DiM (ORCPT ); Fri, 28 Aug 2020 23:38: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 CD4B0C061264 for ; Fri, 28 Aug 2020 20:38:11 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id f7so899272wrw.1 for ; Fri, 28 Aug 2020 20:38: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=x14bAIQMwOQ/wd1IM8KwbT5bU9D+bQ8R4vcYDwgbN5g=; b=vvG6htBBheLhm1ujXdXNj0loUhvt/Xo9DHfkOqPTTdzFQBlyza61Q/FdBGhBCfB0bF SYVFOMH1wVjVtek7wzr+jY326+atNrg1iRqvnX1TAGjKvczHgR+tQoce/DuHvbaPXYHq B6TghRyXDsKUnLvgopI4f1UA/KYsof9ZK9awUTqL+kUT9bRgbBol1aiz+SGHts230k/l N3CBORCoutU435tD5Z/GBOaNHq8dPWj8sQWIXvq+67S9n+XEgZVsvjF3+mSxr6NQDYz1 BD8GkP1zF1C5aNmniy7J51RsceFN5sccwGPighaL68EF5Ur+M2iFEk8mQ11JVamU4xxq jXMA== 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=x14bAIQMwOQ/wd1IM8KwbT5bU9D+bQ8R4vcYDwgbN5g=; b=XWQPiI5nWewA1pYdOt1WlqthEG9YDTA278YZfWfOfk7VMktadOF33CM61UK3ZuJ/dc s0JgsVDZQsjRqOYGtw8Q3c2dD0WSj4eseV2ctRM4wkkMTQ2rf9thgMkxrRXWVkSS+Qgz c/6xXVADrIANQ1qTbRlhlnQio/+VjFxeri561Wi5O6xTLnE9TuGVKN7sYOAFvSVUbkT4 bESDwerFM20Xr3xLSu0ZAzcP18TG7NfIzlCQc7NqAqrEh18auqMUZ0nJoylbak4h5Ej8 klK8h2OqrzGiyXKWouzl82Jlbx4VnPgA3ja9Od2clOtWXHq/qPALY8HGA4mxR8GaHBeU D+qg== X-Gm-Message-State: AOAM53295dcRGcFJYZXRFBbJFhehVoNmzIBaKsXPrNRXFrxiy/KrOPDO g91wULY5G7D11RfWMO4QfpFnxQ== X-Google-Smtp-Source: ABdhPJxwkDLVtqN/iBaXw4DPjHIyTobXpAOhuarJbOUpVb+lyxlGylUVpwEDwwOkRzggVojKgfTHFw== X-Received: by 2002:adf:fcc5:: with SMTP id f5mr1700858wrs.126.1598672290496; Fri, 28 Aug 2020 20:38:10 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:10 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 07/10] wcn36xx: Add 802.11ac HAL param bitfields Date: Sat, 29 Aug 2020 04:38:43 +0100 Message-Id: <20200829033846.2167619-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 30476f857d23..c7661fb50c10 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -1515,7 +1515,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 Sat Aug 29 03:38:44 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: 11743933 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 97E11109B for ; Sat, 29 Aug 2020 03:38:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D43E20BED for ; Sat, 29 Aug 2020 03:38:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kv5UYtoW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbgH2Dii (ORCPT ); Fri, 28 Aug 2020 23:38:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbgH2DiO (ORCPT ); Fri, 28 Aug 2020 23:38:14 -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 173F7C061236 for ; Fri, 28 Aug 2020 20:38:14 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id f7so899294wrw.1 for ; Fri, 28 Aug 2020 20:38: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=OrUSz+1vWHM3urmxg+gRDOL5sDh0IwWl1lMxkmx+/w8=; b=kv5UYtoW73TpFJamx3FmTdr9yf22LZNZwnNzYkMmBwJTDzwSmbUuqAWF4t0seCeyIa qILTgixj8EVNwAIyIZ9kQJuW2uKUnx6oH4KChF/ude7m79fvzPzgSiIQxyJfhFnw+amh 4drFrrVFXTgru/A88Tdf773cW7usGhnDbln2JQv1+T5lhwJjMMsGDvdeZymBIyHNqzCR f6IRRndbGe98Zo0/yprgfwXcB73xcID0UV4gRLMjlZ49V54TsZzZeJzo+XVXctl2A61u RdGZQkzR/36FB6x/FXiHcN87nYj9yKxXoCVhQCF3KfEUNBLRdVnvtb9Nb2HwiCE0uMYJ UXJg== 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=OrUSz+1vWHM3urmxg+gRDOL5sDh0IwWl1lMxkmx+/w8=; b=r/J0RpkOrawv4OUWuszggO87B2oAGoDGSOCpwxcLmivS+ToyBeRmr9BWZ4wnyYVPG8 uQPKfhEmxNmgNIY4S3SuNMHzu5KJ8kk9X5IRNkdlyeoLo317LJ6v6/3blOOGy1ai8/D4 HDJwDjh/UOQh63bAX9CvzAWb+jDqrMnbaFLUNkYbKVxJPmBkeZVcPmk3jbCA6Fz4yMWT xFW27+yvsqBX3NrVm4N/9IoaK1P9h0Gj9BCj+VFBsBibog75dsyq6zDR5JBidFApuKse DiT7hj1ROWuDVH6Mx0TBNrh+/hk7d8If41g1GxKJPU3VL0ZivqFU43eoTYsIY83DGOW/ ow0A== X-Gm-Message-State: AOAM5335KzRUjJTlkmy7Aqe3z0nEWuQPNNxH7D4nzw1yvX7G3w0lUJXC 7nLh8L98DtISXqpGDBIntgpCtw== X-Google-Smtp-Source: ABdhPJy8Cjny82c2fQZw+7T7vYYGM8lrrRDV+tuFRRgwJNJqKvKlAGU9niRvjoKW1sGjGPshiYXXEA== X-Received: by 2002:a5d:4352:: with SMTP id u18mr1752280wrr.239.1598672291473; Fri, 28 Aug 2020 20:38:11 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:11 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 08/10] wcn36xx: Add Supported rates V1 structure Date: Sat, 29 Aug 2020 04:38:44 +0100 Message-Id: <20200829033846.2167619-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 c7661fb50c10..573799274a02 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -1413,6 +1413,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 Sat Aug 29 03:38:45 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: 11743931 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 717FB109B for ; Sat, 29 Aug 2020 03:38:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53A7520872 for ; Sat, 29 Aug 2020 03:38:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VXGiSsso" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbgH2Dif (ORCPT ); Fri, 28 Aug 2020 23:38:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbgH2DiO (ORCPT ); Fri, 28 Aug 2020 23:38:14 -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 AC600C06121B for ; Fri, 28 Aug 2020 20:38:13 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id b79so837603wmb.4 for ; Fri, 28 Aug 2020 20:38: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=snHNh5lKS2G0FTSISsFMGrkG2Oau7dqOyX8GcYHpHKE=; b=VXGiSssovhD85ZzX6cPZxqcb3woNczAD5mY0J+oiwZoAuDoFrqkaE/gWoQrtHpfTbY uY5tM+HqU58dWR523VrERY6qBdNRYW1oumhl4CwU3zdYj5pEn7Zj9zHj6UMLQA4jywgb ivl5GAEt1VrzfNN/nXTiT3ycxgD9AvsurXuB13mVqnWVhnOtTWRYzrJTweX3cblx6Grb LsHBeemlhHXc4xIZm1R1BPIJq5irfnKJyNpAwbQKdVJ/aFeqMDyidh0JsARITMbCohdD X6mZ7nYsCfeFs+atK7YFPeOKrLn3/j3AmbdC4md9tRwa/XlL2RWxCt+zP/Ckza2fk6TF 2fgw== 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=snHNh5lKS2G0FTSISsFMGrkG2Oau7dqOyX8GcYHpHKE=; b=iy7vJRlpLQMA6CdaUssg7Yx8DXw6HeLleogly7/DLcshObi5mNc/YkL/0MxdFpG2tk H9ANO94fQUvJLcCU+b9fPQPa/GwnFwCsAQGgr7Ts6CspU5cTxM1qhCMtthPLfZqIeAZw RzPJ5PgcPVOGdW+1fdQJS/7nKrMyeAeGs7W4aJqo+FADeimtUv/O0FWjd195J/3WEfVf Qp6lgFLmx1YohqfEIIqrm+1hd650CIr4zybo6+MBYrSQa5Z4JfoMUReKT853kkqXsXAF 6TOYVNZRClSgiNa0RkCcyVl9pQa9B4WVbWJVL3JYSseUyV+0gO8+mDb79/7BnKdDOPm3 9VaA== X-Gm-Message-State: AOAM533kZIDSHF+Iow0yHEkoiMxyqde2rfxkfxXsJh6DzSvEvRTE4hlF eLDkRKxeoK2fF8us/rFZrgkoBg== X-Google-Smtp-Source: ABdhPJwuyhe3avaI6oPw97TycrXcvk+R8x7BWKwg8AA1iakz9S5JGdWUFp/M7stKAevsJch/jOVtHg== X-Received: by 2002:a1c:9a47:: with SMTP id c68mr1493787wme.33.1598672292408; Fri, 28 Aug 2020 20:38:12 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:12 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 09/10] wcn36xx: Use existing pointers in wcn36xx_smd_config_bss_v1 Date: Sat, 29 Aug 2020 04:38:45 +0100 Message-Id: <20200829033846.2167619-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 92ae77523115..9490b1bf4e05 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1299,87 +1299,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 Sat Aug 29 03:38:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 11743941 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 8349C1575 for ; Sat, 29 Aug 2020 03:38:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62C9220872 for ; Sat, 29 Aug 2020 03:38:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MWweZxH5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgH2Dit (ORCPT ); Fri, 28 Aug 2020 23:38:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbgH2DiT (ORCPT ); Fri, 28 Aug 2020 23:38:19 -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 E19DBC061237 for ; Fri, 28 Aug 2020 20:38:14 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id q9so877764wmj.2 for ; Fri, 28 Aug 2020 20:38: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=ECKlC4vLs4zIz+kTN0kAbndn3GkZ3/BNt24XyoyX1hY=; b=MWweZxH5QAlm1G+GpzRhGqLNbmtshK4QotzqtYaGmRdy7Xn3WQ44Bexs5Z/o7bLGxb nZMughlCJanGGaw1hVBCodrl2MaZgIyI24w1We2s2TpeLZQSsIB7xN94d5GnP1bl1gYO jl3wA9iDPW0VTO508EVGCIoLg//JnexjLS41XngXe3rhl8s8+t2OfpsNI90HlnxdBzW2 JCTesGjcwJAiF9vExbDcG2UfmpbD1cln4ZDRdUEvJ8+4xZVRV2ZJrDrFc13deyRE6yf5 CIKL5niYEiboptRur55NqmHvYMRd6jAgcI8OtITKQGuTNkhJWUIaoIIOt/xmYcwffl4F 7hLA== 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=ECKlC4vLs4zIz+kTN0kAbndn3GkZ3/BNt24XyoyX1hY=; b=c7o61DBCyflQhjTNhm++F49io74W4Zdj+4VICmNJ+nj26SXxPuY6D9CujwH6BHbxNN rr1P3B3elvv//2N4FCQdV6K6DKnVlfe4a+rBPuxzFqH4lth8XIsbB7JANzs10WEfqoXC zT5dC3nUw+470m8l89iMF5H1/pGJ2jJFywoXqW1dtTK13pzjpYfbnwkEv2hZHP6vG+Id PgpUbXspRhyGPlZ4Yz/FGCCQNjXiKTCt+RJRsPSk1b/kw7M+OmjNePnTCeyHyYdmEJJD g5mw7ojvR2OXX9T68OnEaGpFp2/zhDReoXeXBM9VXOHPbe+NA3AhfYj/aGngFMPllX7t N/RA== X-Gm-Message-State: AOAM531SI5Y3CTXCnuA6kJOMWfOhdtUMyoGCF18vDauOcyBGdoTt9f1V i7FI+1zDcfeTCQVh4wTv2moi8A== X-Google-Smtp-Source: ABdhPJzh0zO7KE8MQqjKnJjo0mZUF62AaHw3QtLKL/oKz9o7Xg660/8KUzI701TMb2P+PjSmQEV21Q== X-Received: by 2002:a05:600c:284:: with SMTP id 4mr1505635wmk.48.1598672293409; Fri, 28 Aug 2020 20:38:13 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id v29sm1827545wrv.51.2020.08.28.20.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:12 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v2 10/10] wcn36xx: Set feature DOT11AC for wcn3680 Date: Sat, 29 Aug 2020 04:38:46 +0100 Message-Id: <20200829033846.2167619-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033846.2167619-1-bryan.odonoghue@linaro.org> References: <20200829033846.2167619-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 9490b1bf4e05..4c30036e2e56 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -2084,6 +2084,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);