blob: 3011b26abf4f0844cde742fa473fdba647296e61 [file] [log] [blame]
developer1f55fcf2024-10-17 14:52:33 +08001From 368c14bdb51f4d5bf323f9dbffc6fb65ea43c8a7 Mon Sep 17 00:00:00 2001
developer05f3b2b2024-08-19 19:17:34 +08002From: Howard Hsu <howard-yh.hsu@mediatek.com>
3Date: Tue, 23 Apr 2024 09:19:25 +0800
developer1f55fcf2024-10-17 14:52:33 +08004Subject: [PATCH 112/193] mtk: mt76: mt7996: enable ibf capability for mt7992
developer05f3b2b2024-08-19 19:17:34 +08005
6For the specific sku of mt7992, it supports both ibf and ebf
7functionality. The firmware algorithm may decide which type is better
8according to the station's beamform capability.
9
developerd0c89452024-10-11 16:53:27 +080010Change-Id: I4b38ddf5059b5eafd5fc4cacb1add2a6d0ea3836
developer05f3b2b2024-08-19 19:17:34 +080011Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
12---
13 mt7996/mcu.c | 7 ++++++-
14 1 file changed, 6 insertions(+), 1 deletion(-)
15
16diff --git a/mt7996/mcu.c b/mt7996/mcu.c
developer1f55fcf2024-10-17 14:52:33 +080017index 7699194..e9a1837 100644
developer05f3b2b2024-08-19 19:17:34 +080018--- a/mt7996/mcu.c
19+++ b/mt7996/mcu.c
developerd0c89452024-10-11 16:53:27 +080020@@ -2270,6 +2270,8 @@ mt7996_mcu_sta_bfer_tlv(struct mt7996_dev *dev, struct sk_buff *skb,
developer05f3b2b2024-08-19 19:17:34 +080021 struct ieee80211_bss_conf *conf, struct mt7996_bss_conf *mconf,
22 struct ieee80211_link_sta *link_sta)
23 {
24+#define EBF_MODE BIT(0)
25+#define IBF_MODE BIT(1)
26 struct mt7996_phy *phy = mconf->phy;
27 int tx_ant = hweight16(phy->mt76->chainmask) - 1;
28 struct sta_rec_bf *bf;
developerd0c89452024-10-11 16:53:27 +080029@@ -2307,7 +2309,10 @@ mt7996_mcu_sta_bfer_tlv(struct mt7996_dev *dev, struct sk_buff *skb,
developer05f3b2b2024-08-19 19:17:34 +080030 else
31 return;
32
33- bf->bf_cap = ebf ? ebf : dev->ibf << 1;
34+ bf->bf_cap = ebf ? EBF_MODE : (dev->ibf ? IBF_MODE : 0);
35+ if (is_mt7992(&dev->mt76) &&
36+ tx_ant == hweight8(phy->mt76->hw->wiphy->available_antennas_tx))
37+ bf->bf_cap |= IBF_MODE;
38 bf->bw = link_sta->bandwidth;
39 bf->ibf_dbw = link_sta->bandwidth;
40 bf->ibf_nrow = tx_ant;
41--
developerd0c89452024-10-11 16:53:27 +0800422.45.2
developer05f3b2b2024-08-19 19:17:34 +080043