From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17717C433EF for ; Wed, 9 Mar 2022 16:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234634AbiCIQqF (ORCPT ); Wed, 9 Mar 2022 11:46:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238618AbiCIQbg (ORCPT ); Wed, 9 Mar 2022 11:31:36 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AF3519BE61; Wed, 9 Mar 2022 08:26:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 61477CE1EC8; Wed, 9 Mar 2022 16:26:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB8E0C340E8; Wed, 9 Mar 2022 16:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646843161; bh=588xbUtmPZNqqQ0O0bWiHhkKzSzqqyaIEJxroH93rbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o9l5sAY9W6YKBnvQofSJmA+nhbV2+2nhtkfAI+qhRfFLjYhn9jABfCOEFTYK6e8Y7 au6swBUcLSQ70j27L43KScQ4yuSyHY8eDFBHpxLI8yr86dPe3dujp60wFB1k4+/wDu lYr7OZ2oxKMPEnwHhSkdagmG78lKxtFMohCb51PtexaEUb5KG+6PCaiBi3giObwPLi DhMvYKPkgRRqSrJozB5aFOGE4qnPebEEt/cb7jU26IPr7dhc/XwDAQ/w4c2vwjEJMH 9Qzw3IF07JPWMA73wwIOs2u5zSPUGhNaPosuiBnYZ77ao8PXqyWPjqnQsOPjQzCNc5 Xh4RSYakIPAXQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sreeramya Soratkal , Johannes Berg , Sasha Levin , johannes@sipsolutions.net, davem@davemloft.net, kuba@kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 10/14] nl80211: Update bss channel on channel switch for P2P_CLIENT Date: Wed, 9 Mar 2022 11:25:03 -0500 Message-Id: <20220309162508.137035-10-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220309162508.137035-1-sashal@kernel.org> References: <20220309162508.137035-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sreeramya Soratkal [ Upstream commit e50b88c4f076242358b66ddb67482b96947438f2 ] The wdev channel information is updated post channel switch only for the station mode and not for the other modes. Due to this, the P2P client still points to the old value though it moved to the new channel when the channel change is induced from the P2P GO. Update the bss channel after CSA channel switch completion for P2P client interface as well. Signed-off-by: Sreeramya Soratkal Link: https://lore.kernel.org/r/1646114600-31479-1-git-send-email-quic_ssramya@quicinc.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c5806f46f6c9..2799ff117f5a 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -15518,7 +15518,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev, wdev->chandef = *chandef; wdev->preset_chandef = *chandef; - if (wdev->iftype == NL80211_IFTYPE_STATION && + if ((wdev->iftype == NL80211_IFTYPE_STATION || + wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && !WARN_ON(!wdev->current_bss)) wdev->current_bss->pub.channel = chandef->chan; -- 2.34.1