From patchwork Thu Sep 10 15:06: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: 249638 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp825933ilk; Thu, 10 Sep 2020 08:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPIZmDNews8oQvB4vt833BiIrerSvEAlkYh4W8rI8Vyby0xbbWM2GMdGAzOMlw1BnO8nzv X-Received: by 2002:aca:570a:: with SMTP id l10mr256730oib.143.1599750351074; Thu, 10 Sep 2020 08:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750351; cv=none; d=google.com; s=arc-20160816; b=yQSjUmt1vNhABk57O+0UB4CUaVxD0OyECGAV3Bdtd7mZAjxgy4y46Ov5TsjFq/Pme+ fV57Ud0Lg6IVxyz84lqBnSipA7zgAekbL+mn2XapOCDpKsYXq5H4OUnOKudBuyBxYSqF pSz6qWstnILRpzusb4sDphpcemxYel4j9wTonT5IQPLqEHIpeq/4eXJYdWrBg6kSW3Bz pgeFTQwshkTuWTe3ZwM8viSfAfSwZ2WIcuy253dRQqjBCZvCVPSb86diJrWWhwJXnxP8 /rdxfSIb6fZ31QAUefVDnjYSXT3EtRWFIaOoFWwl/aTCWufP6HSedIACOhjig1zQJQHa s3OQ== 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=opZRtL2OTwvlSQmTUfWslamr+jEg5RJpO4j7D0MvwxU=; b=g/X1mcoJ2/9DaMVbHLVvUVNJlh13n5fNdy3Zs68ozEng1WYw+q6RIXSrMeWdWf3Nux Tbhj6kXPAziY/cD6h4P3LJ4jy9eMSfDMw9He1a+124VsKTXC0RUjacUGt6B/PGvP/OzD uTzdcweS7ydMmoyUr7RQJ/edlQNUzmPVUV/q/cIRhhlZU2M+eG9sTG1ojuno2Hb9+0Y1 f0OBu9kmbmXS3g3Cacn5uiNhBjku022GGn11c66DYaP8vYrJUNDPmfRLJRJBEnb5JgXd JWT4Xj8Ol4CwBNoq7eTCIiVm8jSSITXT5MgD+nRE9JYdPpOLngiUsCqIiadSv7BwDp6O k7KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=Hbmp3a5i; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bXdk5WDh; 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 m18si3253059otk.303.2020.09.10.08.05.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05: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=Hbmp3a5i; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bXdk5WDh; 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=opZRtL2OTwvlSQmTUfWslamr+jEg5RJpO4j7D0MvwxU=; b=Hbmp3a5igA9ZMIQsTbJbc3Ems coYinjVuqD6JXzW0JziKzIAOcZU8Gt6a4q7o8hK1+fxMymp7mS9T1X0FmKlUfXMrtVmewq5mrFyJ2 7ing8CvbkstDsPFyq3ZVCi7HkAZWw4iG7GACbZsTir1p/G/rKu7Ht/myLKf7Yw2ZGI6ZQXX81AzgK UI5Nf1kUpFbtYmp3vD8tviWhIe6FPQpdUw9I1Pp1GfTb74NJTL0k7kAOaqn/4rNM1G5YEjxKDmtM9 IZWmNTk8zNANX+DNAI4xdoZ0lhpWT7ffpNHcn1WOY2M+R1NgVpALsjbMfQxHEYb340oJgyGtokuC/ fb9U+DjTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO8x-0007fG-J1; Thu, 10 Sep 2020 15:05:47 +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 1kGO8v-0007eN-Gv for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:05:46 +0000 Received: by mail-wr1-x443.google.com with SMTP id w5so7060344wrp.8 for ; Thu, 10 Sep 2020 08:05: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=jPZywSlUGy1DbYCXOG17ZaN4fGsj4lfwxAd0j52fwtc=; b=bXdk5WDh+FTYAUqvJ+3Rkt9BfbjPH88W65o4uL/hwqVRtPxELZodv7ZLsql2nAxYPK hs/GH8U/9O9CQ3uFAQeT8ZRsM6bFOxVYqXMv87jBkUyM8VCwjNWq2azM2hi+nlb5jg4T a5OrNL873vPbxgQztjzjpZpCzmPYdT4+Xi4Zn40VyQwQj2RksH148JrQ212hS9l5nEGR xdtJ8iiq9N0F4+Uuapy/YbkIMriqudeoozncz4mLlWuATC6NO0S8mIZjq5fHWNlI8oRc C6EE2WRIVx/yKwRqiDmJBU7/hSfORQDehB+/Fhu933LvKB45Kqt0ZnjfojmkyKozU8Jj vH9A== 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=jPZywSlUGy1DbYCXOG17ZaN4fGsj4lfwxAd0j52fwtc=; b=fFUF7UnEmJ+xASeq5S4ZvnNWbKKpzd6tNOvnrdsSF9UV4YvT7+mlnfQl23wL2jJ0JP c3Ch8/8vfp2/qfB6W3hAPdgGD6jPrhnCxMUj7sGjdwYLw1flDIxtr8NYk6D02UDXdu26 Zar/Th3IwZAHYybycEpxLce55YGtY2OZ/05EBWKUoBdJPad7rGx9l8Dhakxb+g/rCetQ YDt4FCQmg4ZeC4TNQ2ws7Bf+pZCtJbaf91CvvpcULA+9Ws4hEqrk8ZSNy+18nVBXhZFm QoTOQL/qdeY5Yoy/GYsMUqtGSpZ4lSRp6UNf7lfjJ+uvT0UebmgLMkiDLyetRmQ4Oa+h gHNg== X-Gm-Message-State: AOAM5307tp8S9MLG8FShus2lTwe8Zx+q7aWtpl82sNcEgHLq7Je03Mha rjvl2qdZOJWprt4J1Ct+qblXpg== X-Received: by 2002:adf:aad1:: with SMTP id i17mr10102202wrc.360.1599750344653; Thu, 10 Sep 2020 08:05: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 k24sm3857005wmj.19.2020.09.10.08.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:44 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 1/7] wcn36xx: Functionally decompose wcn36xx_smd_config_sta() Date: Thu, 10 Sep 2020 16:06:25 +0100 Message-Id: <20200910150631.2178970-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150631.2178970-1-bryan.odonoghue@linaro.org> References: <20200910150631.2178970-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-20200910_110545_563897_B522DE5F X-CRM114-Status: GOOD ( 12.78 ) 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 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 71ecf3ef5ab2..475d4f60185c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1326,54 +1326,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 Thu Sep 10 15:06: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: 249640 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp825960ilk; Thu, 10 Sep 2020 08:05:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgA5YyPLpgCkh1MU8zFKW1mxH4nmeiNdx5wC0uAu4JJwNqRXloNORIi/3CW2r3YVWA2CJW X-Received: by 2002:a9d:600a:: with SMTP id h10mr3361476otj.170.1599750352698; Thu, 10 Sep 2020 08:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750352; cv=none; d=google.com; s=arc-20160816; b=Q4/0EJdV7SiGHUbhPETtfyoOQqBcd8lm3VTLOdFbyht5PQ6kMUjlg0k6bmpcP4yGOV vwy9n6m+vp0OvPw7bJztWAw1BUNYK30V/kKetnbBKhlTIvBLoms9GjhpXewpYvbKjSph ZGx1qmMI6jytHWYGV3AvL81bzm9kBUlmcDEh/Ea8PZd6buUlKRDiIthhA87lEJl3vUxr 6MeVNM1a6eGRvcwDFRrej19NREmffTpLOrrF8WPDfWDY+RgPM1q8OqUU/i/vSaBAaww8 NrjmpX76iYhPAD9efkoY3K9eKF8lw4EvuB6Sd5ubap9vHidRksRnHN0uZETxRNRNTAua cZyA== 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=cekZ2yyvgiDoJ7ax0WH/vREFgD+8zs5lzcg9adBl07w=; b=ob1ey/V1V4p/RPH8bNdVcnYijcahC00jHOdAraDw2dHnCzrSsyKzEvdoCLD1tU+bW1 CB7vuxmOHN4yTtrSbNY3eMVO5QvF97E872PeonEOQk0WtQYj3tnxaW63VpH5AIMMAHZ4 2ZPtmWDDYs7phstopj+Vrn46RI8yott5o/bUxuYFFyGHeFknNz21a+5CjeKJ/9s4DkqX a19xUk8mO4ohqXgyqPlO5kyJniTRDV5ttmwrncK5IXbLirsJG1y7ek+QefNlsWEOPRJY tx7ITvazgLnnhq2Z4zUbUCX0Zv8E/XuAk2e9UdKRCzdqtRnqhL+qqNmx7VKKNjYXtcpV PXEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=Y2fIAb9O; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VO7fpuHq; 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 r17si736216otk.297.2020.09.10.08.05.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05: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=Y2fIAb9O; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VO7fpuHq; 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=cekZ2yyvgiDoJ7ax0WH/vREFgD+8zs5lzcg9adBl07w=; b=Y2fIAb9O3Xvs/2IvQr4wSHxSP qAaVUOJO2S/HIDnBITVV70CWtzB2VEDw1CqmAstLjLPEVIVo1a7lxTZ1OcVSYUcBhm0OhlpWf4l7T k6Jj6iA1dg1403mAxqDy2iBY/F74BCyoPdjhhA7llfU9+L1DyGYoi3RIZWlCKg3eg+XkfvEA3LGVR UgOvWbyRNbSdBDSr5eA/NZ7B70lBwBMNJnICp6Q+CORRESWyiTPMTsXIdER57qJQiPtN7YMYpBctW RX2nH6jv+Nyil7ZF9wsjxs0P/yH4PZmXcu8Z+It9gHIDaQ/Kpt56RZ7qlQ2gE6BCyzt1o+ETa4ox+ hMwF3PHfQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO8z-0007gZ-Dv; Thu, 10 Sep 2020 15:05:49 +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 1kGO8w-0007eh-Tn for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:05:47 +0000 Received: by mail-wm1-x342.google.com with SMTP id l9so373519wme.3 for ; Thu, 10 Sep 2020 08:05: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=TSmlKxa8tfftdzKPtW1OR0b3dc7k+Gxn+7syuplFMNk=; b=VO7fpuHqsdhMHthwTUSalazntVQBN4BaxAdhtZ3mhGhxzgk6z9lyBeCGM0jG1aWkAS IqBgziRfD7RUCgTPh/ZzKJCDmskLEGmJaT+5ayggvKm8SYYyrcUCLdPBLB90qEND90io Snz27uNhXQn/fMWJ1ibTnK4VZXxY4TDaIxS8y+CeeDawO1LP1VUvI4OT+imCQFtsZzq+ PaFaJVPOW2fcf9N/qzzpl7KeMpvVlhcx3Er+uHMDU93BjlSKJnfFVMFVPx+TbGPY2JSO 3eaZ1Z3Q/aqrR8bvyyu7VFWsIGQ2oo9q0adDade4MJzDpuQpE+oose9SZkmgqhOuIAxm v0Aw== 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=TSmlKxa8tfftdzKPtW1OR0b3dc7k+Gxn+7syuplFMNk=; b=m4RMzZ0MZztEIu2Nf+gWokcnezIXMo2FRyKuRv4wvmsT0H61+0vTRO7BHNTNTptGEf Ee31JdReejeDtavr7Hqv64EJOxJCJLxLtkimO7dpyuOp0xnBDOF1hEMmZ6nYHcCWMn+e QaFVvEajn8Ih6WzPdKxD21Ke+JCdAvD8Gd/qAB0HsxXXHiyqLWovx70XT/bYiNPRHmzI fkOQOccY1WsVf6bGJJXxpR/gkeqLrJiaOB1JC6I8KlrRIUgIzSQEccA3B4dqqdI6nuO+ 7rO5JhvhZ2/g1U0qALqobvYiZ/sWz3RG6a2jvPOB0KJSCYV6k1cJRalA7LCT2GYYUHLP C4Zg== X-Gm-Message-State: AOAM533E/AIoxUh+Yut7RdpaK8n96WfEU8Hu7bH9xipBy9cyEG/+One2 Cp+cqdI89CGBLN+Zj9wvfQoQOA== X-Received: by 2002:a7b:cb47:: with SMTP id v7mr470670wmj.36.1599750345707; Thu, 10 Sep 2020 08:05: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 k24sm3857005wmj.19.2020.09.10.08.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:45 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 2/7] wcn36xx: Move wcn36xx_smd_set_sta_params() inside wcn36xx_smd_config_bss() Date: Thu, 10 Sep 2020 16:06:26 +0100 Message-Id: <20200910150631.2178970-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150631.2178970-1-bryan.odonoghue@linaro.org> References: <20200910150631.2178970-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-20200910_110546_974778_CDF077EA X-CRM114-Status: GOOD ( 11.57 ) 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 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 475d4f60185c..fa4357b36a8e 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1624,7 +1624,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; @@ -1650,6 +1649,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 Thu Sep 10 15:06: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: 249641 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp825993ilk; Thu, 10 Sep 2020 08:05:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrlBVAbrB4U3r/lRbuGT3FUi6yZsaNNZXo7B6S9pdDqXAxw+PxcXGkQqIf9Aiiz3tgDKTd X-Received: by 2002:a9d:6b0c:: with SMTP id g12mr4380154otp.315.1599750354618; Thu, 10 Sep 2020 08:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750354; cv=none; d=google.com; s=arc-20160816; b=hzV0QXgfJ9vwjv7ZIxKq4pGB0G8owpkw7+yAD+59FyrhkEAKBvqW7XfN+t0UBwuyIj 5VjIxljIcf4QUtbn0d0erCO8iYqfi5IRg1KUO5dpF+aZtOU2RazVLpMKe+q2rQjcd1AI EM9ED7p9UbXp7yz5SSuYtaFe797jsFWARhrTXCQ2LoO8V240Fmz4XcYSbBQ48tVWn2y3 68p5uZw6iv81YI1KooAZWdLkVA4T9L7uBpL9Hb9P4SzjShiAB5fh9AHQriep1POygmiv A8fFx1/5jNW+g4AZg3/AbF+r435zbDlQysltlyu+qAzr8w7VOgNO12NXJKnTMnehiZkt YQVQ== 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=FV4yq0FGkOgwcwkTMxPkG4wuFnpfql5zPV+zZXCyf1s=; b=gi32fSckcQ3BV24IQvwU+GTrUmRG7Oa5T0Qq1t7WSg66nGCtpuoqa3i8B/REL6P0PA P0bsXecDiNdzxStQUnynnW/mRcSyxt/dtQPWxk1LvpOlX2YJIJ79S8fLbuSXBKqFW1FI 5Td8H5/Gm75d8kQ1mvUqgx4UUMThyrDm43aZAdk89wzsmFiMnkx9yFWANj7S/u9216gq g+uiimQpwePq9ttR+BLTtsveYM/BHJC2/2JmTtlS+Q90AGsAHTnler2N/0/lKmGoxxxk xcSMB+Tucjw5ZMoL2Ss675KOL9LwT16pPqP9FxdgKJ10GX2CufpeXnOh1P4UL2PYoVkM JCJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b="su/4Kr0V"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=M2Wg92rS; 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 t132si3054387oih.60.2020.09.10.08.05.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05: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="su/4Kr0V"; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=M2Wg92rS; 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=FV4yq0FGkOgwcwkTMxPkG4wuFnpfql5zPV+zZXCyf1s=; b=su/4Kr0VVmXf5hca6A9b4fJ9l XRK2UcuRwg41k+h4+79qo9hS1tXE4rG20nQqSP5bwHEkFpstzPi1ZABEn3z/4Dkpac9lTj5n8x9o8 dZdXyZI4crgfSfHZzzts2exgoE70LAwB20PMSdcXuqO2CaMMEJ4JtNsWT5ozI4/4ktXGo0RSdWQo7 UNGNctHRdhEvUvY/jAp7bk50v3KCMqdKG3Xk6XfA9GHJJDZRfDh0VWWMLoSJJKgu7E5egcL1Zjqtd eTngDVxv0L3xWWTpZCLqzBL0I4AR1qsCsy/x4vpnsOC2aESy+hpQLAGiX7FZ+SSqlzZAp02AkABCY XAz7squKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO91-0007hP-0l; Thu, 10 Sep 2020 15:05:51 +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 1kGO8x-0007fD-LI for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:05:49 +0000 Received: by mail-wm1-x341.google.com with SMTP id a65so358058wme.5 for ; Thu, 10 Sep 2020 08:05: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=C1kM/nc6ngULE2TMZqCWmpEyLxElDiaI0yH/xvzMhMM=; b=M2Wg92rS/qXH/CKBPOKrB8DyumKnguAlhB9mxAWkLq6IZ7txZ1uptKFQqVwPl/Aldu 0HY3u9jPgVS335mW+yaAKF8P4pV7Dmss/dc516MWRktquag0EZcvrD48lLEQvXu/d2wV QSuf9uBMicyCpg5h1ce7geqEBYE1CDvp6hLctVYA+MeYRfkcV5gQH6Of+ItsfqeNDsEr DXb0tLRloFvMLfDyu3lO2KoQmugmxztfH8t5CIEex/cg3Arxa69oKoOOia9hvP7VvGoq I8STni2IgHRP7Yo2qSsO044hW7sdWpv1moMNaQS7z6lVfcXw39HvBYAqWosCUXoCTG5j Nxhw== 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=C1kM/nc6ngULE2TMZqCWmpEyLxElDiaI0yH/xvzMhMM=; b=ikfr5r91DjTmzPxqgOymefTelIg1DqRzep57za9nH0cEmsp2ckrYpEo64sfXt9E0s9 5MSVf6fJSJY+BEg4Z+RUDqs1/XsrUGKryzBF0pvmh+VkFlg86xHmCZfATMveyBS5w+Xn UG3p1k9S/I0sSlsQlo/+qgfu9+AM9x3J6KcPXSS9wVPVJlKmsOR/PH2eB5BTdiFZuRDY AUW4i7AGX1DxomJz6xfhkNz4JbFx/tiZqQMvBH0mjXUMmxN0jz/Dy0NAAWAgQiHkjxQW T6YtAeKr9xTx/rTKtDdg0PGwK5pS+bkfYpEq6n7D99O9ViDeg4Wu17rQsFumc46GjGe8 F58g== X-Gm-Message-State: AOAM533/8blBiBZZ6t/pJi1sRgeCh+ZuTMVWIPFS5OryF3G/6uyNQK+j bD+Pny9G5Q/UxqSFT3ph9B5x2Q== X-Received: by 2002:a1c:2501:: with SMTP id l1mr525100wml.16.1599750346719; Thu, 10 Sep 2020 08:05:46 -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 k24sm3857005wmj.19.2020.09.10.08.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:46 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 3/7] wcn36xx: Move BSS parameter setup to wcn36xx_smd_set_bss_params() Date: Thu, 10 Sep 2020 16:06:27 +0100 Message-Id: <20200910150631.2178970-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150631.2178970-1-bryan.odonoghue@linaro.org> References: <20200910150631.2178970-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-20200910_110547_716761_A453F8F3 X-CRM114-Status: GOOD ( 16.63 ) 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 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 | 175 ++++++++++++++----------- 1 file changed, 95 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 fa4357b36a8e..4be9def9509c 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1402,6 +1402,100 @@ 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); +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); + + 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) { @@ -1505,7 +1599,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, @@ -1557,7 +1650,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); @@ -1571,84 +1663,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 Thu Sep 10 15:06: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: 249643 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp826014ilk; Thu, 10 Sep 2020 08:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0gh04JBhACosqsN3cJ/jQFT11PnEuidy5gsFjVGIpwONkDfq3UZUcfC4CHJxzxPZ8Uluj X-Received: by 2002:a05:6102:3d7:: with SMTP id n23mr4358674vsq.29.1599750355634; Thu, 10 Sep 2020 08:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750355; cv=none; d=google.com; s=arc-20160816; b=WrsH/Ys1krayo+Fw5u3fjPeWzq4Z7Ns569So1wGP/byircb+Lx5ux+sq+wH/P8Hl8U P55Ddx51dR89R0kYp+QPhA4EvA26jB7yryEgBCP0VUGtMJvi8wB2ii+IjuvPij9UH7DD tzU2l/KBwYyPFMnPNMXaJC1YFiIcCsRiLtDaTfxuss0hyHBZXmORM7myXCFlip3yzkrF iZh25g9i+ii5se3n+qJ1hGXmD6KsPC2zfzVu/bKakPQGziBuTt1/4kp9ft1DKtEp/aJ1 ZFXsWfvJOp5OX5mkky/t3TBE/Zf37ebVMgmOeFS5Tg6Hdai0L2TruOQ27o8MwaTzzk0q PuRQ== 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=tJqMiRVxr2Jkh7g8XUhe+xW9ARS+DE7SlDAb90bqP+8=; b=YgOcquU/Y9cVuOp8geS+JI9KC1u6nGUGt1uRpMWSWtA9keFvq3TpW+/eeTcGRS38Vu L5U701qJkEXLpW9ACooAKXK2ob7I/vZFrTVpggRPGya1LJsivgoo1fZRaKO6dcPWH8LL 3n7JO5IRBl3YszPQkhLJ1pCllEOZyjykzpZ/PgCuMb5hb3DLk/uXqmBBZda6CyvjbXnp g2P7AmQiv0/DjhKgCRM+/l3CZtYmTClq0eLdqaKE0bp1SDEaMgxpBrego5/YLRMwO33z Uwz43FVeXm4quBfKtKkb1Ew90frbki96Fs4bAejGsmlP1pkFqU8ac+8bHSmu7Bmbl9rf tJhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=i4cMkP6W; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VuGX6XAd; 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 53si954960uac.183.2020.09.10.08.05.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=i4cMkP6W; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VuGX6XAd; 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=tJqMiRVxr2Jkh7g8XUhe+xW9ARS+DE7SlDAb90bqP+8=; b=i4cMkP6WzwyuPXSLBaMjLye7z SDfg/k80VCRy7enAZ7oQGhNc9yhcgoy0tPd19walxdgUb2RT5v/cROitiniOEGfH1TaHCD9OZUtPI QTGvIkfJNYvbhWzfcUL8/Gm43CCq1vf3JX9MGacHXxN5qKBXg/kbK/o9FAC2m9nsynnPrSqYrqIEH 22rq/AUNGlNpDkSJjj/crBxk7VY+mpLhXEZj+mhOxIKd8cb1AlLEWIrN10v24tmMUtqS3DYPtmwex +6VRLPrhFa7SCKNfOQn6c0+9gtclNZF1gQshM51OxWOUMUCpVnFnMqkQVmLXKQDemFOG1ss3P8HI8 1ddsQg11A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO91-0007ht-KG; Thu, 10 Sep 2020 15:05:51 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO8y-0007fg-IK for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:05:49 +0000 Received: by mail-wr1-x441.google.com with SMTP id a17so7082418wrn.6 for ; Thu, 10 Sep 2020 08:05:48 -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=I/9+HeHIB4nGhFjGnD4wvRk8F1lVUy5xO8WmHdgPIRA=; b=VuGX6XAdUz+CWmKY8YPSLDHRfNol9VqmNpnXK8TpWu5wmj4saYILPPaOnAzrnPGPEq W0OadQKTk+/mpMQDQD+eJbGMMKxo2pyPGnpG/dmx4BBikw3a7kaIh9Dfd1dowIa5RtsE n3uaa1SjHJDwg4bDgiuqTNE/+NDlDN+DDp//OLdzi8bzsrnLuP5+Qoy+RD/THyyKhuHK pLIXfOB7o3LUmFeaM9spfWKujQMNlDKw0Yv6AiWnG/j+cLZojNiJP7fbP6JPCe8LX6cL IF/pbhn45wRTlMlU3V0onffULkWGIyBoFHRdG+lzUL+fgPng8QLF12zLNnVyk1aXKzZ8 t+4g== 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=I/9+HeHIB4nGhFjGnD4wvRk8F1lVUy5xO8WmHdgPIRA=; b=phfbC0ABrMCHsOz7cN1EB5Pc2a9FPnPheFvYWb/EL31O6ozPdl5cxUqbSWXoXogMFE jjX6hCdtI3TT6AOIcBo2wZCYBorqNGL17NvpqGc12sWHhnN+iTo+y+UxlrERwyX2Uyy9 kgH+3e4qRTeQ6TQMhJa+SPbr7KQhk7aoSpixX9a/sxzPgsTvpWe1Craci1x7FfFBTsod xhk/h2EVOhfaNdmLaOMoCcw9LmLdBivxqX6VJyXYLZRPEhFcBk11cfShTCIVOO6EWWSY jswc/0OqyffG6kXpcmTRoA3sty1oDo9uKbvnSo59Dqv1BtvU4AiZUwBumrQfc5xzo6Tp lZ9Q== X-Gm-Message-State: AOAM531E22MSPXsWxpaIiHEI0pSshgPniJovsIlb+SGtg9LDuuj6/uWH +7QqS3rrcuu0LziUvQEUxdVsvA== X-Received: by 2002:adf:a18c:: with SMTP id u12mr10080362wru.90.1599750347566; Thu, 10 Sep 2020 08:05: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 k24sm3857005wmj.19.2020.09.10.08.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:47 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 4/7] wcn36xx: Update wcn36xx_smd_config_bss_v1() to operate internally Date: Thu, 10 Sep 2020 16:06:28 +0100 Message-Id: <20200910150631.2178970-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150631.2178970-1-bryan.odonoghue@linaro.org> References: <20200910150631.2178970-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-20200910_110548_678587_BD9AD6F4 X-CRM114-Status: GOOD ( 13.20 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 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 4be9def9509c..809a4c0899ff 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1497,10 +1497,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; @@ -1514,72 +1518,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)); @@ -1679,7 +1685,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 Thu Sep 10 15:06:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 249642 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp826009ilk; Thu, 10 Sep 2020 08:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiguMSHGhcFL5WWZI6Ds/1OLNmDa1fbfRqSzq5EJ4YZtU6Ya3Z56+WDVTsLGmy6A2PfB5h X-Received: by 2002:aca:f5cc:: with SMTP id t195mr323725oih.10.1599750355406; Thu, 10 Sep 2020 08:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750355; cv=none; d=google.com; s=arc-20160816; b=hq3mltMWrmqBdZ/7WphoFa5aFtOlR1OuqzAsE4r9qyu5CFKnmO7me2/xMAL7HTUku0 58UpA+lC8aSQV0Lohb+qg83r1uZoQ4OGkWpZRQmC0GjvZSqODyxKovnoMKg4Sv9fAgi7 pbN7knKZKNk7AUqFcqfSlpzRHTxjNRjBYtmQMYmTYtJua+XbxdUd2ozHQUKSPlL4OtSR SSHsF/Vi+ROLGFmppU3LDdQsXBOw0FGluzSUlKIAM8mHd1GJJ9N1Vru0uwM6NT7sQJzH f3Yv1j/FxPYE8nDY9aRShFLUmNlUF/Km2BSMSkS9tcibzsNn9jy5wSYIYQo5+nGEZcBI TWQw== 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=W8lWxu3ahLbR8bLwpVBIJ4ulfySRTpcTGXdztMZSeYE=; b=t7ori1D/3+n0oDSpDcxaHNwEf4voN4lzMYo422jWPzW2WuIAUenXvWTUrckaXUBDld CC9B+RBqSe2MCPvMcFwAAUR9aximZPECs+qKiQAsFJI+7cX/eHBMsTnhtU87VWs9kJPO lD+Nk3N05LC8YWzcoh5GGTiuI+pkXcIuYRnRI5oZPYSOBr6cbokt6kN2idAXx0IZMD8Y Dxe1ObTCaLNRhyebAIClR0zh9QV4FqSbWhf9K9/jFOQCzUrGAgA3qrxPKHVE+soUURMD MEezOc+0IhWry0CkFD8AfgYOQoGU8on7lsdv1D3gd/Wvt9g6MaXBK1ZUYX2Jqrft5MGo jN5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=Kkm2cMig; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ucpAjTCa; 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 t25si3326148ots.115.2020.09.10.08.05.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=Kkm2cMig; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ucpAjTCa; 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=W8lWxu3ahLbR8bLwpVBIJ4ulfySRTpcTGXdztMZSeYE=; b=Kkm2cMigTQl7mpyC3+yct3mS7 k3RLsecQuD46Qqxsyr5AnpbrNSr75a4fTEfsRGtd5Xp+jKuGc0LjKt0GtRpM1JwEjf9lhUEAJiX6U mvI2iY1M4rBhZYGCPKtYYTkfEcYWVzRxORBIdFMJBTAUhE0+MGbBFO16VZCTpeiKFAlPPvR2kB70l yRn0fLUJcaScmErgf21/lm2ahug25vfFKK7Dwksv+NT0rrTE8LB1biiwlLsxFGCwySYT+umJvGMSO 9NH1SabFArdIYhi6LHI4kyuWlbOwa4j3qPR96XUIAvUV+1jHoO9SpKDNw9AGK0KL84PojRV7egNLj anWasN95A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO92-0007iE-57; Thu, 10 Sep 2020 15:05:52 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO8z-0007gE-As for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:05:50 +0000 Received: by mail-wr1-x441.google.com with SMTP id w5so7060632wrp.8 for ; Thu, 10 Sep 2020 08:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DQTt4ZJIu8GTxj+4B1cvxGG4nybh/ZrPxormf6iSTCU=; b=ucpAjTCaNTUlZJQEWLRjLbssJXBm1SZt/yxRqtoouzmk77RdUBsbFmOShJDl8PD6TG d4hbRJLnGhz354i7xar3axwWUh7cBcuwfxj3pCoA90tiBAUdv7fp17i9EZ1sFz0gFH/u R2nNEyrSwuWHVq30F8dDq3BkvOQGUfF3/rCvazqpC5vOEyTWYZxpCZPULItp+YzZA4wv IoarB7c3QNy1ue7JgiQ9/nnGLEpjBUVVT1Te4Quc+FFRXR8g9ZfktV5/M6G+E6IINyL3 siYscq+JNeFURo//EjmCllqq/ysPNQzvCOrDeeY9lpp6BLPMd5g36ABIJx5VN/5kh8k8 D1LQ== 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=DQTt4ZJIu8GTxj+4B1cvxGG4nybh/ZrPxormf6iSTCU=; b=WXQqw+830zH8zTGfRIEQ748eckS3NJnDXxO9li+AWZd+z7/m8LZrOcB/LibW6B2GBV 13wyUt/dmPtuBmsWb26DakkZTcZPrAZxhD5/+VgCrgJ2FSHYVGoL20NE5MDk7tJWM9S2 UqrWk1MyThtH176cpOPMB1rHGypXyCosKhkOTN22NuARcdhQUmtRei/SN0ZDKMxK+vQk MtbW+4yE3fi5rMHskE3exZGHT0Avs7F9UKiQ43ksMQTxG5tScsY3IVkywey+0OvCkZhS vvUFgcG6CUCQtw9DAnyEzdDgqOAPsxeXjPzii68q4eQIp/8ehWbQDmECu2mrAE7tcEka a8OQ== X-Gm-Message-State: AOAM530Cx6Ir0+JUMVfoQ3RHdRlaTkUZv3gln7R0ghzEsh0nLcE+P6/h gipfAzLQmMMKm+cC6+XjxOFRgA== X-Received: by 2002:a5d:4d8a:: with SMTP id b10mr9498645wru.82.1599750348555; Thu, 10 Sep 2020 08:05:48 -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 k24sm3857005wmj.19.2020.09.10.08.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:48 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 5/7] wcn36xx: Add wcn36xx_smd_config_bss_v0 Date: Thu, 10 Sep 2020 16:06:29 +0100 Message-Id: <20200910150631.2178970-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150631.2178970-1-bryan.odonoghue@linaro.org> References: <20200910150631.2178970-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-20200910_110549_386061_4E272EB1 X-CRM114-Status: GOOD ( 13.09 ) 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:441 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 | 44 ++++++++++++++++++++++++++ 1 file changed, 44 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 809a4c0899ff..57833eec16eb 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1605,6 +1605,50 @@ 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); +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 Thu Sep 10 15:06:30 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: 249644 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp826038ilk; Thu, 10 Sep 2020 08:05:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3Nv6Qe8zHUSjAnLIas/xD4az3H9WK9hPv2VDuFQQiiZdGXp1IwGbaIN2qhx8chNqDXuVG X-Received: by 2002:a05:6830:1509:: with SMTP id k9mr3947354otp.226.1599750357188; Thu, 10 Sep 2020 08:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750357; cv=none; d=google.com; s=arc-20160816; b=mgQUIjRBwaEOdtKobCJdnU8ynfmXO/U8axSCIIiRwATdrLoI24W5shh2aQ5ZxPO8nN QhMmfTGJkqRrtqyK7X1TxG6rCZgmKx0EXVum22vx3e8tZIZ13ux8QhcymMyWECJgFJtu rB7oo7G2m8W4vcLO+abKYm6vYSPDzdoK8MQNSFMlATtEAqLF49e9UZDUxbndfqSEt/XF G399H6sVeRS2QZc08RsrzgOUEDqLL01IhoQAqc5jvAPLcOSe/GPBbGZ4TIAOYu1ca9DU ER7EkkJgd9To50CyF+KXVxmuDsKU8/IkOZJ9yYGouF8UPmVCCEUHrNL2lL6QRGKIgKUM HhQA== 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=uKOXhkQhe+yBkfK9eQojSabA3UfbicPZdI7QcS+C9JU=; b=ayXc77FfGBpzAmpfHfpC8p9V/EyHzhrcpVAG3fkvxziZlVwc+99XuFA3V4EIh1gBro 6EgtoCtC0m0FfYQO4JZ6V0QVbVP+WA8Y4AOGxEXEA1KD9GDMTA7JfYKoXiBXS8L/J6Xv /hn/tZnigwHMkV40psMDBUSleGiWbEsVwmIlu0gplrv8rhvAlX8ufyN7jMQmIRPhFGW8 3gx4sk92mqvg5fyO7/x/FhuENW0CWArQpttqqAJ9P7dP3BUuX3fZOjUpDto4G2qu8rmh 4urSfs8UdJW30VlEUaMigFb03W+iD+bhfpsvieSTChd86HWK7JA0FgQ4QK2DXlIexpSf fU9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=mVAeiOE8; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EpVdyZCt; 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 i127si808746oia.148.2020.09.10.08.05.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of wcn36xx-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1231::1 as permitted sender) client-ip=2001:8b0:10b:1231::1; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=mVAeiOE8; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EpVdyZCt; 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=uKOXhkQhe+yBkfK9eQojSabA3UfbicPZdI7QcS+C9JU=; b=mVAeiOE89SCCvJCtN2fh3Ad+h zoI43mUc26HQjJm2+X3jtG2hHalLXr32v3DsxV/oIrXPnK/jk6oQbzRMGSYl2oiHZ2uDls0upBlpw nIfblukUcwxx3AQYprDIkQDM1hT98SRpJmQTZID2J5Pxa1lC/1vvY1OF8+bgi4pDcF7c7OsTTj5iI 5yuWaJJbPT0ZQ6WenBLbg7mxISIHAHX1mF4WzM4/VurcQUYGGlUB0GlRZ2msUolZngKJd18A/2L6/ xJRbB039edQaztn6kpM6bx182UdEqR/K3tYd1EPMkXTw2Ovu8eWNaIxCfTBAaM7ZFeh9hJeGCQ2wa 4SgsYO7fQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO94-0007jB-98; Thu, 10 Sep 2020 15:05:54 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO90-0007gk-BK for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:05:51 +0000 Received: by mail-wr1-x442.google.com with SMTP id e16so7110822wrm.2 for ; Thu, 10 Sep 2020 08:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vs96u/qi7chpLeX5SwWqqSg+eACXy2WDHCGDCKt1xWU=; b=EpVdyZCt6A7xsrh45J2RD2x0lR3dYPwxd8i6XP3A+vCmpVx5iv66Upql1TH5ezlixe Q8pMtpLBWKf9dCtZW8xP9vrrkcYsn4kbS4r1Yf1p/XqMbh2I8zZqUa50+QRJrQd9Nqig emrzwZG6AkP9AkJ2P+9M3wIOtTlmf4CUFCMo/pjpy/s/L+rDgL0cueu2Ca+7HfzszvK+ 2UIideNvjNyYoQ1gff/hPYlwlA4AHDqKIg76LSOYDG3O3R1El/WozPL1C9owmBy5uWZ+ BAqBOFcV9QIfT8K4wgqydBW4Pe7S5WidrPmsXc2LA/wpeMu73Xcw+a0yE2bYmJbOciTG g+cA== 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=Vs96u/qi7chpLeX5SwWqqSg+eACXy2WDHCGDCKt1xWU=; b=poA3GIAQ246VIfYRFs19Ru+ePCfIYuXWAotBampvVjq54qsJwx/sDfIID+uADAXXSf nyty34ei0eTvCE0tWJcCGbHTaLGpWSAKrCElZlQ9vh8YGZJeQwaDOgYVDNZvl1Tvr1Ng ffnUJG/wMa09fz9Asr8GQvtzqgUO1X/jc+oofyHSYU84AB5DerqQ1Z/rmPpFbWSsQnXL yHfH2xudduOFoFCO4MS8qjAT5Rz/hKFTDnRWjA6yis7koD8Nj4/IWSOfHpStw51sQ1a1 sZHFm96AtabR3c/l6SdmsqnNgoRj/fayTAh4T9OGrS0WHDtmKKkDAlCB14TZzz9mpLKG oKmA== X-Gm-Message-State: AOAM531fQ0uvv4ktfSFocbvWNYmOhdIAg4DhqWhg9QFnIiIcO0U4xKCK uazXFXodw12g4Vvy7PFQdaxYgw== X-Received: by 2002:a5d:668b:: with SMTP id l11mr9187531wru.89.1599750349431; Thu, 10 Sep 2020 08:05:49 -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 k24sm3857005wmj.19.2020.09.10.08.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:49 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 6/7] wcn36xx: Convert to using wcn36xx_smd_config_bss_v0() Date: Thu, 10 Sep 2020 16:06:30 +0100 Message-Id: <20200910150631.2178970-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150631.2178970-1-bryan.odonoghue@linaro.org> References: <20200910150631.2178970-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-20200910_110550_431618_246144ED X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0: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 57833eec16eb..5ae6a2ccfebc 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1731,9 +1731,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 Thu Sep 10 15:06:31 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: 249645 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ecf:0:0:0:0 with SMTP id i15csp826050ilk; Thu, 10 Sep 2020 08:05:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyye0jIksS+YfDIe0ezFU/NCbq2SQht7dMi7/ZhIK57uxNqxWHZWPm0g2uq3L6SNHzaGA1n X-Received: by 2002:a92:ad11:: with SMTP id w17mr2287749ilh.77.1599750358164; Thu, 10 Sep 2020 08:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599750358; cv=none; d=google.com; s=arc-20160816; b=yyCU/JjkXVC6OS6Acn+0BotHwTPi3kNWwnnHN5xpqyaYQAcpoziDF9UtEWa3VEFHMF 53Gj3rq6WeRQGGg1iEi5aAe9WryEYpLfbEMlQ30Uo+ICyVPmSD7CzMPf/5zg76AHzXva auTimqzqp9WNrR0cnn+czZvzMdc0vBa14jgILcV0eTXQv3NNJCnhQ09xTXppkSL6hCwR Niupzlf6aLZpjHA8B8pSeiWwS0aUYEbh3sIZyq+QfPrNb5pn4R8lVWd8bgTovFY0M7lW /kTvEMYGUtSLWSqb80CcqpyUJV8fwfOz9+ejOK3j2amfk8d108HzGc6lXUc963+iv19H yojA== 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=Q7pqjuVvPrODxeeL9b2eJ6s6x+O9fSFPkdb+8DQ9ilg=; b=KecOL5N+OiOgYAqlhM6D4Y3mBGj8PpGxq7EEeDBo3UjJOPUJympoeOCO1LV15hSOYy pdZJgK435imFAdV9+6uNKR/QezT7X0kn5IB8g9ofM1cc5xQ3UdF+BH12MYCen4eEWzRP l1P3HFuUEL5/Ld73fSiqjhqgjglosCFO3S7KhquN2jZhR3mqtLxmlyeT7J6l6JKALko7 G/60aps4dHHPjC8XNF99XvyQkNzvrhzC6JPtW7s6Q9IIE/q0hSLAPrjFbxMe+EG2ucMl dQgJxt5q5WW/arO9JrpnSSAz8kvq/GUuSZwrjZZ/qvAqB5qwWbavmcto8wseOaoJRyVX 0/bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=merlin.20170209 header.b=YMKCqDWb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XJRTNmuF; 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 h12si1486754ile.115.2020.09.10.08.05.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:58 -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=YMKCqDWb; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XJRTNmuF; 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=Q7pqjuVvPrODxeeL9b2eJ6s6x+O9fSFPkdb+8DQ9ilg=; b=YMKCqDWbM5eQOkmuL5/ht5FXg kDi8pK5S3I4DO0W/yNfJ6TaR+tugfeogvfVWK4pqHHPGzELcvnidHStPLn5vwIlXT0cel/UlTPGmZ Y0lMLyVvOYXppO389Ps2l4UGKEgX+UOcFGIeN8cgKaEFEq2Q8zktdkaC65k7DoJXDO1Dw3Q61C7qD J7IKfm7szNEgMHGIQms8DH0b1RKKcm39mNfooEA/Ll9hGLv8fX50vlfQ+MGMiue+/bICJlTs8pVtJ rOr39pauGxOQMQ33b6CIuTnOdhKQbtzP+0OnEhM7KNDlTm/FyxaDnxLPB0fHRhNZALS0mLJB6hL6X a44Ex+uFA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGO94-0007jP-Jv; Thu, 10 Sep 2020 15:05:54 +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 1kGO91-0007hO-84 for wcn36xx@lists.infradead.org; Thu, 10 Sep 2020 15:05:52 +0000 Received: by mail-wr1-x443.google.com with SMTP id j2so7082781wrx.7 for ; Thu, 10 Sep 2020 08:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X2d2QAbaWN6PJb4MxG2jZFR8Dup0bgRXymEPCft+cEk=; b=XJRTNmuFkVTy99bAh3/QJevYHn/iaHeLI6pHIvsPy24gCoLFpqw/D0lJAdyJroV2kj mmclL5HorcC3D1FNkbvUGF7RM4c7xQmCl+P2ppmvvMCnBWmCzMpVvH4DMO8abzkMcnJw iaK2nGOepRPxGfA8d7Bvp4eFxpsKrkBSXmeQpXlTTegl3pTq48Hs6Khhrkr86v5D1mnp 6Wp7qWMhjfFw4vkzWg9Fm/tIPCJzjuOS3Tw1L+wOf0xhoTDralDT6g+Ex6TLvtD/gCxY EXOt6LEP1qaNsVPxm7DCiNFeYlHYweC/bYG0AQixMQr3oMxwI29aW0Udf29A0907Vpry NrlA== 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=X2d2QAbaWN6PJb4MxG2jZFR8Dup0bgRXymEPCft+cEk=; b=GzWCgggo/cNxvfjAJl5Rj5GRYoQYOgDWt8gyaSeeg2o1mfFdAIcCUwdVJnj/3S/Nhw lW9c7MN2QcxNiPGQJogvNvyuhryNRURJdTO2T4C5jTSQYLBb1kchUo4aSUCDfToY+k/K zOuKOU01bs5QlWi1YTt+XsoxRLpB3GUW85MiwCtbZOSijNj4FCFo7Tq8JK3dL5n1n+Oj SAsTfaePoyBGVe+58OO+O7eJojPxVai/qt29Ay3p2XoFVtApT162gOR2lFVxHv7gDD0p l+3ZIrE+vVE6mkFkNRFyBxGGK8UY7LxC2UYA9VT3V9hjXQMku3cAr387Qz/4AQMs4tO8 v5LA== X-Gm-Message-State: AOAM5334P+9WoIj+6wpT9e9FGmCIoiFZ/03lJgmpdwskZL1voKNx0LTN GyGFfa0ozpHlcWHS+F+Wofgp4Q== X-Received: by 2002:adf:f808:: with SMTP id s8mr9505546wrp.268.1599750350396; Thu, 10 Sep 2020 08:05:50 -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 k24sm3857005wmj.19.2020.09.10.08.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 08:05:49 -0700 (PDT) From: Bryan O'Donoghue To: kvalo@codeaurora.org, wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org Subject: [PATCH v5 7/7] wcn36xx: Remove dead code in wcn36xx_smd_config_bss() Date: Thu, 10 Sep 2020 16:06:31 +0100 Message-Id: <20200910150631.2178970-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200910150631.2178970-1-bryan.odonoghue@linaro.org> References: <20200910150631.2178970-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-20200910_110551_324923_091A7E59 X-CRM114-Status: GOOD ( 13.23 ) 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 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 5ae6a2ccfebc..05e5e079dab3 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -1697,42 +1697,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; @@ -1742,12 +1715,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; }