Skip to content

Commit c0df2f0

Browse files
committed
wifi: mt76: mt7996: prepare mt7996_mcu_set_tx for MLO support
Pass in struct ieee80211_bss_conf in order to use link specific data. Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
1 parent 747fe94 commit c0df2f0

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ mt7996_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
469469
unsigned int link_id, u16 queue,
470470
const struct ieee80211_tx_queue_params *params)
471471
{
472-
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
472+
struct mt7996_dev *dev = mt7996_hw_dev(hw);
473+
struct mt7996_vif_link *mlink = mt7996_vif_link(dev, vif, link_id);
473474
static const u8 mq_to_aci[] = {
474475
[IEEE80211_AC_VO] = 3,
475476
[IEEE80211_AC_VI] = 2,
@@ -478,7 +479,7 @@ mt7996_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
478479
};
479480

480481
/* firmware uses access class index */
481-
mvif->deflink.queue_params[mq_to_aci[queue]] = *params;
482+
mlink->queue_params[mq_to_aci[queue]] = *params;
482483
/* no need to update right away, we'll get BSS_CHANGED_QOS */
483484

484485
return 0;
@@ -656,7 +657,7 @@ static void mt7996_bss_info_changed(struct ieee80211_hw *hw,
656657

657658
/* ensure that enable txcmd_mode after bss_info */
658659
if (changed & (BSS_CHANGED_QOS | BSS_CHANGED_BEACON_ENABLED))
659-
mt7996_mcu_set_tx(dev, vif);
660+
mt7996_mcu_set_tx(dev, vif, info);
660661

661662
if (changed & BSS_CHANGED_HE_OBSS_PD)
662663
mt7996_mcu_add_obss_spr(phy, vif, &info->he_obss_pd);

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,8 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans)
31453145
MCU_WM_UNI_CMD(RX_HDR_TRANS), true);
31463146
}
31473147

3148-
int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif)
3148+
int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif,
3149+
struct ieee80211_bss_conf *link_conf)
31493150
{
31503151
#define MCU_EDCA_AC_PARAM 0
31513152
#define WMM_AIFS_SET BIT(0)
@@ -3154,12 +3155,12 @@ int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif)
31543155
#define WMM_TXOP_SET BIT(3)
31553156
#define WMM_PARAM_SET (WMM_AIFS_SET | WMM_CW_MIN_SET | \
31563157
WMM_CW_MAX_SET | WMM_TXOP_SET)
3157-
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
3158+
struct mt7996_vif_link *link = mt7996_vif_conf_link(dev, vif, link_conf);
31583159
struct {
31593160
u8 bss_idx;
31603161
u8 __rsv[3];
31613162
} __packed hdr = {
3162-
.bss_idx = mvif->deflink.mt76.idx,
3163+
.bss_idx = link->mt76.idx,
31633164
};
31643165
struct sk_buff *skb;
31653166
int len = sizeof(hdr) + IEEE80211_NUM_ACS * sizeof(struct edca);
@@ -3172,7 +3173,7 @@ int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif)
31723173
skb_put_data(skb, &hdr, sizeof(hdr));
31733174

31743175
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
3175-
struct ieee80211_tx_queue_params *q = &mvif->deflink.queue_params[ac];
3176+
struct ieee80211_tx_queue_params *q = &link->queue_params[ac];
31763177
struct edca *e;
31773178
struct tlv *tlv;
31783179

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ int mt7996_mcu_add_rate_ctrl(struct mt7996_dev *dev, struct ieee80211_vif *vif,
543543
struct ieee80211_sta *sta, bool changed);
544544
int mt7996_set_channel(struct mt76_phy *mphy);
545545
int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag);
546-
int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif);
546+
int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif,
547+
struct ieee80211_bss_conf *link_conf);
547548
int mt7996_mcu_set_fixed_rate_ctrl(struct mt7996_dev *dev,
548549
void *data, u16 version);
549550
int mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif,

0 commit comments

Comments
 (0)