From patchwork Thu Sep 10 15:08: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: 11768953 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 20741618 for ; Thu, 10 Sep 2020 19:44:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0227221D81 for ; Thu, 10 Sep 2020 19:44:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YwoOafbE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbgIJToT (ORCPT ); Thu, 10 Sep 2020 15:44:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731326AbgIJPdH (ORCPT ); Thu, 10 Sep 2020 11:33:07 -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 70822C06138F for ; Thu, 10 Sep 2020 08:07:36 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id k15so7062367wrn.10 for ; Thu, 10 Sep 2020 08:07:36 -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=/ZDhnYzdyErEPvOsme5Hsukpib5rwiRrGO2nt/vf1eo=; b=YwoOafbEd0HreUrwPkh1owdlBkG4Sxa12QT7PAc8bw7GMj0lqycivp09wabvgKZlMa WrrRDnkYrmcQfp7p9TYJMWd4nTQZvgxocDhIvgkOo0CufTcO9rG2LbXajlLluBG/9z5b EQCrUKWjhNRFEWJgRDTHGxHXVYHts4lKRFqiyPAx4eiBkUqyMtq1s38cVDKPWaQLW9Zb I5aoPgPhAviYHB75ij09wFBA0eWgRTLYPVNEz8y/PayDusYU/SVjOmovv245233U834/ mC6tBvTqpXx45v9+EyWhee4LENdxEXWkksOA1e5FIyQ1I9Uk/FYHM2H4OEYx1pLb9wxZ hAfg== 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=/ZDhnYzdyErEPvOsme5Hsukpib5rwiRrGO2nt/vf1eo=; b=EwBrOu7Ny/9bC7pUWS7F31OcPyU7s7fSEsXVsls7byByt1fHAc1nJxNCalu5WvtTFy SSoLESFeEJkrm3ie232+vxSdwjqjnoKecCt5z816v/yVtuaL3nacnKa28gsIsaEUXciB QCdthnVgEzSBa9v/iPzHAek0OzMy9JyA5cLyIdEAC4va/CQiaVXrGOPG5xBP+UofmD7u aV3ZMrcCLZqOJUAZs6VOFc2MBvDMvtzEKq+thqXNcIDuao7CvH2Ia2feFSHce6Gce0nh D02Pu4sYRGHZnzK48oMGx+ntFTqIaNiskQY10FE07nnFpGNrftnoHMDvJpOM0nNBJ4+N wjHw== X-Gm-Message-State: AOAM531L6x0v8fthzrqnacdj50UR8LCQGhgBT6rhKjLPgkS8R46JpqRZ K+s+DWm3CJC8o+HFQ9KV9YcvQmD+fVDOiQ== X-Google-Smtp-Source: ABdhPJxP2lRuoQTGPV9tg7Onodogf5mDoRs0J95oFaFchPu4PD1qG/3RAoeQ17jHu7t4BsGsHuEEjw== X-Received: by 2002:adf:e802:: with SMTP id o2mr9271987wrm.309.1599750455136; Thu, 10 Sep 2020 08:07:35 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id o128sm3895678wmo.39.2020.09.10.08.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:07:34 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v5 1/4] wcn36xx: Define INIT_HAL_MSG_V1() Date: Thu, 10 Sep 2020 16:08:19 +0100 Message-Id: <20200910150822.2179261-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150822.2179261-1-bryan.odonoghue@linaro.org> References: <20200910150822.2179261-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 dde43a2b0d81..0f5952003fff 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -466,14 +466,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 Thu Sep 10 15:08: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: 11768947 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 BCB7E139F for ; Thu, 10 Sep 2020 19:44:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98BF221D81 for ; Thu, 10 Sep 2020 19:44:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T8ULLRfh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726755AbgIJTm2 (ORCPT ); Thu, 10 Sep 2020 15:42:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731329AbgIJPdi (ORCPT ); Thu, 10 Sep 2020 11:33:38 -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 5C751C061342 for ; Thu, 10 Sep 2020 08:07:37 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id a65so364009wme.5 for ; Thu, 10 Sep 2020 08:07:37 -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=47YTP3hiYkA8vkH+lzBNX2aS1DpgYw/pF0C+zzRdrmk=; b=T8ULLRfhHaaMLBkLNhFX2NT9iPeqyReXcGhPzz4nEnpuRXHkqk02HObL09XPP9CDW/ oP2tP3txY0B73E+E/JIvGXlvDH1UL9mYkAUahQEu3KNoz4adbg1F++gQiDKH6Scu4h0w PVmn2uUhroMKitN+0u1DPK9KgnVWGqdtd1jKp2LQVWHGk3wHJH54X8M3nA0Ld0bxmL2L m/JoKqGPikkdEAcvKJutj4jTLmMlRrM6uDBqbnyTBK5Jw8lT1A3aBxO4r4ityJDlAmEG O1x55g0FgqSd7UEWTlST8cFIHlY4naPchJ5uyGoOXHAITB3S1NgY5QXMBu7IbFwVTXUB Qv8Q== 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=47YTP3hiYkA8vkH+lzBNX2aS1DpgYw/pF0C+zzRdrmk=; b=szUHY+ZleZDshRFRGmXzDMWXKt7+7u+izW/px5oAiXWvQB4yo4d3Y1Mlv0vnGYhZB/ TZ9BBNaNKj60RsuLuEcVBO/pVCNVTE9FRVA05dUu66yfrL5rV1ckBuqvJY2/oKPAISLS 5K6zSJIaW/Z8HIP/nzd7FiTih0h7v0VA56R+FibxgPOpd5usQG43+yUe4X2v0F3s8RZI CiocYOLuQRuxHvNcZE+wK0By2wandVTYD7lrz63g3+AWWmZQKu9SrwqRNW6GRUArS94l u4kWS9Crmgjixdksv1j/FYYjYa2Nh0O8vCS2mT4iax4Q9F6LXFvCrWQ2mJ5pIGAZ2KiZ JjWA== X-Gm-Message-State: AOAM531tultotu8Cno3y38nOAHfUfDZ4tSFiqWpUGAobwkbRl18br4qZ qVmd3eXEy8736SQdgm2YYsdAMC6LhkMFNg== X-Google-Smtp-Source: ABdhPJyNCzuHk0s4eIaCzmj/gAHbNCUu5wEu73cFyUyCjSjPh/GJRicwFMXK7BkfNyRrWSsxf73VkA== X-Received: by 2002:a1c:9883:: with SMTP id a125mr442728wme.133.1599750456072; Thu, 10 Sep 2020 08:07:36 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id o128sm3895678wmo.39.2020.09.10.08.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:07:35 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v5 2/4] wcn36xx: Convert to VHT parameter structure on wcn3680 Date: Thu, 10 Sep 2020 16:08:20 +0100 Message-Id: <20200910150822.2179261-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150822.2179261-1-bryan.odonoghue@linaro.org> References: <20200910150822.2179261-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 size 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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 0f5952003fff..e74abc153153 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1446,8 +1446,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_params; - INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); - msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; + 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; + } sta_params = &msg_body.sta_params; @@ -1627,8 +1631,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); - msg_body->header.len -= WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT; + 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 Thu Sep 10 15:08: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: 11768077 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 AE74F59D for ; Thu, 10 Sep 2020 15:34:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E84B20BED for ; Thu, 10 Sep 2020 15:34:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Udk9i/A3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731343AbgIJPe3 (ORCPT ); Thu, 10 Sep 2020 11:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731105AbgIJPdD (ORCPT ); Thu, 10 Sep 2020 11:33:03 -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 6C32AC061343 for ; Thu, 10 Sep 2020 08:07:38 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id y15so394087wmi.0 for ; Thu, 10 Sep 2020 08:07:38 -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=2HTnn0cKnVp0OVhPjKOxy9H7Cqlzp1+vwQDeRnijNCk=; b=Udk9i/A3q4l8EyDrosQNtzW5i1Tl7gMR62Dmd1N6E/F+bH6NAhG/bTLZo6/7hbjBu7 tZrRbOI8Om1pjmZvRVsIf7QW0Hkrafu7QKJIrjAM4nniBClNnmgb0LNm2WnvQtSlyNuh lwEjeJncEjtFuo12YjDw63l2n53N402POxvBVE+m79SdOZpWh2vzlSq3GA8H9nX3o63K O/ejxXkp1ES/NFRK9QqS2Df7M/h2RBGI4jdcSvvPnTo4LBy2EeyI8AvEkw+zau5AiOIK qaDvJ+QmskmzZ5Lv523afDWfvrg1AtYnI/2ZuAXxWUk1mIM0ZylOnHEBaWzOAkAytjQb V+xw== 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=2HTnn0cKnVp0OVhPjKOxy9H7Cqlzp1+vwQDeRnijNCk=; b=lzVvuQAVFMEfnqQjFz6PExkcKKKcBJ4JOEoBu/aQ+iMMqMYpUHBNuYWT/cdoNQw2EQ mdAqyypyaLACkbiyd/I2uPY1A+HzxgvA0Yct6xxxqyWlNbeEOAtyqwjkDIHvZbcCwIra 5TzeOWCtxNhlleZvzT7MBKWfceSLyJLaAa2J2PZn+7N1HENuau9r6dsXTh80eXaDwE52 KQsvXaF8LJCgpxTGVvhRns9yTgSF0xAlY0xhB8FfYLCZXKUbTn2Lq68BhD9JPlXiDAP4 Mz1hAZb4PevJ/9FOqyX4JwVUlmRYN7bKx+hCazuFUmBHSOhYWiLdRAwlp044UeSEnfUQ OP6A== X-Gm-Message-State: AOAM531kf5wqDnPQ6cjopsTdXbbvrPRMLiD7mQbNGJEZZKYsiRJqFRdn s7xgSNaNWzRgjwHCZx0Sj/HBKg== X-Google-Smtp-Source: ABdhPJy/qhDvn7lyh6z56OikbGJesllg8a2IMHkPyjaeePHbpEOfBEeA7DblgCZEB9mgkXvNTEhV1Q== X-Received: by 2002:a1c:dec2:: with SMTP id v185mr440365wmg.1.1599750457145; Thu, 10 Sep 2020 08:07:37 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id o128sm3895678wmo.39.2020.09.10.08.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:07:36 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v5 3/4] wcn36xx: Add VHT rates to wcn36xx_update_allowed_rates() Date: Thu, 10 Sep 2020 16:08:21 +0100 Message-Id: <20200910150822.2179261-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150822.2179261-1-bryan.odonoghue@linaro.org> References: <20200910150822.2179261-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 36cfa7043bc3..720d3fa8ddcb 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 Thu Sep 10 15:08: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: 11768095 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 C7293746 for ; Thu, 10 Sep 2020 15:49:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 991A120BED for ; Thu, 10 Sep 2020 15:49:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="j+lXJDHc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728443AbgIJPtj (ORCPT ); Thu, 10 Sep 2020 11:49:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731317AbgIJPsN (ORCPT ); Thu, 10 Sep 2020 11:48:13 -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 93C22C061344 for ; Thu, 10 Sep 2020 08:07:39 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id b79so372235wmb.4 for ; Thu, 10 Sep 2020 08:07:39 -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=Rwo9ulFXffmBiUSboQ3Oj3Dcuj3Fgxbrid758yS0THY=; b=j+lXJDHcwYuWzsQJt55oO7RJWUviQm/csrE/GGlCgz0iVjB2Pc9M5AegwHyVEtzbrS YOg8tnqBK5NvjYPhESZ44xSxniIan0taVSJEDNuzxs+f4G8pcxBD3KlcnXWMLdn7H2/i Emj26zznQrDrmvaVLRndoiWxTZzFGfSIqIhgIbYLkEsVxl2ETuIaDfyImRv/Mal2lkbG 2kEsym85WL+MNI3TXCmw2jB4KmS6i1GZZomoDBmiaHUPe2dRmchWVdRY7/k0EW/gU4lh P8EwRwSDALqyPwDbz0qwdGzDpsLC9ggD66t2nsJI+9gcTm8t4pkb8WFHYWOt2zaJVUVi /g2Q== 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=Rwo9ulFXffmBiUSboQ3Oj3Dcuj3Fgxbrid758yS0THY=; b=SIYSDny85sIhx38yD2XdigbP+xR/VKBrqJwESGyfMCX3UjS+tIyOANxLoRmiClaXxX lgxQpUIsIpbhany4BTYJAwKjQOnOa5EkO0Ze+kPKz0Tk/uSrDlEycYxT3JCCOO+TPVlB GPrKysBxKYeOb9vIjRkEgGd/nqhgGQDW2jpCUNj/XTLAXq/QTTVfKEQrfS65hO3m1uo4 ulTQbdngfMm6RlCBYAf12s0PLjD08QyXnc/HQHw9z3FuDTDMoIFiElalO8ptLYRuY7z9 OLl8RHyt96dzcDzh2xgLqG08N6T1WASipMEgqqrWJKcj6n3DbznhKdFotAdT4Doyjuo1 9fBA== X-Gm-Message-State: AOAM533Rsu60006bVOxr0Mgoasa2T2VJ+5FRjwhCozWLTzYAa8TXOtNC Qkr0K2D1xoz0sHf6UqMSFpROyQ== X-Google-Smtp-Source: ABdhPJyQ1Aw636dO1BThgeTra2S+9tnsljogGddMa93qvNWXUlfWRYNbViXWT9Y8rcg3cPl8bSFiRQ== X-Received: by 2002:a1c:2ed0:: with SMTP id u199mr405417wmu.125.1599750458078; Thu, 10 Sep 2020 08:07:38 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id o128sm3895678wmo.39.2020.09.10.08.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:07:37 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Subject: [PATCH v5 4/4] wcn36xx: Advertise ieee802.11 VHT flags Date: Thu, 10 Sep 2020 16:08:22 +0100 Message-Id: <20200910150822.2179261-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150822.2179261-1-bryan.odonoghue@linaro.org> References: <20200910150822.2179261-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. 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 720d3fa8ddcb..43596b919ed7 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[] = { @@ -1226,6 +1255,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;