Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1136913pxk; Fri, 18 Sep 2020 04:57:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo6h/vEZ+JJws/Ho545j00SiZ7ECBsLzR4d+llITZZoKrzYk/MIvUOXQSnvEzHZUft6Bs6 X-Received: by 2002:a17:906:1a4b:: with SMTP id j11mr34562622ejf.97.1600430228007; Fri, 18 Sep 2020 04:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600430228; cv=none; d=google.com; s=arc-20160816; b=qmLZbic20t/2PUpe+mELViemzx/gPAEDcjyBQlHvBZUt/EbdRWvNNZZ6AXwkwA9p5h 1aOI5ZO2wMp/mrTTMo2RZDWauu1h3yMmedkTJ3yg5hHRi+Q4r9h/sfVftfqwDxJp4lpg jlCkSeI2I33HYNZo09OtrBt6BwPjJwA/z4gv/SVn96Ob5SRqVDCKvr1jvl5hOxw+Q9i5 htC6pU5n1I5wWa1FOMah73Wh3SbOyYsshUoiiMOz21uqhWxxDHkqENbi2oKJQTIvIKYI mSkgR9nXfhXvl4TJNPpx+nVqwTCWCYe44nt8HOdc0GTvlCHS6PW5TSRRHm4q6I8L9ZDz RsEA== 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 :message-id:date:subject:cc:to:from; bh=BVx7YsugPvlMNEwQbm4IGSEPTPSbmmgzVMcGxRQ9hsE=; b=NggJI0D729xQBHP791O1kUXp7FpXReVl9PPFE7gLGbv2RISBMfBg+OEQqqX1AspuDK fTfhjRZXJXXlmkSjHWnlkZw83sCAg9TQphidCBsZJBQaorM2Y4OXB1J9ZCGTuN1JOUtR NtYdc4H5kLsiq2F9w2MxvZ/pRAD1zdsfqePokOL7H8Pz49n/TFV0Rof0NuC6aevPUyds 1Fa87h9ohM14gfhnfIqbu2HXdzpK6Ktmznw+IrD01PNv5P3m9jGDEH0JA7CloUJC8FVW Fp7BUaCj2DqD0tdTxMRDWXVhn6Tpsq9fvINlaYzGQI9guzw3jMk6x6JZEHx+qehQOln+ 8H/A== 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 gv22si1978966ejb.536.2020.09.18.04.56.33; Fri, 18 Sep 2020 04:57:07 -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 S1726365AbgIRLxT (ORCPT + 99 others); Fri, 18 Sep 2020 07:53:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgIRLxS (ORCPT ); Fri, 18 Sep 2020 07:53:18 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6624C06174A for ; Fri, 18 Sep 2020 04:53:18 -0700 (PDT) Received: from [149.224.67.249] (helo=localhost.localdomain) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1kJEwz-0006ac-RY; Fri, 18 Sep 2020 13:53:13 +0200 From: John Crispin To: Johannes Berg Cc: linux-wireless@vger.kernel.org, John Crispin Subject: [PATCH] mac80211: fix 80mhz assoc to 160/80p80 on 6GHz Date: Fri, 18 Sep 2020 13:53:04 +0200 Message-Id: <20200918115304.1135693-1-john@phrozen.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Trying to associcate to an AP on 6GHz with a STA that only has 80Mhz the cf2 field inside the chandef will get set causing the assoc to fail when trying to validate the chandef. Fix this by checking the support flags prior to setting cf2. Signed-off-by: John Crispin --- net/mac80211/util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index c8504ffc71a1..8d3bfc0fe176 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -3353,9 +3353,10 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata, he_chandef.center_freq1 = ieee80211_channel_to_frequency(he_6ghz_oper->ccfs0, NL80211_BAND_6GHZ); - he_chandef.center_freq2 = - ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1, - NL80211_BAND_6GHZ); + if (support_80_80 || support_160) + he_chandef.center_freq2 = + ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1, + NL80211_BAND_6GHZ); } if (!cfg80211_chandef_valid(&he_chandef)) { -- 2.25.1