wifi: mt76: mt7615: rely on shared poll_list field
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 22 Jun 2023 16:50:25 +0000 (18:50 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 25 Jul 2023 19:59:42 +0000 (21:59 +0200)
Rely on poll_list field in mt76_wcid structure and get rid of
private copy.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7615/main.c
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h

index f275c0fb0bf6b1770fdc2d256bf8afaf48d5aa42..7ba789834e8df387ee3f7233b210a8587d279a9c 100644 (file)
@@ -388,8 +388,8 @@ static int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb)
 
                msta = container_of(status->wcid, struct mt7615_sta, wcid);
                spin_lock_bh(&dev->mt76.sta_poll_lock);
-               if (list_empty(&msta->poll_list))
-                       list_add_tail(&msta->poll_list,
+               if (list_empty(&msta->wcid.poll_list))
+                       list_add_tail(&msta->wcid.poll_list,
                                      &dev->mt76.sta_poll_list);
                spin_unlock_bh(&dev->mt76.sta_poll_lock);
        }
@@ -914,10 +914,10 @@ void mt7615_mac_sta_poll(struct mt7615_dev *dev)
                bool clear = false;
 
                msta = list_first_entry(&sta_poll_list, struct mt7615_sta,
-                                       poll_list);
+                                       wcid.poll_list);
 
                spin_lock_bh(&dev->mt76.sta_poll_lock);
-               list_del_init(&msta->poll_list);
+               list_del_init(&msta->wcid.poll_list);
                spin_unlock_bh(&dev->mt76.sta_poll_lock);
 
                addr = mt7615_mac_wtbl_addr(dev, msta->wcid.idx) + 19 * 4;
@@ -1516,8 +1516,8 @@ static void mt7615_mac_add_txs(struct mt7615_dev *dev, void *data)
        sta = wcid_to_sta(wcid);
 
        spin_lock_bh(&dev->mt76.sta_poll_lock);
-       if (list_empty(&msta->poll_list))
-               list_add_tail(&msta->poll_list, &dev->mt76.sta_poll_list);
+       if (list_empty(&msta->wcid.poll_list))
+               list_add_tail(&msta->wcid.poll_list, &dev->mt76.sta_poll_list);
        spin_unlock_bh(&dev->mt76.sta_poll_lock);
 
        if (mt7615_mac_add_txs_skb(dev, msta, pid, txs_data))
index e14f1f30ac31c7aa585c3dff8935338286b16398..200b1752ca77f11757c7d50ec5f27fed6facaf4d 100644 (file)
@@ -222,7 +222,7 @@ static int mt7615_add_interface(struct ieee80211_hw *hw,
 
        idx = MT7615_WTBL_RESERVED - mvif->mt76.idx;
 
-       INIT_LIST_HEAD(&mvif->sta.poll_list);
+       INIT_LIST_HEAD(&mvif->sta.wcid.poll_list);
        mvif->sta.wcid.idx = idx;
        mvif->sta.wcid.phy_idx = mvif->mt76.band_idx;
        mvif->sta.wcid.hw_key_idx = -1;
@@ -275,8 +275,8 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw,
        mt7615_mutex_release(dev);
 
        spin_lock_bh(&dev->mt76.sta_poll_lock);
-       if (!list_empty(&msta->poll_list))
-               list_del_init(&msta->poll_list);
+       if (!list_empty(&msta->wcid.poll_list))
+               list_del_init(&msta->wcid.poll_list);
        spin_unlock_bh(&dev->mt76.sta_poll_lock);
 
        mt76_packet_id_flush(&dev->mt76, &mvif->sta.wcid);
@@ -657,7 +657,7 @@ int mt7615_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
        if (idx < 0)
                return -ENOSPC;
 
-       INIT_LIST_HEAD(&msta->poll_list);
+       INIT_LIST_HEAD(&msta->wcid.poll_list);
        msta->vif = mvif;
        msta->wcid.sta = 1;
        msta->wcid.idx = idx;
@@ -706,8 +706,8 @@ void mt7615_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
                mt7615_mcu_add_bss_info(phy, vif, sta, false);
 
        spin_lock_bh(&mdev->sta_poll_lock);
-       if (!list_empty(&msta->poll_list))
-               list_del_init(&msta->poll_list);
+       if (!list_empty(&msta->wcid.poll_list))
+               list_del_init(&msta->wcid.poll_list);
        spin_unlock_bh(&mdev->sta_poll_lock);
 
        mt76_connac_power_save_sched(phy->mt76, &dev->pm);
index 765ba986f07c418f1905cf843a73b8554d78dbf4..a20322aae96725adbcba17e3b26448d246ece29b 100644 (file)
@@ -125,7 +125,6 @@ struct mt7615_sta {
 
        struct mt7615_vif *vif;
 
-       struct list_head poll_list;
        u32 airtime_ac[8];
 
        struct ieee80211_tx_rate rates[4];