From patchwork Sat Aug 29 03:39:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 248691 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602732ilg; Fri, 28 Aug 2020 20:38:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDk8ccAFYPycTLAJ7TCxPYOAmMtuEqBVwEZFOt+rJfrzl1QTLn31dcLEXrDtBkUYxZr1zy X-Received: by 2002:a02:c506:: with SMTP id s6mr3948314jam.104.1598672337129; Fri, 28 Aug 2020 20:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672337; cv=none; d=google.com; s=arc-20160816; b=F3im+fP/Hqiw6o9MFBLrvs+IAJfCk8yI55P7JF9BbQJiu7fRYgmF+b4OGLYxooAra/ ifzV7teV9PENv/35iK3Bec/3fxIFAN0uV17eUaKjX9hEJtyuN0/qDQ8oFomr7r2WN47W LLrNFEymwoOwQKZ+HdQtPGQUTE8RM6JqyIuYY036b94h4wscVw4Aet/9xPKZYFoAo0Fb lGzLOX4m+QMNsEd+0E09e93vJwMe5x1CNOZNK2ipVkjaFNzDsS3NZy2wqMYdsrBwvEqB 1WWINj0AfDp0Xy6lpmwBCRQwUQgBhao003ISBnM3QPWIN5H1iKC3Qnh29Ym0QV0PIxec Yczw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dkim-signature; bh=TW0lR3Gz0rg6QRVunIS3OD3WHuhQ+hK8oLoWpF2c7jo=; b=vpbKdV8JXVyFPV7urNesVV5yfQfneOA05iuauZdClAW6a9nBhnFjDAmlGGl35hcJwO lPg5eXC0/aAp+bMmFocIyBq0yvVcFj/dFbF6Vpbxbl+Ug4x32JavvPcfWZjLXrcexErB c9kcrzI0ppSCQL2OjKQ0tLgJz9h2e5n48L8cYR0Dq6pjucceQAxEGwU6XpHeV081lYyD LvJPf4xDwwX8ydGEwsryuTGk3W4sbH9Bqwa3Q+9+meCZLQQ7hkphgH/SCJzUfpmRkCJV iszVbn1nzj3wbuu02jidFVpw4n+GYMPNaGfnx7LP37RMOsV+HchR/CZ4fC1Rx6DFed1b 92Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=AmwPP7gb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=lCBCF76d; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from merlin.infradead.org (merlin.infradead.org. [2001:8b0:10b:1231::1]) by mx.google.com with ESMTPS id y7si802111jan.0.2020.08.28.20.38.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=AmwPP7gb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=lCBCF76d; spf=pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) smtp.mailfrom="wcn36xx-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TW0lR3Gz0rg6QRVunIS3OD3WHuhQ+hK8oLoWpF2c7jo=; b=AmwPP7gbj6StyrNLTkDdz7Ey0 qXSJBFw+UMN6d3dNyUBAY9Ed2tPXwnNOWpLywF7VLFx50KyfgVJtioEdHEBKgpjo/Vs/0Ph4Mnz1g JJiar00Y3gGfEIw3oXiYGvh4PqpzfyZUzlwT1DBwVQ8UYO8NOEFqALDIZyhf+F5Qle0gZr/pcwBHs Yud6OWGU5azZP3a3iNBAjt6WLDUrlHcr4HKJ1eAUpYYuI3s6l3HIOmZEKcqmdDevduBttv9rUBOHr qIrGH4ekwrbHBpp4Awdd9bgpEwrrX702cki0xLI7j7vEYzbb1qICXmNDdNdseMVTeKv6Yq4vKURkk 5YZNSIOeQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhd-0002Vp-Je; Sat, 29 Aug 2020 03:38:53 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrha-0002Tj-LL for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:51 +0000 Received: by mail-wr1-x444.google.com with SMTP id c15so852072wrs.11 for ; Fri, 28 Aug 2020 20:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M2t9wZ7+9qiNghmksV/vhHyIEUoeWUrUP3bGc+D3Uw4=; b=lCBCF76dwsRAIsqL0TJgF+cjGH+CzUKtgIYxBFPae2LEaQiRL9OgFZ9+0X0zTSUD0V jUzD6SinouKLEyraTcjS37azGiP52weN8/RTh+FZ96gShZA1FhhHM6FBu8KOE8Sz6sJN JtgC40S646TBQws5jUFz3mxvsAI+A8PH17z8pWOjeo6uTRrpnHQw/34eVD4ylkexExSh /kjqfnqzmgVn1T2kt91LB56ThoAHpG0t8uWzthd5txtc8kD/PoqLtWU22V/EFTtQF1Y2 fcHxNTRysMN8aTAWgzOLEep3a3xwgDx6i2+2vzEa9c6PMKjI0FWxrSSzV7B3g8GTJBJm 5MTA== 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=M2t9wZ7+9qiNghmksV/vhHyIEUoeWUrUP3bGc+D3Uw4=; b=OkLUmEe5bxeAGjg9H9PaksbS9hHzq98dfQi07tFd1rpQfhJ0crcr1qVYx3rdMwGjaf ETFQORchqhRF/THBnIGlNXZPwZfrQhI+lIvsVz8gIXVxQi7jHMPIfOAgk+TITXhigAAB tBXseS+Fd12Rxas3G9B2r8JWy49kofx1K7WW2hu+9ziQ8OFLBP92kHHhxgdPpDlKrERT 5MQwPvcu37OeBNd3Qm8miZ+yaN9mALu2NaGRL11AFIUxIq2qkvy3mNoV8VhMpQGPUcqk FGDHL+o7/+6fFrFFX8c/I2Oy8okRqup+9Hztb8H7g0vBL9H00kuLpbfaYvi36vaK4RBx rZtg== X-Gm-Message-State: AOAM532psOX3Jr+HGypEFskBzdNS8BknUEpzkeNg27CVv91b5PPLObO+ EXaRm4VFdIgL0NqrCZpHW8po9Q== X-Received: by 2002:adf:f507:: with SMTP id q7mr1710067wro.343.1598672329743; Fri, 28 Aug 2020 20:38:49 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id s20sm1691700wmh.21.2020.08.28.20.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:48 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 5/7] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Date: Sat, 29 Aug 2020 04:39:27 +0100 Message-Id: <20200829033929.2167761-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200829033929.2167761-1-bryan.odonoghue@linaro.org> References: <20200829033929.2167761-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_233850_794087_902EACD9 X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: wcn36xx@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.org Sender: "wcn36xx" Errors-To: wcn36xx-bounces+patch=linaro.org@lists.infradead.org This patch updates wcn36xx_smd_config_bss_v1() to update on internally derived parameters only, specifically making use of STA v1 wrapper routines previously added. Once done we no longer need to pass a struct wcn36xx_hal_config_bss_req_msg which gives us options in later patches to eliminate the kzalloc() in wcn36xx_smd_config_bss entirely. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 116 +++++++++++++------------ 1 file changed, 60 insertions(+), 56 deletions(-) -- 2.27.0 _______________________________________________ wcn36xx mailing list wcn36xx@lists.infradead.org http://lists.infradead.org/mailman/listinfo/wcn36xx diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 87fee9c1b981..360348456070 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1483,11 +1483,13 @@ static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn, vif_priv->bss_type = bss->bss_type; } -static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, - const struct wcn36xx_hal_config_bss_req_msg *orig) +int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, struct ieee80211_vif *vif, + struct ieee80211_sta *sta_80211, const u8 *bssid, + bool update) { struct wcn36xx_hal_config_bss_req_msg_v1 *msg_body; struct wcn36xx_hal_config_bss_params_v1 *bss; + struct wcn36xx_hal_config_bss_params bss_v0; struct wcn36xx_hal_config_sta_params_v1 *sta; int ret; @@ -1505,72 +1507,74 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, bss = &msg_body->bss_params; sta = &bss->sta; + memset(&bss_v0, 0x00, sizeof(bss_v0)); + wcn36xx_smd_set_bss_params(wcn, vif, sta_80211, bssid, update, &bss_v0); + wcn36xx_smd_set_sta_params_v1(wcn, vif, sta_80211, sta); + /* convert orig to v1 */ - memcpy(bss->bssid, &orig->bss_params.bssid, ETH_ALEN); - memcpy(bss->self_mac_addr, &orig->bss_params.self_mac_addr, ETH_ALEN); + memcpy(bss->bssid, &bss_v0.bssid, ETH_ALEN); + memcpy(bss->self_mac_addr, &bss_v0.self_mac_addr, ETH_ALEN); - bss->bss_type = orig->bss_params.bss_type; - bss->oper_mode = orig->bss_params.oper_mode; - bss->nw_type = orig->bss_params.nw_type; + bss->bss_type = bss_v0.bss_type; + bss->oper_mode = bss_v0.oper_mode; + bss->nw_type = bss_v0.nw_type; bss->short_slot_time_supported = - orig->bss_params.short_slot_time_supported; - bss->lla_coexist = orig->bss_params.lla_coexist; - bss->llb_coexist = orig->bss_params.llb_coexist; - bss->llg_coexist = orig->bss_params.llg_coexist; - bss->ht20_coexist = orig->bss_params.ht20_coexist; - bss->lln_non_gf_coexist = orig->bss_params.lln_non_gf_coexist; + bss_v0.short_slot_time_supported; + bss->lla_coexist = bss_v0.lla_coexist; + bss->llb_coexist = bss_v0.llb_coexist; + bss->llg_coexist = bss_v0.llg_coexist; + bss->ht20_coexist = bss_v0.ht20_coexist; + bss->lln_non_gf_coexist = bss_v0.lln_non_gf_coexist; bss->lsig_tx_op_protection_full_support = - orig->bss_params.lsig_tx_op_protection_full_support; - bss->rifs_mode = orig->bss_params.rifs_mode; - bss->beacon_interval = orig->bss_params.beacon_interval; - bss->dtim_period = orig->bss_params.dtim_period; - bss->tx_channel_width_set = orig->bss_params.tx_channel_width_set; - bss->oper_channel = orig->bss_params.oper_channel; - bss->ext_channel = orig->bss_params.ext_channel; - - bss->reserved = orig->bss_params.reserved; - - memcpy(&bss->ssid, &orig->bss_params.ssid, - sizeof(orig->bss_params.ssid)); - - bss->action = orig->bss_params.action; - bss->rateset = orig->bss_params.rateset; - bss->ht = orig->bss_params.ht; - bss->obss_prot_enabled = orig->bss_params.obss_prot_enabled; - bss->rmf = orig->bss_params.rmf; - bss->ht_oper_mode = orig->bss_params.ht_oper_mode; - bss->dual_cts_protection = orig->bss_params.dual_cts_protection; + bss_v0.lsig_tx_op_protection_full_support; + bss->rifs_mode = bss_v0.rifs_mode; + bss->beacon_interval = bss_v0.beacon_interval; + bss->dtim_period = bss_v0.dtim_period; + bss->tx_channel_width_set = bss_v0.tx_channel_width_set; + bss->oper_channel = bss_v0.oper_channel; + bss->ext_channel = bss_v0.ext_channel; + + bss->reserved = bss_v0.reserved; + + memcpy(&bss->ssid, &bss_v0.ssid, + sizeof(bss_v0.ssid)); + + bss->action = bss_v0.action; + bss->rateset = bss_v0.rateset; + bss->ht = bss_v0.ht; + bss->obss_prot_enabled = bss_v0.obss_prot_enabled; + bss->rmf = bss_v0.rmf; + bss->ht_oper_mode = bss_v0.ht_oper_mode; + bss->dual_cts_protection = bss_v0.dual_cts_protection; bss->max_probe_resp_retry_limit = - orig->bss_params.max_probe_resp_retry_limit; - bss->hidden_ssid = orig->bss_params.hidden_ssid; - bss->proxy_probe_resp = orig->bss_params.proxy_probe_resp; - bss->edca_params_valid = orig->bss_params.edca_params_valid; - - memcpy(&bss->acbe, &orig->bss_params.acbe, - sizeof(orig->bss_params.acbe)); - memcpy(&bss->acbk, &orig->bss_params.acbk, - sizeof(orig->bss_params.acbk)); - memcpy(&bss->acvi, &orig->bss_params.acvi, - sizeof(orig->bss_params.acvi)); - memcpy(&bss->acvo, &orig->bss_params.acvo, - sizeof(orig->bss_params.acvo)); + bss_v0.max_probe_resp_retry_limit; + bss->hidden_ssid = bss_v0.hidden_ssid; + bss->proxy_probe_resp = bss_v0.proxy_probe_resp; + bss->edca_params_valid = bss_v0.edca_params_valid; + + memcpy(&bss->acbe, &bss_v0.acbe, + sizeof(bss_v0.acbe)); + memcpy(&bss->acbk, &bss_v0.acbk, + sizeof(bss_v0.acbk)); + memcpy(&bss->acvi, &bss_v0.acvi, + sizeof(bss_v0.acvi)); + memcpy(&bss->acvo, &bss_v0.acvo, + sizeof(bss_v0.acvo)); bss->ext_set_sta_key_param_valid = - orig->bss_params.ext_set_sta_key_param_valid; + bss_v0.ext_set_sta_key_param_valid; memcpy(&bss->ext_set_sta_key_param, - &orig->bss_params.ext_set_sta_key_param, - sizeof(orig->bss_params.acvo)); - - bss->wcn36xx_hal_persona = orig->bss_params.wcn36xx_hal_persona; - bss->spectrum_mgt_enable = orig->bss_params.spectrum_mgt_enable; - bss->tx_mgmt_power = orig->bss_params.tx_mgmt_power; - bss->max_tx_power = orig->bss_params.max_tx_power; + &bss_v0.ext_set_sta_key_param, + sizeof(bss_v0.acvo)); - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->bss_params.sta, sta); + bss->wcn36xx_hal_persona = bss_v0.wcn36xx_hal_persona; + bss->spectrum_mgt_enable = bss_v0.spectrum_mgt_enable; + bss->tx_mgmt_power = bss_v0.tx_mgmt_power; + bss->max_tx_power = bss_v0.max_tx_power; PREPARE_HAL_BUF(wcn->hal_buf, (*msg_body)); @@ -1711,7 +1715,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, sta_params->mac); if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { - ret = wcn36xx_smd_config_bss_v1(wcn, msg); + ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); } else { PREPARE_HAL_BUF(wcn->hal_buf, (*msg));