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: 11765901 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F280092C for ; Wed, 9 Sep 2020 17:10:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C96CA208FE for ; Wed, 9 Sep 2020 17:10:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e5dBR0Bu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730380AbgIIRJt (ORCPT ); Wed, 9 Sep 2020 13:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730251AbgIIPgD (ORCPT ); Wed, 9 Sep 2020 11:36:03 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B6FC0612F4 for ; Wed, 9 Sep 2020 08:35:41 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id w2so2726369wmi.1 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=OUDORyKUdGfewYCPj5a71Z/fX0vNsZQftJFdOmJtkjYQQA3O1TIM4J2cWq2RGSeKSX kAbDDPuVtjYud48MshPkMPah9ND45rNPfqKh8BSv6BfsrwcCPdrAqDJIUCRC9XsfggQA Iv0IuLLvj4bP5LrzREnRdnUB32keUZk76EcGQy8ZYoZ+vb+LIByBtJ0EDlb+peDj9cIb BunJMtn55Sjba1Mwq3JY1zzswbivF9/d6Ezh+Rt4Vv3g3NtFKSIr2yIqtUbpk5m+wGga xd+02W8OR3rwiXuL19FD/6xY8w1+YMVQmaxC1V6UJRXOBHIaFpWVreTBnL1ZOvYIMr3o BtBw== X-Gm-Message-State: AOAM531SoOHhGxcNvbjrbVCexAnj8UjkyfH33nhaRkfQ5LK9HGRyIQIe gJdXMYGpBrdUF/vqpl07l90GGg== X-Google-Smtp-Source: ABdhPJwKKKA9Quw0YjNc2SBrAqKt9gocD3tkE4wbdyTwFm1RUkNfwlSr6+jQ1S6//F64ZlePB4mB9A== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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(-) 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: 11765899 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 738D5746 for ; Wed, 9 Sep 2020 17:10:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52E3121919 for ; Wed, 9 Sep 2020 17:10:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="C2o7CmUp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731129AbgIIRKM (ORCPT ); Wed, 9 Sep 2020 13:10:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730166AbgIIPgD (ORCPT ); Wed, 9 Sep 2020 11:36:03 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECD7AC0612F5 for ; Wed, 9 Sep 2020 08:35:42 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id e17so2728960wme.0 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=E4eeBUi9lFMoQbQ4QciTDXBcXfGpZOMhWN4P+vcQVnda9DNbSmoIToCCvZVQVzSTFr xDnSs64EFt52LHBxHbYddTNThhoD610ZDXlw/Gp0mkhHLvQltneqixE9vkn31DdjUasd PW/cHcnShK7yamUyQRKP/ar1NumjmDvp1TLfXa0i1E2IapfOvqyhVdDUBHaYQJka8emr qt9vfYlkumVAJWQQXGbK54f5Up6L15RAoTNeDGPTBcj/IYcvM+7Xoo8/YbqFYtBZBo8H imxtuzhMvNDHheRCBzO4MsAdz+qjcJhGCqLWyWECFnwWjdA7Bu+r/ZfMABBI1D05jgis NaZw== X-Gm-Message-State: AOAM531VjXQ7xGoWGht5GVTvQIhbo6x+6eJkGQyD+2TZzSFrsBcQgIs3 Nq/BrcJ1ssTu8oohMLgy4MNQFg== X-Google-Smtp-Source: ABdhPJw0u6NOPIJK1AIJY6tvpAgkPUTW4zN+uG8AWNnTxeNPjz6FMZkM2eqyjfn4f8ot05I3ffm5Lw== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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(-) 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: 11765897 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19EB992C for ; Wed, 9 Sep 2020 17:10:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAEB021919 for ; Wed, 9 Sep 2020 17:10:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JQmdq/Dm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730978AbgIIRJ7 (ORCPT ); Wed, 9 Sep 2020 13:09:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730189AbgIIPgD (ORCPT ); Wed, 9 Sep 2020 11:36:03 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1801BC0612F6 for ; Wed, 9 Sep 2020 08:35:44 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id q9so2732107wmj.2 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=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=Mn9UTMOZjyOIQZ4qiJYVtjaBHNze5YnAMpM4LfhL5JmqtTwDeMVN/NzsWqm9oL/I0m i9SEExfIa127aAO/5juWDUW6zqwRxibbmcWq61Yrt8YXkgdhUYG1TEYS3smGVeF0GXld 47YLm1NbX/GjoHNx7mnLirCbArzG3+QGLshUSXNPwgo+SvERBwN+wPS8F2cVBQpAZA8+ +W1qGzdvLRvG2MI4RS303z/RkeCcmefMNwsZeq051SbSrANtt1UfXsfn1V8zKV5ssoB1 YC39ic4Ak6RYDdClF75HkddhetbeOwmn3Xt+5MbIoHPPld+shTvRVJS2iqz2gppljSfR BoVQ== X-Gm-Message-State: AOAM530QMRL9AFpOGfqAEZg0bsGEI4/I+sNgGrQk8uKkrnllpFkcA7R0 5MfMU4OrY9yhxEYKUuemP65U7w== X-Google-Smtp-Source: ABdhPJyS2BgRP6d03iPIT16SDfw7Ckc07Dbx+GIGRrqVz1Qg0Xxq3a4EsbZ81iyzYqdxdVs1r/ggQA== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Reported-by: kernel test robot --- drivers/net/wireless/ath/wcn36xx/smd.c | 172 +++++++++++++------------ 1 file changed, 92 insertions(+), 80 deletions(-) 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: 11765895 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5357F746 for ; Wed, 9 Sep 2020 17:09:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 309BE21941 for ; Wed, 9 Sep 2020 17:09:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Fybatupi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730339AbgIIRJw (ORCPT ); Wed, 9 Sep 2020 13:09:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729942AbgIIPgD (ORCPT ); Wed, 9 Sep 2020 11:36:03 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17019C0612F8 for ; Wed, 9 Sep 2020 08:35:45 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id w2so2726507wmi.1 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=+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=DonECvKyugP9oU8D5rCpgoO6wUQaMwOpxA+PqX4ASFrF9HxWrJlFUKO9JNNHNGkX6n CPvjsqix4iUxZmcv8GDQMcRm9PlO7vzUoq44Sd2nylcFnZYmd+vRYM2KN95z1RBqwe4k hrfq+3h+e6Pe7cGzvE3JexO+einqPBvG5v1HUXTmwq7/5dR+AYVoWoWeHVPg+O9aZ7hA AOqDNgZ34iHM5o1gH4piTszcxNmlZtvy+fWyhqpTRg5Dd0NuWpP7YmQdA29Ayqs15JXP uC46oi/UXvK8knVBO5VeBsVZxunROHE23KggPhzrI4UGL2k+3w3nj0NN7tT+GarOCZo6 fK7A== X-Gm-Message-State: AOAM531SoqxinDYkScM0r4//ySVpS5EWRxcpdDG8dsTxFM99HchV0voU 9g3ZZ2e1Gijr6xTTUZX68BCtoQ== X-Google-Smtp-Source: ABdhPJwduk9wXLxyFaVVJxDU0QNdkIjiI5tdH9PYmPd9Q1HPFMpzDmUfWOpSDVi2CmEqbDlUDjABuw== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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(-) 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: 11765885 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37D6292C for ; Wed, 9 Sep 2020 17:09:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BE8421919 for ; Wed, 9 Sep 2020 17:09:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gn6su5lY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730354AbgIIRJG (ORCPT ); Wed, 9 Sep 2020 13:09:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730341AbgIIPgD (ORCPT ); Wed, 9 Sep 2020 11:36:03 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9D0BC0612F9 for ; Wed, 9 Sep 2020 08:35:45 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id o5so3409832wrn.13 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=gd1HqpVME895QGHiGoh5S4KPA9zE8ayk0eoYcPpEotwtwWT2Nlcqt2peRjKRJ6jgFC mlM0YwBpJPhuEf+TlT/9emxvUT71HOCtt+QApSgaMOsc/2oulgZbTeQ3tc9Yn+wfxelv MM9pQNCnVz0MVxEsBFPdBK6fhswDcfcxmWvkDI9nO8maw0jqP6GljJjmwW96R3tjIoGT 5McYrmuFEZJ4Ttg0Agj8jqdQ8Vj6fDV0NTQzvO8ZcNYNidvclKu0XuV53nyFsKbmWRbl ODhMzxy+6RlpgVEK36cLVnmt1ifzQzCCsW8vFbo/+rmPbv4IO+KuDuHUfhWAvQAKiArT w3ow== X-Gm-Message-State: AOAM531TzoUrdRO26b6KbOT5ncN+ycOODLIieyexWopCLVivOOUFyvmK sa/1areUG30fjYnZhQmvbjQfQQ== X-Google-Smtp-Source: ABdhPJzsy3kaOio6wjZFPiVINfDBnrMMD+GB7vYLVY8KiXYVFsojEqgPsKt5tJG/glBSeojqQppyTg== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This commit adds wcn36xx_smd_config_bss_v0() as a step along the road of functionally decomposing wcn36xx_smd_config_bss(). Signed-off-by: Bryan O'Donoghue Reviewed-by: Loic Poulain Reported-by: kernel test robot Reported-by: kernel test robot --- drivers/net/wireless/ath/wcn36xx/smd.c | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) 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: 11765887 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFB5292C for ; Wed, 9 Sep 2020 17:09:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F0BD221E5 for ; Wed, 9 Sep 2020 17:09:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EMnSQzZT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730911AbgIIRJF (ORCPT ); Wed, 9 Sep 2020 13:09:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730340AbgIIPgD (ORCPT ); Wed, 9 Sep 2020 11:36:03 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16A28C061756 for ; Wed, 9 Sep 2020 08:35:47 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id t10so3479089wrv.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=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=DvogpbdOpBEXYLcnbN46bOg7kfH08mmx4FaouDFkhGHVOE0ysI98I8CPMo7WZsP/G3 ZW7BRgyH15UpEMHZ47VXKcwGQHUo035supXxvMn/h8dNlTfb7Mk+Qaq7+89sxI740yfS XC7h20NNB2l5pAxOP534uN/gsv84WOh+Ua1aLsp9WxemOcSexRR/g8S49yst5YJ6JUxb Ftf+fazTnJQGuqqh6wS6b9XBetWUIDCyXwn2ICZuK41JPujBQG3e4ii8t8Qavfxu/8FK 7lxXUaNAx2PJJGS9mw7bGzdvmwXq0Iq3q1L3WiE0mH2U+dUFJisTpwpGlWH3Sxlvkrer 8GdA== X-Gm-Message-State: AOAM532+sd3BGa2TrfKUp3fsNAde5XpLL+s85qjA5j8T8OIdDM6d+yS/ 5mBPoBpX5+rUrRw+zkaUxkLscw== X-Google-Smtp-Source: ABdhPJysZYDKrwLOFlDsjr2JknJHfgYs93ua2Bzj2UCNzwZ1fsEaWqu2QdWDsvUxWiWM/1qyQxdqNw== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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(-) 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: 11765893 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3534192C for ; Wed, 9 Sep 2020 17:09:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1662721919 for ; Wed, 9 Sep 2020 17:09:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bDaDaBH3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731122AbgIIRJ3 (ORCPT ); Wed, 9 Sep 2020 13:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730346AbgIIPgD (ORCPT ); Wed, 9 Sep 2020 11:36:03 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DC78C061757 for ; Wed, 9 Sep 2020 08:35:48 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id w2so2726676wmi.1 for ; Wed, 09 Sep 2020 08:35: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=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=kxJErNjqDFxn1gb1XEjRYw+2LF1sc+E6o74ltLARFh/k7p0e+9k17dw/aQHH0KWH3e pNNhkNKriM2E9LsQIZ8K1WNxsctb4nuTvjSIByVRnm/JHLUga7FoLklUiAVX6hYxcc9k 09XJqb6rWenukqexI9BH/J0ZG86yIBqwAJrrfAUneTi0P3eBXOR8wSS0pe2sERazcEQO ILcr2zAwxp3y1GfltAxEYR93HV2kkHP41obdNWZ3pzOcz9wO3wttShyGA1wyBMLuwCyD yBlcd9uxb//yaOtyc9CGI5iggcXIyuklATpilJvnAO3VXRQa+DNpVr9wrgP8DBDZS2J1 LnNQ== X-Gm-Message-State: AOAM532+YBibS5fXKQf/XajvKitiYk11+7gydqgUh7g+LGeCbnksP0Wg vXYr1FnCl5VXe5HVAGhMKGXmSw== X-Google-Smtp-Source: ABdhPJwJBBoWskU3EpRSkqKDHRBKJiRQD+etEYEz5En6jDjNqKfrmUzx+46FSaXziOja6PePxMSN/A== 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 Cc: bryan.odonoghue@linaro.org, shawn.guo@linaro.org, loic.poulain@linaro.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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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(-) 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; }