Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp648593rdh; Thu, 23 Nov 2023 14:28:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IET5KYQ5AinU4Qso9ICiSvJ81qCUkSUmdtFHH4HeIa9j28JKvrKodhLf3GjoHFsd7EUulrC X-Received: by 2002:a17:90b:1b4c:b0:280:2609:6d51 with SMTP id nv12-20020a17090b1b4c00b0028026096d51mr690479pjb.18.1700778489713; Thu, 23 Nov 2023 14:28:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700778489; cv=none; d=google.com; s=arc-20160816; b=c/q598pPCjzc8Szj3QKheU92KB2gI1i2TaowShKgGucSvVHKZg8CyU8+2sAKEU0iK/ 7bfNO93A6pAa2PKJnyeZkYOZ7idJ5lFzIpSp6v66a5riT0SxTyRIIOcLjEm/bwqkxLEb sM7vFY6PoIhq6sLPfsHDj8ZOOx/uy/mPAwiHylk4iRRCp/sdO9ATApWDVmcDTm0ycnME titXjkHvq8jFAoBFAY3m142hOmVzcamMA5HBGuO75RC51b0o7dy5cZ+tBp5phDkUaf1E 78+C8qOo80AqspglI80MPnibCKR3ATZAM2FkTPDkf6lo5XU09SbCLO+bxdyBiX+/JoAk eKQw== ARC-Message-Signature: i=1; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TKYfuNSNeNnvEUmjh4pr20odwS4M+QXd1x4w8HGydEo=; fh=QCRMbNmxBrwEohLjUHQ8w4lzVnBUUFoRxUspyxOIxFc=; b=eLcc50VULMqJAvDAxFmuoXnkT3MVN8mZFWinZm7rTKEq5zmXugB6EP9RFsIyfwrDCu 37cOMGAKvxvCZ7Kg1vDKnB9Xoe3ZxIP6DKntv90LtjFgzLhj4k7rqpSxYjUl7+YKYc/t /pSKcxsLg/DjzN07RJYsJkk3a229nVXX/J4zRyIIoG6tHYcXV1pfA1hjk+H5ZDZPk1f2 TxxNERZ5P1RgqJNgUt9NY25A3MivmMBmhLbTUm3xKzmIw2xLfm+yFgnYvX/NMmfm2gpH d82J9yJ6qCOM+/uIL0FMmpYh8dkrzIWPrE+AEsTS38f92qYVFvVS4FIsZMtTfpQrDG+g X4vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=rHax5LHP; spf=pass (google.com: domain of linux-wireless+bounces-8-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ev15-20020a17090aeacf00b00280ca5f4ca5si2612527pjb.113.2023.11.23.14.28.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 14:28:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=rHax5LHP; spf=pass (google.com: domain of linux-wireless+bounces-8-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7EEA9B20E68 for ; Thu, 23 Nov 2023 22:28:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D2AC33092; Thu, 23 Nov 2023 22:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="rHax5LHP" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 704D9D64 for ; Thu, 23 Nov 2023 14:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To: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; bh=TKYfuNSNeNnvEUmjh4pr20odwS4M+QXd1x4w8HGydEo=; t=1700778476; x=1701988076; b=rHax5LHP7d/G8cuvAEErQeGrxEphbMd5baKhQqv+nuZIofU rHev2Rc9rDghPLfFZ9K1UvQ+8xtDQDJuryjAKt6rH9ve5pfUvm/790jhmZBsi+XdCL+pvJeqvtm05 sg0pdCNCTNyiGnn3PiyTQwO3+uF6qxxRxoroniK24b69DnLnxhDBbc/W4uBj86rx5ZeDncseI+fZk 5LW+llOLr+s1hLzAT5PYuKw7yu4u40VS8QQKwzzX6VeiJJPXU2GDNu9oVXti5xMmfeGyuKCNTBzyn E6ASxIfPWgw92IoU/UYXUj3+wMLoUHptzVwJokpzTJ1ABGRR/QWGcVQPVXc35H4w==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1r6IAr-00000001Y53-2Ru6; Thu, 23 Nov 2023 23:27:53 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [RFC PATCH v2 02/13] wifi: mac80211: take EML capa/delay from assoc response Date: Thu, 23 Nov 2023 23:14:39 +0100 Message-ID: <20231123231436.5bd5d9a20c39.I545e955675e2269a52496a22ae7822d95b40235e@changeid> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123221436.143254-14-johannes@sipsolutions.net> References: <20231123221436.143254-14-johannes@sipsolutions.net> 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 association response is more likely to be correct than a random scan result, which really also should be correct, but we generally prefer to take data from the association response, so do that here as well. Also reset the data so it doesn't hang around from an old connection to a non-MLO connection, drivers would hopefully not look at it, but less surprise this way. Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 778eef2f06f1..2cdafabe46e0 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3068,6 +3068,9 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, memset(sdata->vif.bss_conf.tx_pwr_env, 0, sizeof(sdata->vif.bss_conf.tx_pwr_env)); + sdata->vif.cfg.eml_cap = 0; + sdata->vif.cfg.eml_med_sync_delay = 0; + memset(&sdata->u.mgd.ttlm_info, 0, sizeof(sdata->u.mgd.ttlm_info)); wiphy_delayed_work_cancel(sdata->local->hw.wiphy, &ifmgd->ttlm_work); @@ -4961,14 +4964,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, eht_ml_elem && ieee80211_mle_type_ok(eht_ml_elem->data + 1, IEEE80211_ML_CONTROL_TYPE_BASIC, - eht_ml_elem->datalen - 1)) { + eht_ml_elem->datalen - 1)) supports_mlo = true; - - sdata->vif.cfg.eml_cap = - ieee80211_mle_get_eml_cap(eht_ml_elem->data + 1); - sdata->vif.cfg.eml_med_sync_delay = - ieee80211_mle_get_eml_med_sync_delay(eht_ml_elem->data + 1); - } } /* Allow VHT if at least one channel on the sband supports 80 MHz */ @@ -5416,6 +5413,11 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, goto abandon_assoc; } } + + sdata->vif.cfg.eml_cap = + ieee80211_mle_get_eml_cap((const void *)elems->ml_basic); + sdata->vif.cfg.eml_med_sync_delay = + ieee80211_mle_get_eml_med_sync_delay((const void *)elems->ml_basic); } sdata->vif.cfg.aid = aid; -- 2.42.0