Skip to content

Commit 96fcecd

Browse files
committed
wifi: mt76: connac: prepare mt76_connac_mcu_sta_basic_tlv 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 97a1beb commit 96fcecd

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,8 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif,
865865
mvif->sta_added = true;
866866
}
867867
conn_state = enable ? CONN_STATE_PORT_SECURE : CONN_STATE_DISCONNECT;
868-
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, sskb, vif, link_sta,
869-
conn_state, new_entry);
868+
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, sskb, &vif->bss_conf,
869+
link_sta, conn_state, new_entry);
870870
if (enable && sta)
871871
mt76_connac_mcu_sta_tlv(phy->mt76, sskb, sta, vif, 0,
872872
MT76_STA_INFO_STATE_ASSOC);

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,11 @@ void mt76_connac_mcu_bss_omac_tlv(struct sk_buff *skb,
369369
EXPORT_SYMBOL_GPL(mt76_connac_mcu_bss_omac_tlv);
370370

371371
void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
372-
struct ieee80211_vif *vif,
372+
struct ieee80211_bss_conf *link_conf,
373373
struct ieee80211_link_sta *link_sta,
374374
int conn_state, bool newly)
375375
{
376+
struct ieee80211_vif *vif = link_conf->vif;
376377
struct sta_rec_basic *basic;
377378
struct tlv *tlv;
378379
int conn_type;
@@ -390,8 +391,8 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
390391
basic->conn_type = cpu_to_le32(CONNECTION_INFRA_BC);
391392

392393
if (vif->type == NL80211_IFTYPE_STATION &&
393-
!is_zero_ether_addr(vif->bss_conf.bssid)) {
394-
memcpy(basic->peer_addr, vif->bss_conf.bssid, ETH_ALEN);
394+
!is_zero_ether_addr(link_conf->bssid)) {
395+
memcpy(basic->peer_addr, link_conf->bssid, ETH_ALEN);
395396
basic->aid = cpu_to_le16(vif->cfg.aid);
396397
} else {
397398
eth_broadcast_addr(basic->peer_addr);
@@ -1049,6 +1050,9 @@ int mt76_connac_mcu_sta_cmd(struct mt76_phy *phy,
10491050
struct sk_buff *skb;
10501051
int conn_state;
10511052

1053+
if (!info->link_conf)
1054+
info->link_conf = &info->vif->bss_conf;
1055+
10521056
skb = mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid);
10531057
if (IS_ERR(skb))
10541058
return PTR_ERR(skb);
@@ -1057,7 +1061,7 @@ int mt76_connac_mcu_sta_cmd(struct mt76_phy *phy,
10571061
CONN_STATE_DISCONNECT;
10581062
link_sta = info->sta ? &info->sta->deflink : NULL;
10591063
if (info->sta || !info->offload_fw)
1060-
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
1064+
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
10611065
link_sta, conn_state,
10621066
info->newly);
10631067
if (info->sta && info->enable)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,7 @@ struct mt76_sta_cmd_info {
17581758
struct mt76_wcid *wcid;
17591759

17601760
struct ieee80211_vif *vif;
1761+
struct ieee80211_bss_conf *link_conf;
17611762

17621763
bool offload_fw;
17631764
bool enable;
@@ -1903,7 +1904,7 @@ mt76_connac_mcu_add_tlv(struct sk_buff *skb, int tag, int len)
19031904
int mt76_connac_mcu_set_channel_domain(struct mt76_phy *phy);
19041905
int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif);
19051906
void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
1906-
struct ieee80211_vif *vif,
1907+
struct ieee80211_bss_conf *link_conf,
19071908
struct ieee80211_link_sta *link_sta,
19081909
int state, bool newly);
19091910
void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev, struct sk_buff *skb,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
16991699
return PTR_ERR(skb);
17001700

17011701
/* starec basic */
1702-
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, vif, link_sta,
1702+
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, &vif->bss_conf, link_sta,
17031703
conn_state, newly);
17041704
/* tag order is in accordance with firmware dependency. */
17051705
if (sta && conn_state != CONN_STATE_DISCONNECT) {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
18201820
conn_state = info->enable ? CONN_STATE_PORT_SECURE :
18211821
CONN_STATE_DISCONNECT;
18221822
if (info->link_sta)
1823-
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
1823+
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
18241824
info->link_sta,
18251825
conn_state, info->newly);
18261826
if (info->link_sta && info->enable) {
@@ -1874,7 +1874,7 @@ mt7925_mcu_mlo_sta_cmd(struct mt76_phy *phy,
18741874
return PTR_ERR(skb);
18751875

18761876
if (info->enable)
1877-
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
1877+
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
18781878
info->link_sta,
18791879
info->enable, info->newly);
18801880

@@ -1920,6 +1920,7 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev,
19201920
struct mt76_sta_cmd_info info = {
19211921
.link_sta = link_sta,
19221922
.vif = vif,
1923+
.link_conf = &vif->bss_conf,
19231924
.enable = enable,
19241925
.cmd = MCU_UNI_CMD(STA_REC_UPDATE),
19251926
.state = state,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,7 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev, struct ieee80211_vif *vif,
21742174
return PTR_ERR(skb);
21752175

21762176
/* starec basic */
2177-
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, vif, link_sta,
2177+
mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, &vif->bss_conf, link_sta,
21782178
conn_state, newly);
21792179

21802180
if (conn_state == CONN_STATE_DISCONNECT)

0 commit comments

Comments
 (0)