From patchwork Tue Sep 8 18:25: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: 11763865 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 70C3E138E for ; Tue, 8 Sep 2020 18:34:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 561E62087C for ; Tue, 8 Sep 2020 18:34:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nexus-software-ie.20150623.gappssmtp.com header.i=@nexus-software-ie.20150623.gappssmtp.com header.b="WZCyRBI7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731737AbgIHSeu (ORCPT ); Tue, 8 Sep 2020 14:34:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731857AbgIHScq (ORCPT ); Tue, 8 Sep 2020 14:32:46 -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 A27AAC061388 for ; Tue, 8 Sep 2020 11:24:57 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id e16so243468wrm.2 for ; Tue, 08 Sep 2020 11:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BTCWkwRmuH8PVjJv41u3EUB522Tf7wb2bKFIwOAThY0=; b=WZCyRBI7k1r6YEf9qStznnaywdXgAeKWhpKgffvuEoBG0GSc1U0uZdbVzMfCpNVcId 48SPYOBKez9GDaT0aNWm08ir1ANaXe64vIS5HRTlkE4GJLuIBqaS6+RSnB66Wj/bwJ02 FRqo7Ste9VqBaAQZMWnoJlplzq/5jNz17wyiMAJt8cpcCV+XyKC0KfIYEqCUI0lUR1Md Fiy9LPeKOs7o6WCm+ESSbXKBuFAzV8Zi/w187SrFZeKE49L8RKY/F8NwFtEkQrLtr4Qz Wlq3rLPQgPvlH+siI3C6TMaudFgQHgfH7QOXUQrR4n6xxdHL3x9jmf2trYTK+KQ6X5MH oQgA== 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=BTCWkwRmuH8PVjJv41u3EUB522Tf7wb2bKFIwOAThY0=; b=o3fYPEmpD9As0EuAZVSBz2h8cmWPWZy9hj23Vd0gEsX6WAMHnTDkR9OiW3zue0Sh+g LVcP1zhy2I27PWhMPteZ3nc7BP/nJJk2DwsRDqPJ+3KITxXLDGtoaxmsRb7KNf7Y0h3Q Pn3hvFkzRWD1k8DucB2mnIwoUS6D87QXN+A9nO9wNMV7/D0AUdTpSnnqetqoPFM3OcCc 3kux5La+RnGtLfmr+PtzMZpCBedsm6LB37ofjHjjTrV86DEEymcij6N2hZe25KKct1m8 8Ctpvs7DpqfrnHJo8tfCDe3n6GLdMy3WmiDk5+b2hF8+V+N2YHYzMo0Cb05H4iYIHOGX W/UQ== X-Gm-Message-State: AOAM531CHvdu82dpsgg2gOJAlmp6gYT5/74e1MjQu6cTei3sJ8N+8e9K yx78DFpWrssiDRYCGmuv9UlSaQ== X-Google-Smtp-Source: ABdhPJyNVA8R2MA5tIdh1MRyXgm+n4f/aH9hb2Ea2DAg01muSJHUjrjljRlB829dD58e/1OLlIQmYQ== X-Received: by 2002:adf:f190:: with SMTP id h16mr942210wro.202.1599589496380; Tue, 08 Sep 2020 11:24:56 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id c4sm334348wrp.85.2020.09.08.11.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:55 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v3 1/2] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Date: Tue, 8 Sep 2020 19:25:41 +0100 Message-Id: <20200908182542.2870535-2-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182542.2870535-1-pure.logic@nexus-software.ie> References: <20200908182542.2870535-1-pure.logic@nexus-software.ie> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Bryan O'Donoghue 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 2c2b6178c8cd..9c283c110e07 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -766,6 +766,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 Tue Sep 8 18:25: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: 11763915 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 594EB59D for ; Tue, 8 Sep 2020 18:37:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B43F2080C for ; Tue, 8 Sep 2020 18:37:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nexus-software-ie.20150623.gappssmtp.com header.i=@nexus-software-ie.20150623.gappssmtp.com header.b="BmeQlZuu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731531AbgIHSgt (ORCPT ); Tue, 8 Sep 2020 14:36:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731778AbgIHScq (ORCPT ); Tue, 8 Sep 2020 14:32:46 -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 7F202C061389 for ; Tue, 8 Sep 2020 11:24:58 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id a9so311856wmm.2 for ; Tue, 08 Sep 2020 11:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b80YWigxhp2Bij0sjpEU6Mw77SxZ6jTq1LZAsmGVkXg=; b=BmeQlZuuR6UaVzlxK9RT6pnJ5Idmtcj5x+/TTHzd2kQkxaijREoOfMKq+JT5/2qDtC GiGjo0+ndlCRSLR2kVLm3l8DiTAuvUe9bXmAnzTXldNc1nirOwCBhtpt80pmQy6T4DTG 1nw4UJ33xdrxsNYFqOxsT5ACeyRlN6F8HPxHL9YetcHJrXlxJmaf2zNvrcdiuGl2AEEQ G1ZQAfSI3EItDujzlkWmbWgcLprFdduih1uBVaM6DhJ2Qs8AQjF2MTvV3YP7qSLSUzUH etov4Ha2YxpTLbq1AutdxDUDpngNegUcxgcDtm8VsXkz46dRUgaSwhaqxVAzTaDGR1RH aj7Q== 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=b80YWigxhp2Bij0sjpEU6Mw77SxZ6jTq1LZAsmGVkXg=; b=gT4ThsNsHtkX0Nof5V6F+RpR7lKsFjujeSYL2s3J/huLueRY2juYYVSSHa8t4BMrdF x8pRli/5k3qeVjLyuNus3fOGDF0P6bhiB8bPBYYayODrAZMz7LCG4PafrjkvoH4So0BC EpjMfWqj4tr+ekJgUrK0uw+0rLw63OJQuGv0/QbhwOipdICPKEfWbdfCDVsxhmrQ3D0w a8Ons8j9/Nay5YeVthvRnYpxdfl9amHpgdzToHCHo8QYd5YoF2J8w27lT4EYEZ8XIwqo pTnVhAwwEt/Ozl9TcStr1ffAEjPqJzHa5/KvzJ4RsCvDcE8Ui+9wNmuSslF9gKI6YQHJ D3LQ== X-Gm-Message-State: AOAM533ox/o3BUC7FQYYkEEXG4ASyyWYOT4MzUFaJXsinTiCI5sYG97m CLGbfusAh5SKSK36pw8JtAqyvw== X-Google-Smtp-Source: ABdhPJxwR917BxM4zjf/LNaZZTXnoZeZoCN6MJ6fIzVfHtO8MEO0QSSFdhAdyd0NPIiZUMu+rBhPFg== X-Received: by 2002:a05:600c:2246:: with SMTP id a6mr436231wmm.38.1599589497240; Tue, 08 Sep 2020 11:24:57 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id c4sm334348wrp.85.2020.09.08.11.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:56 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v3 2/2] wcn36xx: Advertise ieee802.11 VHT flags Date: Tue, 8 Sep 2020 19:25:42 +0100 Message-Id: <20200908182542.2870535-3-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182542.2870535-1-pure.logic@nexus-software.ie> References: <20200908182542.2870535-1-pure.logic@nexus-software.ie> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Bryan O'Donoghue 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. After this patch is applied an AP should see the wcn3680 as an 802.11ac capable device. 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 9c283c110e07..9e97513feeb5 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1200,6 +1200,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[] = { @@ -1228,6 +1257,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;