Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1358369pxj; Fri, 18 Jun 2021 05:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPrXT+wathC4wTKDsvnI2ZZei7Onr8DhahGKigt1WHeoNzGdNG+xDV3CRpZTHfxnKL+E1L X-Received: by 2002:a17:906:36cc:: with SMTP id b12mr1123117ejc.534.1624019673504; Fri, 18 Jun 2021 05:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624019673; cv=none; d=google.com; s=arc-20160816; b=kEAasAZsjL3IrrwJmfA9S2HiT0VngDYtRz5PClbFVQAJXtCSHybMQ7J5wHa1+ag07U 80H30+TBc6MtTRJDI/OsRfwpwUhgshxc+2eZg0CstocKm/nwcbKYhHgbcGe/WTtibgfz iurrF+CAVglfMpCkPFSRuwjMuPK9fpr5AwYwPDxZ+3ThTRRtFiGkcQUIw7no2EcLOrCI t5WOYCp4pdNkcvi6Qm05+kXawkDX9M96xyI2cKy0+/2+9wQL9+Mj0fTWikDpRBiSANvI khocigcLXWDb4UrW5ma6TpktESj6fSs/zv8HjMUI+hml9B89Mr+Fl0YQVTOK4Fstcad7 3+tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from; bh=/e0UAZndatlPHwtZOpGvBbga04IlNe3QO/74xgmN7Fk=; b=BH4JWQhbwVOQYJQj6FrfKBDkXJHBjJs67i+21iybd2X/e666PzBIh5R7PlbD8vZCXC aAIBGXTsL5XAt8OT1fWB/bIaCdJ4W4AtAI4vn9+HQhflUa608K0kqr/+EHG/j2lTRckl sQs9IJPHUfrRney6p7SKI02N7E2AFMK//ZoADe4gDPID1oBa7wqpHWBC9WC3AG22K20s 7/Lo6YFW37YP+drkj9hne6x60va0sOjWWIT6vX3D8IriWKBs3890o555A7McAI8fiswa ZixY+J/qcntqUAGL4IcaaQ6G5d4sziTvPocwzMFCF9Sryd/WGloj1PyRfX2QD9gAcMVj 2/kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y13si2313763ejk.111.2021.06.18.05.34.10; Fri, 18 Jun 2021 05:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233301AbhFRKuR (ORCPT + 99 others); Fri, 18 Jun 2021 06:50:17 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:48228 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233147AbhFRKuP (ORCPT ); Fri, 18 Jun 2021 06:50:15 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=kveik.lan) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1luBwz-001YXx-2Z; Fri, 18 Jun 2021 13:42:14 +0300 From: Luca Coelho To: johannes@sipsolutions.net Cc: luca@coelho.fi, linux-wireless@vger.kernel.org Date: Fri, 18 Jun 2021 13:41:40 +0300 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210618104156.747775-1-luca@coelho.fi> References: <20210618104156.747775-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.5-pre1 Subject: [PATCH 15/31] mac80211: conditionally advertise HE in probe requests Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg While building probe requests, only enable HE capability if there are actually any channels in the band with HE enabled, otherwise we're not really capable. We're doing the same in association requests, so doing it here makes it consistent. This also makes HE not appear available if it isn't due to regulatory constraints. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho --- net/mac80211/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 0f6fd90f6696..22cab76a9c2f 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1938,7 +1938,9 @@ static int ieee80211_build_preq_ies_band(struct ieee80211_sub_if_data *sdata, } he_cap = ieee80211_get_he_sta_cap(sband); - if (he_cap) { + if (he_cap && + cfg80211_any_usable_channels(local->hw.wiphy, BIT(sband->band), + IEEE80211_CHAN_NO_HE)) { pos = ieee80211_ie_build_he_cap(pos, he_cap, end); if (!pos) goto out_err; -- 2.32.0