Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1359921pxb; Fri, 26 Feb 2021 08:50:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhNQCt5UBmqUa1+p7Q2ydd0eQRhL6BMhV+2/gs345pU6U0QdMTkCye+ShdzfbveDPAm7Kv X-Received: by 2002:a05:6402:5112:: with SMTP id m18mr4463819edd.129.1614358224096; Fri, 26 Feb 2021 08:50:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614358224; cv=none; d=google.com; s=arc-20160816; b=NRh8HwOmnjZ7Zavb7dnJOm3CiLr8qN2aS2BAQhnikFHUn0PRTx7rHbabiELdXbTDBv 6AO59nwA3oJZB7Svuvz+Lws1pWqvKq27rpwGVpSyXkZ4RqvitmVc5Od3+MYgEg2g2SCz 2zsWV8CWNc0O0Mku0t918jYS87WrDXRz2vsjA9MjD82i/ToRmcq++xI30CnGbGZvcbZZ 0GwLNO9qV38Q0UfBQOmt0iRP8M7vI3GVmIKwVQaj3cSoueWLvQGjMYKcGuUH+3Uqvzjx rzF19dSKdmLctp9ce9SVsqHQ3MTdhj3oSVqQk7vHYSq85OZdWMVt+ZbqFesgaQ7zNKP0 7UXw== 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=xbPkdJWknW3o3liqjKesfPi4wOENbNS2PYtOtDLuo+s=; b=ll6TB5ErMxZh6NwJeit7zo6B8OCe+Jn90GCp1sFcvuYyhCRV0fm0FcFiJeMHQVLYSY ncLv2s5GHeyzuGYWqoG028VL9GlH8dfEAwQqoaATOMSWSpMTn1cDkaN6AETcrYt9E45c FU4twc4QBUHUXFdv5Y9Qkl4DnwivFjxmK4sttlpIX9qAzJxQYoMPk4FaNa9R9fNF8VgO qdJr5t7Zh+iUFs9WgU7v0iELxhH/hAS3CfK66Y/l7xAXRBM3vaVr5Kn9phncHJLZlR6/ paLi6oqda2uuVvhQXYetLfP+RvJ11ixBnO5Pq99x5Apf45noqc4YG7x2K6Ccfi4od2Wn 9xXA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox26si7145744ejb.4.2021.02.26.08.50.00; Fri, 26 Feb 2021 08:50:24 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230223AbhBZQpa (ORCPT + 99 others); Fri, 26 Feb 2021 11:45:30 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:48454 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229586AbhBZQpS (ORCPT ); Fri, 26 Feb 2021 11:45:18 -0500 X-UUID: c26f49ec24ea4fa8b7b9948881e2923b-20210227 X-UUID: c26f49ec24ea4fa8b7b9948881e2923b-20210227 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 132487405; Sat, 27 Feb 2021 00:44:31 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 27 Feb 2021 00:44:29 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 27 Feb 2021 00:44:29 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Shayne Chen , , , Ryder Lee Subject: [PATCH v3 1/2] mt76: mt7915: add missing capabilities for DBDC Date: Sat, 27 Feb 2021 00:44:27 +0800 Message-ID: <427ab5a2a79b8bbfa05225cfe4cfb55b3f143c8c.1614357346.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 499513151A86E2E5101392422E2DCAE1DCD9EF30BE8BD662A6E60BF995734AC32000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This improves dbdc performance. Signed-off-by: Ryder Lee --- change since v3 - fix build warnings. change since v2 - adjust setup sequence. --- .../net/wireless/mediatek/mt76/mt7915/init.c | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index c599b44a728c..165be6abcc96 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -113,6 +113,24 @@ mt7915_init_wiphy(struct ieee80211_hw *hw) ieee80211_hw_set(hw, WANT_MONITOR_VIF); hw->max_tx_fragments = 4; + + if (phy->mt76->cap.has_2ghz) + phy->mt76->sband_2g.sband.ht_cap.cap |= + IEEE80211_HT_CAP_LDPC_CODING | + IEEE80211_HT_CAP_MAX_AMSDU; + + if (phy->mt76->cap.has_5ghz) { + phy->mt76->sband_5g.sband.ht_cap.cap |= + IEEE80211_HT_CAP_LDPC_CODING | + IEEE80211_HT_CAP_MAX_AMSDU; + phy->mt76->sband_5g.sband.vht_cap.cap |= + IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 | + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK; + } + + mt76_set_stream_caps(phy->mt76, true); + mt7915_set_stream_vht_txbf_caps(phy); + mt7915_set_stream_he_caps(phy); } static void @@ -240,22 +258,17 @@ static int mt7915_register_ext_phy(struct mt7915_dev *dev) phy->mt76 = mphy; mphy->chainmask = dev->chainmask & ~dev->mphy.chainmask; mphy->antenna_mask = BIT(hweight8(mphy->chainmask)) - 1; - mt7915_init_wiphy(mphy->hw); INIT_LIST_HEAD(&phy->stats_list); INIT_DELAYED_WORK(&mphy->mac_work, mt7915_mac_work); mt7915_eeprom_parse_band_config(phy); - mt7915_set_stream_vht_txbf_caps(phy); - mt7915_set_stream_he_caps(phy); + mt7915_init_wiphy(mphy->hw); memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR2, ETH_ALEN); mt76_eeprom_override(mphy); - /* The second interface does not get any packets unless it has a vif */ - ieee80211_hw_set(mphy->hw, WANT_MONITOR_VIF); - ret = mt7915_init_tx_queues(phy, MT7915_TXQ_BAND1, MT7915_TX_RING_SIZE); if (ret) @@ -332,8 +345,14 @@ static int mt7915_init_hardware(struct mt7915_dev *dev) void mt7915_set_stream_vht_txbf_caps(struct mt7915_phy *phy) { - int nss = hweight8(phy->mt76->chainmask); - u32 *cap = &phy->mt76->sband_5g.sband.vht_cap.cap; + int nss; + u32 *cap; + + if (!phy->mt76->cap.has_5ghz) + return; + + nss = hweight8(phy->mt76->chainmask); + cap = &phy->mt76->sband_5g.sband.vht_cap.cap; *cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE | IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE | @@ -637,25 +656,14 @@ int mt7915_register_device(struct mt7915_dev *dev) return ret; mt7915_init_wiphy(hw); - dev->mphy.sband_2g.sband.ht_cap.cap |= - IEEE80211_HT_CAP_LDPC_CODING | - IEEE80211_HT_CAP_MAX_AMSDU; - dev->mphy.sband_5g.sband.ht_cap.cap |= - IEEE80211_HT_CAP_LDPC_CODING | - IEEE80211_HT_CAP_MAX_AMSDU; - dev->mphy.sband_5g.sband.vht_cap.cap |= - IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 | - IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK; + if (!dev->dbdc_support) dev->mphy.sband_5g.sband.vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_160 | IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ; + dev->mphy.hw->wiphy->available_antennas_rx = dev->mphy.chainmask; dev->mphy.hw->wiphy->available_antennas_tx = dev->mphy.chainmask; - - mt76_set_stream_caps(&dev->mphy, true); - mt7915_set_stream_vht_txbf_caps(&dev->phy); - mt7915_set_stream_he_caps(&dev->phy); dev->phy.dfs_state = -1; #ifdef CONFIG_NL80211_TESTMODE -- 2.18.0