developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 1 | From 8c79e229decdc24af9e95e6396699b3723f7efc4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Fri, 7 Jul 2023 10:35:05 +0800 |
| 4 | Subject: [PATCH 13/98] wifi: mt76: mt7996: fix mcu command format to align |
| 5 | firmware |
| 6 | |
| 7 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 8 | --- |
| 9 | mt7996/mcu.c | 12 ++++----- |
| 10 | mt7996/mcu.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++-- |
| 11 | 2 files changed, 75 insertions(+), 8 deletions(-) |
| 12 | |
| 13 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| 14 | index 18c3f34..ee1915c 100644 |
| 15 | --- a/mt7996/mcu.c |
| 16 | +++ b/mt7996/mcu.c |
| 17 | @@ -1684,8 +1684,8 @@ int mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif |
| 18 | { |
| 19 | struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv; |
| 20 | struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; |
| 21 | - struct sta_phy *phy = data; |
| 22 | - struct sta_rec_ra_fixed *ra; |
| 23 | + struct sta_phy_uni *phy = data; |
| 24 | + struct sta_rec_ra_fixed_uni *ra; |
| 25 | struct sk_buff *skb; |
| 26 | struct tlv *tlv; |
| 27 | |
| 28 | @@ -1696,7 +1696,7 @@ int mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif |
| 29 | return PTR_ERR(skb); |
| 30 | |
| 31 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA_UPDATE, sizeof(*ra)); |
| 32 | - ra = (struct sta_rec_ra_fixed *)tlv; |
| 33 | + ra = (struct sta_rec_ra_fixed_uni *)tlv; |
| 34 | |
| 35 | switch (field) { |
| 36 | case RATE_PARAM_AUTO: |
| 37 | @@ -1728,7 +1728,7 @@ mt7996_mcu_add_rate_ctrl_fixed(struct mt7996_dev *dev, struct ieee80211_vif *vif |
| 38 | struct cfg80211_chan_def *chandef = &mvif->phy->mt76->chandef; |
| 39 | struct cfg80211_bitrate_mask *mask = &mvif->bitrate_mask; |
| 40 | enum nl80211_band band = chandef->chan->band; |
| 41 | - struct sta_phy phy = {}; |
| 42 | + struct sta_phy_uni phy = {}; |
| 43 | int ret, nrates = 0; |
| 44 | |
| 45 | #define __sta_phy_bitrate_mask_check(_mcs, _gi, _ht, _he) \ |
| 46 | @@ -1816,13 +1816,13 @@ mt7996_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7996_dev *dev, |
| 47 | struct cfg80211_chan_def *chandef = &mphy->chandef; |
| 48 | struct cfg80211_bitrate_mask *mask = &mvif->bitrate_mask; |
| 49 | enum nl80211_band band = chandef->chan->band; |
| 50 | - struct sta_rec_ra *ra; |
| 51 | + struct sta_rec_ra_uni *ra; |
| 52 | struct tlv *tlv; |
| 53 | u32 supp_rate = sta->deflink.supp_rates[band]; |
| 54 | u32 cap = sta->wme ? STA_CAP_WMM : 0; |
| 55 | |
| 56 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra)); |
| 57 | - ra = (struct sta_rec_ra *)tlv; |
| 58 | + ra = (struct sta_rec_ra_uni *)tlv; |
| 59 | |
| 60 | ra->valid = true; |
| 61 | ra->auto_rate = true; |
| 62 | diff --git a/mt7996/mcu.h b/mt7996/mcu.h |
| 63 | index 78ecd75..05785cb 100644 |
| 64 | --- a/mt7996/mcu.h |
| 65 | +++ b/mt7996/mcu.h |
| 66 | @@ -433,6 +433,73 @@ struct sta_rec_sec_uni { |
| 67 | struct sec_key_uni key[2]; |
| 68 | } __packed; |
| 69 | |
| 70 | +struct sta_phy_uni { |
| 71 | + u8 type; |
| 72 | + u8 flag; |
| 73 | + u8 stbc; |
| 74 | + u8 sgi; |
| 75 | + u8 bw; |
| 76 | + u8 ldpc; |
| 77 | + u8 mcs; |
| 78 | + u8 nss; |
| 79 | + u8 he_ltf; |
| 80 | + u8 rsv[3]; |
| 81 | +}; |
| 82 | + |
| 83 | +struct sta_rec_ra_uni { |
| 84 | + __le16 tag; |
| 85 | + __le16 len; |
| 86 | + |
| 87 | + u8 valid; |
| 88 | + u8 auto_rate; |
| 89 | + u8 phy_mode; |
| 90 | + u8 channel; |
| 91 | + u8 bw; |
| 92 | + u8 disable_cck; |
| 93 | + u8 ht_mcs32; |
| 94 | + u8 ht_gf; |
| 95 | + u8 ht_mcs[4]; |
| 96 | + u8 mmps_mode; |
| 97 | + u8 gband_256; |
| 98 | + u8 af; |
| 99 | + u8 auth_wapi_mode; |
| 100 | + u8 rate_len; |
| 101 | + |
| 102 | + u8 supp_mode; |
| 103 | + u8 supp_cck_rate; |
| 104 | + u8 supp_ofdm_rate; |
| 105 | + __le32 supp_ht_mcs; |
| 106 | + __le16 supp_vht_mcs[4]; |
| 107 | + |
| 108 | + u8 op_mode; |
| 109 | + u8 op_vht_chan_width; |
| 110 | + u8 op_vht_rx_nss; |
| 111 | + u8 op_vht_rx_nss_type; |
| 112 | + |
| 113 | + __le32 sta_cap; |
| 114 | + |
| 115 | + struct sta_phy_uni phy; |
| 116 | + u8 rx_rcpi[4]; |
| 117 | +} __packed; |
| 118 | + |
| 119 | +struct sta_rec_ra_fixed_uni { |
| 120 | + __le16 tag; |
| 121 | + __le16 len; |
| 122 | + |
| 123 | + __le32 field; |
| 124 | + u8 op_mode; |
| 125 | + u8 op_vht_chan_width; |
| 126 | + u8 op_vht_rx_nss; |
| 127 | + u8 op_vht_rx_nss_type; |
| 128 | + |
| 129 | + struct sta_phy_uni phy; |
| 130 | + |
| 131 | + u8 spe_idx; |
| 132 | + u8 short_preamble; |
| 133 | + u8 is_5g; |
| 134 | + u8 mmps_mode; |
| 135 | +} __packed; |
| 136 | + |
| 137 | struct sta_rec_hdrt { |
| 138 | __le16 tag; |
| 139 | __le16 len; |
| 140 | @@ -616,9 +683,9 @@ enum { |
| 141 | sizeof(struct sta_rec_amsdu) + \ |
| 142 | sizeof(struct sta_rec_bfee) + \ |
| 143 | sizeof(struct sta_rec_phy) + \ |
| 144 | - sizeof(struct sta_rec_ra) + \ |
| 145 | + sizeof(struct sta_rec_ra_uni) + \ |
| 146 | sizeof(struct sta_rec_sec) + \ |
| 147 | - sizeof(struct sta_rec_ra_fixed) + \ |
| 148 | + sizeof(struct sta_rec_ra_fixed_uni) + \ |
| 149 | sizeof(struct sta_rec_he_6g_capa) + \ |
| 150 | sizeof(struct sta_rec_eht) + \ |
| 151 | sizeof(struct sta_rec_hdrt) + \ |
| 152 | -- |
| 153 | 2.18.0 |
| 154 | |