Skip to content

Commit 0cb065b

Browse files
LorenzoBianconinbd168
authored andcommitted
wifi: mt76: move rate info in mt76_vif
This is a preliminary patch to introduce mt76_connac3 mac library used by WiFi7 chipsets (e.g. mt7996). Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent c8e370f commit 0cb065b

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

drivers/net/wireless/mediatek/mt76/mt76.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ struct mt76_vif {
705705
u8 wmm_idx;
706706
u8 scan_seq_num;
707707
u8 cipher;
708+
u8 basic_rates_idx;
709+
u8 mcast_rates_idx;
710+
u8 beacon_rates_idx;
708711
};
709712

710713
struct mt76_phy {

drivers/net/wireless/mediatek/mt76/mt7996/mac.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,19 +1013,19 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
10131013
u8 band_idx = (info->hw_queue & MT_TX_HW_QUEUE_PHY) >> 2;
10141014
u8 p_fmt, q_idx, omac_idx = 0, wmm_idx = 0;
10151015
bool is_8023 = info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP;
1016-
struct mt7996_vif *mvif;
1016+
struct mt76_vif *mvif;
10171017
u16 tx_count = 15;
10181018
u32 val;
10191019
bool beacon = !!(changed & (BSS_CHANGED_BEACON |
10201020
BSS_CHANGED_BEACON_ENABLED));
10211021
bool inband_disc = !!(changed & (BSS_CHANGED_UNSOL_BCAST_PROBE_RESP |
10221022
BSS_CHANGED_FILS_DISCOVERY));
10231023

1024-
mvif = vif ? (struct mt7996_vif *)vif->drv_priv : NULL;
1024+
mvif = vif ? (struct mt76_vif *)vif->drv_priv : NULL;
10251025
if (mvif) {
1026-
omac_idx = mvif->mt76.omac_idx;
1027-
wmm_idx = mvif->mt76.wmm_idx;
1028-
band_idx = mvif->mt76.band_idx;
1026+
omac_idx = mvif->omac_idx;
1027+
wmm_idx = mvif->wmm_idx;
1028+
band_idx = mvif->band_idx;
10291029
}
10301030

10311031
if (inband_disc) {

drivers/net/wireless/mediatek/mt76/mt7996/main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ static int mt7996_add_interface(struct ieee80211_hw *hw,
223223
vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR;
224224

225225
if (phy->mt76->chandef.chan->band != NL80211_BAND_2GHZ)
226-
mvif->basic_rates_idx = MT7996_BASIC_RATES_TBL + 4;
226+
mvif->mt76.basic_rates_idx = MT7996_BASIC_RATES_TBL + 4;
227227
else
228-
mvif->basic_rates_idx = MT7996_BASIC_RATES_TBL;
228+
mvif->mt76.basic_rates_idx = MT7996_BASIC_RATES_TBL;
229229

230230
mt7996_init_bitrate_mask(vif);
231231

@@ -505,7 +505,7 @@ static u8
505505
mt7996_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
506506
bool beacon, bool mcast)
507507
{
508-
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
508+
struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
509509
struct mt76_phy *mphy = hw->priv;
510510
u16 rate;
511511
u8 i, idx, ht;
@@ -517,7 +517,7 @@ mt7996_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
517517
struct mt7996_dev *dev = mt7996_hw_dev(hw);
518518

519519
/* must odd index */
520-
idx = MT7996_BEACON_RATES_TBL + 2 * (mvif->mt76.idx % 20);
520+
idx = MT7996_BEACON_RATES_TBL + 2 * (mvif->idx % 20);
521521
mt7996_mac_set_fixed_rate_table(dev, idx, rate);
522522
return idx;
523523
}
@@ -555,7 +555,7 @@ static void mt7996_bss_info_changed(struct ieee80211_hw *hw,
555555
struct ieee80211_bss_conf *info,
556556
u64 changed)
557557
{
558-
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
558+
struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
559559
struct mt7996_phy *phy = mt7996_hw_phy(hw);
560560
struct mt7996_dev *dev = mt7996_hw_dev(hw);
561561

drivers/net/wireless/mediatek/mt76/mt7996/mcu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static void
604604
mt7996_mcu_bss_bmc_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
605605
struct mt7996_phy *phy)
606606
{
607-
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
607+
struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
608608
struct bss_rate_tlv *bmc;
609609
struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
610610
enum nl80211_band band = chandef->chan->band;

drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ struct mt7996_vif {
128128

129129
struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS];
130130
struct cfg80211_bitrate_mask bitrate_mask;
131-
132-
u8 basic_rates_idx;
133-
u8 mcast_rates_idx;
134-
u8 beacon_rates_idx;
135131
};
136132

137133
/* crash-dump */

0 commit comments

Comments
 (0)