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;