From patchwork Tue Sep 8 18:24:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 249324 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4791574ilg; Tue, 8 Sep 2020 11:24:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6rUdnqvKhcaba+qJRaX0sxo3c7clso9Xy9eZh2ZNPSZcUmukUldptwfJMYpcaCVbkQ6p4 X-Received: by 2002:a5e:8c0c:: with SMTP id n12mr109111ioj.147.1599589456703; Tue, 08 Sep 2020 11:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589456; cv=none; d=google.com; s=arc-20160816; b=dslhUz4+yIH4IqQF1CHsIVTpJPmS8mlKhWOx6pIBy0K8/kvOztDlzIYitwBnYpyVkP Ya3ZL8qflFAUSR4NbHWxRdq0eL/EKVLaFzav51R+q5GokJgwsEq4oHOqnyBVpwW78B4M lQmvRBoZIfvkoNYk+4Q5vmWde6hs2EOlcSu7asIDLLArIghCJnClalPLsXJp1rTDj1gf SyaIWxi3IR2ydFFNbyqAjQ2QH6cULL/KSjbhcxH8lBMGPhSy8I96av9HzyZW7tJG9UYR WhIfLw+QA5mrY9Zh+TaKaVm4LHBI4VbekwSiLld7Y/qfAFqriIlUb+NNRDkznV0CdUtQ 8E/w== 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=HWuYe2QK/vFD5JMRpHOmJnC95GUKzDFic9CvLoNHpAw=; b=C4g4mMI52fsEsbvsmNy8zjDNbcpu2f8Am+MW4Fmn4VxpVS0v/FrIaH1WZBg4XTZT1i 4KS2UKJMEqUgaDiO7oFnD2hQsAaz/0Hv7qpGNlJgtQCIIwxo9ztbx8DNACZcs0GJ8mPv uAKUVGY7/EUJ7AvD6BSFZzsWCFmUSH4QiqfDw0SOVNKNR9IFszVmdFkIlcaBCsigPPdb d0F5ohVObdUZfIkxcz+w1K9WCqnTnecV6ndFVtpEXYzm6vc3dL1ew3dxdVU9gheyz7iU TFKl7xZe9fQo0E1lq/0zZ8oL3fpKCacnlqSMjTFUXw34pvs3WrW1tuIaq68x4gkbCWFe KF5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=J3uNU+UW; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X1nC4See; 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 x5si204612ila.127.2020.09.08.11.24.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:16 -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=J3uNU+UW; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X1nC4See; 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=HWuYe2QK/vFD5JMRpHOmJnC95GUKzDFic9CvLoNHpAw=; b=J3uNU+UWpHTv7q/Q8VEYg9nmV Fg+TbMsvIJcvUK2jagIZsLmCVK6PZi0zVz2xq159lPnmrBrSvzcAnmqxdSLGXSAiX+hp1grUD4zmh 1AXFzIcVJRLU82DdykywlcYfXXnQCHKNPL8usKpx7f2/laHGiaBQIdYNaZy3o35DI3VYeO0qKZLlw UEuzB9dgrg/sv+Gxi8/LJQTrsgJKJF08QFRlDxLPxzIKUAiCVtdZx2hS8JnGJP2q/TXxGaP8ia6IL soCcT0TPLX+W3iuIp0rsYviPV7JUHHpuhECYxnG8a87YwPUZ6zEl4LLDZvuWyEyY/Zfrr1WQLtnfl Wth1lOXnA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiHt-00058f-18; Tue, 08 Sep 2020 18:24:13 +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 1kFiHq-000576-Ca for wcn36xx@lists.infradead.org; Tue, 08 Sep 2020 18:24:11 +0000 Received: by mail-wr1-x444.google.com with SMTP id w5so207913wrp.8 for ; Tue, 08 Sep 2020 11:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TAN3QMP99RMuUE2X4Hhmcyc8WgDbU6qUkAUGwiuBm+0=; b=X1nC4SeejQjeJyQI7dQSYL+Z5IwxvGY68esopG5mFiYSIhNtKZcHeTzSAFJivUmYr8 bbZERcQTQp/IXonUh9Jl26zU4PbcZ+AFMGSwUQr+ceDmAESUAG8paUWvX+uR45R9dOWU dikp4JnU9SALDdiTYFhLBwu4o0s7Zaa34RL9jvwxe1pzhUmDdIOpppxbB2Q61y3IMDRU dwrs/APby+NsKxiBij/MS5X8Wn/I9eNfxvamn/QfkkMhExxWl5ojoQg1Tk7oVpmqb79n mhfiVBmeYnZrFXhfIYL2U1rwITzlpPZYhDTOwUdO2E15EJ6ktPOGzwFgJAXTN+oq5h0i B5HQ== 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=TAN3QMP99RMuUE2X4Hhmcyc8WgDbU6qUkAUGwiuBm+0=; b=NT5HCK0YSjn2JdmDM4zXQtOb+d3JC9+EoNbDadv7tKFym1K4UYMLmZKoIzc/xtGtoc VARuOk9HnnQJJn6Tx5GDn7IPArSv1616AX4OGPRSXN+P0za0IGi74S6fwyiRX+aS7XaH 5H37jj7pFt6t7Xod31eAEHlfqfzJqfOtnFYxSBFJaOKrX5F7z91t3xl22j6nWFPGIXnP MLiRs9a6Z6S7R+Yg/7nf7IP2qmXZ4MNsSSXzTyhZE00n7jDW1YKYL34uaD3QywhvtmbD lEpb21irV4ykwKR/PeQsSXQAA3Yb2jx7lzjtcqZP5aqEsPppiMWDFjMtNWr2iZO0oG0v GPVw== X-Gm-Message-State: AOAM531VjomHhY1TjYZKKdVVPUxcHO9DeddgN5vBtdwANie/XUtNUdXO aW/vqwdLiK28HKA2uZwjWuIRvQ== X-Received: by 2002:a5d:4bc6:: with SMTP id l6mr1005090wrt.132.1599589449430; Tue, 08 Sep 2020 11:24:09 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id 189sm330439wmb.3.2020.09.08.11.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:08 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v3 1/7] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Date: Tue, 8 Sep 2020 19:24:49 +0100 Message-Id: <20200908182455.2870345-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182455.2870345-1-bryan.odonoghue@linaro.org> References: <20200908182455.2870345-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-20200908_142410_469362_BE0A49E0 X-CRM114-Status: GOOD ( 13.48 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 Reviewed-by: Loic Poulain --- 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 f434c355d32d..e26752396bdf 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1308,54 +1308,65 @@ 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; INIT_HAL_MSG(msg_body, WCN36XX_HAL_CONFIG_STA_REQ); msg_body.header.len -= WCN36XX_DIFF_STA_PARAMS_V1_NOVHT; - wcn36xx_smd_convert_sta_to_v1(wcn, &orig->sta_params, - &msg_body.sta_params); + 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 Tue Sep 8 18:24:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 249325 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4791585ilg; Tue, 8 Sep 2020 11:24:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzHLrBSi4sEKk6SzifD2bEW/equjxHMwUwqTzIQ1hpIgV2HRWcMcCrrYgXitlcbu5J2orW X-Received: by 2002:a05:6e02:c61:: with SMTP id f1mr27630ilj.137.1599589457739; Tue, 08 Sep 2020 11:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589457; cv=none; d=google.com; s=arc-20160816; b=YuPaofH1OVbJPZRrVyyfyJ0q33oBE6cIhlspcvmCkMttxPbfv6vDUbIF56XSvqFDF5 EcP6QDizpdPzrygZ1mp5fhjtC99ukVZk3Q97HzTBj3TAGh1yk3dd8PYbe10i6fZczIra r+iCN6GoYA/xiZZqMMvn+JNC+Kjdiz4ZGRe43Ruj+cz6W61YvdfERhmy/w7M7J/5CRaw 7+krJICd23TPxt0kxmI9YL8sBz4fVffbHPvz6hlkGBdBE7s8/ubvB8CR7rBMz/mNAhoD gOgplRycBv0We1iCOi7F1t5Xe8nzukmfw0qCWPu6gnNDbTntqZw8dPjBZQvmNgrZ21C+ 5RMw== 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=4dUzqF9fIIwCX8jp4K8dGbifUmFhS24ZbXMGdOq/OZ0=; b=ty6pZqincbOHKr1WqJrAPSjYeF6F7IhktPgY5n2cvgLgzhr5y55+NqcWSQvkNS6L09 QnriAIkqIv3yCOAXKZDyRKQiISpS3C361JMKV4crnhazB2KrwyckN2HESHrORtUtpls5 ISUkQPq5t3m1Jjxvv3XFZ63geeGRzE7P3Up9SZ8yd3Zkg07CIaqOhjgaKHEGpGzv3t3P c9eVNaFYOeYQ7dwObZhgs2j6CPPY7U+a6RdhqgFnByQ48Q6MnTI6yaSihKXtIGvtvICA YuNQ8KSVCCwrRam4IZf/xXSO95FQv3OPm68NF+vIfgXr7N3/mhcDioXE4QZV0AFIicGE 7Vcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=H07Yjh4F; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="xUo/Mj/s"; 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 s5si187893ilo.145.2020.09.08.11.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:17 -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=H07Yjh4F; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="xUo/Mj/s"; 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=4dUzqF9fIIwCX8jp4K8dGbifUmFhS24ZbXMGdOq/OZ0=; b=H07Yjh4FcH6XWWc0thJKSHLUV DdSkmI7b/0SRDpKAl9gf8DzTa3HHtuThFXGsrJ/HgcQjHZyW/KIOnroYxUTlVccFE1JqJKivUf/oz mgqeKIbHZfmSelIw87ncyofPrga8kCfwnT57FDmnaEK07cMLoJp8NRgBdD7cGpCQgWSSyY1gtDwpf mCxc8oPAambtZs/aoYTqTDLibW8h2S0QG9N7BJbCLUWVaZhdcwenSPFVuTHorUwk1FnW5kswn9Nvl oT6aDhY5rNqllqgQhubZNYhA8ovfwMMetHbD3voeQ6r3bgEES7klghk2HWiRbsa9PaFO1G7GCR7BQ T9N+sA7DA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiHu-00059E-Do; Tue, 08 Sep 2020 18:24:14 +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 1kFiHr-00057e-D6 for wcn36xx@lists.infradead.org; Tue, 08 Sep 2020 18:24:12 +0000 Received: by mail-wr1-x444.google.com with SMTP id m6so256382wrn.0 for ; Tue, 08 Sep 2020 11:24:11 -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=naU0RpV8J9Z6Qcq0aj4T/awPa3wV7pjar3MjYtbLY9w=; b=xUo/Mj/s1sJsaYWY+y3Gfo/CcSyX9jnhvjfW2EQ4K7CGpNlGtvMSEjilGQHeocn5y1 h6DdqZfXl/hKp7fBVL6kqPAVEthkgx99duEEGk7GmgeYKTQeRlkUXBoCC2LiUZNvGN9W acsu9Ed3pgrhA9KTkXLPQJJgHvvsLBc2IJ8yiIrE3Fbz0c9iyAeTMzJ2yOvFsZa2yWaQ bjF/yATYZMrpqCa+v6rtAcSIvmzeSTypywXZa1Z2H2FlAloN4FnL+9cHycrzBj7HyaTq DjJ5umHfMikKtuSzBrmoOsgAbXbIweymhRrP3xCCYlZJdzVyzVINa73MBwgpkTPR5Obi zp5g== 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=naU0RpV8J9Z6Qcq0aj4T/awPa3wV7pjar3MjYtbLY9w=; b=S4YiwmFofmmjwFvSfWxheI+D1tW68yGMjClH2naM6csfRF2oHmc17atVUA6Ait10he kFPv2ZyRfVsEknrWgntK3Iw8wqxJe3MZC7BubA97kBjDi4PD6FslqEITjO96o7ep6W7n n2r0mQw8d90AJul51amHkq3D+4sW6D1Gn7Bx3ju5fVzowTOWLg1LuG1AjgaqxwMrMZl4 TJUQZQ0e2ilAamUhjS9zJbwaIUARPoE1sLaHqU/x7u7eBtk5C0K2InhhnPteWHdARGn8 QNjj/S3yP+N+AqiOG49z77Hu6FuRqedFV9cOGRzIknDfs094YrK1vb/ku4z2EOs9s3MQ 0OUA== X-Gm-Message-State: AOAM533zQund1HpvFlR+rQgtIqyX80NVwj0C5ZODc4/M11Cj0iuqhGFg Iyt6sNxTzrXTMgBOQUzCR2sZcw== X-Received: by 2002:adf:e7c8:: with SMTP id e8mr968198wrn.358.1599589450623; Tue, 08 Sep 2020 11:24:10 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id 189sm330439wmb.3.2020.09.08.11.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:10 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v3 2/7] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Date: Tue, 8 Sep 2020 19:24:50 +0100 Message-Id: <20200908182455.2870345-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182455.2870345-1-bryan.odonoghue@linaro.org> References: <20200908182455.2870345-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-20200908_142411_482556_A05D6E46 X-CRM114-Status: GOOD ( 12.27 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 Reviewed-by: Loic Poulain --- 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 e26752396bdf..28a571918b19 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1606,7 +1606,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; @@ -1632,6 +1631,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 Tue Sep 8 18:24:51 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: 249326 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4791649ilg; Tue, 8 Sep 2020 11:24:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWlbyfZqbGkdMhxxMG/bQasIqvQFVp4DTSpG6WrRiZkph9x99Mv3Tb1F2viuBjZjPkg0mc X-Received: by 2002:a05:6638:210f:: with SMTP id n15mr205858jaj.41.1599589462789; Tue, 08 Sep 2020 11:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589462; cv=none; d=google.com; s=arc-20160816; b=FVYCQRmy6rOp3XKCexrzR+bG/cesIE3Y5t6R+BvNQvXcM4YpsXHhLjb6oJXuaY2XJz jfZPJ26zAflxdmqvbs65G6P+C/vJ0HDMkBFCNkQXbFeXCIIorgWElPMlSYIrmag3/97Z FHM88czvidLZmpuMgxetSNGUl9ktV95w3KbBZn5+W0Wv9L+XGU56Oh9Sr/Ewchz9TiBO Mh80yo5NVdhvQZYaUK01vO+eZv9i5cQT2a4pZAycpbuAeJyO+PTlHKnvy3UV5hTWGaHZ 1zZD1+dIt9f7EOveSb2doU114S7lGN3qdgFfiuewTUdL3I/qdy78EWZSO8m+2O6Eb7my 8ngg== 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=FPIOeGX+xnyfwvkYmUEg2RrPq3ioxlRIBUkXGGPU2hM=; b=NprAu/VbDp1c2lMQtjlRxkKKUON4VXBurjxr7hWJOfJzrfYE40naK4Qa2LQztXMTrf Lvzzpk62dRShkRNSQQY8eU4eVCA5QaBocFIzAACp/HQgr0YATjk8sC4MuGtfxUUMibsv 4y8gbGh3rscF1SOuI5bBEMZdEyfiY9eyhuYCsUnKLt+XrFgJNEI2qeTSR3NZOJ+D6aJx VjQL1EnnpOOfuW72sRi3Z1NQ7IsI4UQT4F9ho5P2/lnqdi7e3xyhqJLRE7GGGrGN4niK GHASDX2iqH2uVsFmdNtlmD43BXer7tSA0rvEOJGFthq68ET+cVbCyUUohdHkeaGmlwh8 fr5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=Ojl7d7Vo; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bNNS+mdf; 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 d18si91139ioc.87.2020.09.08.11.24.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:22 -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=Ojl7d7Vo; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bNNS+mdf; 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=FPIOeGX+xnyfwvkYmUEg2RrPq3ioxlRIBUkXGGPU2hM=; b=Ojl7d7Voy50WpXQ3er3/evPlu mloJEzuYMRZIpGxBxBlA+xx0eh1MIcagt/Z963kRwugAT7JHJY1fvc32R8zEQmL+AgZg5lkIjEjXN +YlkkTBfVWy8en8IfN0M/gJzA0QPz50sWVZ+sYZlbIXkhezKH3nzLsmW0yjvcCPHXeyugtccpZiIX j9zYStcPNNkWARMxZTL2rFrLRYth4k17CQU/5+rmiUsDL83r2EsVkGe6E5G9F6cOHlTLjmb28JQI+ VJ9GZKsEdURvaJfVcdnRearpk+cn3gk4MK0K+JnyfI9mMSjy9gqDSr1txEffsrczUdWrpYcBayBrj K4Ks3mIgg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiHz-0005CL-37; Tue, 08 Sep 2020 18:24:19 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiHu-000595-Jt for wcn36xx@lists.infradead.org; Tue, 08 Sep 2020 18:24:16 +0000 Received: by mail-wm1-x343.google.com with SMTP id b79so298074wmb.4 for ; Tue, 08 Sep 2020 11:24:14 -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=2bb83HCAluDLRPf/WFmZ9LIqNCsJ2xe/qCw3buaSSDk=; b=bNNS+mdfG3LMvb1uwhdXes1htGVAIaVqty70MIaW7ALRAvqZsHlO+++KBtrKxKlp3r 3tzBTUHN79U6mT7bWgue8NTM5Iu7fbJufz8IFDvCYiur3gPtPU5YgAS90JVtauXldS5g J5U0y4zk11NGT9b51wjPbfX9h+ckBL5EGcMTNtF0yesEtQFj5TSiSoQN3qRRsw1O/6MO Cf1TQZU4nm5plUDmXcnkvLUstwXPvK9eaIHmQ9/Xil97Pe2s+BaaSw9m75fDgCWHKSAS zCxCMLxHqjEEBnVw/yP53PN9dmWcN8AWIjpQdjuvPM6/+czyTjpIvrnfCw85eAQJav1x cy4g== 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=2bb83HCAluDLRPf/WFmZ9LIqNCsJ2xe/qCw3buaSSDk=; b=cnuGtfRCwcbAZBVoFtWz+yllEvTRIWWRXH2QNYgtzERTmggXhYCpvnjXF++XKY91CT Bgwt0kUmrBmaAB54JCTE+ZbUS3q0vM3PV8xFVATHuhiLJeRy1gnqfpleCvQl1QT/j8qS T3PKxPcd80b2mV2CQV2kg4kPS9n8PrnhNOcg/TQY3REDfymdsg2JDBo425+YgLXfX++a 7tb59Six+PC7uDSZzqhrj6KmjirEQVwMDj9A+GSoi7x263GwGtP+6Ex5DwNl92gsBrlQ 0fgkjdN5MVNWcui5+9qyongJpGQWCVpHbCiO+ODO8JDqWHqtQXEywYm9MZWdMJvoU8xm z+eQ== X-Gm-Message-State: AOAM533yGPFv0T1YeG1nGYric10JNc3575XF7mjmgd5VQ6LbFI8xRocU 368V8z5c4n0I9juQ9DHj12nAuA== X-Received: by 2002:a1c:92:: with SMTP id 140mr397804wma.39.1599589451702; Tue, 08 Sep 2020 11:24:11 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id 189sm330439wmb.3.2020.09.08.11.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:11 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v3 3/7] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Date: Tue, 8 Sep 2020 19:24:51 +0100 Message-Id: <20200908182455.2870345-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182455.2870345-1-bryan.odonoghue@linaro.org> References: <20200908182455.2870345-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-20200908_142414_826662_DF699288 X-CRM114-Status: GOOD ( 17.52 ) 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:343 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 Reviewed-by: Loic Poulain --- 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 28a571918b19..3e8b929f45fc 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1384,6 +1384,97 @@ int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif, return ret; } +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) { @@ -1487,7 +1578,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, @@ -1539,7 +1629,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); @@ -1553,84 +1642,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 Tue Sep 8 18:24:52 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: 249328 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4791667ilg; Tue, 8 Sep 2020 11:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzj2vXwWsgCR17jzWgKEl8GqrEGEEKxVmQosXSHOsRYTYZQzsZFNm3S+IGfPKjxyjS4RAyN X-Received: by 2002:a92:b6d8:: with SMTP id m85mr23387ill.165.1599589463684; Tue, 08 Sep 2020 11:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589463; cv=none; d=google.com; s=arc-20160816; b=EJSlcIGrgKoCVKhrTbLyCjuA/D4Sv0PpSRP3djc1Gptx1lGlrJ/CkKkR0hxGUCotGV nWnn5noduQf6AYV88AczQYQ295s+5Iqe0M+/uYaMFmgmiqkckFbaYk6iFxdqh6sJomib oV9k6xbIryZ1LpqyVXsv622QYrZ0p1GrOUHS0tQMK2SE9k0zrt7cRn6jasUAdL7Ut8xi u2xWIry8Wjd8He8ybhGCL3sJDiR/SBRf9vuBpXJtOSQZWVJT3aCaQKvx+jt1GWLP4dAf NE+WzENGabY7cWZEYCrzb+/H2oCPePMSJq3h6C7PVfA6ErSiDlHk7ktxjGSMwFHDfPpf HHvQ== 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=6dWmcnuVCMDbPeJ4Y+YDdc0WsV3b0kMvDgJaO3hgy28=; b=KxXloY2sR11s89NojXqe4oEOGLJLaOmBGtVZacx2ffhdWBlZD6ICRVQiKFIIeCqD6t IJ+HrNFNAu6+WFyWpyWXIq2uLtW3ZR3NWkW3hCeOijwYncj5y2CF/faCyPaAK96KhI8m G27j2Wfi+45fBOGnEWf2JgkRYwNlNzUHll349M1ZhgXu1egRhW6lF9IXCyujkRUH0IQm rJgMcJkueT/s5gvRXBUJV/Mscrp04nTZinUp/G2CYvLLnbj/J/ItJw9dK+jaHIQ+kslz UYLVpcstY6u5qJESv0tx/xczGcwRZyGLpLZCqwgap8ezVB9HxW6b99v57bFAUkM2VWpx Fiug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=nQNxQomc; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=pdhz58Hj; 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 m4si96522iob.77.2020.09.08.11.24.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:23 -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=nQNxQomc; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=pdhz58Hj; 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=6dWmcnuVCMDbPeJ4Y+YDdc0WsV3b0kMvDgJaO3hgy28=; b=nQNxQomcjJRGfyqbC4VyIkuIy 7zeI1WBA8mkaD0ccEIJJ+s8B07DHoN90R4VAdSqbu8gGYrEjakzgO6ccEren/MlTNhKRRiDDQ+tge iB2H8hQU/uMcSYHN3qELjpv7NZR96+bHT0S/MNT1TSeLbt95ZnfzXiYY+Odlo0X1vgNhb9MArbGKZ 8Py7u53l1Z9t1JLgZ5/9aeer7kxMwwkl0FgUut2NJFgBH3VKGVTIo/rQifsDExKb8iY5Dp0rF+Dzd RW68Mn3n+GmAtKwIsrBeAbR22M8+Zydcv1AhtYFEKYeJTx3Rm6aweIPbzHupjb5VQ5YcoUd4MNCIS /Fi173m3A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiI0-0005Cu-57; Tue, 08 Sep 2020 18:24:20 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiHv-00059I-4d for wcn36xx@lists.infradead.org; Tue, 08 Sep 2020 18:24:16 +0000 Received: by mail-wm1-x343.google.com with SMTP id q9so289380wmj.2 for ; Tue, 08 Sep 2020 11:24:14 -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=+Nq2zvDwY36ADBkPvbURAQy+9pgEoAZ5b/bksokgvCk=; b=pdhz58Hj7RgWbQ1DDDx4cMT3OZl5JZTNkNca5UgGjJ2yVOKQHyUyTLgWAFip91Dj+R rMW2X4OgmwD5CkZ2ci00oaMiSTwr0ikjwccae8V9cUdnkqxnoGo3LG+diXqUeNQ5qXiW /v5Ph4oDDANK5DsGej7qLDbWAZfYI0k2u8a2kFJoCun4ugls063hSrv/lQplb+kqiggc OX7BLk5GQ7tBbjzYMLwFxnwukJxKiEfubZ0Z2wzoiGKWHR8PaPLW5VFG0pgF4O/UijqS l0KfGGDs8c7FkuSwhGbqi8scZJiNMsGaW9jfYCKeX6nRhJsnSAixDenjazasVQPMIQad RtXA== 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=+Nq2zvDwY36ADBkPvbURAQy+9pgEoAZ5b/bksokgvCk=; b=o9n7VXsepr6cuD6PHu9gz5Ek8AaYml/xrLy4Me0rAAK1GhUBT9lr7s7Nmcyo2O3EKF kYup+YoFuzIdfA+et4DuxOUIKVQrrQbwjmChW7q9EqDMgQ9O6wB1D27BDTPT1n8v27Xu rTfh/2KfGjJGhliVH3qXYfRBXNmkAyR1WLYnvura08AEm5nvSjier8lNcKSZ6k34yy0a eoqGypanhHYtlmpihQmi4FUbdRMhDrWu2vRhdm6l02rZq1EglDCFjeAfeG2gPPQR55w9 J1AxayO2/ekvMuB3PVFn/6uwjS+cvwWTv6vBEdH0w2gK7Nm5J4zLc4o/Pv3xla1L2W8h ZnSw== X-Gm-Message-State: AOAM530s/eyrBbpxk0XSs9rNtaoaK7tsstWDyx5DsyvX3r9KAnzri0sv zZfMczrcu/gvmPm2IVg2eqEYhw== X-Received: by 2002:a1c:2903:: with SMTP id p3mr404022wmp.170.1599589454147; Tue, 08 Sep 2020 11:24:14 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id 189sm330439wmb.3.2020.09.08.11.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:13 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v3 4/7] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Date: Tue, 8 Sep 2020 19:24:52 +0100 Message-Id: <20200908182455.2870345-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182455.2870345-1-bryan.odonoghue@linaro.org> References: <20200908182455.2870345-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-20200908_142415_296524_46C57425 X-CRM114-Status: GOOD ( 13.72 ) 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:343 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 Reviewed-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/smd.c | 116 +++++++++++++------------ 1 file changed, 61 insertions(+), 55 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 3e8b929f45fc..7e3302ba97fa 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1476,10 +1476,14 @@ void wcn36xx_smd_set_bss_params(struct wcn36xx *wcn, } static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn, - const struct wcn36xx_hal_config_bss_req_msg *orig) + 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; @@ -1493,72 +1497,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)); @@ -1658,7 +1664,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 Tue Sep 8 18:24:53 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: 249327 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4791666ilg; Tue, 8 Sep 2020 11:24:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws+zqrpjqNqvTZb9QLmSuqj/yqyBnO3LXZk+vkF3d/9lAhvzMV7FPlgmQ5d/ZFJz9+CETV X-Received: by 2002:a5e:8d04:: with SMTP id m4mr114716ioj.107.1599589463646; Tue, 08 Sep 2020 11:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589463; cv=none; d=google.com; s=arc-20160816; b=jUq7M5TGrMnemEHmMYoS3X8HwHvBY8CuaezpZbkJlj3+qD1LRgx1dXBWOD9CwWLuyP bPqB/NsaeYefNdvKh5L/oycOUBxSco1y9lGAqMyghdlpa49sDr5wsCV8PDj+QZnteHnA bjKFoQ6EwQtcejQpDmCdp6E9bJasWHrNHDBWNfJGuXaWSe7JxqccY6IVw7BPYufxxzXZ ssFIVHuSh21Cf2ahzK0Vx7oeRa3dFJDkt+qqXIhOI9gz/B9APsPvpRAP8oORgE634CJx bsPt4LioOv4td+OOIBqpvr+7G5uEwO765bhTZpdgp2L42gdhSKLLphNPYn5kV14CGUir Izeg== 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=ahAVr0H/CY/zv7IoHNoRY7SQJFXHlESdzTzdc+EnOH0=; b=rGyWMCBSHrlqqvTMsg3J2fZrS9qwVy5EPKjUC7Mvr6ttWYfJTZrDvWF/ZgiBeln0Eg Wkx8UR46N+hPk6dFD0RNu+lTfmYmKQbPo95phd/mMGYmImLD4eRZ2V4Cg/LpJwMNt+K/ I8QCkcIkyHHxJmNmwQ2D1JE6dfeJnhzWZDp6cplT5X9UKCE8XBEZSVQKEi5HONoxV1hb NOUETWG/a8HpyVeSyZ3SrY0vAPt9+npjW2P0ixjwkDKg4oRAH1TCYU6PaJqe7fFNeYSl PTcM6Jxg2gFZ6JrAp5JH6EfjJ0uq1Hg4qeo/iOym3Lesbj6t3W1anQPcf/RsSg0WRwdY XSUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=qOl5hEoh; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=y4UZqdFw; 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 z18si123322iod.17.2020.09.08.11.24.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:23 -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=qOl5hEoh; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=y4UZqdFw; 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=ahAVr0H/CY/zv7IoHNoRY7SQJFXHlESdzTzdc+EnOH0=; b=qOl5hEohJjKpnRU0HlFNcPuor H64eZ57o8b53HYX3bpy12eOxD52UzTbAT/kxjk9QS3VhKGqjchtXr1zAyXSOmrvjfdoJWV7CCCe// lAYhWSpoYGcm4rMstNSYuJ66w4LHoz1mja+GVKKUPS+zTKVTEBrMPFd0o+SaKdWTJVljLTO7FpVrZ s+aMRrhGUlBseepU6iCrfZTxALql1dc/KlbBYusozSF1lkvMjyGdWW3Ck+6a8lxN1u5heyb2w5GZ8 3hmSPlQZndlYUdXPgTSeoSZTDP28xQMUaLUN2Zucdi/QhOOgq24cBNZwxVCjyiPeC+5ZkAAvQCoSm pf171f3PA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiI0-0005DB-Kt; Tue, 08 Sep 2020 18:24:20 +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 1kFiHw-0005A9-0n for wcn36xx@lists.infradead.org; Tue, 08 Sep 2020 18:24:17 +0000 Received: by mail-wr1-x442.google.com with SMTP id s12so193989wrw.11 for ; Tue, 08 Sep 2020 11:24:15 -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=HkVQqcl8Y72suOLVUyDLPMVLmKcAEdEBQttsVtZoFdc=; b=y4UZqdFwkp8nFPNtkEBkwllKDqiZ5DJDPAoBQ1pt+AR0JBZGN4f7fZLScqvPdZ+5gN gEWX8+QDG7hzBMrEsrr/M1BMq6I3JpC6U/xpXHG/xXJv89+5qpaY/yP7fQB2B4CiI9hP eH0P2vw4VQ9OBXKugLSNBMx+PyHzV1lcwfkhYLAuXZleCoUzzWqFTc16v/3mN9Rbc+ty xLpxL4Yi88QCh3T2Tq52TctSGCM5ZE2PhazvxteoPr+PRL+RNyBSu+Lcqgp8oAzodc3R kp1g+v3j+qUF2O6OvhUw7D5px4thZ5TCnrgja/98Lk35Frp5n4Y9ur/+nbaqYt0Un1Za oOOQ== 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=HkVQqcl8Y72suOLVUyDLPMVLmKcAEdEBQttsVtZoFdc=; b=XeUj6R9PSX6gbeLJr/8AEFOn//sqZWsA+aBOU53QAWAKtJmcmQFXrb0azMeWqmb9KN VLnTKv6OgUlM+I3O4cqKNJFGlfoiVJM36czip6VJ0BCpqGoY8qM081TSk7ClXR8hZ6RG Drvn/h18ENLGKsd44Scu7FDF5zhMoUhKXZ5yRAxshpmyg2is8akepOTIhZem31uLw8wD sHJsvTbdPxdqDqaXlaZ3cVowPYfG+gphO0tjcYEZb1qSqQWFiG/NUEmdecPHeSzidV1+ Bf81Fin8Q5c+bmeos/30BiBtmeePi09hvU+wULMLRWUD3fNNm7BhEwRxbQ5rdbypDKOy mP7g== X-Gm-Message-State: AOAM5309Twkeak/tLmX5iJAox8ztDsgHZLRhFYSmhu4+QxkAMHcZTjJe wbYn5yOPho3zkT/YtM0MYZ/tLw== X-Received: by 2002:a5d:46c5:: with SMTP id g5mr951320wrs.416.1599589455037; Tue, 08 Sep 2020 11:24:15 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id 189sm330439wmb.3.2020.09.08.11.24.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:14 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v3 5/7] wcn36xx: Add wcn36xx_smd_config_bss_v0 Date: Tue, 8 Sep 2020 19:24:53 +0100 Message-Id: <20200908182455.2870345-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182455.2870345-1-bryan.odonoghue@linaro.org> References: <20200908182455.2870345-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-20200908_142416_066673_B5509F3A X-CRM114-Status: GOOD ( 13.48 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 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 Reviewed-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/smd.c | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) -- 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 7e3302ba97fa..e603e2d3be16 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1584,6 +1584,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 Tue Sep 8 18:24:54 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: 249329 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4791670ilg; Tue, 8 Sep 2020 11:24:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeeoM0FVpZvi0ACXddLQKQBdTmzp3Sevl+D924OR9QeneFudwUrGN03OWGXasLS6w27JjY X-Received: by 2002:a05:6602:22d3:: with SMTP id e19mr104213ioe.197.1599589464094; Tue, 08 Sep 2020 11:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589464; cv=none; d=google.com; s=arc-20160816; b=R6wmnK4sRCTEpVQo3zVinA7/W8GcEMQZWp8WKonfBjCbHWBXRsa9vmhgrlXPyZrz1O CxwtY5NGo5HSnpAqlMc7PbWazOYlTKgHdMSL0WhSeiaBJoy+M2hEKDha5eEGCDMlUPo1 d2cjOFDiwTsKdx9zlUtKwR1koy56e01wpKr7+sgYDTouEpXz4PNU0VWl5eV6i9AqJ/nO T+b3AwEJmonhkeP41BvVUmKKl5Azj84hvcLiKOSQat17D6dPxFrXcPzUsBYeaD5pqroI rVPdeZpIEPpjeqt4FnbQlGyq1EPnV5WfMKuGZGE9R0zOUZNk/r8s4tNyfcnkN+RNNr6N YWUQ== 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=B0Cp23c8tiy6tETjqkt5GIuIdfUoK+4+HTEl5vSyVw8=; b=XVs/4TtCvAemShedO4FClN1eS/2s9LhDBbsi/ts2mKapBpsMCiR+CTrLnTTyo774/W 4ilTZfWOI9AR15FSEqXl2vYjwJN06Gy0/kp74fxJ5MK6UolT+tNoGOVkfMZUj07bHSLa wrYDafs7SkQjOdPJyGJa/X23WQ50yo/i/tfphYl2OR4Awec417DGSK7vtRxye8deu3cH 33+938BpkqFmOAalKPvD8qJYkSEDS/MO/2YrXN84QVWotctGmJUbLVC0/WUAm4EfuLx5 zyFB/igfpr+4c5OEXjLshAKiynqiHeTeoN1Fw5yZscLW57/mhAkTZvVig61W6DGLUN1L zOqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=hjHcxc65; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HxjEjeDB; 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 g2si219425ilc.2.2020.09.08.11.24.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:24 -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=hjHcxc65; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HxjEjeDB; 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=B0Cp23c8tiy6tETjqkt5GIuIdfUoK+4+HTEl5vSyVw8=; b=hjHcxc65lU8ZILmoyjcetpby/ Pjo+/dh5EM4PEwEE0KhZ6rELku3Y7hdvTsufeC8KmSO4zmBDlV6MPlfN48PfRg3Z6HA+Fu9G5kmDU Vf9BgKLpHLIy5tQ03oNx9KPxcpzqm83kvqrCjVurgU4M1cw5VYUC0ExPxaLYX9phekoD5gmUcMQiR SQWi8FQNvs+7PC3B/z8c1CTedWZytXnSsDZc28TKtSXoCGaZw6avyWiaGMEFiyYsgCLxVNPwoj0lZ h261OYxXfSU/J4RATZhr+wLpVMZNyvqKeSQIkQCzwvGDUeOPdnWO3CF1iJwHtYiAtw5WurVYm8vx0 Gm7QuLKhA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiI1-0005Db-7n; Tue, 08 Sep 2020 18:24:21 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiHx-0005Ax-7P for wcn36xx@lists.infradead.org; Tue, 08 Sep 2020 18:24:19 +0000 Received: by mail-wm1-x344.google.com with SMTP id a9so310321wmm.2 for ; Tue, 08 Sep 2020 11:24:16 -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=w/nry3NgBBjA9BLR7RzttfZX9dZbP5DRqQfPiOO3p9I=; b=HxjEjeDBpqabIpTm9g8TfVny9NUnL1Xihv2rOtm2tlJTyPEAHZBVpluoQb8Ak53QKY dUPcWsNWEqq2jYhMIvrxQUMq3awrNg//GzJolKw8l4WM+ju7sfe8qAzYZ1xkIQ/BlGc6 DIsYmJxaxA3EW7RQHbi/MUpNvssNh0Pnh5p8WT4AuUmnVHzlr/3dLHpM3CDRd4NgPTwM HMZmgQ7pNw6CRAx3eQF4uFetr217Y5e2n65TMZNIQ9TZJQYQq3WyBKpPcjtkwkasSI0r CRoutRGFOfaDxRWWPnRmnvLwo/NAfZDNrnfkqmsS+uJdQDiw4kqR9jrAIbR0muESpqbY oktg== 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=w/nry3NgBBjA9BLR7RzttfZX9dZbP5DRqQfPiOO3p9I=; b=C9yaW3QxmO//0iCxS3YrZZSdLoJeOgrr2A36Y8ulxwM2rP0kuF6ausn2AQOa/Ap9D/ SDR8doC+4ilNOtcyBz/vQihQmEsDAwJKi/eMitsCkUj4K+KGSgqi5mkwPkMZ3WGcA4Vt LUFcigjOK6QCMT/NtSf8k3JTkXn28VUEcXGLxlJcklARMFQcbljICIigFu9Uxw0L8Zl4 sjWk3G5ksrkzWlsEfAoE1ThvUxqQN2vAP+VOcZPV4jnprld/8V8ddCKZALFuaMNofniI xTUXJU/vfvxUUZ+hX0fRCjbwKXgAS+iIxB2VUPiQg0mr4rHiToPSjSh+BYBi4oVKacnQ WpUA== X-Gm-Message-State: AOAM530/UzNM8PjhdbbtEHAvjQWM7r4PHk/TVTKQFM6G63rAeOaoaKbg NkOQUUpbnzSJDo56nQmK5D1CvA== X-Received: by 2002:a1c:6445:: with SMTP id y66mr445429wmb.12.1599589456130; Tue, 08 Sep 2020 11:24:16 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id 189sm330439wmb.3.2020.09.08.11.24.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:15 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v3 6/7] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Date: Tue, 8 Sep 2020 19:24:54 +0100 Message-Id: <20200908182455.2870345-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182455.2870345-1-bryan.odonoghue@linaro.org> References: <20200908182455.2870345-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-20200908_142418_019391_7ED16A36 X-CRM114-Status: GOOD ( 12.29 ) 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:344 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 Reviewed-by: Loic Poulain --- 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 e603e2d3be16..fc922dd9ccde 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1707,9 +1707,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 Tue Sep 8 18:24:55 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: 249330 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4791688ilg; Tue, 8 Sep 2020 11:24:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgOm/4ZyRw+jnm12O+6yCgdoG7ZYyNLz1CZxeUfEPJRZXthLuWp90qwU3htPGaPogQaJbu X-Received: by 2002:a6b:6309:: with SMTP id p9mr152266iog.78.1599589465014; Tue, 08 Sep 2020 11:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599589465; cv=none; d=google.com; s=arc-20160816; b=sN9dmA+cVIIdr7O0ZcOda1WraTjczHmGUflRZC86XY2rGEeMXbnHvil+Mj/Wq+Xdht L6ED6IEneiDAAEF11+OL+wVinHOkXqHCCMVxHWER/J3BsHlEW+/8IEI6EHRiYOwftkos rtZ1QqJV0wwskbTXjNWOYvnSamMP8wVvbbnas4xwjZIutfa/6G0iYLbPCz8UE+H6jvOw H07p4zdYKWFLF7+pYddIPfG7y4dxDjJeqdYE/dX6dh5ar7TArqeGWSuaLYFBLzhZV11e jvpnIF+ghO61NERqbkev8PZKNv+Qo1DrSRjSiC1Kifu5sXvnoukGEHLbmHOWI4zippHv esuQ== 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=bO8abkq1sdaBCdr+F1kXFa/GeWECCdvP/LdxiwDLGuo=; b=kBr1v+7fZdQ8rSxuM22l//QY2fSawcS4hGcK5lizx914p5PZz2lqiQtchwheYfzsaU VqriH9OYLhrqpmgFvtjTpVrRw4uOWtKwmkLz4XVr2R2462Nl5Wg2jm2UP1HxRLmHC8pi OjSU5FUxlQhq7ho57MD6Tbc7Uj8etiIuBy6o+xyqBgM47Oj6GMzonrVB4mf9hWJetM1Z UT2TemVu10LNBHpT6cZ8FalLrwy2q59ZvAvoXyzdjB6mtfjy7YiO7L7YfL/dVI7oQZRn P3VFR9acZJkha2QHoHajVCfW9ucGk0s0NSBaFBvY815Z2W2aG6EZXPWclxILrESRlI+3 xa/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=aITJ4APe; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="R/5PR7kx"; 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 v73si198887ili.146.2020.09.08.11.24.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:25 -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=aITJ4APe; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="R/5PR7kx"; 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=bO8abkq1sdaBCdr+F1kXFa/GeWECCdvP/LdxiwDLGuo=; b=aITJ4APeLy3EFMiCcmCgFzH6V ap51fWi/HI9yr7IT3BVa1tk74df5Om1CX6q2wslw9uLtEW5xkivB8YNje3dIYWiVU92BYNkRkvPVr Pin1nfPWGnitd6c04ik7frXfXDqyz3jqoLYiCJC/9REtAmBxcu29l10Ga0gYQiLHpvn4qqi2dtuyg VgAwiwEFdhzGLWjfajdfrslyZQMxiuOz5EQNp8DzVqYkv8KcXjhiBlSDLkueIYqu1cAj+92eSu7Xk 31WWF/j3tu0xHTKy07u1ELMB1tJXOTloYGkvFD6DqZLc9MbCMbNPdz6cH9+1ZvYe9LzYwY+m5lBOf fAtdAPklA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFiI1-0005Dt-JV; Tue, 08 Sep 2020 18:24:21 +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 1kFiHy-0005BZ-6H for wcn36xx@lists.infradead.org; Tue, 08 Sep 2020 18:24:19 +0000 Received: by mail-wm1-x342.google.com with SMTP id x23so284408wmi.3 for ; Tue, 08 Sep 2020 11:24:17 -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=yTFsQ/Thh+oiXlokRzBRhy7fryTyWLYZWgMktev/5uE=; b=R/5PR7kx5bfQao/dqFxTgY6vVvKrEtNMCgcmIzT8IuiRX6AkKDoLQuIu2T/OUZrFRa 5NdfNo3Nj8cfkFq0zvoUSU3r8iPIy3IO0bua3rHtdY029+N1mAKp0GeXFDKdtmPCTDSE kfLaUVJ8StB+NaAWiB843vsIR50j55pTpA/zAsY6EgrOFTn0jG45GDj/sYl7QpJtO4Rk 0Y3UhlAg6Ui1aMqYVWVGJSd5YlzbUh3sNbpvEQQPO3+a/OiB3rElDdMEALn2qs6LZY/Y d9OMMlkS6K1g1hWqzPKwCF0C8+l1zcB+RhvHCJmKKAs0CWz7eGBFZ4CY2PMjO8Q5DxcA ZWUA== 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=yTFsQ/Thh+oiXlokRzBRhy7fryTyWLYZWgMktev/5uE=; b=bxBE2FISzU1JlT+BMZ0PH0mdIKkSAnwD7CymutHzwybHjqe1AcO5qsqFfg1wUNTS3z PqQXCbXSXPgOa/kTafteRz5zdWK3q1bDTr3jcJzryZwgJeBWAjUP9/2/y2OABTmZHtyn BtKCYKyKPl3X45hZmaYfBJ/pQnKDbW5wDQJI19B8JXBxaJKxsc5FpPxyKd7u5dpXexnF W7TTHREd6TdvxKnB5ESMaADXporSUZjVRp61poj2ZCkMohuF8hDfyv4bzdTlrBxN9fZ2 nw+jOAEvDmZfb5ubfhM5boufsa01qL2RJDalWTq6ubIgQ5MfH4gAqDvi9fkNC2jpHBNm tCRA== X-Gm-Message-State: AOAM5316QYXT3hV78of8fTSSeextPu1NnakFDvZCkBunz1D6CNqPZUHq RIrvnj4a2wKq2vkq+dNE6Kefa59pM/lxAw== X-Received: by 2002:a1c:a385:: with SMTP id m127mr373050wme.189.1599589457082; Tue, 08 Sep 2020 11:24:17 -0700 (PDT) Received: from localhost.localdomain ([176.61.57.127]) by smtp.gmail.com with ESMTPSA id 189sm330439wmb.3.2020.09.08.11.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 11:24:16 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v3 7/7] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Date: Tue, 8 Sep 2020 19:24:55 +0100 Message-Id: <20200908182455.2870345-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908182455.2870345-1-bryan.odonoghue@linaro.org> References: <20200908182455.2870345-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-20200908_142418_276462_73DCFD58 X-CRM114-Status: GOOD ( 13.92 ) 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_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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 Reviewed-by: Loic Poulain --- 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 fc922dd9ccde..ce6536a3185c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1673,42 +1673,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; @@ -1718,12 +1691,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; }