From patchwork Wed Sep 9 15:36:22 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: 249480 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523903ilg; Wed, 9 Sep 2020 08:35:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5jjcf+eUC2cy5/lvZRCR7fiOud2MnoYnHA56rkYM5FYfVvl5ZrswQDNFS2eaUxloOq1ml X-Received: by 2002:a05:6602:2043:: with SMTP id z3mr3695283iod.93.1599665748145; Wed, 09 Sep 2020 08:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665748; cv=none; d=google.com; s=arc-20160816; b=ICPU3acMg166N6NzlW7PRzDN6em1QjOuodMeXoNIEIVie37xahGAtnR8ZskijbFrPu iTtjg68viHCroKgZioiFU0eyXaZhONX7C8ynWNt/wSNYwW7GbFVCmEAFapoWR5kZEZ8L 6jTopto+7Fp/pI7l1gM7495pzfzjHIXIvC5tOv5PdKUd3hbWr0Bh9M/JpnP0FVqvPdMP YjLd36YRc/c4st+ESf/FuiEn5FBm+AuozEMyqp/dQwqzLjhUOvC8MyWFfaiGXgngadPq RfEDim2CfGc/CLThiCiuMJ+WneHTL1p0ONrhdMQKgGet+JPgvUjIrL3+qqLbZmn5PSWh YCNw== 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=EXN4kNHhBP/g7qqGptZTHqaXsN0qkaYRbluHPlZ0i0w9W81MRwCnhCRKcoVZthBnmU XyAawFmMDTWoZwQt3B1eOGI5U978mqmx2GPgocwLOF7gPknkyZfKzggRhGYfxYKBpfeb lo9znUUytNMkzWdOuWrxzgSJsGB24ILU9aF6rkCmuCnt42meVvjMu1q9ele2990svkF+ ijLoKE/+RBqDPsMUZo7ugCJQNjn5N2YuR3+1UVBZ7BaIj+WiNpwtQYPYfHuYazGZWMZR VT2IMNV5ic+BlCkPoplTiI/pJLco1I6OvoaCc6rEqz4SOxXjV9oWsxKobfbLlRYC20A3 3rSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=kLzSgAoP; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e5dBR0Bu; 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 v4si2086225jan.53.2020.09.09.08.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:48 -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=kLzSgAoP; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=e5dBR0Bu; 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=kLzSgAoP11PQ6xUah+dJnoj8A Lf7lzImaESFN51lwo54itByTw2rI0LBHeRTlK+L38GvIb0iMG8klsEQZd7z9euCM+nftBVHzvr8aS gg7P+iq45bMkipTR6oXc9wqMrPpwm8/WJuwEdMXe70oi7jb0t8TgKxMwkglNdQibI0npOztVoNjdX hwFIqE0ucHnMiATqZO1JR208A8pMJgG/J51UcKAa4zRmIfKoPXmpLjGB5AP715Y9qNh/PgSxW9Nav rz1IpItTmi4oVd/9aZWh6mSKevhZtWx0dwksXOMgCOxB4AOmmZv4STLG3K8toarQatvm3nGXHkcNi thq4YDyhQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28O-0006SD-Kq; Wed, 09 Sep 2020 15:35:44 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28L-0006Qh-EC for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:42 +0000 Received: by mail-wm1-x341.google.com with SMTP id l9so2826579wme.3 for ; Wed, 09 Sep 2020 08:35:41 -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=e5dBR0BupdAskOjCR2OsjCy+jm0ple/SxA7HI6cVw3GyCuIddX7XOUMSNPxUx58zTb xrMoV58SdKtT4wjJYoFC6ITxEupXAccFJ5pdbbOb1/eb75eECWSeAXUAAvPSaREJ2lC8 tzDAMVLNL3TXvffbUK/lrvJPQEyzXAfmO6Lc803q2woZRxw52icYgmhFuVp/kmw3Z9F/ 2NJ1LWsja4G6RxP12CAzqNNjGXDTsRtgJHkk1qoC4TtY5ZJLp+rRGQc131eja0/tTsZy I5Fm+ae/XAK/JXKb7k13pVXnvpboLvNcWdYCOMegiDP+/GRi1cEzv9osjqQLsDTbZ97u bZvg== 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=nsRrGfvgwVyMAOW/2C1Y5D39j3WW2cmNGruWWapTQOt5VWMcas3QlcKEedu9H+Twwn eu/YZBnbzfZj5WpUtn9iGPiX4ZXcVTiyqtsmX3xmzYq9stHY7L8h7QvFiZ4naFLRfwlL cRcGQxzdxPNge4pkBaLa6FhlxRalYFsdynX9VCQZClN2RfPglb2Zjq8VNDjXRaokMEdB xsXHAtKfZxX9OMVOASZcJf3bibMCaiWxXH86t0nldCfsnyQY8J/iF+Bb8D/anC4/5aUg 2XTdmkoV0xx7ZorepgtGzR2V1tioIS1eRJmVbik5/UMMJYvgZ4+n2oHLP6gVlB3FdVY7 sa/Q== X-Gm-Message-State: AOAM530/b7NFYRyJ1PatTxGsGk7x4p33r5xe1/i+fhIijIYwqDKmWcY0 7v8LBSbbqWsJ4/hsS75ZMq2cEQ== X-Received: by 2002:a05:600c:24cc:: with SMTP id 12mr4285160wmu.126.1599665740601; Wed, 09 Sep 2020 08:35:40 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:40 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 1/7] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Date: Wed, 9 Sep 2020 16:36:22 +0100 Message-Id: <20200909153628.2904888-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113541_507644_0A7631CE X-CRM114-Status: GOOD ( 12.42 ) 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:341 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 Wed Sep 9 15:36: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: 249481 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523920ilg; Wed, 9 Sep 2020 08:35:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+RPeKHPmCCUJRZqjnhqiTW7bRS4nT5igjhChLhAruTdPfvvQ0UN4JUrPV07wVjoDS6ZL0 X-Received: by 2002:a92:dd85:: with SMTP id g5mr4110116iln.210.1599665749462; Wed, 09 Sep 2020 08:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665749; cv=none; d=google.com; s=arc-20160816; b=LO5SCK2UvqrjfD/wuVFxg8HFF/3rzKkPSFeSjVjNrKd51RzLj80xUSwmc3sJ5ygqY8 gIqtMHeRit8LoR1qqzDuJKycp8V1ueiFyr9zK/T2/E3xc7/M4Km4+/RXtVjueNo7ZU/V /751jv2yBzxaeY6YPZ7AFXxsZspazD9dNPrMO33qmhdjkllFrzDbviOV9W3xVyWx/R5o R9gFmowBq8SAbpra/P7TpJ6fRZXOY4zsCOvHKuxas+/kpYuSCuY/6JUW9o6+zzf02mTo xNxOZS0gB4Tk6nmyeWvwd01Ynu9wCyy/x+smh5fxJxqUBxE4GY/w4m3Lz0PN5RF/9on1 +KOw== 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=slhH+6MdI/Zl5WII1fvccjnQnZiTqcQY5rrFAMJ4AvNFv2R6zgWjsVZbq5jXoNLzS3 ZmYbw+2y0nMqPsJKqCBL6sUwMOAds1MhVd+wKGmQ9tNC4nmJiqZDj6qgRu1JPo5s+brh 9WDiMd/OP5e7FFio6RHJ3Rh0ZQyfM+FTUyGvc2eo/hl/VKKsjmYdfDdRPxwhCiXlpxS/ 5+TJ9en36+3R4I+bFeSGXnW+EbICXTUmu3Vc66mQonXFkOYbDQtWGHkufbmVSXSaCfml fmzebxE0G57KU2KgbWkeP21pcx9bb801LCI3SstD8eA/Y+4Ft56LCUduOfBKurFBE4B1 3GFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=h8bbHuXL; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=C2o7CmUp; 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 u14si2319289iom.12.2020.09.09.08.35.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:49 -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=h8bbHuXL; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=C2o7CmUp; 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=h8bbHuXLJn5zDWLzIpclPeHu8 xF5oX6zX8ZTF03W4MZuGWSYFpftKCqDd/PHZEU46g4YNEKYk7SS3TZmhZuBpM3Taw8Vob6AaJzxKH mbSfVTvcSV8KYgxurPEVLrCzP2LFuGt4BvIftUtUWco5nIYFqva35bRYHEWRGk56C5ejPgQlAVYPD i6OJ2r0gkPUm0cpYDC3Pb1jeqdso/S7mdNsTokqy79itCxhMxwomhpqZmWoHoxqJmmPURfZXvozlp 7bJPtQ7d/Bdd5sY3kUHfrcya1ikb2ENA/KyX8SzuUHAOeVRYFwCDu+0XMO4g3ANoLlZ+CjtiB6ITu e3LIWsZRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28Q-0006TA-53; Wed, 09 Sep 2020 15:35:46 +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 1kG28M-0006RH-JY for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:43 +0000 Received: by mail-wm1-x344.google.com with SMTP id k18so2811794wmj.5 for ; Wed, 09 Sep 2020 08:35:42 -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=C2o7CmUpJtKLs9TEWpSRunSOxPh+9pLoyKfJLJMjnmv3A2fRSeKqUnjBwGd/5ErmIT f7IWJ+Hbl9+5RjVHYczBuBABIZt5dtffPjB5VkM1uu62D5JaP4gpvW9fuc8xLh9ZrfWm yjD1zxEfn+5F4JDjg6lAadJjQsyqiXNo0/Lgn+fJgWfVvbe764x061ER94+Ozi0AjtDw 1Mj3PeXXqF9xnyIJD+2d1XtoUNN+Z7DI+tp4NgQTKYER/XGrScZcHSyiHxiWfY4GG0xx 4rp5DMfJo2agzwegtVbuRLmLptFpxnm3C6SLSKWc+yR+IxNJkrQ5wDedhP6fNiqtTOhl x+eg== 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=qPSz27CJKERcHHM2mFUlfis9ybXpCDvBlQSTf7r7Fp1mR1W6MybPO7jO/0J0v9kb8Q UcWQ5eFUHOTGLSeyqzIO47+FL46VII37hTxNNt9tR4//qhJj5Hgy6xrz6CTzu/UH3wD/ jfQ7tFTIPQALIZXjd6icq9D6maqBK2ekoAWfGR8A15GWC5ORNSG2fHBP5qFD/SDzTPI2 yjOiPyBktSqRuPOoASlcc34ns+QTTgsSjLCGeainEsiFX3+0mQ93/cz1omERgh+YSpQR Eh6dqYONTKGl/xJ5ZLkeOzgH3Ps4kZqtuRTvdwIBlYHyx0ps9qSxjsguY+ZxhuvVDsaI 1qdg== X-Gm-Message-State: AOAM531Bx78Xxr8+OkZU1zmawCaKgHDzsmWLEXekxghVoDZNxnUASEeC n1mr2k11p2CP1bqykMJhyItXug== X-Received: by 2002:a7b:c182:: with SMTP id y2mr3754745wmi.21.1599665741678; Wed, 09 Sep 2020 08:35:41 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:41 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 2/7] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Date: Wed, 9 Sep 2020 16:36:23 +0100 Message-Id: <20200909153628.2904888-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113542_708584_E2B7E83D X-CRM114-Status: GOOD ( 11.13 ) 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 Wed Sep 9 15:36: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: 249482 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523960ilg; Wed, 9 Sep 2020 08:35:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe7cEZPhI80YsAIXSoVQB5mA/K9W2UKJCpmta2vvAlCjSeYK+pC6rGhsBq+kGvT+KL9J2s X-Received: by 2002:a05:6638:76b:: with SMTP id y11mr4502906jad.29.1599665751770; Wed, 09 Sep 2020 08:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665751; cv=none; d=google.com; s=arc-20160816; b=kkauOjc5jIlmfNCQDsmgEfJnPtJX7oNs/5Q3Xo+cM3FJ1WhdlciZ8Ijt6MuNvJr/At n46oc5iickVng4mH8+iGAgA+xKJXQtMWYYyPZvJWl67YHeiMP5Haw8tA9xJ/CdXMTBQR 8HTnZf6/DOCtox97fMnFfacFp2NgRyPJC+90z43Z/Nj9wIhQ+cooALsulXlN8FBvDFDM 9eM4FX+1xJXxaztxY2+ljltI6/0RL7dSlnTHIuUD7/opgE1ckbuQ18wPu/4BW7v0BA6P 2oeHoq1AEIo9DePAdZ6fvp/bnAK8WXezgmM04uovtduPiMup3xUm5enbpp66mBPpoXnV 5qfQ== 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=kWJyVGEqj7Ymd1KWhiE4ernv0cEWGH1uRuI4W31gOYjrgr4hxa/F6+ZpEabsX8eEqb j1tanNo5e5u/LYzUr1ICzkETHqGWFvE0PoPmh1PoJ+TzmboUAs7ChEcGn8rGaMkUuLax DBHbDcdacKULXvabCmsFBVULd4Ncrvva14KLslstRqSa2w/gJZNm44r4FEpvn68YjQN5 cyY+F5O97dHMOdWKgRvCdQjCSEGVfkCibGAf3wVN8xkjQknCvL0uzgi+I5hd6Sggp70D BUQ6jqVBpUzQI2QwLdOXlqSYoXC0X4yFwvhdOKFj2eGv4aM5UxEkg0+gJPBmvjULL8jK VeVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b="Vhkq/VOV"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="JQmdq/Dm"; 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 u18si4487300ilc.144.2020.09.09.08.35.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35: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="Vhkq/VOV"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="JQmdq/Dm"; 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=Vhkq/VOVQaJ2U4zZhU600prVL 4EG2TWqKNraUZDlMQLJcAx04cEqSS7CCInVcI1V62YFN6moSugTAdJq10EY5+8hzORUaRUQb+6f96 2iB18UEaoO5t7+iYVQH/jbhrbR0lvdhT0yugovanEs64+s7dD4Vzsh8rE1rc22wpcuE+eyBC/Ri51 SQH9gVozPvc5D15AOpuYMgnJ2xu6nJFE3TIPpQtMFgnXfPekHvppcZ0T4d2by+7E25pgy9qzk10yW TwPkXqHFH/81y7McQSiKak+6qzOqcybmIPq/8BuUS8/c2k+Q8+9iaPlKAIJH/TvBVUX3taDtSvLdT 5Sk7x2nLw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28R-0006Tw-OT; Wed, 09 Sep 2020 15:35:47 +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 1kG28N-0006Rl-MP for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:45 +0000 Received: by mail-wm1-x342.google.com with SMTP id s13so2718468wmh.4 for ; Wed, 09 Sep 2020 08:35:43 -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=JQmdq/DmpRMuXqPjhMZTbESGSk0q4YnMaQhFqxvag3yXFNWjosuAlQjmpkSyL8GplP 6424d70nxq8QD4uDwnnv/ihpOvF8iK7EpwbNOTGNd54Y/Rth91iwgjuaOeuHS+OsodYZ gieHSNWHvKTzKNLxBkElMXQ5O1jWzIYvazMkDqNMcM56Mfqn/QnsZQdyGIWM7XOKZFRp CLfIuOxLzzRvvecEaJosbaL6zeHmyn8CjGoVfWbhj3Gdoyc0DYuxA/ktLbySSpngE3yW gVEDeI97yJomHdMWHno3amIX2dAEyHspNZGw3Oe3vq35LjSz5oQoJv2I1Yolft03k4K3 fSbQ== 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=fVNkp6a+z4FgDxzbbGEIwJRIhCTF9h30xEvzOCc6oh6IBVyQChOv0E3wxR9QDgISuk FS8WjvrvprXlW8A4YjqVhcETeeIfB98y0rJYwQAu1oonV312c1sCpjtI0J5pBuHQTKXN 6au5epDrBcy7sKdY8ZJrixw5Ga9fgsMLJ61SkFOWdo8tCf8lw+94Jis+iCubAn2eBa4q YgFshDU579r7DY90DkYmcZwawQN6z4WYbi7aIU1aizpNkT89MQRTdLPfP6YdgVyJ1F2M zjP2WT5nS7TCS5p8ULta5AXklYW4mPutJwzUNnRC+SjySSLGWFOyUtCYDvfGAFSM0QDR tRDw== X-Gm-Message-State: AOAM533Tb89BzMiEDK43vGYTV76x1KmAXAfPSVBfFtR9NXs43nSabz1S AfYsSuKm+/dLdyadMnk6DGpZOQ== X-Received: by 2002:a7b:c749:: with SMTP id w9mr3848922wmk.29.1599665742763; Wed, 09 Sep 2020 08:35:42 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:42 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 3/7] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Date: Wed, 9 Sep 2020 16:36:24 +0100 Message-Id: <20200909153628.2904888-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113544_255821_49972782 X-CRM114-Status: GOOD ( 16.30 ) 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 Reported-by: kernel test robot Reported-by: kernel test robot 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 Wed Sep 9 15:36: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: 249483 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523965ilg; Wed, 9 Sep 2020 08:35:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi+lM+WW7igH00E3A1uTt1wu5a9vtRb4moM+3z1wuQU0KNhFFOXalAQGGTNZ7m0jRlaYo0 X-Received: by 2002:a05:6e02:ed2:: with SMTP id i18mr2915397ilk.124.1599665752318; Wed, 09 Sep 2020 08:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665752; cv=none; d=google.com; s=arc-20160816; b=An95foiGgmP9Sm7eaQThCj+6qaYXGTE4bbaPVmiEkxo3fBJK8+Aok75yFtn3dvFwG5 0CIrdGWLWEP4I+f9qd6l3mHrLHxXTKSslpFIBYT7Efuj/h74zNbTRRsNSb21WNXJfb6m veF0sLu0PYg4yCrN7zhDh+0rmmA66t+FJEkogUo/MfIUP+h2b34HaTquXQxRb0tn1Fxe A5q15YUJPrhaZE2mIQDXuVCUcAMrRZdzqANyHG/j95EorqrQYQzGMraygqO0VfifYhdt 5t8jFluu5q2HNBEzUJaNXEdqzLrdurBpcJrWoH/rxlJ4dfVr3Mje7AcuB5xzmUSdS1mp ev/g== 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=ec7xw63AyXsJ7H0rdUgA3JSJFqtZKSjTRlfVpJR8SdaLo5yPBESOqSJzyuuxKQ9LbJ bSmGvzyBtMk3/deumhtLBxre4w8SW0naX5wYTLy8ILebwXr143NL8VEcdDeEkqKbeuFK kUSAvNjG4cn9Iijjun8wkMrHkrovvgACIlUoQquEp+bbj7B2CSWTQcllBnSbKlLSGxMT IstygUojef2ei2u62cS5UDiVgLxQ7DNqMnxJmx9QEY865oN3BPdAFwUQdOvlO6eyW+kC DAW16u15gjIA08FjokeZQ6IVwtXykEnO7P7FbiiDyzV2ke14wepcRVKPzFmBdb+jUfBK uVaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=aWGQYuz1; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Fybatupi; 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 m8si2326811ilf.86.2020.09.09.08.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:52 -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=aWGQYuz1; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Fybatupi; 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=aWGQYuz1qKy+4DWVLgOUXURnx B+ua7+oy29ieU7OPqQk3AnhFooVOCzd0LV8HbVqVlroc+hnWx0jUlUEEoZYWBitTAnTd1arpImNTP Eup+tr/pyKvWLvil9zHLmF0Cnt2KBwTcqpfcC8nFjSqyEbX8p4X3+0vOfDNnpdC3HyBoyXlD8IL24 5g2MZStjWCnWTiCIsh6vXfxSyzbwBN2gBDTRJJ2kZeBq/uw8xqm6xmEL8FyaiqyqPzuchiZzUMOLa AlIh0VrcnI/4X7eDDKNxLEH7BjdBowSQe+WZ7nGitv9sUDPH6b+U2OXrWx8U9EioPGiD1VEdOQeSK IdHFkRCEg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28S-0006Ug-TI; Wed, 09 Sep 2020 15:35:48 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28O-0006Rn-JZ for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:45 +0000 Received: by mail-wm1-x341.google.com with SMTP id x23so2719236wmi.3 for ; Wed, 09 Sep 2020 08:35:44 -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=FybatupiTTtywH3lPJFQEugStBJFSHeVCSZBS5A6KOTmgveOD3MuL5jb7K8CJVuNgS 4voZT22obJzsEHwZPJhbnEiAFH8Y0SzvZjJEmhKrx+1iEDGfdRneu/lozUwgqwYOOIOJ VMocwLMcLlQP34AsZ0juJGcib5eP8cguGRnzIbXnmjMuZeOF9x0q+rf4XSWVs+SmIGU9 gqVETyArNUtw1Zajssdi4pqWm2e/qdos9POwYgOtU9ZDZKlo0g2LEbJb3PK4DO7cZhT9 +gpmY+BUYCC0b2y565BuosQBuk/mVUo+2vsoV8l2b3qN3OHeNIKJqM8Ktn2ycuc+g1y3 uqbQ== 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=VzX7coaAFhxQc5TrAPeY3QBc50/9d4KjJjrhpmg3Bj34EQ6i+CVApmyNaEbjbwOmrM B/IXUIvl9k5u9j98Cv241CH+v9XEhZNTCyEXmFgXOrNa3/1hgyDEaFNmyi/hbDCAigDq LhIp6ZCar66qywVLSrhtDdG0+MUDaxmEoisY6nsv1wuP/mYDSywe2LYr1QZArrjOrp9A zmDKqqv05Zn4lvay5uRFLshWW6GtE1ma6sK1cV7Ln8CLPRce5uYK4CYGW/d/vW7vqXbE yc5xlrpJXED5Lr+TlOs/jrnftcteFZ+lDVNewaVxfsbiXkaSUwdsj97G8tMaVngnUGnA wLqA== X-Gm-Message-State: AOAM531dX7eqVmxPVLior4Qkba6TECVfYBtG4zs5Bs7NyomQHWKgUaBU 607irR4VyaF7zhL/bOb4SP3/ig== X-Received: by 2002:a1c:2e4b:: with SMTP id u72mr4118688wmu.69.1599665743695; Wed, 09 Sep 2020 08:35:43 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:43 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 4/7] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Date: Wed, 9 Sep 2020 16:36:25 +0100 Message-Id: <20200909153628.2904888-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113544_676194_4B0C6F69 X-CRM114-Status: GOOD ( 12.76 ) 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:341 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 Wed Sep 9 15:36: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: 249484 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523966ilg; Wed, 9 Sep 2020 08:35:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwv8Gtu9Tyk1+pkXG5P8kYZZrVNWvOoGFp5qlxBq/0E7hodkDrvOexlP6azICyT6O68xq4M X-Received: by 2002:a92:7307:: with SMTP id o7mr4292526ilc.226.1599665752424; Wed, 09 Sep 2020 08:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665752; cv=none; d=google.com; s=arc-20160816; b=vcJYdV4jwNcTp529jEjDMAk0RPNGoEKHFI1hRqHY0ccmxXjPRbcrZaudNg9bkyuw9k YEb8aC7esLlaclUlVQ2LxP2uELlgrLAuPbrJirMLPxeNfAC2vSG6vAzIMMW0ukh/3OLO kp1RWh3qRJliRYFSfK7BxQ+wqGFehq6Ged5beyBBpcZ09/bqANmHRTAuAI4KPwrpZ2VI 3iJAnnL+96JqhqWVjYE2Lt97Mops4jJnCWCVzmW/GK2z0Ds/J+ayN8oiVfPhcrC9nwsc C6EM5VdTsGsEACV/BOxQfwmnUd3uJ5vI8PoeVLXca72OQcVFXlGY6pG8OrqHl9L0ABVv AASg== 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=BWzy6ZUsoQ3EWIP2kVJ0DQVHpadDIIGcmYjyyU728uYt25n4vN9POv55j/sEYM6t5N b2ib+EjBberAZnmCV0CXboApn/70YvBl8/LejrM35ztq1VstQvQ+BxzzjD3aOcfSh8FU DyaedFvCp3DIHZoNubupWBZ+wZqXzsKn49+hDo+GlqrgjCbjTFrdRj4KO2/knCT0hEbP n8yLsaQCnrycoidbkwqZkV7N2bh+Zo0lybyylePQ3dF7IaVtPnRLUl5CUs/8+bzctchF CsPjIvehWftdwUyErd2WcGhvPweAY/wWDZW1uvBxUJpcEI7dJt6E/l9Y9dG9ZZNForKo oGAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=DEZyNCFX; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gn6su5lY; 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 t67si3010538iof.26.2020.09.09.08.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:52 -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=DEZyNCFX; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gn6su5lY; 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=DEZyNCFXrkePTZU7NAXVkbjPP 8Jo3I2aad15EOXxnkE432O7SlrB19CFL1TOzXkIMY8ZvtnrhEL2ZiWGxGQFIpCnujUQmM/0m8QMpr UoYKoCQM8KGygvFsZK2W8/CGgbqO1C7n3WdpEJ1jiiBpcRy89bk61sLWRF/xgvFtnbWgSchiE35Dr KkCF4KpY/fH5SpQbUQSadpH/ho9CbAVYp8QsZmaZkch8kFzPY5mcpunbiDZlBHLk2HUkzeagJg/4g sTKlUDBT7NhxeI0wbFybKwnbsOzyHNpFIT2M9V8/r5gmOqiWc+QygaGEE3RHJIHjs910sLrA7BO3T HzZVDHjrA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28T-0006Uw-9D; Wed, 09 Sep 2020 15:35:49 +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 1kG28P-0006Sg-KF for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:46 +0000 Received: by mail-wr1-x443.google.com with SMTP id x14so3419934wrl.12 for ; Wed, 09 Sep 2020 08:35: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=HkVQqcl8Y72suOLVUyDLPMVLmKcAEdEBQttsVtZoFdc=; b=gn6su5lYht2SYy5qbVTDc4jr27USvSHy28HZjSXLv/oDPCOfMRfbMD0o7hCFPzrhsO R++1ZQNXvrcfjnPgKdLNBDbrzwK4RtQi78aI2Xo51+dE45MtIG/HQmSs83aq1le/uAto mqZgGA445sISsYdaG479J2XJIbnYyIcMIBjS22OBtASVNcigXLhDF6mw+R60v/VjAf3Q GUsaRmgKPU44wiK5Cv1/1hDkKWqYjOtyThnPFiZVTZLiRP+UUFp5/C+iHyWSzVDWExox l5CZPlHy6OfLYQS/UvP0CXU/pRp87Un7wnldhcuDs3T8kWrhjEznXpG5QpbEbMmpJ7CI enKw== 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=BLIwAH5qHUT/z4yBz2g72M7fvv33ydqeY516ZMx4IigD6PCSBwSzG4QrotiNzhuJbf SOdrhO3okuOXuZ03HUzJLIi5KvttP18xj3kFsOsvbPfQo7aLzpPLF2bF39AO0C95N+iW lUp+rBP2dqrgmQlYMFqSt9jA41U138NEk9dM9Cl79bNbmjMwm+Esf/eFqxmrxBxNyIK1 fxpferU8MZUMpAgDiCVzdV2zaKUBxjaSyutaIlppPwxpJe4t8LHun7IePbZnnDcsCxG0 XdxKATbuS2CAiefQpPor6dXN4/ofupxFfUFoexkq2bTL4a6SEKxFXUgwqOi7nudwptrs ivmQ== X-Gm-Message-State: AOAM532xYFeHN5pWjOpEuYINClAWQwoUSlzE551H4UN+pZ2DXBORJ/q5 HJDVozXrydbY/FYdus5Dx6HA7w== X-Received: by 2002:adf:c3cc:: with SMTP id d12mr4482893wrg.399.1599665744654; Wed, 09 Sep 2020 08:35:44 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:44 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 5/7] wcn36xx: Add wcn36xx_smd_config_bss_v0 Date: Wed, 9 Sep 2020 16:36:26 +0100 Message-Id: <20200909153628.2904888-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113545_795231_273A19BF X-CRM114-Status: GOOD ( 12.33 ) 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_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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 Reported-by: kernel test robot Reported-by: kernel test robot 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 Wed Sep 9 15:36: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: 249485 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523979ilg; Wed, 9 Sep 2020 08:35:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo1ieJlU0aU4ZK2nBpfOrWsiGspvCGBHiMOC6ivQptuD0FbsjV6VrW+oncWqmS5NQOsNnA X-Received: by 2002:a05:6602:2d90:: with SMTP id k16mr3827562iow.19.1599665753362; Wed, 09 Sep 2020 08:35:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665753; cv=none; d=google.com; s=arc-20160816; b=B5gUM563RsL4dsX78zHYkQ4syi2sRibTcuF96jq2UqWZ0pto4OUF9k5kjJTapXxPnc foR3lurJTd+ZxlgP936ucWM6Ldqnk6sg3mayVEk6KOM6J81KgVLjTtiVOYThSPwBhxOZ RWiSsVt0FDh59kZEELC+0OSdrc67YFtfAF7dg6VlDrUNvT+FKRB24ocgaz1obd5nPEPD AUrtRLsf1Z1lkPq/o0Wm9qFP0pWd40dfSNeAiMRCY9GgiK1RXjl3j2ymLBt8hzeogAIr wZAnTj26lImRGf+QU/g92PzBzUyz04Jc/wbIR9e8sjPHBwSmMybHhzbZavi40WhvCZdN GuvQ== 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=VVdtQ0dKWC4ACsTLYg/mLVnGRi0Anx5DeNjzzWilgpGtoGLwUsYfh8Xj58LuBDo1iq Kt5BVi0W9Ae3MyghgGo6D70zJPhV0EL5aCkGT5ERcFxVEnLsD3lBRRcjrgVbQur7Xj5v FJSqoZH9qXZtuW1Y9aHXFLMqID++tEB/YyQVrypev7ElNUZPiaEjZ96Olx7RGEKS+WLn KV07FXviIP8rAVeCwLlgeu9WiaoVERW94zLIPNwLpm82OrqLarWe+NVVomctjLIlEDKP XVEC9aLdxEXzc1rRu7JrpgYK9SN80OzHB2af4CDYGSYSDtkwNtWN0A6E95ovL9jYcDBX s/rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=l9HTUPN5; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EMnSQzZT; 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 x96si1974943jah.39.2020.09.09.08.35.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35: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=l9HTUPN5; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EMnSQzZT; 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=l9HTUPN5CYQdABuudHJCUAbbX wfIro7VEYuJ1YGwiyXWQbcAiA5EadujI+7CbUtNSv+9RQoKAs9nwJXMKdpROOTv7/1GC4xEduQFUm YgQ2iNhbjnGIV9KrwUEWV/44u+MoDduDdVlm5C7UCe6d0qfBK0AG5KNyTOyZ10KoAJMzX5dNrjn8P 2VgsTxI88RdR376YZQWdjLBhxam3arHa5zLbjLM3okmAkmaB2/5ZaWdWTizlbvcM+zj0w0ImFxLXh qIsLQYq3akpZrKF7O5OfGdMsIu2wdWyxPr19uaWVgjnW0PPAsWmqQKl8QtXyV2tgx6dzs8NJ4iAiN 7+/o4n3uA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28U-0006Ve-0F; Wed, 09 Sep 2020 15:35:50 +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 1kG28Q-0006TB-ME for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:47 +0000 Received: by mail-wr1-x442.google.com with SMTP id z4so3479221wrr.4 for ; Wed, 09 Sep 2020 08:35: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=w/nry3NgBBjA9BLR7RzttfZX9dZbP5DRqQfPiOO3p9I=; b=EMnSQzZTSE9s5aFAM5MDV0hTDv9ggZAxrmlePWW4YdP43Zi68a3/vEMVOfy9Ee51Zf 4FEYdWOdWQr9tV4D0xB3n32EpVf2tMX/pqmN7JGJ4+EA21kAw+XTSBCkC0zfego+mtcR EJTOd9qDhor9BCfXRY9oGTek80zjaAKXhtqZDWakXL+UrIViFmeMmgU0NN3aPfuOC3Jx 8zQU5g5QcFCY+ysgpVrQ4pjKQZ9h/Lis2kU02piYNbHEe2bz5ueDtyzBso99j/HUTxeZ WNc6rgWfyRzj0FyZP0FEgippjD+0CoJpCJj1w9XATKjtEr45upPkwWKrjQGQ45hqd0NG Rl5Q== 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=PKQZGMPdlCb8U+JRrL0uFvifpt5y3joxnQ53ZzKN7YNd22maJURzMCxEzr5ZwK3y8P A7nzvoKNExUmy6ZWqFTlfdZJcF4h4zu1cIv1tLl6Y8R3G/xZUDXwi6mB4FLu2R0fkS2G Rv+uTbJ/AmphmS1Ttonvdfc6jEokWBQjqOhn7An7z18Xf7lMLT7z26nO2fdxhYSUciD/ JKBQByiWg54XCjymt5Y+ehCU0NX9Kaum0mZqCMOcei14eu2g+1H0uNcg2gFL184ivgQ0 6UPR6H6+S0/WWE7DjDjOVM3ZdY6SW0ydjWv7A2h8JMQ3bLFcJMc9vTSKHQXHbA9Jw/eQ d6UQ== X-Gm-Message-State: AOAM530RybkfN+OH6kPT2ECY9Da4RYSYVfGoydxprJqLKypNGbfvmMXm QvLL+VTS7KtvlEO3SBl3cvIJwA== X-Received: by 2002:a5d:574c:: with SMTP id q12mr4402142wrw.253.1599665745792; Wed, 09 Sep 2020 08:35:45 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:45 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 6/7] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Date: Wed, 9 Sep 2020 16:36:27 +0100 Message-Id: <20200909153628.2904888-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113546_742404_E5CDBF12 X-CRM114-Status: GOOD ( 11.32 ) 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 Wed Sep 9 15:36: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: 249486 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp523998ilg; Wed, 9 Sep 2020 08:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzae7+qtK0xJ52/UtgCeOGdUPvKyfoX3nWR/wWi4yXqKDiQpgs50Gs49ZBgo3bpHjiA3F9B X-Received: by 2002:a6b:b48c:: with SMTP id d134mr3865988iof.115.1599665754835; Wed, 09 Sep 2020 08:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599665754; cv=none; d=google.com; s=arc-20160816; b=0P/lLxcDNNt3EHRn1TCjJE65qDyb9mC9/jDc20iXmxW0th1gy3q2LJb5JLPOvxwfZl mn3Df6dliNhbVWCuJtGFYzh77xa+kvIKLX7o3hsKyr464YjqWgr0owKsRxlC92R3mWw7 oSMmEaUdVl6Qr22f2411lLjz0PeyVePwjWB9+lMepoCkrpfNYBEo+VfHovOWvmdttLuU 2jvK3FPjXgR6SP+h/1FLUyAVhq77MhifBltt9xZk4pG1b2woHh961tVTlo9+DYt/aITp wIcIzbxhvxlp9oDJq5fwXcSNNGfaPrtwl5g20N7J6xeRw+S9ETX/IfBs/lZR2whbXjex a96w== 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=z+sh4GM5mntTbk3kraBkUeCdrrK9L7KNomcgn1RS9ApV7DRHI/oqLiu2HBLkO9iTr6 ppOrqe5jTG/n8PUVQdxMX0CeAgIRirhFB8iAFtiXLxpmkye7slFaZ62lBc6X0HLcVSzr 0nF8SY98s8h8Bue8GgZVWE3c2xzrRsrb21ne1PzYUSIsJ3mcReGu+oyUiv2A+N5Hvojn JIGxv3krksuY6wQmBmpTlRBt6CGrNHbmRg42O5jc6kBBsH69gSSYSnRwC60XDwayhnvC vuURpD4RGbUAQ1V+k7mNHDcR+Xhmmzs2S5tTkPUJK3FsQ4nxix2FqHalxw7eB0GVe4EA /weQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=AwdztXfb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bDaDaBH3; 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 x19si2169972jas.106.2020.09.09.08.35.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:54 -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=AwdztXfb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bDaDaBH3; 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=AwdztXfbXxqrk6/8jeiLIit98 Nm/KAupgvSzpDue2nM/KMNAy5gDeYuSrcDB1gwWEwZeh/k7YBt7bJ9IpctBH+EaqXUpiTwdEKPN9/ VPcOfIeQEcYdjfHJ2xwMJbzIcKBhdbqLI4iBIySfLdPgasqiuwOzU+ZQdsmmhxS//YKyt3Grs5Tw5 TwxJpgSSh/qbwLlBkv11NVUP6YPi2vP9Sn+uTjO9uHAf61gnCBBl/0K2oN3psYACWdvaZzbtNpE1E vLvWsjSqqrKDiaYGf0UhIwWjJEnkJN81tkpDswQpTkVMciQEwh2zJa9q2IMxwPzKx+3lgOpTluGb3 gLtzK4Bbw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG28V-0006WT-Hu; Wed, 09 Sep 2020 15:35:51 +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 1kG28S-0006Tu-1a for wcn36xx@lists.infradead.org; Wed, 09 Sep 2020 15:35:49 +0000 Received: by mail-wm1-x344.google.com with SMTP id z9so2835706wmk.1 for ; Wed, 09 Sep 2020 08:35: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=yTFsQ/Thh+oiXlokRzBRhy7fryTyWLYZWgMktev/5uE=; b=bDaDaBH3RlmXba1m2936yTlW0VjhPgcg7KEU3pm5sHzQ8eq4cbIryvBB5LKuF7T9TH HBtoJH/72ZuoWP2/Rp8My9ruBESz+sbp9jfgWMhH3IYHWn0/QqC3H7KuwJZV6SlkIMcA ZUvuYOrqFzV2/vs82kyDwCSGSRJuxTfbWPAxyALgWAHSzBTNJlFYoB63/wyA5mfn8SGQ ubq4vUPcGIY28MTs284xY2vYf8PD5jCyiGsp6S6xNb1dUpDTJSH2arWrwZUfKn0pJDZk OUg0wcCAIydOXK5kM/hXLn1wmDngzKTcmebAvY6xgrX0knTbzKH3mJHiqdfZmP3ZIlW5 9Njg== 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=BsyH70idcVcQ+zpOqKMajbIMNR71MA6vHoEUmC+W+rhxPKc/BqFsTX9HEVtRaLvb8c SSIQleRVferI53oxHotK0M7QK1XiLafv0wcl3lxHsPYc0MCz801EZuattJ31eGJekpzG 8wcy4x00FtQdKL+Pwd2rEc65migKiBw5gtmWOuM7FkNz7m/WnC9lR+EdVFHRk8bMQn0j w3mdBe9bSme61CvKTD8vS9Whfx3bOUxLEdtEIzlZBLfdepSMbgZTqPReh4sG30wj0kX5 hRaDP2xR+5NeUFj4aEX+FHWhQAbs8jePtVFLnezj0d1uWwtVKhffomfFUax2f38IZySW sX1A== X-Gm-Message-State: AOAM533UD22SBMEccG35PNgyZ4QdaXxeLImjR2hXVYkLZkTIzw7ZHkQV OGi1zsyL+rP1/shusbPuuFTGf3yTc+wXxQ== X-Received: by 2002:a7b:c24b:: with SMTP id b11mr4339736wmj.134.1599665747147; Wed, 09 Sep 2020 08:35:47 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id c18sm4924871wrx.63.2020.09.09.08.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 08:35:46 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v4 7/7] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Date: Wed, 9 Sep 2020 16:36:28 +0100 Message-Id: <20200909153628.2904888-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200909153628.2904888-1-bryan.odonoghue@linaro.org> References: <20200909153628.2904888-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-20200909_113548_206203_1D623437 X-CRM114-Status: GOOD ( 12.85 ) 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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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; }