From patchwork Thu Sep 10 15:04:49 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: 11768987 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 CC01F618 for ; Thu, 10 Sep 2020 19:47:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABF2721D91 for ; Thu, 10 Sep 2020 19:47:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="inDBJR68" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727081AbgIJTrn (ORCPT ); Thu, 10 Sep 2020 15:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731238AbgIJPEb (ORCPT ); Thu, 10 Sep 2020 11:04:31 -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 91114C0617A5 for ; Thu, 10 Sep 2020 08:04:09 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id s13so360846wmh.4 for ; Thu, 10 Sep 2020 08:04: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=RqOhclRRIqI97WuGHZsdvXxzhC2mxsIcVlTbaDy3Bdg=; b=inDBJR68WYJdwpPmY616QNwaCxGJEHgdaL3t93f7/bywUN6ytLC2hWLHssLIhl6GPb uCm9JZi9LYz4y2rzkRo/E14Al60Du8sJcgYo/FqT9BW4qPvD6TdHm2Hzinb/0gsKfry5 EiKo6pQhmwX1Zyy4pSbSt9A3SZShluCBIU/bOqOb4Ns3tbE+yzjQCgNaBFgtfpv6OsQ6 VIX21FYZENu/5ZEI6IfIFrfjhB3xnWmTqmo5x090VvnTnNnsL0HhR/IImt3L0OUt8lzK 76pVADwhhyG8s9j2f1s9cpjVkZLB6BEMHbPkFyEVpW6VSQHVlJ3SOOYUGs4s5sY3n//L 32Ag== 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=RqOhclRRIqI97WuGHZsdvXxzhC2mxsIcVlTbaDy3Bdg=; b=uPh5VMrUSbhpW+eQMdHKHOdum8qMe6rLgUKpdPIViN1Imsn2YC8+xViSUAKBpXK9oM X3LnZWtn8x7INAEHhrpm2Xqmhl8dH8iHIWdjdyH9px3kyfm3afIQGEF4OZwihQts8y1F 37+39JhhQeAf3vx6klD9L4MEhMwcPGU0Qv9N0ycuCswo4AByYnaaX9qti7tVO/EVHlWy 4/rTCI/sDOl4qzRkKZBxkQD0Cb8Z7IEfeWqYnlgkRRtLZ923lv1iovyT+SSXB0h1XUse e8S1jF1UVQ9Mt6X3Ul8PPFucXutJoNamwR0jzS1sXekTBI46YoCLHfPRjzZQ4sRbBMVo aTjw== X-Gm-Message-State: AOAM530CVhOU+9zngF6LMOGm9/HUBW7w6sIm/EtaGwKOLcnL/Q6buEBp AEXkQigqsn7uzK6VkhdX1Hqpig== X-Google-Smtp-Source: ABdhPJxrfhnvzMBaSkWIVB/WHZwXEHknQ1rkHe0mm9DLoxoR1otzptZ5aopkd/DfBKJIWgV4C4oA/Q== X-Received: by 2002:a1c:f612:: with SMTP id w18mr405111wmc.47.1599750248298; Thu, 10 Sep 2020 08:04:08 -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 q186sm4075754wma.45.2020.09.10.08.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:04: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 v5 1/2] wcn36xx: Add VHT fields to parameter data structures Date: Thu, 10 Sep 2020 16:04:49 +0100 Message-Id: <20200910150450.2178784-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150450.2178784-1-bryan.odonoghue@linaro.org> References: <20200910150450.2178784-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In order to pass VHT parameters to wcn3680 we need to use a super-set of the V1 data-structures with additional VHT parameters tacked on. This patch adds the additional fields to the STA and BSS parameter structures. Since neither wcn3620 nor wcn3660 support VHT the size of the passed message is fixed to the previous message length. Subsequent changes will differentiate between wcn3620/wcn3660 and wcn3680 which does use the larger message size. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/hal.h | 14 +++++++++++++- drivers/net/wireless/ath/wcn36xx/smd.c | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 573799274a02..3cceeaf0136f 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -1592,9 +1592,15 @@ struct wcn36xx_hal_config_sta_params_v1 { u8 reserved:4; /* These rates are the intersection of peer and self capabilities. */ - struct wcn36xx_hal_supported_rates supported_rates; + struct wcn36xx_hal_supported_rates_v1 supported_rates; + + u8 vht_capable; + u8 vht_tx_channel_width_set; + } __packed; +#define WCN36XX_DIFF_STA_PARAMS_V1_NOVHT 10 + struct wcn36xx_hal_config_sta_req_msg_v1 { struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_config_sta_params_v1 sta_params; @@ -2015,8 +2021,14 @@ struct wcn36xx_hal_config_bss_params_v1 { * "STA context" */ struct wcn36xx_hal_config_sta_params_v1 sta; + + u8 vht_capable; + u8 vht_tx_channel_width_set; + } __packed; +#define WCN36XX_DIFF_BSS_PARAMS_V1_NOVHT (WCN36XX_DIFF_STA_PARAMS_V1_NOVHT + 2) + struct wcn36xx_hal_config_bss_req_msg_v1 { struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_config_bss_params_v1 bss_params; diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 4c30036e2e56..55aaaeb78b14 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1223,6 +1223,7 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, struct wcn36xx_hal_config_sta_params_v1 *sta = &msg_body.sta_params; INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); + msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, &msg_body.sta_params); @@ -1294,6 +1295,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, return -ENOMEM; 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:04:50 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: 11768991 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 1595B59D for ; Thu, 10 Sep 2020 19:48:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBFBC21D91 for ; Thu, 10 Sep 2020 19:48:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vSDGDst8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726662AbgIJTrj (ORCPT ); Thu, 10 Sep 2020 15:47:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731240AbgIJPEu (ORCPT ); Thu, 10 Sep 2020 11:04:50 -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 DED95C0617AA for ; Thu, 10 Sep 2020 08:04:10 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id z9so380104wmk.1 for ; Thu, 10 Sep 2020 08:04: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=tfNF9Nm72/GLHvVDln+H8GXexy5WDv58YkhHrtQxFnI=; b=vSDGDst8DcY4fX3LcPTgzEiZyU07n0y66ZY8g3HrAnCmDBT/VdRdCCrdsFh4jhQNzT jf5hndZuiHGe0yQnWKCjYq4+wyEG8I0Fm48uvm/N1ul6WMZzBdZjDAjhUHaKD3spbmRz ZwGaE3FfejvkewLaKKjyZsdeZgiAclreWQwp/dmJwpIV6RnMWRbyH/ykDdB4IjVN0K/h Yx/AWWH5MKPirp2UqUrQH15DH4Uws9RtE3MWlChTtIiQQe1aLCL4S4qZytCYqOmNENL3 Ma0ANLF+R3bY9RToAXIR84dGSiMejKpiXsy60V9HSsFqUAIUxem37wmqGvvSeFB3pZnD 88HA== 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=tfNF9Nm72/GLHvVDln+H8GXexy5WDv58YkhHrtQxFnI=; b=STJ7nOPzSR54EADhRA90ECZ++b08u1QXlVawrEVBOjBSajc6sW2cNYbcfPwgnFbGGu 8qDZIRMvFdOeyaTEy+39PxOWR0cnAPWQFKTEU+OOqRazHvRNGvQCCQ2gQkDcPDqSnRFB rfMV6z0DaDYfc5cUjwynWyceSvN3C2ShiSnqFyusBLAOeLL0BJgMN6mfRXW5SQ47vwXc 0ZoVN+55eDEy786e6U0Y7xsPz/epANXYMVi1BBb8drsYctTJ6z8GjODtVPeHyHFqKMPc TvOmlrn7VFz2hRKhp4Q00ZMsKXtiAkjdbFZGVhTsslXYVBMdHdTwWHE5AMQ8xtpeDPdd Tzpg== X-Gm-Message-State: AOAM533Yko6brcuvPojNsox5aOzQvn9MpjbVcUZa3qBRQv8dE9sGJoat IDFeE/197yFhmThjDad0/PiaVg== X-Google-Smtp-Source: ABdhPJxBELC+xFOxC4UazE1oHhzDFO6NqcaITjlLQ1T4zFD7Mj9CLmGAA1URqDVCk+ZyuiubwT89XA== X-Received: by 2002:a1c:1f42:: with SMTP id f63mr408880wmf.1.1599750249622; Thu, 10 Sep 2020 08:04:09 -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 q186sm4075754wma.45.2020.09.10.08.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:04: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 v5 2/2] wcn36xx: Use V1 data structure to store supported rates Date: Thu, 10 Sep 2020 16:04:50 +0100 Message-Id: <20200910150450.2178784-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150450.2178784-1-bryan.odonoghue@linaro.org> References: <20200910150450.2178784-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This patch converts the internal data structure used to store data-rates from version 0 to version 1. This allows us to extend out the internal storage to represent VHT parameters. Using the extended version 1 data-structure allows us to avoid a whole raft of version 1 specific fixup functions. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 5 +++-- drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 55aaaeb78b14..d5ca9907af86 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -242,9 +242,10 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn, sta_params->aid = sta_priv->aid; wcn36xx_smd_set_sta_ht_params(sta, sta_params); memcpy(&sta_params->supported_rates, &sta_priv->supported_rates, - sizeof(sta_priv->supported_rates)); + sizeof(struct wcn36xx_hal_supported_rates)); } else { - wcn36xx_set_default_rates(&sta_params->supported_rates); + wcn36xx_set_default_rates((struct wcn36xx_hal_supported_rates *) + &sta_params->supported_rates); wcn36xx_smd_set_sta_default_ht_params(sta_params); } } diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h index 342ca0ae7e28..d7d349de20e6 100644 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h @@ -169,7 +169,7 @@ struct wcn36xx_sta { u8 bss_dpu_desc_index; bool is_data_encrypted; /* Rates */ - struct wcn36xx_hal_supported_rates supported_rates; + struct wcn36xx_hal_supported_rates_v1 supported_rates; spinlock_t ampdu_lock; /* protects next two fields */ enum wcn36xx_ampdu_state ampdu_state[16];