Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp973636pxb; Tue, 14 Sep 2021 13:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyb10eN9QOFWTqQfBcymy7UzH5dA6+GNffpuRyRwp4mtVGJjCy/9/PPDaw+dcZbV5nN9rFy X-Received: by 2002:a05:6512:2310:: with SMTP id o16mr14146339lfu.646.1631649632200; Tue, 14 Sep 2021 13:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631649632; cv=none; d=google.com; s=arc-20160816; b=ZOUQl5/EIWBU7r4NgBX5483XKi0nnbl+ZajTbe8w3ATHHhPDmLOU/8nwVIh+l8CQuo 8hMxCh/X9e4JUXBBWRomhNvNWm56lO8Oq3wAZBO8sNbrI2yuoMHwefn/l1YppMxFXCTd zpnAdpEP3a6FxWK5GxYkO2oSUgeucl0hJViwAkgdOL3KmyCX8qxn8igJWUjKxWCHNpIh S/tGucYKN6bRu+6du5J+xCbJcbFwy4JDEIXfym+kLgKKg+1QgHhd52GZ5jSVWhzgzdXl yin8TMeg00ojdahIOR4gFg/3Q+s8CJeRUUIv0Fa/J5DznmfzcbNSz8H28uid9sUgQ3io hyIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pcJuG9MhEOy4QmpvD1R8R6XvCD3IzpCt7QVopFtZeOw=; b=cfVavR7RulaUZ7IRrJDEGm1u/lpVsrRpvz7dc+Oiwvuvrf4HRPUtVf0hSK1Io6SiYN y862rt+MqF9JpyOq8AnVf2ytTRviYzSKYzDDaDccBpA6oMyPMv1nMAY/epJhAF5ej4A5 L6T/Mt5394/RLGnzcEPGe7KYDyT0JDtkciQeN8ygAxBS9ou2EYcX56/Huk4xQpF9SZkn 0hTmLxRGbz45UXIvDMk24bt5MpCSmH4ewEQYiz+qT8a7dmbCBU0V5uw3KNGD/y8M5bbq oOrTWbqOkiqSqG0SzK55/KiTJxlKtY2sNOhg5zLsQ8rsOZ0V1r8H+XariiSIKQ6dyj/q gc5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si13601895ljc.353.2021.09.14.12.59.58; Tue, 14 Sep 2021 13:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233614AbhINUAy (ORCPT + 99 others); Tue, 14 Sep 2021 16:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233476AbhINUAu (ORCPT ); Tue, 14 Sep 2021 16:00:50 -0400 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050::465:102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92F2FC061762; Tue, 14 Sep 2021 12:59:31 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4H8DhK5vCtzQk8q; Tue, 14 Sep 2021 21:59:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= To: Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Kalle Valo , "David S. Miller" , Jakub Kicinski Cc: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= , Tsuchiya Yuto , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz , Andy Shevchenko , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 3/9] mwifiex: Run SET_BSS_MODE when changing from P2P to STATION vif-type Date: Tue, 14 Sep 2021 21:59:03 +0200 Message-Id: <20210914195909.36035-4-verdre@v0yd.nl> In-Reply-To: <20210914195909.36035-1-verdre@v0yd.nl> References: <20210914195909.36035-1-verdre@v0yd.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 023AE189C Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org We currently handle changing from the P2P to the STATION virtual interface type slightly different than changing from P2P to ADHOC: When changing to STATION, we don't send the SET_BSS_MODE command. We do send that command on all other type-changes though, and it probably makes sense to send the command since after all we just changed our BSS_MODE. Looking at prior changes to this part of the code, it seems that this is simply a leftover from old refactorings. Since sending the SET_BSS_MODE command is the only difference between mwifiex_change_vif_to_sta_adhoc() and the current code, we can now use mwifiex_change_vif_to_sta_adhoc() for both switching to ADHOC and STATION interface type. This does not fix any particular bug and just "looked right", so there's a small chance it might be a regression. Signed-off-by: Jonas Dreßler --- .../net/wireless/marvell/mwifiex/cfg80211.c | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index dabc59c47de3..146aabe14753 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -1270,29 +1270,15 @@ mwifiex_cfg80211_change_virtual_intf(struct wiphy *wiphy, case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_P2P_GO: + if (mwifiex_cfg80211_deinit_p2p(priv)) + return -EFAULT; + switch (type) { - case NL80211_IFTYPE_STATION: - if (mwifiex_cfg80211_deinit_p2p(priv)) - return -EFAULT; - priv->adapter->curr_iface_comb.p2p_intf--; - priv->adapter->curr_iface_comb.sta_intf++; - dev->ieee80211_ptr->iftype = type; - if (mwifiex_deinit_priv_params(priv)) - return -1; - if (mwifiex_init_new_priv_params(priv, dev, type)) - return -1; - if (mwifiex_sta_init_cmd(priv, false, false)) - return -1; - break; case NL80211_IFTYPE_ADHOC: - if (mwifiex_cfg80211_deinit_p2p(priv)) - return -EFAULT; + case NL80211_IFTYPE_STATION: return mwifiex_change_vif_to_sta_adhoc(dev, curr_iftype, type, params); - break; case NL80211_IFTYPE_AP: - if (mwifiex_cfg80211_deinit_p2p(priv)) - return -EFAULT; return mwifiex_change_vif_to_ap(dev, curr_iftype, type, params); default: -- 2.31.1