Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp661096pxj; Wed, 2 Jun 2021 08:20:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXtZJKuGhNOV8ZpPxx+hidQEdYmlL0frawp5gHn/4zyG58oDE82DHfqzU+dkV/FCkiEF1y X-Received: by 2002:a17:906:9143:: with SMTP id y3mr25406798ejw.465.1622647204761; Wed, 02 Jun 2021 08:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622647204; cv=none; d=google.com; s=arc-20160816; b=SQPltqIY42w9GPxrbUgocqyRJJcwiY8JX7rO+2plJ4YYYfHmpNQObHltKEtDHKFJkw KeB8GuWJF/4z+Uz4orzL1d/m3YoFeuEsQSVP8fbHxn9IHF8Ynny9GQDvatnaDTs5McDL Rl70lqZxrv8U21KS/iAfUbrt6gAgpOj3ktLpfReqFLuj5dGiGO4B/EJecJTLagRuB+A2 8e4P6viDNfp69GZX7xtVrXRIB6UsZzzuZ3l5nJjVJWvCof8MAU8EjO0m1+xkFcvuMppI eNQnHXbFNSDJz01LCYKEikoMv7CwNzmB1P93gUqASnzMvVdiUjVcttA9cyPGCOYqLLNc i0pA== 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=mNvBDbUI8wcJWjLw/jITmqGVnXEAT7D2iQqW1/8ydBw=; b=yQbPdwyeXg3V3MxJLF4VVGn/fr68RO8HLfx0VQcLhHisd7hhDmSAeE+apS5P09HuyA AyaSvxL2YfoC3lI0I95HPFuPDpNGDYGgEBKzvKIf1cmnvsv/8CZd7oBpu/g60+LGlDuh gcw0HjCVzTxleZoyhwc8mZTe7uFrJ77rlCMT0LRo2S0dC2j457HEk7pz0YQILwgavAFf JX+ZyNe/YQ4yQ4T7RO5Q19D5H96xZSij0gVpcjXbbeKDvc/jfAjv3HxprchoZea5r2Up 1XgbF3L3vMnOrFpzLICUegPVhUC6m72wSq/BiQl/VkNOW8/f/cA27Xwd3D7q3O0Sjsh4 CzzA== 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 m25si156806edr.588.2021.06.02.08.19.38; Wed, 02 Jun 2021 08:20:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbhFBPUL (ORCPT + 99 others); Wed, 2 Jun 2021 11:20:11 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:48207 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231618AbhFBPUK (ORCPT ); Wed, 2 Jun 2021 11:20:10 -0400 X-UUID: 36bace2b19b64c5496c75d4df3d970f7-20210602 X-UUID: 36bace2b19b64c5496c75d4df3d970f7-20210602 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 266100842; Wed, 02 Jun 2021 23:18:26 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 2 Jun 2021 23:18:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 2 Jun 2021 23:18:24 +0800 From: Deren Wu To: Felix Fietkau , Lorenzo Bianconi CC: Sean Wang , Soul Huang , YN Chen , Leon Yen , Eric-SY Chang , Deren Wu , KM Lin , Robin Chiu , CH Yeh , Posh Sun , Eric Liang , Stella Chang , , , linux-wireless , linux-mediatek , Deren Wu Subject: [PATCH] mt76: mt7921: enable VHT BFee capabiliity Date: Wed, 2 Jun 2021 23:17:52 +0800 Message-ID: X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Deren Wu enable BFee functions with proper BFee IEs Tested-by: Eric-SY Chang Signed-off-by: Leon Yen Signed-off-by: Deren Wu --- .../net/wireless/mediatek/mt76/mt7921/init.c | 1 + .../net/wireless/mediatek/mt76/mt7921/main.c | 18 ++++++++++++++++++ .../net/wireless/mediatek/mt76/mt7921/mt7921.h | 1 + 3 files changed, 20 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c index 59da29032645..82b01a2cea69 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c @@ -219,6 +219,7 @@ int mt7921_register_device(struct mt7921_dev *dev) dev->mphy.hw->wiphy->available_antennas_tx = dev->mphy.chainmask; mt76_set_stream_caps(&dev->mphy, true); + mt7921_set_stream_vht_bf_caps(&dev->phy); mt7921_set_stream_he_caps(&dev->phy); ret = mt76_register_device(&dev->mt76, true, mt76_rates, diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c index 84930ad5ebc7..95502708b840 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c @@ -140,6 +140,24 @@ mt7921_init_he_caps(struct mt7921_phy *phy, enum nl80211_band band, return idx; } +void mt7921_set_stream_vht_bf_caps(struct mt7921_phy *phy) +{ + u32 *cap; + + if (!phy->mt76->cap.has_5ghz) + return; + + cap = &phy->mt76->sband_5g.sband.vht_cap.cap; + + *cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE | + IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE | + (3 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT); + + *cap &= ~(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK | + IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE | + IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE); +} + void mt7921_set_stream_he_caps(struct mt7921_phy *phy) { struct ieee80211_sband_iftype_data *data; diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h index 8aa8d2ecdffa..abf8be358786 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h @@ -356,6 +356,7 @@ void mt7921_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps); void mt7921_stats_work(struct work_struct *work); void mt7921_txp_skb_unmap(struct mt76_dev *dev, struct mt76_txwi_cache *txwi); +void mt7921_set_stream_vht_bf_caps(struct mt7921_phy *phy); void mt7921_set_stream_he_caps(struct mt7921_phy *phy); void mt7921_update_channel(struct mt76_dev *mdev); int mt7921_init_debugfs(struct mt7921_dev *dev); -- 2.18.0