Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1764472pxp; Mon, 7 Mar 2022 01:45:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGjoPLTuZR8qfimosqKxGYlIePpKyDleMMySCs3NkHOTVSgsNYI1vbkR7BS0NtZmA6AX/1 X-Received: by 2002:a17:906:9b94:b0:6db:472:db87 with SMTP id dd20-20020a1709069b9400b006db0472db87mr7312320ejc.624.1646646330246; Mon, 07 Mar 2022 01:45:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646646330; cv=none; d=google.com; s=arc-20160816; b=kydjOnlPHawZvGu3fOIA/G56GlinsG+Mmf6nhlOkEoFHjAMz1NC/ri7Er3jDD4tk2a fMJA1goC8OGSKE56AtRB3w3bFXlwFWzGy5GjjEoty5IhNdRy1zU18xOmvoCCYISlR8Es wRLNgsIcysSNE3ftxGlg6MAiZ7eNJS451zC1l0uBAeNvm9HK3mg7tmc5T5GZ+urLxCDY IGncuHeJydlVzD/qY2/IsWwav+DM2eIDRZd6K+25M6D+TWZc0gMZhzxFOuPjJ961bEzC a2/Wo9YoyBiiRXTjtx0PyPPTdwYcJqW25GeiDBFZNz9d+GQ0fWjOLFVMsO0LSqz6e309 vS5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=t1z1CIFDLBt/CHPLCk50Z0SL4Px7st00Hin1QphrvPA=; b=eMQixcs8zGWlia5xpzM8FCFzCMoUo8MY2aNVCV7qdxX+EHCoaze1UQB90QdCRMPQ79 aKxd5CQHeFPc5CvB1f+Ag+FE1lv46rHgNHM+mS1BVzSid08ng3+ryH6J9KXSM5mUy6yd jJH0cIWjaGphBZMbjSXq2R2jB1+mU0y9qlKOmvu0+W1GPU+I5uB0/vAeJjcFK1Klt+au OxknKLjQb2/Mx81aIjC55UVFyG3E43v47hcUh47P3s94a2Ysq08CVvJQrKTU+u6G0kfv Xpl67zTgbwOT50bNgJmm36bNVvd5G9Dltyd02BT+QC7morv/xIstYpfXNzv98qKTDz/0 O5Bw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kz9-20020a17090777c900b006cfd1959b85si7274186ejc.363.2022.03.07.01.45.13; Mon, 07 Mar 2022 01:45:30 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232025AbiCGDMp (ORCPT + 71 others); Sun, 6 Mar 2022 22:12:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231559AbiCGDMo (ORCPT ); Sun, 6 Mar 2022 22:12:44 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0F7D37BE6 for ; Sun, 6 Mar 2022 19:11:46 -0800 (PST) X-UUID: 651fb86d9f8a46299403a60719a218ee-20220307 X-UUID: 651fb86d9f8a46299403a60719a218ee-20220307 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1559602429; Mon, 07 Mar 2022 11:11:39 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Mon, 7 Mar 2022 11:11:38 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 7 Mar 2022 11:11:38 +0800 From: MeiChia Chiu To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , Ryder Lee , , , MeiChia Chiu , Money Wang Subject: [PATCH v2 1/4] mt76: connac: add 6 GHz support for wtbl and starec configuration Date: Mon, 7 Mar 2022 11:11:22 +0800 Message-ID: <20220307031125.2585-1-MeiChia.Chiu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=no 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 Since there are no HT & VHT IEs being sent in 6ghz, some capabilities judgement and parsing for wtbl & starec configuration should be modified to reflect such changes. Reviewed-by: Ryder Lee Signed-off-by: Money Wang Signed-off-by: MeiChia Chiu --- The series is based on https://patchwork.kernel.org/project/linux-wireless/patch/20220302061406.24797-1-MeiChia.Chiu@mediatek.com/ --- .../wireless/mediatek/mt76/mt76_connac_mcu.c | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 6c762fbf9aaa..9f83fa379396 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -905,18 +905,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb, struct tlv *tlv; u32 flags = 0; - if (sta->ht_cap.ht_supported) { + if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) { tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht), wtbl_tlv, sta_wtbl); ht = (struct wtbl_ht *)tlv; ht->ldpc = ht_ldpc && !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING); - ht->af = sta->ht_cap.ampdu_factor; - ht->mm = sta->ht_cap.ampdu_density; + + if (sta->ht_cap.ht_supported) { + ht->af = sta->ht_cap.ampdu_factor; + ht->mm = sta->ht_cap.ampdu_density; + } else { + ht->af = FIELD_GET(IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP, + sta->he_6ghz_capa.capa); + ht->mm = FIELD_GET(IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START, + sta->he_6ghz_capa.capa); + } + ht->ht = true; } - if (sta->vht_cap.vht_supported) { + if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) { struct wtbl_vht *vht; u8 af; @@ -1242,7 +1251,7 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif, if (he_cap && he_cap->has_he) mode |= PHY_MODE_AX_24G; - } else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) { + } else if (band == NL80211_BAND_5GHZ) { mode |= PHY_MODE_A; if (ht_cap->ht_supported) @@ -1251,8 +1260,11 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif, if (vht_cap->vht_supported) mode |= PHY_MODE_AC; - if (he_cap && he_cap->has_he && band == NL80211_BAND_5GHZ) + if (he_cap && he_cap->has_he) mode |= PHY_MODE_AX_5G; + } else if (band == NL80211_BAND_6GHZ) { + mode |= PHY_MODE_A | PHY_MODE_AN | + PHY_MODE_AC | PHY_MODE_AX_5G; } return mode; -- 2.18.0