developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 1 | From a0cf73079cf52808d6b4196d433d62aebd751c16 Mon Sep 17 00:00:00 2001 |
| 2 | From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 3 | Date: Tue, 23 Apr 2024 09:19:25 +0800 |
| 4 | Subject: [PATCH 124/199] mtk: mt76: mt7996: enable ibf capability for mt7992 |
| 5 | |
| 6 | For the specific sku of mt7992, it supports both ibf and ebf |
| 7 | functionality. The firmware algorithm may decide which type is better |
| 8 | according to the station's beamform capability. |
| 9 | |
| 10 | Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 11 | --- |
| 12 | mt7996/mcu.c | 7 ++++++- |
| 13 | 1 file changed, 6 insertions(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| 16 | index a88beb36..28123fb7 100644 |
| 17 | --- a/mt7996/mcu.c |
| 18 | +++ b/mt7996/mcu.c |
| 19 | @@ -2265,6 +2265,8 @@ mt7996_mcu_sta_bfer_tlv(struct mt7996_dev *dev, struct sk_buff *skb, |
| 20 | struct ieee80211_bss_conf *conf, struct mt7996_bss_conf *mconf, |
| 21 | struct ieee80211_link_sta *link_sta) |
| 22 | { |
| 23 | +#define EBF_MODE BIT(0) |
| 24 | +#define IBF_MODE BIT(1) |
| 25 | struct mt7996_phy *phy = mconf->phy; |
| 26 | int tx_ant = hweight16(phy->mt76->chainmask) - 1; |
| 27 | struct sta_rec_bf *bf; |
| 28 | @@ -2302,7 +2304,10 @@ mt7996_mcu_sta_bfer_tlv(struct mt7996_dev *dev, struct sk_buff *skb, |
| 29 | else |
| 30 | return; |
| 31 | |
| 32 | - bf->bf_cap = ebf ? ebf : dev->ibf << 1; |
| 33 | + bf->bf_cap = ebf ? EBF_MODE : (dev->ibf ? IBF_MODE : 0); |
| 34 | + if (is_mt7992(&dev->mt76) && |
| 35 | + tx_ant == hweight8(phy->mt76->hw->wiphy->available_antennas_tx)) |
| 36 | + bf->bf_cap |= IBF_MODE; |
| 37 | bf->bw = link_sta->bandwidth; |
| 38 | bf->ibf_dbw = link_sta->bandwidth; |
| 39 | bf->ibf_nrow = tx_ant; |
| 40 | -- |
| 41 | 2.18.0 |
| 42 | |