Skip to content

Commit ab0eec4

Browse files
ryderlee1110nbd168
authored andcommitted
wifi: mt76: mt7996: enable BSS_CHANGED_MCAST_RATE support
Similar to BSS_CHANGED_BASIC_RATES, this enables mcast rate configuration through fixed rate tables. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Change-Id: Ifc305e8c7de9a7df4ad5f856e2097d721a886aaa Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 15ee62e commit ab0eec4

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,14 @@ void mt7996_mac_write_txwi(struct mt7996_dev *dev, __le32 *txwi,
10701070
mt7996_mac_write_txwi_80211(dev, txwi, skb, key);
10711071

10721072
if (txwi[1] & cpu_to_le32(MT_TXD1_FIXED_RATE)) {
1073+
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1074+
bool mcast = ieee80211_is_data(hdr->frame_control) &&
1075+
is_multicast_ether_addr(hdr->addr1);
10731076
u8 idx = mvif->basic_rates_idx;
10741077

1078+
if (mcast && mvif->mcast_rates_idx)
1079+
idx = mvif->mcast_rates_idx;
1080+
10751081
txwi[6] |= FIELD_PREP(MT_TXD6_TX_RATE, idx);
10761082
txwi[3] |= cpu_to_le32(MT_TXD3_BA_DISABLE);
10771083
}

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,15 @@ mt7996_update_bss_color(struct ieee80211_hw *hw,
503503
}
504504

505505
static u8
506-
mt7996_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
506+
mt7996_get_rates_table(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
507+
bool mcast)
507508
{
508509
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
509510
struct mt76_phy *mphy = hw->priv;
510511
u16 rate;
511512
u8 i, idx;
512513

513-
rate = mt76_connac2_mac_tx_rate_val(mphy, vif, false, false);
514+
rate = mt76_connac2_mac_tx_rate_val(mphy, vif, false, mcast);
514515

515516
idx = FIELD_GET(MT_TX_RATE_IDX, rate);
516517
for (i = 0; i < ARRAY_SIZE(mt76_rates); i++)
@@ -557,8 +558,13 @@ static void mt7996_bss_info_changed(struct ieee80211_hw *hw,
557558
}
558559
}
559560

561+
if (changed & BSS_CHANGED_MCAST_RATE)
562+
mvif->mcast_rates_idx =
563+
mt7996_get_rates_table(hw, vif, true);
564+
560565
if (changed & BSS_CHANGED_BASIC_RATES)
561-
mvif->basic_rates_idx = mt7996_get_rates_table(hw, vif);
566+
mvif->basic_rates_idx =
567+
mt7996_get_rates_table(hw, vif, false);
562568

563569
if (changed & BSS_CHANGED_BEACON_ENABLED && info->enable_beacon) {
564570
mt7996_mcu_add_bss_info(phy, vif, true);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ mt7996_mcu_bss_bmc_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
605605
struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
606606
enum nl80211_band band = chandef->chan->band;
607607
struct tlv *tlv;
608-
u8 idx = mvif->basic_rates_idx;
608+
u8 idx = mvif->mcast_rates_idx ?
609+
mvif->mcast_rates_idx : mvif->basic_rates_idx;
609610

610611
tlv = mt7996_mcu_add_uni_tlv(skb, UNI_BSS_INFO_RATE, sizeof(*bmc));
611612

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ struct mt7996_vif {
125125
struct cfg80211_bitrate_mask bitrate_mask;
126126

127127
u8 basic_rates_idx;
128+
u8 mcast_rates_idx;
128129
};
129130

130131
/* per-phy stats. */

0 commit comments

Comments
 (0)