Skip to content

Commit cb1353e

Browse files
Ming Yen Hsiehnbd168
authored andcommitted
wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd
Integrate *mlo_sta_cmd and *sta_cmd for the MLO firmware. Fixes: 86c051f ("wifi: mt76: mt7925: enabling MLO when the firmware supports it") Cc: stable@vger.kernel.org Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Tested-by: Caleb Jorden <cjorden@gmail.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Link: https://patch.msgid.link/20250305000851.493671-5-sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 0ebb60d commit cb1353e

File tree

1 file changed

+4
-55
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7925

1 file changed

+4
-55
lines changed

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

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,49 +1814,6 @@ mt7925_mcu_sta_mld_tlv(struct sk_buff *skb,
18141814
}
18151815
}
18161816

1817-
static int
1818-
mt7925_mcu_sta_cmd(struct mt76_phy *phy,
1819-
struct mt76_sta_cmd_info *info)
1820-
{
1821-
struct mt76_vif_link *mvif = (struct mt76_vif_link *)info->vif->drv_priv;
1822-
struct mt76_dev *dev = phy->dev;
1823-
struct sk_buff *skb;
1824-
int conn_state;
1825-
1826-
skb = __mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid,
1827-
MT7925_STA_UPDATE_MAX_SIZE);
1828-
if (IS_ERR(skb))
1829-
return PTR_ERR(skb);
1830-
1831-
conn_state = info->enable ? CONN_STATE_PORT_SECURE :
1832-
CONN_STATE_DISCONNECT;
1833-
if (info->link_sta)
1834-
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
1835-
info->link_sta,
1836-
conn_state, info->newly);
1837-
if (info->link_sta && info->enable) {
1838-
mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta);
1839-
mt7925_mcu_sta_ht_tlv(skb, info->link_sta);
1840-
mt7925_mcu_sta_vht_tlv(skb, info->link_sta);
1841-
mt76_connac_mcu_sta_uapsd(skb, info->vif, info->link_sta->sta);
1842-
mt7925_mcu_sta_amsdu_tlv(skb, info->vif, info->link_sta);
1843-
mt7925_mcu_sta_he_tlv(skb, info->link_sta);
1844-
mt7925_mcu_sta_he_6g_tlv(skb, info->link_sta);
1845-
mt7925_mcu_sta_eht_tlv(skb, info->link_sta);
1846-
mt7925_mcu_sta_rate_ctrl_tlv(skb, info->vif,
1847-
info->link_sta);
1848-
mt7925_mcu_sta_state_v2_tlv(phy, skb, info->link_sta,
1849-
info->vif, info->rcpi,
1850-
info->state);
1851-
mt7925_mcu_sta_mld_tlv(skb, info->vif, info->link_sta->sta);
1852-
}
1853-
1854-
if (info->enable)
1855-
mt7925_mcu_sta_hdr_trans_tlv(skb, info->vif, info->link_sta);
1856-
1857-
return mt76_mcu_skb_send_msg(dev, skb, info->cmd, true);
1858-
}
1859-
18601817
static void
18611818
mt7925_mcu_sta_remove_tlv(struct sk_buff *skb)
18621819
{
@@ -1869,8 +1826,8 @@ mt7925_mcu_sta_remove_tlv(struct sk_buff *skb)
18691826
}
18701827

18711828
static int
1872-
mt7925_mcu_mlo_sta_cmd(struct mt76_phy *phy,
1873-
struct mt76_sta_cmd_info *info)
1829+
mt7925_mcu_sta_cmd(struct mt76_phy *phy,
1830+
struct mt76_sta_cmd_info *info)
18741831
{
18751832
struct mt792x_vif *mvif = (struct mt792x_vif *)info->vif->drv_priv;
18761833
struct mt76_dev *dev = phy->dev;
@@ -1884,12 +1841,10 @@ mt7925_mcu_mlo_sta_cmd(struct mt76_phy *phy,
18841841
if (IS_ERR(skb))
18851842
return PTR_ERR(skb);
18861843

1887-
if (info->enable)
1844+
if (info->enable && info->link_sta) {
18881845
mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
18891846
info->link_sta,
18901847
info->enable, info->newly);
1891-
1892-
if (info->enable && info->link_sta) {
18931848
mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta);
18941849
mt7925_mcu_sta_ht_tlv(skb, info->link_sta);
18951850
mt7925_mcu_sta_vht_tlv(skb, info->link_sta);
@@ -1940,7 +1895,6 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev,
19401895
};
19411896
struct mt792x_sta *msta;
19421897
struct mt792x_link_sta *mlink;
1943-
int err;
19441898

19451899
if (link_sta) {
19461900
msta = (struct mt792x_sta *)link_sta->sta->drv_priv;
@@ -1949,12 +1903,7 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev,
19491903
info.wcid = link_sta ? &mlink->wcid : &mvif->sta.deflink.wcid;
19501904
info.newly = state != MT76_STA_INFO_STATE_ASSOC;
19511905

1952-
if (ieee80211_vif_is_mld(vif))
1953-
err = mt7925_mcu_mlo_sta_cmd(&dev->mphy, &info);
1954-
else
1955-
err = mt7925_mcu_sta_cmd(&dev->mphy, &info);
1956-
1957-
return err;
1906+
return mt7925_mcu_sta_cmd(&dev->mphy, &info);
19581907
}
19591908

19601909
int mt7925_mcu_set_beacon_filter(struct mt792x_dev *dev,

0 commit comments

Comments
 (0)