]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: mt792x: extend mt76_connac_get_phy_mode_v2 for per-link STA
authorSean Wang <sean.wang@mediatek.com>
Thu, 13 Jun 2024 03:02:30 +0000 (20:02 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:01:57 +0000 (23:01 +0200)
Extend mt76_connac_get_phy_mode_v2 with the per-link STA configuration.

The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20240613030241.5771-37-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index a1a07bbca7b385f106dda74927dac80ba8116921..8e9078342429e6ec16e6197354727aca557ed486 100644 (file)
@@ -793,7 +793,8 @@ EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_he_tlv_v2);
 
 u8
 mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
-                           enum nl80211_band band, struct ieee80211_sta *sta)
+                           enum nl80211_band band,
+                           struct ieee80211_link_sta *link_sta)
 {
        struct ieee80211_sta_ht_cap *ht_cap;
        struct ieee80211_sta_vht_cap *vht_cap;
@@ -801,11 +802,11 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
        const struct ieee80211_sta_eht_cap *eht_cap;
        u8 mode = 0;
 
-       if (sta) {
-               ht_cap = &sta->deflink.ht_cap;
-               vht_cap = &sta->deflink.vht_cap;
-               he_cap = &sta->deflink.he_cap;
-               eht_cap = &sta->deflink.eht_cap;
+       if (link_sta) {
+               ht_cap = &link_sta->ht_cap;
+               vht_cap = &link_sta->vht_cap;
+               he_cap = &link_sta->he_cap;
+               eht_cap = &link_sta->eht_cap;
        } else {
                struct ieee80211_supported_band *sband;
 
@@ -911,7 +912,8 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
 
        tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_PHY, sizeof(*phy));
        phy = (struct sta_rec_phy *)tlv;
-       phy->phy_type = mt76_connac_get_phy_mode_v2(mphy, vif, band, sta);
+       phy->phy_type = mt76_connac_get_phy_mode_v2(mphy, vif, band,
+                                                   &sta->deflink);
        phy->basic_rate = cpu_to_le16((u16)vif->bss_conf.basic_rates);
        phy->rcpi = rcpi;
        phy->ampdu = FIELD_PREP(IEEE80211_HT_AMPDU_PARM_FACTOR,
index b56896cdd4d8867f03aba073f25a0c0bec018853..d4488b9cca464bced4aa79a8007339c07569e3ee 100644 (file)
@@ -1901,7 +1901,8 @@ int mt76_connac_mcu_sta_update_hdr_trans(struct mt76_dev *dev,
                                         struct mt76_wcid *wcid, int cmd);
 void mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta);
 u8 mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
-                              enum nl80211_band band, struct ieee80211_sta *sta);
+                              enum nl80211_band band,
+                              struct ieee80211_link_sta *link_sta);
 int mt76_connac_mcu_wtbl_update_hdr_trans(struct mt76_dev *dev,
                                          struct ieee80211_vif *vif,
                                          struct ieee80211_sta *sta);
index c19c6a0be597610a34fd12123e93bfb58489e4b1..80b735cfbdc788b3368be9a80bec63f28626e6f4 100644 (file)
@@ -1526,7 +1526,7 @@ mt7925_mcu_sta_phy_tlv(struct sk_buff *skb,
        phy = (struct sta_rec_phy *)tlv;
        phy->phy_type = mt76_connac_get_phy_mode_v2(mvif->phy->mt76, vif,
                                                    chandef->chan->band,
-                                                   link_sta->sta);
+                                                   link_sta);
        phy->basic_rate = cpu_to_le16((u16)link_conf->basic_rates);
        if (link_sta->ht_cap.ht_supported) {
                af = link_sta->ht_cap.ampdu_factor;