From patchwork Sat Aug 29 03:39:23 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: 248688 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602671ilg; Fri, 28 Aug 2020 20:38:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz39wW9XjrbFf5uBxorLkIe9MdyL4PXE64nr9dilAvtYaguvdhcmwBznzTjoRPFkryOnBJp X-Received: by 2002:a05:6638:16ca:: with SMTP id g10mr3890702jat.66.1598672331341; Fri, 28 Aug 2020 20:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672331; cv=none; d=google.com; s=arc-20160816; b=0MWKixGlMhvXeEUqojD7EFRZIrdwX0vCeE2CuorWiD9V/jBg3ET9evqthzzchEFiuF Tyx0K/Spwdmo4+URX7XrHrW7zw0FiIEdJtwbHGSY56nAs+oV6hvvu1RgImNPWgjBR++P hkEsEjyyZuO9njeeC7rQo5jQ13HQxkSJJ2ootuYBHZ3FOxyYmq/4F+GZPh4N1BJ/8b3X rctlDy8FUDeL6JbyfseLXTGzDxZlkI8pS09LO0azAqDGl9C2DxvlZ6pVb1vFJxAY7KCi rd3l3o7NP3ClRFgDLAe79eh5KyvK5fqsZHzo1dJPF71ADOPYvzjOzO53oIqIjxmHUjHp NiHQ== 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=OMlK4OLwfuucpyrc9Kv/gp3IK62O9SZmEWo6H1VvHbA=; b=ltxltDEOpMAu2uftfNZM4krSzAi4SKDpzOGzgtdsfA9ODMwekXmASqFAV+HLMHqn5l d7nSi4GRhk1Jm7MYq73nb0d2muio/7ZEYFgLeC7ldqR5h9SKiM/SSbQhIxp5/5O0N8na RDP1xaa+Rmj1NuN1V8wpCzXb3o+WLhOQOUJDSWb2Ttk+nps/foRjdEN/AN1elgpJ7WwB Wb0KyLXmfRloM5Bh44vg7LcAM6q0yoXAmUSogerinUW9+1dD7SfGoagK+hF819uZ5+Fp 5mmxF84M3pMOgF35XjW9ZW8smw7/z9afnJFdSGa1FbgjwL8Ks1xLD2ut0ifA3tG/KVTO XAHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=xideKgK+; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gJDeuboG; 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 p15si1124188ilm.60.2020.08.28.20.38.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:51 -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=xideKgK+; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gJDeuboG; 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=OMlK4OLwfuucpyrc9Kv/gp3IK62O9SZmEWo6H1VvHbA=; b=xideKgK+uM8dpbLIRLMCJKm2L YwokXzn+3Mlpxxr0GAJ+/2SJirltLaumktITqrHLw1KzihO+9mSHFbv77jO0Zp3l0pSqz93SfZaRj cSSciQNVyTy1h2JyksflnGEYwWSeuzu60CxvTJJ4O9Gvi3X5lgGOQ8R8CpKEjvEYEt76YJqdhuqsx NWNyzqyMQwnG8Y73HIOpE1dPP9ef6h8GJvQHgqJeMXFKaF+8+qHbjwfFkJN2R2fjtEO+LfYil8SaL wRvNtYg5ijiwbW88eQ6oXRO2rFQ0lGFg5NDDvx4qTuvri900qlnQXWKgTxX62i4d5pNkCkIRjmRDV haJ3qwjjQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhX-0002SN-GN; Sat, 29 Aug 2020 03:38:47 +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 1kBrhV-0002Qv-8R for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:46 +0000 Received: by mail-wr1-x444.google.com with SMTP id o4so906250wrn.0 for ; Fri, 28 Aug 2020 20:38:45 -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=kmGkmjV/m2zZGU727AEDIK8F57fQ739jwqBKaTJaAC4=; b=gJDeuboGw9uYXGSPAmw2jBgLbsJEgvXTdsY+C0hlTCtU+g1knpbpQz2T8RVBWtSMCK e3uI6jWp9A78ZHUnzMShDR7QoObOAtEKYfFT4Y/+2ApCKS00czoAgcWIiGsum4RJu+Pj 4/UmxZYCaJp6cYcN3/Acw0j0poAO7MzlOgynRdwkvRbiRce5jiPY/NdfIrEJDli09n8F cLW4aq9Hlvu4Roq8WZTnWPs43A48QZ2f7ZBml9O2xu9Elq0fgpHaU0tzLfM3Xx/Owpzn Te+eL7VdDbTh+HFo4+A8UHNOCsrqtWEYH4blrc/5xTybYLVMVQdTbkN0DZcjKMVMx5ry 5vgA== 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=kmGkmjV/m2zZGU727AEDIK8F57fQ739jwqBKaTJaAC4=; b=Jl1PkgRvf3PeDi9aXMt8kjwxWTt1Blma8yaWbilnwc4JWzZPikyhrYm8riyuWkrdJS UBQKKzZviSxZ/KGklHbORF9IrzSvIGY2Nkj0LbHMW/3OXox9EqsoLIy1S9+qUEWb4vcN O91nxDac8cezSpz1NWfupRtCgLXtnVVOqXZHfkuq9qNtTMPFViPGXiCsAeOFcNykWleD 6K3SmnqFBMHz1Y5DaJLiQbAseu3xhmG3PyVJhxx/TqyJ5eShso6F0r95leQSZXgkkgge Lj62ZoW1l4cgwRRpypU5jyR1u+c/Ay3cn7ZNxCb5X73qnp4/q6Ka5vxnjpdiTHMc/KGF vL3g== X-Gm-Message-State: AOAM533dkfHiBwWkkeFL9BbaRwjGaI7ow/o3O1pCfSS07Q/3Ub4EoeKL QA/BNciecCtXZB0ImG5f6l9f9g== X-Received: by 2002:a05:6000:1003:: with SMTP id a3mr1689067wrx.258.1598672324461; Fri, 28 Aug 2020 20:38:44 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id s20sm1691700wmh.21.2020.08.28.20.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:44 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 1/7] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Date: Sat, 29 Aug 2020 04:39:23 +0100 Message-Id: <20200829033929.2167761-2-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_233845_325604_B70E23F2 X-CRM114-Status: GOOD ( 13.68 ) 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 commit functionally decomposes wcn36xx_smd_config_sta into a clearly defined wcn36xx_smd_config_sta_v0 and wcn36xx_smd_config_sta_v1 path. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 53 ++++++++++++++++---------- 1 file changed, 32 insertions(+), 21 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 97fb47a8bc1a..e8c2f4a152b4 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1312,10 +1312,11 @@ static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, } static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, - const struct wcn36xx_hal_config_sta_req_msg *orig) + struct ieee80211_vif *vif, + struct ieee80211_sta *sta) { struct wcn36xx_hal_config_sta_req_msg_v1 msg_body; - struct wcn36xx_hal_config_sta_params_v1 *sta = &msg_body.sta_params; + struct wcn36xx_hal_config_sta_params_v1 *sta_params; if (wcn->rf_id == RF_IRIS_WCN3680) { INIT_HAL_MSG_V1(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); @@ -1324,46 +1325,56 @@ static int wcn36xx_smd_config_sta_v1(struct wcn36xx *wcn, msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; } - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, - &msg_body.sta_params); + sta_params = &msg_body.sta_params; + + wcn36xx_smd_set_sta_params_v1(wcn, vif, sta, sta_params); PREPARE_HAL_BUF(wcn->hal_buf, msg_body); wcn36xx_dbg(WCN36XX_DBG_HAL, "hal config sta v1 action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", - sta->action, sta->sta_index, sta->bssid_index, - sta->bssid, sta->type, sta->mac, sta->aid); + sta_params->action, sta_params->sta_index, sta_params->bssid_index, + sta_params->bssid, sta_params->type, sta_params->mac, sta_params->aid); return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len); } -int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, - struct ieee80211_sta *sta) +static int wcn36xx_smd_config_sta_v0(struct wcn36xx *wcn, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta) { struct wcn36xx_hal_config_sta_req_msg msg; struct wcn36xx_hal_config_sta_params *sta_params; - int ret; - mutex_lock(&wcn->hal_mutex); INIT_HAL_MSG(msg, WCN36XX_HAL_CONFIG_STA_REQ); sta_params = &msg.sta_params; wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); - if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { - ret = wcn36xx_smd_config_sta_v1(wcn, &msg); - } else { - PREPARE_HAL_BUF(wcn->hal_buf, msg); + PREPARE_HAL_BUF(wcn->hal_buf, msg); - wcn36xx_dbg(WCN36XX_DBG_HAL, - "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", - sta_params->action, sta_params->sta_index, - sta_params->bssid_index, sta_params->bssid, - sta_params->type, sta_params->mac, sta_params->aid); + wcn36xx_dbg(WCN36XX_DBG_HAL, + "hal config sta action %d sta_index %d bssid_index %d bssid %pM type %d mac %pM aid %d\n", + sta_params->action, sta_params->sta_index, + sta_params->bssid_index, sta_params->bssid, + sta_params->type, sta_params->mac, sta_params->aid); + + return wcn36xx_smd_send_and_wait(wcn, msg.header.len); +} + +int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, + struct ieee80211_sta *sta) +{ + int ret; + + mutex_lock(&wcn->hal_mutex); + + if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) + ret = wcn36xx_smd_config_sta_v1(wcn, vif, sta); + else + ret = wcn36xx_smd_config_sta_v0(wcn, vif, sta); - ret = wcn36xx_smd_send_and_wait(wcn, msg.header.len); - } if (ret) { wcn36xx_err("Sending hal_config_sta failed\n"); goto out; From patchwork Sat Aug 29 03:39:24 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: 248689 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602700ilg; Fri, 28 Aug 2020 20:38:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEaHgkkvXEGxl+xEdsfhIMYi0+Pd7jT0+qMXxe6wY5y/Sr8U8/4clV3+jInpCCvbh0Q4sO X-Received: by 2002:a92:99d4:: with SMTP id t81mr1492156ilk.95.1598672333916; Fri, 28 Aug 2020 20:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672333; cv=none; d=google.com; s=arc-20160816; b=dgJJ4tLLS5QjBN7BXRlYAf7dGjTKasSwtJ7K0jw3xQ5w5sZ1zCqK72z3GViKdhXvgp SNSlI79tYy6TcYOk2178agqwmrllYcxGok+kjIfQoD6SzTA6BxgECOHYabXsXzFehsON TEEksXUhrH66Kg+/dN4PnjHeD1LpzDISNWXmUQXfumqe4MhxfQLaQpyQHYrTYG1XVZa3 zXaDQFWhmORy0IUFwUThgaC82v31XoUbgNSWXxJySbDfjEJYSnjFGjOdx5V7KtN1kPR+ G+BzxAeG/hLKeAfJdLYu+JbY8JeNdLHD8t3hsK40AUKw/Ue3SGgbo6bZq+kCTBU9bG8R l07Q== 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=J7EY3GfVg5uOnD1aXipjVNEV87LaCVOGVwTZI5k5OO8=; b=vFdqtmCZfydSWf0kZ0ZClQoYaNPug5czMH5naBfG3pkTRfrqNYhemtnJvUNO8kyTO+ ZF4gxb0gb4V49sUd73Ex8WxwyefqOSPbF4QWvBUmsBldIhR5QY2X1WW3y0ZIrV/x49Eo xZY9znEHWubhHyTd0Wo8s2VGgqCABzhFHx0y8MZqs6Cq+dZV9j/tgeyMOfNN+GFkNnTM we/Cc3UNko4+2Y8jYG54NFe+YInX+fG3T+hQ7q3uTlu2xSVJAp+/h0KQ3R7+bOA6PHc6 30g7k6WWGI1NqUaf2v8LDxGmb5WdyH0sDzRsLGxNEsTP71HYcphr5zsrPmxawFqxAeVk BOpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=DT0hFHQG; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="HxsSo/PZ"; 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 b14si1154718ilo.0.2020.08.28.20.38.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:53 -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=DT0hFHQG; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="HxsSo/PZ"; 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=J7EY3GfVg5uOnD1aXipjVNEV87LaCVOGVwTZI5k5OO8=; b=DT0hFHQGzirWVSJFXN2vh3WE7 lwRECeWAUO6h3/xj1LY0mnC9IpgXQV9P1dHyoP5/EF3FJrS06Et1hFESDduEU8vWU4AeWB8yDG2/V MNVSsgvXRyqu5eus33HRWyylobli2ZB4nrKA1UnfNYqzhZK4CP5Zu+PrTocE+6QiBDO+rJS4UH9Q6 t1e+OaHlb1I68kL6MZT+rTnGJ1exi+EbJtMX2j0eADX6zMosUbwGyH3T4b/vA0hj04FALFmAHESO2 9103zV49xZORzKCnkqvH77fqleZHjSDjVNVV6zNLieHg6CQJqiNmzIh+QF2x9MXZXmuFXXob//Wxf uYliJqVSA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrha-0002UI-UC; Sat, 29 Aug 2020 03:38:50 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhW-0002Ra-Nj for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:47 +0000 Received: by mail-wr1-x443.google.com with SMTP id a17so21894wrn.6 for ; Fri, 28 Aug 2020 20:38:46 -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=or2dbECxnpurnyDMf3aY/pIgT+JTIa/EycsL2GtCXSY=; b=HxsSo/PZu+qfet4lp+lRj+AN0WRVaaZGoaTTcBrC4XMvC3ENptwieaP1VAvMzbCdHB 1y56MxnkH2i9BkW1k7STYaLxHOhCHCFt55FqItCENYDX7l85DSBO9uQYJr48HsTNGDPl q4l6/8pxqehmhZKlXWjHMowSGU486uKlh33rE0vA/p/NYes+4XcX1XSUpY+9Zn+CjFBr Pnxh4ry5j6V2MMKqtVZM+/IBD948IwNopgZbQwQS10JJcvfe0LPqAoHagEYnKa88nvTz wMLOQK8t/zeYDvMSeiKxasvkOUKwjCrs2alg2v1jlBGaRaxq5iIrRM7Ohx7l+qUSg+Wp +Oqw== 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=or2dbECxnpurnyDMf3aY/pIgT+JTIa/EycsL2GtCXSY=; b=RJRmjVZNcNXNezZHpZ3lFmGr6i4rL2L0ATNMI2DvfLCGu/gyDvy8aGqb02lF7F/CHU iPrseWPU0ng2uvwsXNYsubaKcs4j7gkJQ2GtC7J9FUGvTPuKdYPFZndKyfxjcj5/B+u8 xDwjc1wT2x9rl9vxao1a0c+z04lXtXBpr0R690VFDUgAkJiewgcoZEio2tykI6sHgSne wqwbjjxVLzBOW5gQWggA5otL29BA2VvH09ziR7pv4uFZZoz6LJkz9CfodOWignTvEAQT mvr8KDukAPHpEcBZYAQR87nogm1I/p66cilkX6zRfIKnUMiA/dl87OkzfW60WaDClHpT uWKA== X-Gm-Message-State: AOAM531sgspjsKkx6F1GQ4MvqsGJUkM3htdUmmZ1jnj6Z/ZHtAoEWLJ7 3TAfiR6JN30ha4FC48hyPnZbLg== X-Received: by 2002:a5d:5273:: with SMTP id l19mr1832129wrc.64.1598672325876; Fri, 28 Aug 2020 20:38:45 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id s20sm1691700wmh.21.2020.08.28.20.38.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:45 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 2/7] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Date: Sat, 29 Aug 2020 04:39:24 +0100 Message-Id: <20200829033929.2167761-3-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_233846_831950_C2FC7638 X-CRM114-Status: GOOD ( 12.18 ) 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:443 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 In order to facilitate functional decomposition of wcn36xx_smd_config_bss() we need to move wcn36xx_smd_set_sta_params() later in function. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 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 e8c2f4a152b4..654ef074b1eb 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1618,7 +1618,6 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; bss->reserved = 0; - wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); /* wcn->ssid is only valid in AP and IBSS mode */ bss->ssid.length = vif_priv->ssid.length; @@ -1644,6 +1643,8 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, vif_priv->bss_type = bss->bss_type; + wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); + wcn36xx_dbg(WCN36XX_DBG_HAL, "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", bss->bssid, bss->self_mac_addr, bss->bss_type, From patchwork Sat Aug 29 03:39:25 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: 248690 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602711ilg; Fri, 28 Aug 2020 20:38:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCNS/JWtKkFvjQ62iWjpRriH4qrCsngAlwerhJM9Gff9g5rTlTJslnbB+MNr2QVMSDNBVV X-Received: by 2002:a92:9992:: with SMTP id t18mr1628499ilk.170.1598672335065; Fri, 28 Aug 2020 20:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672335; cv=none; d=google.com; s=arc-20160816; b=k6Mz75qABcOJ8pydkl/mPxVVmPPva2pI6RxP5wUMYp2kn14OEFEV2b3G4M8jeQ7e9U oi9RpqIsdN7CT0cXvys+DHz2K7jJDO1pS+jAnfFeMcYArpmHsAfMewvV26uGd8oV1xve HtNixy+6HQR+fUGmeQVVL3wlX1VLozaj+ArMZBLPxANUQYoIjonzbedNvSc6GH0IcG06 YGbyzfAewEJyJGAmNjzdjwe5HZJzHIoQs+slbzIhlw+R6qZrUPoi8vprfjVhxKpPdg7W ATpOJ7k+f57T5P0DTlqeOylk2fZd47SvTD9aEJSo4XhWHxryXv5sOWyUsoPulqabwgm7 BEwA== 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=C3QtkanXdLc3qB2LIPuqes7BYLTA+DaCnrmqj9ulcUA=; b=wFAaxj24R1mO7ejEPWwvU7uT70WGvtkMuNED7eCr6WJG95P4tzZ8cSFO2iwECU+khQ N1VnAAN1IwQ4LvTWYzLc0XM9VFouvQUIOgVcGO6/seXARrriF2QOd9wbvmTc/x9w/j1X iKEm6yaEpMAEPk6DVmvcnQqnEz/9MCiSgd59Bzb2aGJ2mAghGJ+G94OBIEdwEOR2Cqg2 lxDLInWdVCGTObpP1/vXsW07nwMyoWcvGfl73+KZ8gBsSP+UA63FeWQ3Mr3ljpxXtG5B po+WOql5hGtTo8eLrRzGwxUP98piMc19khFTjUS3EZL+FJhhJwuBL8u+1E2JgXdfH4sA nDLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=LuLvsHMm; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="iNNWC/2f"; 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 l1si1127859ilf.11.2020.08.28.20.38.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:55 -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=LuLvsHMm; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="iNNWC/2f"; 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=C3QtkanXdLc3qB2LIPuqes7BYLTA+DaCnrmqj9ulcUA=; b=LuLvsHMmiBKTKsY6U9hOipzcw UL6KwZrqeHAHqT1U+mz1FGm7rybqggAKD+1kFl/jnMdVJJNEsdpErb2LLAITyUmW0S1slbcaq+gqb 7KqvXmd6aj49S77AwXlgz8nM5Ov01gy//ICuKHgqG2rEP0i2i2DzStCvtmx/OYIUAAwIUx267jR5/ f+6+WT5yvBiifgB9IChmFPC5/Ib8Wk/SYAFRZb6saNxqNV+Bmf04QHpHehvLRsxvPKSEEaWZMuGp7 SVH3cOeMaKH7JUi3n55iNyZEogoYF2vihn/DEhb3ix9p4eauMnwUz3RqLOjvlPHpLx1kq4kTbsl0M ubUPmB4cw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhb-0002Uf-No; Sat, 29 Aug 2020 03:38:51 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhX-0002SL-Ux for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:48 +0000 Received: by mail-wm1-x342.google.com with SMTP id z9so855717wmk.1 for ; Fri, 28 Aug 2020 20:38:47 -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=Inet6OCfp+FQ7rBZ5m79Dx9CVjCkFP88QA/07j0o8NA=; b=iNNWC/2fCLSalsnwsckxWXqWvaK53tdB1wHKwQwJT9ji3W3NBg7ejB0p/22b6efFPH fQMAJO8A+fl0vSV1f1CQFkVSqg7TeCUhIX++n89CC1r3p2wdEMr6dHeNeQEMF2Fpb5nT MazZ+SvCTq1kaero31+cWaimSGzfseUAjtLKIIumHBfN8DTYjZT48zZfR3d+plOjkhLm 6WHhllH/dqg00lOtlfp/7OixGHgj6WjBnPMz4xg4b/l+KQUAk+i0BtQFlfLuz3huDbog qoOTNH2lMGElqpsvNBE8OmPOvwb1sBk5j6VvP3rFV95YTfVr93+IRz0DFNqOrqEvo4bk TUYg== 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=Inet6OCfp+FQ7rBZ5m79Dx9CVjCkFP88QA/07j0o8NA=; b=Epk9d3Fj+TvpdKD0Dzxu05owMBisCHM8jDDwJnK8i1Zt3tH5QPyLf+HrvHy1/EQ0CM 4upX8AQtR/WQkur6yxUqcKEkminQDK6wArp20htogTtx3SQZL4r3wYMl2v+5YRg4Nt7Y Svik2oPZUFtN/HJtI4RuU93sbVdcIhVL954ztO7HMJypeNjtsTvJSlD7y5URO4NwnCBQ jKCl1y2I9JfA3vJ237j40iM1Fk//7aqTSins0vb/ESAx0ZTUUNxkUwhlhmbf/mYYDkib rIOnXe7vGJmQv28Ea2hxQ050hlO6oxFumkHviL7wehKiDiDj0kObXTB+N8mNpk7Nnstk SiuQ== X-Gm-Message-State: AOAM531urVSIzT1Ozku2bgELBTF20iGA3ffRjSCzXnSy9nY7fKev+uTB NPsDKT8X8RDIsAf+aY3z6fJqDg== X-Received: by 2002:a1c:988d:: with SMTP id a135mr1498416wme.8.1598672327030; Fri, 28 Aug 2020 20:38:47 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id s20sm1691700wmh.21.2020.08.28.20.38.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:46 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 3/7] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Date: Sat, 29 Aug 2020 04:39:25 +0100 Message-Id: <20200829033929.2167761-4-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_233848_071591_E376DCE9 X-CRM114-Status: GOOD ( 17.36 ) 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:342 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 commit moves BSS parameter setup to a separate function wcn36xx_smd_set_bss_params(). This will allow for further functional decomposition and fewer kzalloc() operations in subsequent patches. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 172 +++++++++++++------------ 1 file changed, 92 insertions(+), 80 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 654ef074b1eb..4d15abed5493 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1392,6 +1392,97 @@ int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +static void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + const u8 *bssid, + bool update, + struct wcn36xx_hal_config_bss_params *bss) +{ + struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); + struct wcn36xx_hal_config_sta_params *sta_params; + + sta_params = &bss->sta; + + WARN_ON(is_zero_ether_addr(bssid)); + + memcpy(&bss->bssid, bssid, ETH_ALEN); + + memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN); + + if (vif->type == NL80211_IFTYPE_STATION) { + bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE; + + /* STA */ + bss->oper_mode = 1; + bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE; + } else if (vif->type == NL80211_IFTYPE_AP || + vif->type == NL80211_IFTYPE_MESH_POINT) { + bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE; + + /* AP */ + bss->oper_mode = 0; + bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE; + } else if (vif->type == NL80211_IFTYPE_ADHOC) { + bss->bss_type = WCN36XX_HAL_IBSS_MODE; + + /* STA */ + bss->oper_mode = 1; + } else { + wcn36xx_warn("Unknown type for bss config: %d\n", vif->type); + } + + if (vif->type == NL80211_IFTYPE_STATION) + wcn36xx_smd_set_bss_nw_type(wcn, sta, bss); + else + bss->nw_type = WCN36XX_HAL_11N_NW_TYPE; + + bss->short_slot_time_supported = vif->bss_conf.use_short_slot; + bss->lla_coexist = 0; + bss->llb_coexist = 0; + bss->llg_coexist = 0; + bss->rifs_mode = 0; + bss->beacon_interval = vif->bss_conf.beacon_int; + bss->dtim_period = vif_priv->dtim_period; + + wcn36xx_smd_set_bss_ht_params(vif, sta, bss); + + bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); + + if (conf_is_ht40_minus(&wcn->hw->conf)) + bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW; + else if (conf_is_ht40_plus(&wcn->hw->conf)) + bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; + else + bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; + + bss->reserved = 0; + + /* wcn->ssid is only valid in AP and IBSS mode */ + bss->ssid.length = vif_priv->ssid.length; + memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length); + + bss->obss_prot_enabled = 0; + bss->rmf = 0; + bss->max_probe_resp_retry_limit = 0; + bss->hidden_ssid = vif->bss_conf.hidden_ssid; + bss->proxy_probe_resp = 0; + bss->edca_params_valid = 0; + + /* FIXME: set acbe, acbk, acvi and acvo */ + + bss->ext_set_sta_key_param_valid = 0; + + /* FIXME: set ext_set_sta_key_param */ + + bss->spectrum_mgt_enable = 0; + bss->tx_mgmt_power = 0; + bss->max_tx_power = WCN36XX_MAX_POWER(wcn); + bss->action = update; + + 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) { @@ -1499,7 +1590,6 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, return ret; } - static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -1551,7 +1641,6 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct wcn36xx_hal_config_bss_req_msg *msg; struct wcn36xx_hal_config_bss_params *bss; struct wcn36xx_hal_config_sta_params *sta_params; - struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif); int ret; mutex_lock(&wcn->hal_mutex); @@ -1565,84 +1654,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, bss = &msg->bss_params; sta_params = &bss->sta; - WARN_ON(is_zero_ether_addr(bssid)); - - memcpy(&bss->bssid, bssid, ETH_ALEN); - - memcpy(bss->self_mac_addr, vif->addr, ETH_ALEN); - - if (vif->type == NL80211_IFTYPE_STATION) { - bss->bss_type = WCN36XX_HAL_INFRASTRUCTURE_MODE; - - /* STA */ - bss->oper_mode = 1; - bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_MODE; - } else if (vif->type == NL80211_IFTYPE_AP || - vif->type == NL80211_IFTYPE_MESH_POINT) { - bss->bss_type = WCN36XX_HAL_INFRA_AP_MODE; - - /* AP */ - bss->oper_mode = 0; - bss->wcn36xx_hal_persona = WCN36XX_HAL_STA_SAP_MODE; - } else if (vif->type == NL80211_IFTYPE_ADHOC) { - bss->bss_type = WCN36XX_HAL_IBSS_MODE; - - /* STA */ - bss->oper_mode = 1; - } else { - wcn36xx_warn("Unknown type for bss config: %d\n", vif->type); - } - - if (vif->type == NL80211_IFTYPE_STATION) - wcn36xx_smd_set_bss_nw_type(wcn, sta, bss); - else - bss->nw_type = WCN36XX_HAL_11N_NW_TYPE; - - bss->short_slot_time_supported = vif->bss_conf.use_short_slot; - bss->lla_coexist = 0; - bss->llb_coexist = 0; - bss->llg_coexist = 0; - bss->rifs_mode = 0; - bss->beacon_interval = vif->bss_conf.beacon_int; - bss->dtim_period = vif_priv->dtim_period; - - wcn36xx_smd_set_bss_ht_params(vif, sta, bss); - - bss->oper_channel = WCN36XX_HW_CHANNEL(wcn); - - if (conf_is_ht40_minus(&wcn->hw->conf)) - bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_BELOW; - else if (conf_is_ht40_plus(&wcn->hw->conf)) - bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; - else - bss->ext_channel = IEEE80211_HT_PARAM_CHA_SEC_NONE; - - bss->reserved = 0; - - /* wcn->ssid is only valid in AP and IBSS mode */ - bss->ssid.length = vif_priv->ssid.length; - memcpy(bss->ssid.ssid, vif_priv->ssid.ssid, vif_priv->ssid.length); - - bss->obss_prot_enabled = 0; - bss->rmf = 0; - bss->max_probe_resp_retry_limit = 0; - bss->hidden_ssid = vif->bss_conf.hidden_ssid; - bss->proxy_probe_resp = 0; - bss->edca_params_valid = 0; - - /* FIXME: set acbe, acbk, acvi and acvo */ - - bss->ext_set_sta_key_param_valid = 0; - - /* FIXME: set ext_set_sta_key_param */ - - bss->spectrum_mgt_enable = 0; - bss->tx_mgmt_power = 0; - bss->max_tx_power = WCN36XX_MAX_POWER(wcn); - bss->action = update; - - vif_priv->bss_type = bss->bss_type; - + wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); wcn36xx_dbg(WCN36XX_DBG_HAL, From patchwork Sat Aug 29 03:39:26 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: 248699 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602959ilg; Fri, 28 Aug 2020 20:39:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWGdboQP+euflbqbtzJ/3hImm02R+NwGwnwwoQvqvET3FZB4U/cE0n4ngnSRoiH/+wyyC6 X-Received: by 2002:a17:906:2408:: with SMTP id z8mr1740123eja.421.1598672360085; Fri, 28 Aug 2020 20:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672360; cv=none; d=google.com; s=arc-20160816; b=UHnJEYdCH/FZZUeGHSbQp9vinYirB4UzDb7ETheE0VeADoiAsuOjUiR2Sqh/TsB0IK AjrQbIHPdt+TugoBZNI/LpAmyBA3ta47LkAkvpfbKu1qyZr8RDqmO/m6SzLt0YQB/194 +5nG9TXTyLCQht/90vwIiQImWcrr32kyupa9X/7lvWfW0VFUzCcXit+17c1HgOhSFvh6 xdBeD9SDbzmKTSeCjFyakvEUMlO+4REATs/NYEGsF3MhW8AAJD7+//kX1IIQcQDqO19K Wk2g7rS/ubJbVuW7bFtyC4BucRn7jrbZXYrfBDsgDqzzmP3I5tLMduJEAjcBP+qnFmVj O8cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OfKzT0AQLv9vCASnT+Ck1FNtBdRG7UzTmfEa75WAP6U=; b=ZCAVR7Bg00mbfJKy6sAwZmbMbXDyYp1JMyNPQyALcVNZ/4ddkmisxTXYeiS9o+MWrc fTqh6eb6Q0OzPQsdeoxGQVraLWlFK67Y26T+dzTAHpRJ/EjiYGSOa32ifaWwZLbcm9GS 7fvHymTk+ibjgqUBxei36m/PPpm1227E1Ohs29/dtd6wx7pbVOf3o8Vwy0QqQidErxZl ou5WbfnNGZfzgwJTsi9ek33CXJ/EpWmNyuL9rvSP52p6HJHnpxQjzj/3N9BAVhGzCmGr tIebtuQ5U0AcL4QX9ZYmw96/xUuAtmFB6D3TN78fqp+7L2CZ8qZiiNDXFgEMwd/GN4cU 8F0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HIPVdGgI; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si771590edx.502.2020.08.28.20.39.19; Fri, 28 Aug 2020 20:39:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HIPVdGgI; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbgH2DjR (ORCPT + 2 others); Fri, 28 Aug 2020 23:39:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbgH2Dit (ORCPT ); Fri, 28 Aug 2020 23:38:49 -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 6BDD4C061235 for ; Fri, 28 Aug 2020 20:38:49 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id e16so894981wrm.2 for ; Fri, 28 Aug 2020 20:38:49 -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=OfKzT0AQLv9vCASnT+Ck1FNtBdRG7UzTmfEa75WAP6U=; b=HIPVdGgIqrJu0YOXqxK6wFKDD1gqQ2p4RKCSM0fbzMnLmROBz/ap9rkZK1E1vyTdvb tbzo5NvFrEKNeZcIKVZ+lO/k/po46EoRfavRCp3LzV8kOy6wbWzrsfb3vSVMsGBsQCO7 aBZmBeJrlTMIYnBWnQhRcSdwMrWNdW56KZcC8XVS1FrXv00h7qETgyvzsNe08m8bEEXr KA+YIR5UdIeDGqgObtHLW5HUDvHKZXSPyJblp6AWIfQEKN92MaKhHNdoTsGmCrYU/X2u 3SmgnDYtsBA8nR1vCXJGfDQOqNLNV1tVphckCBJHX0m0YrE2zUnWZeqiCmGT2zg8DTxz uaeA== 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=OfKzT0AQLv9vCASnT+Ck1FNtBdRG7UzTmfEa75WAP6U=; b=d+ep3hdHSt8rqXFofp6e0CgtAIXhKQjUjvsp2z0u+RqOH7vG8dFIqQGmdJWKTNS09/ e9k5nd8xE/ZN7W0Bs8jmBEn49vo3RUb9CK8nxlQyd/sP5k5lzS34StUZqOEvKQZaRjFt vxyF2mP4pLF49fQegNHl7yXb2u29ZPkWFqJeLI35vPs+Bho42HpjJs1dhgELXwEGoTNj klSHWwyRZkh5I8zuVv/WwLEAO5KQSz95sh676cdJGV4Kks+4oegti4odxILzrXdVCAdl PkJZKHAGdAjOW38EmWqw8d2VsXaSttD/BgUI0BrzTkQVWgQKdHxGIQvw9m1n52acvu+S IKPg== X-Gm-Message-State: AOAM531kgh2Ay2RvbZVzMDtEO1+Vcut5e3UIjUfBN+Yy2FEgvLwivJd/ hmjsMZWAQNoEntnraBxRAWFwjQ== X-Received: by 2002:adf:f7c3:: with SMTP id a3mr1691030wrq.162.1598672328149; Fri, 28 Aug 2020 20:38:48 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id s20sm1691700wmh.21.2020.08.28.20.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:47 -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 4/7] wcn36xx: Add wcn36xx_smd_config_bss_v0 Date: Sat, 29 Aug 2020 04:39:26 +0100 Message-Id: <20200829033929.2167761-5-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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This commit adds wcn36xx_smd_config_bss_v0() as a step along the road of functionally decomposing wcn36xx_smd_config_bss(). Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) -- 2.27.0 diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 4d15abed5493..87fee9c1b981 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1590,6 +1590,47 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, return ret; } +int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, const u8 *bssid, + bool update) +{ + struct wcn36xx_hal_config_bss_req_msg *msg; + struct wcn36xx_hal_config_bss_params *bss; + struct wcn36xx_hal_config_sta_params *sta_params; + int ret; + + msg = kzalloc(sizeof(*msg), GFP_KERNEL); + if (!msg) + return -ENOMEM; + + INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ); + + bss = &msg->bss_params; + sta_params = &bss->sta; + + wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); + wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); + + PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); + + wcn36xx_dbg(WCN36XX_DBG_HAL, + "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", + bss->bssid, bss->self_mac_addr, bss->bss_type, + bss->oper_mode, bss->nw_type); + + wcn36xx_dbg(WCN36XX_DBG_HAL, + "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", + sta_params->bssid, sta_params->action, + sta_params->sta_index, sta_params->bssid_index, + sta_params->aid, sta_params->type, + sta_params->mac); + + ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); + kfree(msg); + + return ret; +} + static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, 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)); From patchwork Sat Aug 29 03:39:28 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: 248692 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602738ilg; Fri, 28 Aug 2020 20:38:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrrh2o25lEijSS9Vx/DLbMlI/+wG9TcKt8Ltzj3KEUirGZjSsyEzXeZg2Ep17BHMxjIhUb X-Received: by 2002:a6b:f801:: with SMTP id o1mr1445525ioh.43.1598672337350; 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=HIDRl7IEI4MkqwKBG27pcjBEDXtRbB5re6V4TKd/X84Rg3EC3u2EkoODFYzHrU77Q3 padWQDrH//zNzcIjGMey2btz0WS2GCHI9ScgFRVJYFN1FRgBvNY9eOtcCE+wljR//T8A vsL4Ylks/7amikM+Lq31G7DCE3YRlB0vd4kHSLzn0za9ffosM7ZNJIe93/9KWIy9oAh7 IRsM+qb0SyDu0/Ml6rSnhCb03SFdkTHDUUFNxmk8QMqghpITcNtOCHkg1WaM0iAzfk/t V+PTb/YscBh/YQCPKP1AQm6SEzVB8/EMm2H4Z1AqdBNY4cCTviHJMdpMZth/DZH08N89 /s6g== 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=405LapMebpbZGKyTqH82sNgauKYIMyg1QBxS+mWQIXE=; b=qk0nfIEzGA36eM6vnThvU9m0GY7YHa4nDr+DWAa+2ricgHaLOhydN5xZ1qAgLmhRxT W2GKb4GoVAVgVFouBhVatKHKr8dCFdVAOmzJc8CAlrwH3wweq9V9EcwH/eB+3ICPm3SO wKRVhvh3dEvwvfkiGTRzG9lA1D2tXrU+poJUoTyol3QCaFVj8WR0MvOLEsNArCnZeF11 VlPuRhXnPMV+df5Q2NE/jTtkzNvCz28GIv3kjnt5h/WFhvxrPjcwHSqOastFvco9ezQF mCnjPp7wDn8ZpDUzOuglkQAjyEq5tVJTpGa2RrZDZl8acElTwqoOrmquZCX+g/TQztyE 4DvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=HvJkj9nw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="QLKHbzn/"; 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 w68si1194934ila.119.2020.08.28.20.38.57 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=HvJkj9nw; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="QLKHbzn/"; 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=405LapMebpbZGKyTqH82sNgauKYIMyg1QBxS+mWQIXE=; b=HvJkj9nwc/PocX7EsEuMrFeuE nC+hJa71YmZ9f67UyOJ4HHae4Htal1Rdh8WVqhjiBspSSe0iUqr0zE/8vj8LvJysknJgBTiyWLxXW uYXPaJctQ8DDDPjzlHZq7lfaQol18sDRIRDb4DrEve54d3guhTbGxxjs0EFNva7cOzeurXU7B/VCs c2/jtEf69ePBJ1lGhX3iE0YgT/ZQJCMi6maxlTTzdlLRtRLWZ/98wxvUyAz/yBm2yAvnqofGBOGuQ /0B5RJURCPBQamcjuUhqyDCtqPpk2O27/3HIKutnF5kHzEThi5fEreT0rHgsw+ttu7fIU02KHzPQV Tol+Pxk1g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhe-0002WP-9x; Sat, 29 Aug 2020 03:38:54 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhc-0002UZ-2S for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:52 +0000 Received: by mail-wr1-x442.google.com with SMTP id h15so848286wrt.12 for ; Fri, 28 Aug 2020 20:38:51 -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=7wSp9Uc31N+F391d+EwEdxeVPC+PHewHvyf7Qc4RkB8=; b=QLKHbzn/8D5DxiEtkzmemLHocLZctxdRUhXfO4Le6dGH/nXvxM3stqjNvSsvmdwBbW 5LVKpiq7x/8KzY4/voVW43ErDPDJgyTmO3lcCXiUpncBP87i8dQLKbxfneui0m5LHgu0 ZXDuIB0P31ZiuHWuYbb9gUKFx3fH4k9EaM50MAdhvh9ZR8h5tN7OznpPWRiQnEakwtL0 wqHlE+LuVakeOV9e5pbQiOu8h/y9MG7P/8724a/YlEcOMBoXEKd15xgAKcreYT3MBofh 5+/2/1f/6+D6dU6AKn22W/JQTbqpi+0pQHMi8/2LsaPAIq0T8hVtW0j3t4Tw2PMjZY0m +SAQ== 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=7wSp9Uc31N+F391d+EwEdxeVPC+PHewHvyf7Qc4RkB8=; b=BAqeJYpaWy2UdezSYTcWaMMrpe0xplTKvLP7bQVEQsVX4Tqm8Fa+s/b0Ey9ZMYqH+3 ZUjI9f886iNt+hNNyObHjYVhF16YWN+Zx9HgrQ2WjnUjAiNYAgK54Uu4JODImL2uBqWn zs6qazhF1ivx7YPihdSRDMQmz4GA9g9RY0g+Gi8eJu5McR0dZKpUl3zqGVDaWzh0QwGe eRGKHkARzac8luzmVSC4Ei+a6iSeSxBP8HYE6Onr6n1OrOkmM4f61Bzqxe8WD6WocoZx gFhmKxyobfGcj/BhDWGHGeVQHb1qVcOmb80wDQd/Ij/jsVxv5f7SbX5tb4vGSVSjYtXQ v7zg== X-Gm-Message-State: AOAM530nFZM5BQ2K1wiNtzZk57ukLHUDY6EHgPC2B2t/AcUGxInmFWfz uWwAR/ETNrzlVFKeSnTfBNTuJA== X-Received: by 2002:adf:cf10:: with SMTP id o16mr1589985wrj.380.1598672331177; Fri, 28 Aug 2020 20:38:51 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id s20sm1691700wmh.21.2020.08.28.20.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:50 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 6/7] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Date: Sat, 29 Aug 2020 04:39:28 +0100 Message-Id: <20200829033929.2167761-7-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_233852_182670_76BC909A X-CRM114-Status: GOOD ( 12.20 ) 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:442 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 A previous patch added wcn36xx_smd_config_bss_v0() this patch converts the version 0 data-path in wcn36xx_smd_config_bss() to use wcn36xx_smd_config_bss_v0(). Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 4 +--- 1 file changed, 1 insertion(+), 3 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 360348456070..9acf1af14c54 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1717,9 +1717,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); } else { - PREPARE_HAL_BUF(wcn->hal_buf, (*msg)); - - ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len); + ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update); } if (ret) { wcn36xx_err("Sending hal_config_bss failed\n"); From patchwork Sat Aug 29 03:39:29 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: 248693 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1602751ilg; Fri, 28 Aug 2020 20:38:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc8GWwT6rXn7F3t9yRGsmTmetjMXKFgKrnMC1sdODQs8kj+y49edFu2DFBnmDKjHTgAziP X-Received: by 2002:a02:1649:: with SMTP id a70mr3834724jaa.39.1598672339068; Fri, 28 Aug 2020 20:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598672339; cv=none; d=google.com; s=arc-20160816; b=iCXFK13ypbtHaSZAppuqBZvd9TpyNcKH4sh38nHjwHGojyxaVQ5ll2xg4tu7YF1CjS gLFbv8/ORpCba9Sxcf++pe9aW+5fU8wD2wTpRt19MAlLSmN5DpX4IM/jnyEjPY0uyyKi ML78ttrcPChAXtDld+vVvjka1eI3JsDwIrmg1tH4ZtSsAHdIwsUdbRnHu9397nw8L++y tTk0votj4MmlrcaiIVoEaYw7gizWX/P+2do8yyCiSu7z6/jrDqtZH4vNmdDrl1NNF17I yubSTuPXLvphqeVrArJ78Xn3wrFZac8RNvFdFgKM2EXOXJr0/pR1crpa2Kf1SbPlfI26 tWmQ== 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=y7JydTvjGYNxEZA7QbjdvLYx7Sdi6i3QQfCkZvrJcGs=; b=pRJA2NfUIA5w37RQT7+kJ/R9QuED52hT1hZhl5MJcV3QwJESAcUyfDl6CZkNk9Zuev 1jw7uin4escHcfWl0cXY918iahRE3XSNtWxbj/fKfARLNrkPJ6zKZSbAhUeNMJPcj6KX EiU6I9QwtxbOycwZX9lABIRSF6P0IlwyTjDFr3/4MsrzCJ1c2DOKutIPtzBg7+UlFl01 /7iluQDnk1F2o4icLCdwxfGcgB48e5e8OvakFqyf0RZJpFhHmv4Nly/PiqSNNyRVarFC BExVZelhPBir82Uk3LpsVqj6Z//LmElkE9/Nnfta1Fg4D9rJIRN5GKE6UC+ZT7k0k7SZ yPmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b="VTVu0I/m"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X7A5f5kI; 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 l5si1078495ilg.87.2020.08.28.20.38.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:59 -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="VTVu0I/m"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X7A5f5kI; 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=y7JydTvjGYNxEZA7QbjdvLYx7Sdi6i3QQfCkZvrJcGs=; b=VTVu0I/mTxOiW/tDK639dJL5g uus5AniyCkT/U07tt5RShjQRarBLtct4T9APGMPgm06jdroQHI25kFKZxxID/Z7m150AzyeOWxcOP S37BuaD1E5i/z87Ne9cN5iU8qzf8kpgEl26VHpK5wqG0l2nNoAfZoZ5FaPOzmjIow+5/Gwq5eRnXw ZPRaao7HrHEI4Q3BCbNGrFnfSxLMoAtFagTCo3sd5l+TFQr3/I4acFwRYYSrHQqytRxMuh+qSJg64 5b+jskEqLZ8Ld6Ottzt5fI3YrqS3YzVDUOayiAQWQXtr+yXX0YVR+l+wH3eA2qOeU/3wsMQslZ5tK FtEZ2gElw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhf-0002XB-Qf; Sat, 29 Aug 2020 03:38:55 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBrhd-0002Vf-Gt for wcn36xx@lists.infradead.org; Sat, 29 Aug 2020 03:38:54 +0000 Received: by mail-wr1-x442.google.com with SMTP id w5so868027wrp.8 for ; Fri, 28 Aug 2020 20:38:53 -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=uxv61ncwVKFnMMfQ3MXOOnXWNB/b+jhNeIcIEXIr8Og=; b=X7A5f5kIZQxiUDKLPU+AyV/QmxXLuswYHbKSh6F1VmRxPjWCzx3SyQ4oHX5H1S6t2u mGXjZQfvo1/SQNzftI86fsJS9aq1sIKYUqQy3kShimW8ZADkw3q02mrzeydHmTnNFeIp 7q1hL3lNe0NxQYXBXvJEmHERxi+yEixSHy4Ry2RQeY7kWK3JlOAKbflMcpNDAg7Rhwyp ZMM7aLgFlSS6KO+xOiZww2BGgQJtNR7j3g4zpg3Ht6oQQ5xIa1SlJ3z2YuxeiLzqCRKj Shd4Dh9A8aLG9iOTf3pkjxGKUa6WU8+lltBmEXwUxP3RiRA0sME22LunfGHJH95+E/UQ CdBA== 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=uxv61ncwVKFnMMfQ3MXOOnXWNB/b+jhNeIcIEXIr8Og=; b=R54rETIzfsXbSNLvGYso2DUe49pWceMUul835RoS17hP5aTRpd7m3l544oK99rzv/K jPnkYkSqnD03sbbELjtbJboq/K8H8hZ5Qga4aEXsMNLXPNU3weAfudBHHpW+AQXRO1sq sMwRjavqLE7jQhLJESj5EFkc0sxT4RBAC9cl9EF+OPxFxUx0xdcC7kUdtRp80D569Qpo LaQ5U+ElQYHybOpM3BZg0rI6lAgPI9Cbz5usys0pkdv3gu7juYhwltGbCUCvLni3laCQ OQcyASSaE2lhSVT5sktpQ3trHjL2i8/xkXrEEoq9SOiD3GYVllLbYEIjq+8ZAeGSABP1 d8wg== X-Gm-Message-State: AOAM531oatOJmmMjG+4wDqpRS05gkEza5kF+eEtzzdJt6k1TqJVvNfHw jOhjnJkAu0lpE7Vg2NKKmiVjHA== X-Received: by 2002:adf:f106:: with SMTP id r6mr1752085wro.106.1598672332736; Fri, 28 Aug 2020 20:38:52 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id s20sm1691700wmh.21.2020.08.28.20.38.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 20:38:52 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v2 7/7] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Date: Sat, 29 Aug 2020 04:39:29 +0100 Message-Id: <20200829033929.2167761-8-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_233853_620907_E8915650 X-CRM114-Status: GOOD ( 13.81 ) 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:442 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 wcn36xx_smd_config_bss_v0() and wcn36xx_smd_config_bss_v1() have been designed to operate in standalone fashion. As a result we can drop the dead code now present in wcn36xx_smd_config_bss() and happily remove one kzalloc from the BSS config path as we do so. Signed-off-by: Bryan O'Donoghue --- drivers/net/wireless/ath/wcn36xx/smd.c | 39 ++++---------------------- 1 file changed, 5 insertions(+), 34 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 9acf1af14c54..2c58f7050836 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1683,42 +1683,15 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, struct ieee80211_sta *sta, const u8 *bssid, bool update) { - struct wcn36xx_hal_config_bss_req_msg *msg; - struct wcn36xx_hal_config_bss_params *bss; - struct wcn36xx_hal_config_sta_params *sta_params; int ret; mutex_lock(&wcn->hal_mutex); - msg = kzalloc(sizeof(*msg), GFP_KERNEL); - if (!msg) { - ret = -ENOMEM; - goto out; - } - INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ); - - bss = &msg->bss_params; - sta_params = &bss->sta; - - wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss); - wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params); - - wcn36xx_dbg(WCN36XX_DBG_HAL, - "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n", - bss->bssid, bss->self_mac_addr, bss->bss_type, - bss->oper_mode, bss->nw_type); - wcn36xx_dbg(WCN36XX_DBG_HAL, - "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n", - sta_params->bssid, sta_params->action, - sta_params->sta_index, sta_params->bssid_index, - sta_params->aid, sta_params->type, - sta_params->mac); - - if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) { + if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) ret = wcn36xx_smd_config_bss_v1(wcn, vif, sta, bssid, update); - } else { + else ret = wcn36xx_smd_config_bss_v0(wcn, vif, sta, bssid, update); - } + if (ret) { wcn36xx_err("Sending hal_config_bss failed\n"); goto out; @@ -1728,12 +1701,10 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif, sta, wcn->hal_buf, wcn->hal_rsp_len); - if (ret) { + if (ret) wcn36xx_err("hal_config_bss response failed err=%d\n", ret); - goto out; - } + out: - kfree(msg); mutex_unlock(&wcn->hal_mutex); return ret; }