Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp574462rdb; Mon, 29 Jan 2024 10:54:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFG/flcccSEI8pB6C18+f/WfdyI9mmrqZdtAXIlb/UPbG7lGUsNxq3kqBcDpQvoCm0Bsm+9 X-Received: by 2002:a05:6214:5090:b0:68c:5562:d9d3 with SMTP id kk16-20020a056214509000b0068c5562d9d3mr1253237qvb.94.1706554484545; Mon, 29 Jan 2024 10:54:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706554484; cv=pass; d=google.com; s=arc-20160816; b=vAi9WeFfbcLkeQE/GUUcv4nutdJ/V9cOHR66qpK4qiLOptdYDxMQ1ZbVg+V3R2qlYd B3M8L0U9sfF66Xtc1wVwQaFGDo203P8VgTY+u6V6HcZMOLkBp5+eaVzQufCigDcYCcvQ 6tKE0WrFVOFLyRRUk3Mi0XKQrUG4F+5oqmHD20i6+uVpxIsZB3qWgnhgrbjOlmwsUV+i cRgekf10X0hDr1+13rc2iuXfdUiz1eBN6qjBX7YJIA3eoDjPE3BBTljq7hAQNTBZ6Ee5 1VglZreT0e7okcE3NLx2R75cGgqQUVAPrnFC0uVovGHlQli8ghuFcEdRDCg84E8qHlJY zirg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=PIPAqo4rCv2Njc94WT+NN6BB0BdBKrBVdyRRZgq83Vw=; fh=ZOfPkQAo6eH/fFAL3SVU0Sw+JsO2TTWYUD61dOGbkOc=; b=AOUKPG326wZwIfwRFSN8RuiBO1TMhqwLZWhGJANUGQBRlsCcHw94iq0ilhYa1jb2QN Ad6AZDsPXzYpPOehR3iXBQHI1Fy1nYoWBGuSrL7DtkBkdYXqjXh+3LjiASKkv3c5RF3N N5FUucv1USjKvRfsrj8Hnet6zLaKlIyoQC5HYwP6W97EwlAla+wgthpiVbguz/QEIfqg oFYQ4gpFCQpgOKHtaQA0TqDtzDXVUcBrHwXslm+nAMZCgMb5jlYtjuQ8iIiUKgJeobtv Fo8zOiqVaJFqZASgvY/rKkTIQVi+tJCen7JZWtylVhvNAtWvspukBbziTLkyVjabVOQV R6Wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=KuZijSO9; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCXviAnGgCdqBDSfqqjNObin3kbGoG6GsFL2HojUukNwQqIaDR8wVse8mx5he30y1KgM8/Nkk9cLoLNMj8yJuYNNY2dPwVzi0vWVqvhShQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jf10-20020a0562142a4a00b00681865a7979si8316565qvb.327.2024.01.29.10.54.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 10:54:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=KuZijSO9; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 07F531C24F69 for ; Mon, 29 Jan 2024 18:54:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9344614AAA; Mon, 29 Jan 2024 18:54:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="KuZijSO9" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 069EB4CB28 for ; Mon, 29 Jan 2024 18:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554452; cv=none; b=S6Isas8Y0k5EN/z+cAjlbRD0w716q2a5TX49l9+8FFfxXk59+LAWnoQ6NFuus7zX9vXNkIrmFfvNIHZ8V+stiD+FGh7GEBCuXQwJHbwwvQxzynIZwQ8asBTXKAkoB7IJ6mo7EzRNbigSoc2Q7rr+zeOl8SDk6KIsoFyb2f2YlWE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706554452; c=relaxed/simple; bh=PVFdaj5VUQh/lAUtTz4P4kLyn/mjINRKxu+X6+evylw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=c3fN02Ru8vQZec0H5re2xrY5YeZ8prcfY1qXO83CDQYhKpG4jycu+8E28NRBdQ0VFtbzCxbIskPOgyAqDGQ5xPM4THzb2lES4lCTJQdbphcnhSw9qbQnFJPv4Y8D4JDbEGTYreRSPVfiY5MMx8282CwXCFZTsHMlkMK2szcuTP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=KuZijSO9; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=PIPAqo4rCv2Njc94WT+NN6BB0BdBKrBVdyRRZgq83Vw=; t=1706554451; x=1707764051; b=KuZijSO962o+3P55JOTQ9aqc0LiglSQgD4QJnvT6exkYDEMJs0RxAFb66kePyckvQ/sds1sDmmh ap4HNimKVpMOG7VmtKDvVW5lsh7B9jgMxX+o8IJ+3YjwungX63fry//o2PwwGSoAU/R1dVrKtBFwt ALaX+ZTZ8v4HlZuYv4fvVOubKtt5jVLHukNqgYbpEBWyyLMuA31bwp0aT4yRvqtyMWLjAgvOkHcTO MwRz6MvMMBCqLKLV/ARaWzz3OlNQ1b8w8CoSwBuyPPXhK92K1Q+MproMBohiCL7C3tZf/Eygc55Xk psM8xAK1/S/Sn8CAEqV5hiHpPACyJlkAfoJA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUWlj-00000004zhu-1Xu9; Mon, 29 Jan 2024 19:54:07 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] wifi: mac80211: initialize SMPS mode correctly Date: Mon, 29 Jan 2024 19:54:05 +0100 Message-ID: <20240129195405.d6d74508be18.I0a7303b1ce4d8e5436011951ab624372a445c069@changeid> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg The SMPS mode is currently re-initialized too late, since ieee80211_prep_channel() can be called again after we've already done ieee80211_setup_assoc_link(), in case there's some override of the channel configuration. Fix this. Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index c62c7c6ce91f..f1cdd2df323e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -8,7 +8,7 @@ * Copyright 2007, Michael Wu * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2015 - 2017 Intel Deutschland GmbH - * Copyright (C) 2018 - 2023 Intel Corporation + * Copyright (C) 2018 - 2024 Intel Corporation */ #include @@ -2918,6 +2918,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, /* other links will be destroyed */ sdata->deflink.u.mgd.bss = NULL; + sdata->deflink.smps_mode = IEEE80211_SMPS_OFF; netif_carrier_off(sdata->dev); @@ -5045,9 +5046,6 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, if (!link) return 0; - /* will change later if needed */ - link->smps_mode = IEEE80211_SMPS_OFF; - /* * If this fails (possibly due to channel context sharing * on incompatible channels, e.g. 80+80 and 160 sharing the @@ -7096,6 +7094,7 @@ void ieee80211_mgd_setup_link(struct ieee80211_link_data *link) link->u.mgd.p2p_noa_index = -1; link->u.mgd.conn_flags = 0; link->conf->bssid = link->u.mgd.bssid; + link->smps_mode = IEEE80211_SMPS_OFF; wiphy_work_init(&link->u.mgd.request_smps_work, ieee80211_request_smps_mgd_work); -- 2.43.0