Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3199645rwb; Sun, 20 Nov 2022 09:05:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf4klf6epKhWb6F2wMsIZD3bUwPpeLPbE5dWr9YuC3nVfwbL9LjpMqDTMAtHRiaOci70pDTN X-Received: by 2002:a17:90a:4a8f:b0:215:f80c:18e6 with SMTP id f15-20020a17090a4a8f00b00215f80c18e6mr23142726pjh.45.1668963927191; Sun, 20 Nov 2022 09:05:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668963927; cv=none; d=google.com; s=arc-20160816; b=MdizC/U5XL1xQP/BK46AZfa/BtJs6DmLY6EJ+ujQ2BhrDASQaetW17vvGrYWwZJOdz NLu8pQJIcPfW8FhhEKYHco6qiWD+zaBX4rtVm1CR1x9Uc4VON8nWSJQcSnPzLfWnZdSH ivdWBdemM+plmTawtBY6UpNlr1cpBNfuh+QfHgFmXEsMxpXf00Eexi+SiJgmsLoq0nbD b69YgIr777Cc8eepcvF7sdONUGp9GkLvXgit3SDGzBtJ82orF0Rj4RVTqPur2p21rRrl vRfz4eJ30Lg+55rSlfQiFGYzaznxtfdCPLr7vDpSqGWXdtfsMrj87glrZjjFzFYUp+e2 yL1g== 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=0FIA9h73Rn7PQoq+VQkPtaqpEXr7d1UEUXpFRpa5UEo=; b=wzWQwmrHXJ6mJAE9qi7hW87t0ujARu/HY1jgzgBhKQchdEudFnkb+M0Q5lHU0AUUM3 6XUmjjFLFnXGvP11FwjkLpqgTj8zsHoG5kYWgS5szuT1iWDyt5GwwPjKqLXx+A1n+r73 X0Kj28V57XGVnIer4Pu55DEIKgNmg9/S1VqiaBDfkHgET0Q+qHaObqYyCvq/6W5y/syP Q/0M3uNV9O1KWn7IrEEzZ8QD8XaRzPll7xrqZ0vu8xiA1EqfO6yOSwn4d5Wc0eDMIuUc Po8kCLWJIdphSxNRBe2zR8bjhJ5lCM/PzKHU8BPzi4z0l8sEfhFPP2sgoY+m+4wi913k BcPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IMUduVyt; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020a170902ecd200b0016bf245fbe1si9509925plh.296.2022.11.20.09.05.17; Sun, 20 Nov 2022 09:05:27 -0800 (PST) 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=@intel.com header.s=Intel header.b=IMUduVyt; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbiKTRBv (ORCPT + 68 others); Sun, 20 Nov 2022 12:01:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiKTRBm (ORCPT ); Sun, 20 Nov 2022 12:01:42 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C23272EF3B for ; Sun, 20 Nov 2022 09:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668963701; x=1700499701; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OfJuOazZOkGXenkFsGJYDOPNlOCzvIkQqMh+MZ6RSvs=; b=IMUduVytfCzjsg4De4ZIpk3IAWp2pQ+sjWcIu2AYDagaWykmpDd39RoW lZW/WrgJ+Cma53KomqRYQnUULTNjyzs97Xe28fEeN2572H4AHB5dMJz9N Li3l+CvMLNKbaZvOAIW978D0aTnfuLqsso0Cn22ZTu6HhsXh+LBHNCPbZ x+PDe4hW8R84ghhFmpJ2KI+6JP9gCEaxQKGN12gX48oEVXVKUonTygzLH HZjotUhjzuYF+8I6MQoWyOtzagv1GTailYiN7lrLPJpiPrT2xIriGRdok PuFWSC+dsUFeUn2ueeTWnPWl/ZVP9TEX63JI1Ir5NdLyIIz2Kb19T/j+b A==; X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="315234892" X-IronPort-AV: E=Sophos;i="5.96,179,1665471600"; d="scan'208";a="315234892" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2022 09:01:41 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="765719510" X-IronPort-AV: E=Sophos;i="5.96,179,1665471600"; d="scan'208";a="765719510" Received: from dwiener-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.249.87.2]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2022 09:01:39 -0800 From: gregory.greenman@intel.com To: kvalo@kernel.org, johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 6/9] wifi: iwlwifi: mvm: set HE PHY bandwidth according to band Date: Sun, 20 Nov 2022 19:00:36 +0200 Message-Id: <20221120185147.881d46861305.Ib4cac0b7f90dfadebceceb1e07c8cdfd7a4138f6@changeid> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221120170039.1788067-1-gregory.greenman@intel.com> References: <20221120170039.1788067-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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: Johannes Berg The bits are reserved on the opposite bands, so we shouldn't always send them, only the 2G bit on 2.4 GHz and the 5G bits on 5/6GHz. Fix that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index 2b43fff4d3f9..e83382ded8af 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* - * Copyright (C) 2005-2014, 2018-2021 Intel Corporation + * Copyright (C) 2005-2014, 2018-2022 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */ @@ -571,10 +571,6 @@ static const struct ieee80211_sband_iftype_data iwl_he_eht_capa[] = { IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU | IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS | IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX, - .phy_cap_info[0] = - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G, .phy_cap_info[1] = IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK | IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A | @@ -716,9 +712,6 @@ static const struct ieee80211_sband_iftype_data iwl_he_eht_capa[] = { IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, .mac_cap_info[3] = IEEE80211_HE_MAC_CAP3_OMI_CONTROL, - .phy_cap_info[0] = - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G, .phy_cap_info[1] = IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD, .phy_cap_info[2] = @@ -874,9 +867,23 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans, iftype_data->he_cap.he_cap_elem.mac_cap_info[3] |= IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3; - if (is_ap && iwlwifi_mod_params.nvm_file) + switch (sband->band) { + case NL80211_BAND_2GHZ: iftype_data->he_cap.he_cap_elem.phy_cap_info[0] |= - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G; + break; + case NL80211_BAND_6GHZ: + case NL80211_BAND_5GHZ: + iftype_data->he_cap.he_cap_elem.phy_cap_info[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G; + if (!is_ap || iwlwifi_mod_params.nvm_file) + iftype_data->he_cap.he_cap_elem.phy_cap_info[0] |= + IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; + break; + default: + WARN_ON(1); + break; + } if ((tx_chains & rx_chains) == ANT_AB) { iftype_data->he_cap.he_cap_elem.phy_cap_info[2] |= -- 2.35.3