developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 1 | From 8a284ffc268754a8e941888ce6f1b506f3c7564c Mon Sep 17 00:00:00 2001 |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 2 | From: MeiChia Chiu <MeiChia.Chiu@mediatek.com> |
| 3 | Date: Mon, 28 Nov 2022 14:36:09 +0800 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 4 | Subject: [PATCH 10/11] wifi: mt76: mt7996: add muru support |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 5 | |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 6 | Add sta_rec_muru() fw command to support MU-MIMO and OFDMA features. |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 7 | |
| 8 | Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com> |
| 9 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 10 | --- |
| 11 | mt76_connac_mcu.h | 3 ++- |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 12 | mt7996/mcu.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++- |
| 13 | 2 files changed, 57 insertions(+), 2 deletions(-) |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 14 | |
| 15 | diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 16 | index b91262ee..6249de57 100644 |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 17 | --- a/mt76_connac_mcu.h |
| 18 | +++ b/mt76_connac_mcu.h |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 19 | @@ -519,7 +519,8 @@ struct sta_rec_muru { |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 20 | u8 uo_ra; |
| 21 | u8 he_2x996_tone; |
| 22 | u8 rx_t_frame_11ac; |
| 23 | - u8 rsv[3]; |
| 24 | + u8 rx_ctrl_frame_to_mbss; |
| 25 | + u8 rsv[2]; |
| 26 | } ofdma_ul; |
| 27 | |
| 28 | struct { |
| 29 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 30 | index 20519bff..611f6450 100644 |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 31 | --- a/mt7996/mcu.c |
| 32 | +++ b/mt7996/mcu.c |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 33 | @@ -1101,6 +1101,59 @@ mt7996_mcu_sta_amsdu_tlv(struct mt7996_dev *dev, struct sk_buff *skb, |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 34 | } |
| 35 | } |
| 36 | |
| 37 | +static void |
| 38 | +mt7996_mcu_sta_muru_tlv(struct mt7996_dev *dev, struct sk_buff *skb, |
| 39 | + struct ieee80211_vif *vif, struct ieee80211_sta *sta) |
| 40 | +{ |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 41 | + struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem; |
| 42 | + struct sta_rec_muru *muru; |
| 43 | + struct tlv *tlv; |
| 44 | + |
| 45 | + if (vif->type != NL80211_IFTYPE_STATION && |
| 46 | + vif->type != NL80211_IFTYPE_AP) |
| 47 | + return; |
| 48 | + |
| 49 | + tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_MURU, sizeof(*muru)); |
| 50 | + |
| 51 | + muru = (struct sta_rec_muru *)tlv; |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 52 | + muru->cfg.mimo_dl_en = vif->bss_conf.eht_mu_beamformer || |
| 53 | + vif->bss_conf.he_mu_beamformer || |
| 54 | + vif->bss_conf.vht_mu_beamformer || |
| 55 | + vif->bss_conf.vht_mu_beamformee; |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 56 | + muru->cfg.ofdma_dl_en = true; |
| 57 | + |
| 58 | + if (sta->deflink.vht_cap.vht_supported) |
| 59 | + muru->mimo_dl.vht_mu_bfee = |
| 60 | + !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); |
| 61 | + |
| 62 | + if (!sta->deflink.he_cap.has_he) |
| 63 | + return; |
| 64 | + |
| 65 | + muru->mimo_dl.partial_bw_dl_mimo = |
| 66 | + HE_PHY(CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO, elem->phy_cap_info[6]); |
| 67 | + |
| 68 | + muru->mimo_ul.full_ul_mimo = |
| 69 | + HE_PHY(CAP2_UL_MU_FULL_MU_MIMO, elem->phy_cap_info[2]); |
| 70 | + muru->mimo_ul.partial_ul_mimo = |
| 71 | + HE_PHY(CAP2_UL_MU_PARTIAL_MU_MIMO, elem->phy_cap_info[2]); |
| 72 | + |
| 73 | + muru->ofdma_dl.punc_pream_rx = |
| 74 | + HE_PHY(CAP1_PREAMBLE_PUNC_RX_MASK, elem->phy_cap_info[1]); |
| 75 | + muru->ofdma_dl.he_20m_in_40m_2g = |
| 76 | + HE_PHY(CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G, elem->phy_cap_info[8]); |
| 77 | + muru->ofdma_dl.he_20m_in_160m = |
| 78 | + HE_PHY(CAP8_20MHZ_IN_160MHZ_HE_PPDU, elem->phy_cap_info[8]); |
| 79 | + muru->ofdma_dl.he_80m_in_160m = |
| 80 | + HE_PHY(CAP8_80MHZ_IN_160MHZ_HE_PPDU, elem->phy_cap_info[8]); |
| 81 | + |
| 82 | + muru->ofdma_ul.t_frame_dur = |
| 83 | + HE_MAC(CAP1_TF_MAC_PAD_DUR_MASK, elem->mac_cap_info[1]); |
| 84 | + muru->ofdma_ul.mu_cascading = |
| 85 | + HE_MAC(CAP2_MU_CASCADING, elem->mac_cap_info[2]); |
| 86 | + muru->ofdma_ul.uo_ra = |
| 87 | + HE_MAC(CAP3_OFDMA_RA, elem->mac_cap_info[3]); |
| 88 | +} |
| 89 | + |
| 90 | static inline bool |
| 91 | mt7996_is_ebf_supported(struct mt7996_phy *phy, struct ieee80211_vif *vif, |
| 92 | struct ieee80211_sta *sta, bool bfee) |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 93 | @@ -1778,7 +1831,8 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev, struct ieee80211_vif *vif, |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 94 | mt7996_mcu_sta_he_6g_tlv(skb, sta); |
| 95 | /* starec eht */ |
| 96 | mt7996_mcu_sta_eht_tlv(skb, sta); |
| 97 | - /* TODO: starec muru */ |
| 98 | + /* starec muru */ |
| 99 | + mt7996_mcu_sta_muru_tlv(dev, skb, vif, sta); |
| 100 | /* starec bfee */ |
| 101 | mt7996_mcu_sta_bfee_tlv(dev, skb, vif, sta); |
| 102 | /* starec hdr trans */ |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 103 | -- |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 104 | 2.39.2 |
developer | abdbf25 | 2023-02-06 16:02:21 +0800 | [diff] [blame] | 105 | |