From patchwork Fri Sep 11 10:29:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 259240 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81EDAC433E2 for ; Fri, 11 Sep 2020 10:29:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 25E8620758 for ; Fri, 11 Sep 2020 10:29:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="DNB78KAt"; dkim=pass (1024-bit key) header.d=amazonses.com header.i=@amazonses.com header.b="D8l5lMyX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725810AbgIKK3G (ORCPT ); Fri, 11 Sep 2020 06:29:06 -0400 Received: from a27-188.smtp-out.us-west-2.amazonses.com ([54.240.27.188]:50794 "EHLO a27-188.smtp-out.us-west-2.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgIKK3D (ORCPT ); Fri, 11 Sep 2020 06:29:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=gbvhytky6xpx7itkhb67ktsxbiwpnxix; d=codeaurora.org; t=1599820142; h=From:To:Cc:Subject:Date:Message-Id; bh=E0O4cRkVYea8p/aCJQqVPQUhPH/+iV+SPpANjQ/SNoQ=; b=DNB78KAtvueQ2q5Xr/ddZPrGyhZMxhCgbNR0Ik6kc6mXvobC1/0OGVBqGHjV1RrK EdsyIsE7DtN0SxxBhAgEvXUS478VFcb/dG03hrKW3hl6M2OBxkLiEKEWQbk9Jf+uzpu 0DQKwwwbzZjL5GICtCznRGoyd7tO5NXPb3rmJQ9I= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=hsbnp7p3ensaochzwyq5wwmceodymuwv; d=amazonses.com; t=1599820142; h=From:To:Cc:Subject:Date:Message-Id:Feedback-ID; bh=E0O4cRkVYea8p/aCJQqVPQUhPH/+iV+SPpANjQ/SNoQ=; b=D8l5lMyXHTDfMuoQK685Grms2IeON7FD4SYZpOXDKol3wuzVrcIVphGtwM1q/BHJ hjsmpNy0nWW2MmcJl6fK1bAhT/nHn7e4D/9Kmc7wHh7JfDdpgAwQlCpWTqL79YJ2S2c 6+qFqqLBPHLfPcju7sMMAJhrs+EYHyJVSnoX937E= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 727DFC433FE Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=wgong@codeaurora.org From: Wen Gong To: ath11k@lists.infradead.org, johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, wgong@codeaurora.org Subject: [PATCH] mac80211: do not set IEEE80211_STA_DISABLE_HE for NL80211_BAND_2GHZ Date: Fri, 11 Sep 2020 10:29:02 +0000 Message-ID: <010101747cb617f2-593c5410-1648-4a42-97a0-f3646a5a6dd1-000000@us-west-2.amazonses.com> X-Mailer: git-send-email 2.7.4 X-SES-Outgoing: 2020.09.11-54.240.27.188 Feedback-ID: 1.us-west-2.CZuq2qbDmUIuT3qdvXlRHZZCpfZqZ4GtG9v3VKgRyF0=:AmazonSES Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org VHT is not support for NL80211_BAND_2GHZ, but HE is support for it, so it should not set IEEE80211_STA_DISABLE_HE for NL80211_BAND_2GHZ if it does not support VHT. When connec to AP with NL80211_BAND_2GHZ, it does not support VHT, then it failed for HE and connected with HT mode. After this patch, it connected with HE mode for NL80211_BAND_2GHZ with a HE mode 11AX AP. Fixes: 57fa5e85d53ce51 ("mac80211: determine chandef from HE 6 GHz operation") Signed-off-by: Wen Gong --- net/mac80211/mlme.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b2a9d47cf86d..c85186799d05 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4853,6 +4853,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, struct ieee80211_supported_band *sband; struct cfg80211_chan_def chandef; bool is_6ghz = cbss->channel->band == NL80211_BAND_6GHZ; + bool is_5ghz = cbss->channel->band == NL80211_BAND_5GHZ; struct ieee80211_bss *bss = (void *)cbss->priv; int ret; u32 i; @@ -4871,7 +4872,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, ifmgd->flags |= IEEE80211_STA_DISABLE_HE; } - if (!sband->vht_cap.vht_supported && !is_6ghz) { + if (!sband->vht_cap.vht_supported && is_5ghz) { ifmgd->flags |= IEEE80211_STA_DISABLE_VHT; ifmgd->flags |= IEEE80211_STA_DISABLE_HE; }