Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp648607rdh; Thu, 23 Nov 2023 14:28:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHO0cNvEj7Rr1WYSCc/T1o9CVkpAu6osWm2S+I0b0yLuKFVc3iMO6tQNNO/MPdFHXgwPDun X-Received: by 2002:ac8:5b88:0:b0:41c:baf5:b500 with SMTP id a8-20020ac85b88000000b0041cbaf5b500mr1147545qta.47.1700778491693; Thu, 23 Nov 2023 14:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700778491; cv=none; d=google.com; s=arc-20160816; b=MhmbCabwBkVH2bq6qRe3Feaj/z4iYU/j3VnKGXCHtcG6Ff8WBeRoymxnTotdiQ16OM l4jplJUx67s8iyEr6eF0MzCBKuiGtbX9SpAsRAJz6nDoUBNGbyfE/RrBr/R2uZnpUWO4 2R/CqCB+FTW8KT+Btx2fcRVoCkvklV2U6YdI7pCkXLi1ZmvGhURpj1ySljd8SZZPjLKz ZPnITkqhcVDFnAqumkrmPLGFt6wq2iTRb+kC9kx1tVf+Zl8aVjtAO2qxZuf0pILRJksG ExX630uEmyocMB5zVgbAVVo1jEKZ/MUrz0ZiStCaVbCacCvAu5nOsN7E0mlIxyKxCnVT KBBg== 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=Pw7ikaLund/3cz5pLyerBidDni0/DRZLHwuJ+uXbv/o=; fh=QCRMbNmxBrwEohLjUHQ8w4lzVnBUUFoRxUspyxOIxFc=; b=csxzC9xf5rzutqQRfHRDXde9nd8AgIKRBP0emJAtVckMQFfmp3vwXE1dvEVzrvDHj4 1YYDeOfM9Ycqb+Pcu1OrlBA08azlA/ynfWf6bCZSbFOpI5RZnDaH2197B1xOTEDVDVE8 TR4SEpnzSC92wu8uGgtic31RS8Zd5A7MC+dADpEMHyP/NdMOoP1HYyEWywJlN+fqrJMz PeHp4YgGPCId32wrsO1+N+CbmR1VQfcoeyZWjsJl71IAWVKT9TSU4bYODGzM7bQPPOdo 9owCKwKauQpOuNUy8AE690+yyVUQV3UmTd2dcZx66RbDtXe6+r2juGgr2K5AIOqmutSB NFdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=gFbNtIOw; spf=pass (google.com: domain of linux-wireless+bounces-10-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-10-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i10-20020ac85e4a000000b004237838dd47si2000871qtx.750.2023.11.23.14.28.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 14:28:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-10-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=gFbNtIOw; spf=pass (google.com: domain of linux-wireless+bounces-10-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-10-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 7331C1C20A5C for ; Thu, 23 Nov 2023 22:28:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FCB93FE43; Thu, 23 Nov 2023 22:28:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="gFbNtIOw" 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 B1707D67 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=Pw7ikaLund/3cz5pLyerBidDni0/DRZLHwuJ+uXbv/o=; t=1700778476; x=1701988076; b=gFbNtIOwmr7hLPft+3xdhIzCnPQk3opY4vJofR5P94OowpV 2UQv8vSZhLblO07nZXQK2U8R4u7i0aZIYP2BbDYryNA2NExOgczkodD/dlKSDTT1wqxf+czxYgJJz TOKayB1Z53fgQLJBZXNq2xra94L4DNYAgBWvnUTgE3IcDvxCSwhEfxmPaApUrVKI+UZLkIbYyCcaw cawIzDct3z/7g+7zcCm0ddof+7t91ddFIVXSnjv5fBYIqjmIL5kXS7Mb3dOTeGuS7lUwgOLJUzM+O 9wWZwUZhYNa/ABS6rsbaRMqRMWGjhlv9h2JsdkKIId0Ux/epo/3Tv4xK5LGOoXxw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1r6IAs-00000001Y53-0foW; Thu, 23 Nov 2023 23:27:54 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [RFC PATCH v2 03/13] wifi: mac80211: remove extra element parsing Date: Thu, 23 Nov 2023 23:14:40 +0100 Message-ID: <20231123231436.507e99367629.I112b1ef00904c4183ac7644800f8daa8a4449875@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 We already parse all the BSS elements into elems, there's really no need to separately find EHT/ML again. Remove the extra code. Signed-off-by: Johannes Berg --- net/mac80211/mlme.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 2cdafabe46e0..d3b32fecc91d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4940,32 +4940,12 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, (IEEE80211_CONN_DISABLE_HE | IEEE80211_CONN_DISABLE_EHT)) && he_oper) { - const struct cfg80211_bss_ies *cbss_ies; - const struct element *eht_ml_elem; - const u8 *eht_oper_ie; - - cbss_ies = rcu_dereference(cbss->ies); - eht_oper_ie = cfg80211_find_ext_ie(WLAN_EID_EXT_EHT_OPERATION, - cbss_ies->data, cbss_ies->len); - if (eht_oper_ie && eht_oper_ie[1] >= - 1 + sizeof(struct ieee80211_eht_operation)) - eht_oper = (void *)(eht_oper_ie + 3); - else - eht_oper = NULL; + eht_oper = elems->eht_operation; if (!ieee80211_verify_sta_eht_mcs_support(sdata, sband, eht_oper)) *conn_flags |= IEEE80211_CONN_DISABLE_EHT; - eht_ml_elem = cfg80211_find_ext_elem(WLAN_EID_EXT_EHT_MULTI_LINK, - cbss_ies->data, cbss_ies->len); - - /* data + 1 / datalen - 1 since it's an extended element */ - if (!(*conn_flags & IEEE80211_CONN_DISABLE_EHT) && - eht_ml_elem && - ieee80211_mle_type_ok(eht_ml_elem->data + 1, - IEEE80211_ML_CONTROL_TYPE_BASIC, - eht_ml_elem->datalen - 1)) - supports_mlo = true; + supports_mlo = elems->ml_basic; } /* Allow VHT if at least one channel on the sband supports 80 MHz */ -- 2.42.0