Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp507528imw; Wed, 13 Jul 2022 02:47:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u55yoywq0QAbr03bqXWPdDWluMa95dIkX62Oik0tk0bDRA7+z+EUnZTO0ED96kyBqWz+Dj X-Received: by 2002:a17:902:ea0a:b0:168:d8ce:4a63 with SMTP id s10-20020a170902ea0a00b00168d8ce4a63mr2377219plg.57.1657705634164; Wed, 13 Jul 2022 02:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657705634; cv=none; d=google.com; s=arc-20160816; b=TBVucedgeIfmgFYk0kDsnPpgkKYReryhdCJHicOm/kyHZ/cFpVuMlMIUR9Z4A0XkNc 89lVr+vhTzqCFUmgSc8REURhBK1WAzDpUC42PKZor5oNDmQT5LyxEvdTu+7WK3/5Izrj AY4aEQW4xV5xgGEBbs61I0NY2OhNmV3u+Uu5R8hjuGBY9bsKHR24fpWbXqiXeMTEXaNc uqYFl5cU3phh40fl8vzI+UTF3n8YdDf3TBibP4wlLv2FqY5MGYgjD9p8lRCZBlH47o2p 2ayl8itIG9l8eh/MpjfrNP0kIYc/sPlBh3zOFZxSYoi/a/frX/kqbofFj3yOIaw2gHjX NinQ== 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 :dkim-signature; bh=n7wFBEEAuNQGGsR1pxmwrMMRlVj3BpAiqSqQllf4lKg=; b=HQ/oaTsvucEDJycHiJxcsZker92cVStMBTol06pJZLj2zKUqamA1pq++gwLfcVNoXy vfimX7jaooH9IIgy1QEpQPlJ3c4PxrL6rcVmd0cCLqq05IWe09QMKhIgzI+vJaGvLfjG AP7NZbWidlshy9GULWGxoMycJpkURO/f+t645WtLz9wnq265RvjiJh+DfsdwhQRNn0QJ dtpv6LYTiSGiTpyrSLt9VtSQPocbAUE5eC/KmnSHv8tNOchY2RandRwV+n0j43VvAdUe 8TTbGLhXS8DJ48G7t2IUshgja/6SfcrKQyEDAoUaZWkBB6jT20iCLADYtYU6k+6b2IKD cx3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=NdNptq9Q; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h190-20020a6383c7000000b0040d1da68c7bsi16641889pge.7.2022.07.13.02.47.03; Wed, 13 Jul 2022 02:47:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=NdNptq9Q; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235736AbiGMJpM (ORCPT + 65 others); Wed, 13 Jul 2022 05:45:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234609AbiGMJpK (ORCPT ); Wed, 13 Jul 2022 05:45:10 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B836BFAEB for ; Wed, 13 Jul 2022 02:45:08 -0700 (PDT) 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=n7wFBEEAuNQGGsR1pxmwrMMRlVj3BpAiqSqQllf4lKg=; t=1657705508; x=1658915108; b=NdNptq9QaEYb5hcGAeLWUoeDf8hVCLkInoSNm76JDViBwNR exNLEVOCdhXNXPNKYFYcyUS0ZtGhrXt/NGFyNZ1nFMkgxk4LEUPnkhw2K3ih2oxLBTnGrsJt2XjiT Uoat64PKkV/dUUi/MQPbIlygcJ50HDKi9nTM8Dy001xKynBPenLFsICPrjMDDVniE70RiM+PLXaWX 2AKRLmqow3TRUcXAJMCE+SWqBcodbumAQoz6xMKNRm1iuQKmCBDRaghtx2YcXMTyeSk9D+TL9AsUD maq5Pee0PWM5PrunJCWvEbWFfnTkL3Q7uNuRWdfThlBgKUFYKlgUQJ0ximlXADwg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1oBYvZ-00EgvB-RX; Wed, 13 Jul 2022 11:45:05 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Andrei Otcheretianski Subject: [PATCH 04/76] wifi: mac80211: Consider MLO links in offchannel logic Date: Wed, 13 Jul 2022 11:43:50 +0200 Message-Id: <20220713114425.640af05da5be.I968979e66d80dbf8b9352075a6dcc7a366c1ba85@changeid> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220713094502.163926-1-johannes@sipsolutions.net> References: <20220713094502.163926-1-johannes@sipsolutions.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Andrei Otcheretianski Check all the MLO links to decide whether offchannel TX is needed. Signed-off-by: Andrei Otcheretianski Signed-off-by: Johannes Berg --- net/mac80211/offchannel.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 2ed4e2325914..aff5d3c39902 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -842,10 +842,24 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, /* Check if the operating channel is the requested channel */ if (!need_offchan) { - struct ieee80211_chanctx_conf *chanctx_conf; + struct ieee80211_chanctx_conf *chanctx_conf = NULL; + int i; rcu_read_lock(); - chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf); + /* Check all the links first */ + for (i = 0; i < ARRAY_SIZE(sdata->vif.link_conf); i++) { + if (!sdata->vif.link_conf[i]) + continue; + + chanctx_conf = rcu_dereference(sdata->vif.link_conf[i]->chanctx_conf); + if (!chanctx_conf) + continue; + + if (ether_addr_equal(sdata->vif.link_conf[i]->addr, mgmt->sa)) + break; + + chanctx_conf = NULL; + } if (chanctx_conf) { need_offchan = params->chan && -- 2.36.1