On 01.12.22 11:39, Kalle Valo wrote:
Shayne Chen <shayne.chen@xxxxxxxxxxxx> writes:
(Split the big patch into smaller intermediate patches by functionality
for easier review. Refer to the cover letter for more info.)
Signed-off-by: Shayne Chen <shayne.chen@xxxxxxxxxxxx>
[...]
+static void mt7996_mac_sta_poll(struct mt7996_dev *dev)
+{
+ static const u8 ac_to_tid[] = {
+ [IEEE80211_AC_BE] = 0,
+ [IEEE80211_AC_BK] = 1,
+ [IEEE80211_AC_VI] = 4,
+ [IEEE80211_AC_VO] = 6
+ };
+ struct ieee80211_sta *sta;
+ struct mt7996_sta *msta;
+ struct rate_info *rate;
+ u32 tx_time[IEEE80211_NUM_ACS], rx_time[IEEE80211_NUM_ACS];
+ LIST_HEAD(sta_poll_list);
+ int i;
+
+ spin_lock_bh(&dev->sta_poll_lock);
+ list_splice_init(&dev->sta_poll_list, &sta_poll_list);
+ spin_unlock_bh(&dev->sta_poll_lock);
+
+ rcu_read_lock();
+
+ while (true) {
In upstream we have a preference that there's some kind of limit for
loops, to avoid neverending loops.
This loop pulls entries from the on-stack sta_poll_list and bails out
when the list is empty, so it's impossible for it to be neverending.
- Felix