Commit d17a2fe8 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

wifi: mt76: mt7921: rely on shared poll_list field

Rely on poll_list field in mt76_wcid structure and get rid of
private copy.
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent e3b0311f
...@@ -84,8 +84,8 @@ static void mt7921_mac_sta_poll(struct mt7921_dev *dev) ...@@ -84,8 +84,8 @@ static void mt7921_mac_sta_poll(struct mt7921_dev *dev)
break; break;
} }
msta = list_first_entry(&sta_poll_list, msta = list_first_entry(&sta_poll_list,
struct mt7921_sta, poll_list); struct mt7921_sta, wcid.poll_list);
list_del_init(&msta->poll_list); list_del_init(&msta->wcid.poll_list);
spin_unlock_bh(&dev->mt76.sta_poll_lock); spin_unlock_bh(&dev->mt76.sta_poll_lock);
idx = msta->wcid.idx; idx = msta->wcid.idx;
...@@ -281,8 +281,8 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb) ...@@ -281,8 +281,8 @@ mt7921_mac_fill_rx(struct mt7921_dev *dev, struct sk_buff *skb)
if (status->wcid) { if (status->wcid) {
msta = container_of(status->wcid, struct mt7921_sta, wcid); msta = container_of(status->wcid, struct mt7921_sta, wcid);
spin_lock_bh(&dev->mt76.sta_poll_lock); spin_lock_bh(&dev->mt76.sta_poll_lock);
if (list_empty(&msta->poll_list)) if (list_empty(&msta->wcid.poll_list))
list_add_tail(&msta->poll_list, list_add_tail(&msta->wcid.poll_list,
&dev->mt76.sta_poll_list); &dev->mt76.sta_poll_list);
spin_unlock_bh(&dev->mt76.sta_poll_lock); spin_unlock_bh(&dev->mt76.sta_poll_lock);
} }
...@@ -568,8 +568,8 @@ void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data) ...@@ -568,8 +568,8 @@ void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data)
goto out; goto out;
spin_lock_bh(&dev->mt76.sta_poll_lock); spin_lock_bh(&dev->mt76.sta_poll_lock);
if (list_empty(&msta->poll_list)) if (list_empty(&msta->wcid.poll_list))
list_add_tail(&msta->poll_list, &dev->mt76.sta_poll_list); list_add_tail(&msta->wcid.poll_list, &dev->mt76.sta_poll_list);
spin_unlock_bh(&dev->mt76.sta_poll_lock); spin_unlock_bh(&dev->mt76.sta_poll_lock);
out: out:
...@@ -649,8 +649,8 @@ static void mt7921_mac_tx_free(struct mt7921_dev *dev, void *data, int len) ...@@ -649,8 +649,8 @@ static void mt7921_mac_tx_free(struct mt7921_dev *dev, void *data, int len)
msta = container_of(wcid, struct mt7921_sta, wcid); msta = container_of(wcid, struct mt7921_sta, wcid);
spin_lock_bh(&mdev->sta_poll_lock); spin_lock_bh(&mdev->sta_poll_lock);
if (list_empty(&msta->poll_list)) if (list_empty(&msta->wcid.poll_list))
list_add_tail(&msta->poll_list, list_add_tail(&msta->wcid.poll_list,
&mdev->sta_poll_list); &mdev->sta_poll_list);
spin_unlock_bh(&mdev->sta_poll_lock); spin_unlock_bh(&mdev->sta_poll_lock);
continue; continue;
......
...@@ -313,7 +313,7 @@ static int mt7921_add_interface(struct ieee80211_hw *hw, ...@@ -313,7 +313,7 @@ static int mt7921_add_interface(struct ieee80211_hw *hw,
idx = MT7921_WTBL_RESERVED - mvif->mt76.idx; idx = MT7921_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.idx = idx;
mvif->sta.wcid.phy_idx = mvif->mt76.band_idx; mvif->sta.wcid.phy_idx = mvif->mt76.band_idx;
mvif->sta.wcid.hw_key_idx = -1; mvif->sta.wcid.hw_key_idx = -1;
...@@ -358,8 +358,8 @@ static void mt7921_remove_interface(struct ieee80211_hw *hw, ...@@ -358,8 +358,8 @@ static void mt7921_remove_interface(struct ieee80211_hw *hw,
mt7921_mutex_release(dev); mt7921_mutex_release(dev);
spin_lock_bh(&dev->mt76.sta_poll_lock); spin_lock_bh(&dev->mt76.sta_poll_lock);
if (!list_empty(&msta->poll_list)) if (!list_empty(&msta->wcid.poll_list))
list_del_init(&msta->poll_list); list_del_init(&msta->wcid.poll_list);
spin_unlock_bh(&dev->mt76.sta_poll_lock); spin_unlock_bh(&dev->mt76.sta_poll_lock);
mt76_packet_id_flush(&dev->mt76, &msta->wcid); mt76_packet_id_flush(&dev->mt76, &msta->wcid);
...@@ -764,7 +764,7 @@ int mt7921_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, ...@@ -764,7 +764,7 @@ int mt7921_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
if (idx < 0) if (idx < 0)
return -ENOSPC; return -ENOSPC;
INIT_LIST_HEAD(&msta->poll_list); INIT_LIST_HEAD(&msta->wcid.poll_list);
msta->vif = mvif; msta->vif = mvif;
msta->wcid.sta = 1; msta->wcid.sta = 1;
msta->wcid.idx = idx; msta->wcid.idx = idx;
...@@ -843,8 +843,8 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, ...@@ -843,8 +843,8 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
} }
spin_lock_bh(&dev->mt76.sta_poll_lock); spin_lock_bh(&dev->mt76.sta_poll_lock);
if (!list_empty(&msta->poll_list)) if (!list_empty(&msta->wcid.poll_list))
list_del_init(&msta->poll_list); list_del_init(&msta->wcid.poll_list);
spin_unlock_bh(&dev->mt76.sta_poll_lock); spin_unlock_bh(&dev->mt76.sta_poll_lock);
mt76_connac_power_save_sched(&dev->mphy, &dev->pm); mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
......
...@@ -150,7 +150,6 @@ struct mt7921_sta { ...@@ -150,7 +150,6 @@ struct mt7921_sta {
struct mt7921_vif *vif; struct mt7921_vif *vif;
struct list_head poll_list;
u32 airtime_ac[8]; u32 airtime_ac[8];
int ack_signal; int ack_signal;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment