1e93d8355e04671bcb0252d0aa0e40800c8ed37b
[librecmc/librecmc.git] /
1 From: Alexander Wetzel <alexander@wetzel-home.de>
2 Date: Sun, 9 Oct 2022 18:30:40 +0200
3 Subject: [PATCH] wifi: mac80211: Drop support for TX push path
4
5 All drivers are now using mac80211 internal queues (iTXQs).
6 Drop mac80211 internal support for the old push path.
7
8 Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
9 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 ---
11
12 --- a/net/mac80211/cfg.c
13 +++ b/net/mac80211/cfg.c
14 @@ -4357,9 +4357,6 @@ static int ieee80211_get_txq_stats(struc
15         struct ieee80211_sub_if_data *sdata;
16         int ret = 0;
17  
18 -       if (!local->ops->wake_tx_queue)
19 -               return 1;
20 -
21         spin_lock_bh(&local->fq.lock);
22         rcu_read_lock();
23  
24 --- a/net/mac80211/debugfs.c
25 +++ b/net/mac80211/debugfs.c
26 @@ -663,9 +663,7 @@ void debugfs_hw_add(struct ieee80211_loc
27         DEBUGFS_ADD_MODE(force_tx_status, 0600);
28         DEBUGFS_ADD_MODE(aql_enable, 0600);
29         DEBUGFS_ADD(aql_pending);
30 -
31 -       if (local->ops->wake_tx_queue)
32 -               DEBUGFS_ADD_MODE(aqm, 0600);
33 +       DEBUGFS_ADD_MODE(aqm, 0600);
34  
35         DEBUGFS_ADD_MODE(airtime_flags, 0600);
36  
37 --- a/net/mac80211/debugfs_netdev.c
38 +++ b/net/mac80211/debugfs_netdev.c
39 @@ -677,8 +677,7 @@ static void add_common_files(struct ieee
40         DEBUGFS_ADD(rc_rateidx_vht_mcs_mask_5ghz);
41         DEBUGFS_ADD(hw_queues);
42  
43 -       if (sdata->local->ops->wake_tx_queue &&
44 -           sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
45 +       if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
46             sdata->vif.type != NL80211_IFTYPE_NAN)
47                 DEBUGFS_ADD(aqm);
48  }
49 --- a/net/mac80211/debugfs_sta.c
50 +++ b/net/mac80211/debugfs_sta.c
51 @@ -1057,10 +1057,8 @@ void ieee80211_sta_debugfs_add(struct st
52         DEBUGFS_ADD_COUNTER(rx_fragments, deflink.rx_stats.fragments);
53         DEBUGFS_ADD_COUNTER(tx_filtered, deflink.status_stats.filtered);
54  
55 -       if (local->ops->wake_tx_queue) {
56 -               DEBUGFS_ADD(aqm);
57 -               DEBUGFS_ADD(airtime);
58 -       }
59 +       DEBUGFS_ADD(aqm);
60 +       DEBUGFS_ADD(airtime);
61  
62         if (wiphy_ext_feature_isset(local->hw.wiphy,
63                                     NL80211_EXT_FEATURE_AQL))
64 --- a/net/mac80211/ieee80211_i.h
65 +++ b/net/mac80211/ieee80211_i.h
66 @@ -2300,7 +2300,6 @@ void ieee80211_wake_queue_by_reason(stru
67  void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
68                                     enum queue_stop_reason reason,
69                                     bool refcounted);
70 -void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
71  void ieee80211_add_pending_skb(struct ieee80211_local *local,
72                                struct sk_buff *skb);
73  void ieee80211_add_pending_skbs(struct ieee80211_local *local,
74 --- a/net/mac80211/iface.c
75 +++ b/net/mac80211/iface.c
76 @@ -460,12 +460,6 @@ static void ieee80211_do_stop(struct iee
77         if (cancel_scan)
78                 ieee80211_scan_cancel(local);
79  
80 -       /*
81 -        * Stop TX on this interface first.
82 -        */
83 -       if (!local->ops->wake_tx_queue && sdata->dev)
84 -               netif_tx_stop_all_queues(sdata->dev);
85 -
86         ieee80211_roc_purge(local, sdata);
87  
88         switch (sdata->vif.type) {
89 @@ -813,25 +807,6 @@ static void ieee80211_uninit(struct net_
90         ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev));
91  }
92  
93 -#if LINUX_VERSION_IS_GEQ(5,2,0)
94 -static u16 ieee80211_netdev_select_queue(struct net_device *dev,
95 -                                        struct sk_buff *skb,
96 -                                        struct net_device *sb_dev)
97 -#elif LINUX_VERSION_IS_GEQ(4,19,0)
98 -static u16 ieee80211_netdev_select_queue(struct net_device *dev,
99 -                                        struct sk_buff *skb,
100 -                                        struct net_device *sb_dev,
101 -                                        select_queue_fallback_t fallback)
102 -#else
103 -static u16 ieee80211_netdev_select_queue(struct net_device *dev,
104 -                                        struct sk_buff *skb,
105 -                                        void *accel_priv,
106 -                                        select_queue_fallback_t fallback)
107 -#endif
108 -{
109 -       return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb);
110 -}
111 -
112  static void
113  ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
114  {
115 @@ -845,7 +820,6 @@ static const struct net_device_ops ieee8
116         .ndo_start_xmit         = ieee80211_subif_start_xmit,
117         .ndo_set_rx_mode        = ieee80211_set_multicast_list,
118         .ndo_set_mac_address    = ieee80211_change_mac,
119 -       .ndo_select_queue       = ieee80211_netdev_select_queue,
120         .ndo_get_stats64        = ieee80211_get_stats64,
121  };
122  
123 @@ -967,7 +941,6 @@ static const struct net_device_ops ieee8
124         .ndo_start_xmit         = ieee80211_subif_start_xmit_8023,
125         .ndo_set_rx_mode        = ieee80211_set_multicast_list,
126         .ndo_set_mac_address    = ieee80211_change_mac,
127 -       .ndo_select_queue       = ieee80211_netdev_select_queue,
128         .ndo_get_stats64        = ieee80211_get_stats64,
129  #if LINUX_VERSION_IS_GEQ(5,13,0)
130         .ndo_fill_forward_path  = ieee80211_netdev_fill_forward_path,
131 @@ -1471,35 +1444,6 @@ int ieee80211_do_open(struct wireless_de
132  
133         ieee80211_recalc_ps(local);
134  
135 -       if (sdata->vif.type == NL80211_IFTYPE_MONITOR ||
136 -           sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
137 -           local->ops->wake_tx_queue) {
138 -               /* XXX: for AP_VLAN, actually track AP queues */
139 -               if (dev)
140 -                       netif_tx_start_all_queues(dev);
141 -       } else if (dev) {
142 -               unsigned long flags;
143 -               int n_acs = IEEE80211_NUM_ACS;
144 -               int ac;
145 -
146 -               if (local->hw.queues < IEEE80211_NUM_ACS)
147 -                       n_acs = 1;
148 -
149 -               spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
150 -               if (sdata->vif.cab_queue == IEEE80211_INVAL_HW_QUEUE ||
151 -                   (local->queue_stop_reasons[sdata->vif.cab_queue] == 0 &&
152 -                    skb_queue_empty(&local->pending[sdata->vif.cab_queue]))) {
153 -                       for (ac = 0; ac < n_acs; ac++) {
154 -                               int ac_queue = sdata->vif.hw_queue[ac];
155 -
156 -                               if (local->queue_stop_reasons[ac_queue] == 0 &&
157 -                                   skb_queue_empty(&local->pending[ac_queue]))
158 -                                       netif_start_subqueue(dev, ac);
159 -                       }
160 -               }
161 -               spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
162 -       }
163 -
164         set_bit(SDATA_STATE_RUNNING, &sdata->state);
165  
166         return 0;
167 @@ -1529,17 +1473,12 @@ static void ieee80211_if_setup(struct ne
168  {
169         ether_setup(dev);
170         dev->priv_flags &= ~IFF_TX_SKB_SHARING;
171 +       dev->priv_flags |= IFF_NO_QUEUE;
172         dev->netdev_ops = &ieee80211_dataif_ops;
173         dev->needs_free_netdev = true;
174         dev->priv_destructor = ieee80211_if_free;
175  }
176  
177 -static void ieee80211_if_setup_no_queue(struct net_device *dev)
178 -{
179 -       ieee80211_if_setup(dev);
180 -       dev->priv_flags |= IFF_NO_QUEUE;
181 -}
182 -
183  static void ieee80211_iface_process_skb(struct ieee80211_local *local,
184                                         struct ieee80211_sub_if_data *sdata,
185                                         struct sk_buff *skb)
186 @@ -2124,9 +2063,7 @@ int ieee80211_if_add(struct ieee80211_lo
187         struct net_device *ndev = NULL;
188         struct ieee80211_sub_if_data *sdata = NULL;
189         struct txq_info *txqi;
190 -       void (*if_setup)(struct net_device *dev);
191         int ret, i;
192 -       int txqs = 1;
193  
194         ASSERT_RTNL();
195  
196 @@ -2149,30 +2086,18 @@ int ieee80211_if_add(struct ieee80211_lo
197                                  sizeof(void *));
198                 int txq_size = 0;
199  
200 -               if (local->ops->wake_tx_queue &&
201 -                   type != NL80211_IFTYPE_AP_VLAN &&
202 +               if (type != NL80211_IFTYPE_AP_VLAN &&
203                     (type != NL80211_IFTYPE_MONITOR ||
204                      (params->flags & MONITOR_FLAG_ACTIVE)))
205                         txq_size += sizeof(struct txq_info) +
206                                     local->hw.txq_data_size;
207  
208 -               if (local->ops->wake_tx_queue) {
209 -                       if_setup = ieee80211_if_setup_no_queue;
210 -               } else {
211 -                       if_setup = ieee80211_if_setup;
212 -                       if (local->hw.queues >= IEEE80211_NUM_ACS)
213 -                               txqs = IEEE80211_NUM_ACS;
214 -               }
215 -
216                 ndev = alloc_netdev_mqs(size + txq_size,
217                                         name, name_assign_type,
218 -                                       if_setup, txqs, 1);
219 +                                       ieee80211_if_setup, 1, 1);
220                 if (!ndev)
221                         return -ENOMEM;
222  
223 -               if (!local->ops->wake_tx_queue && local->hw.wiphy->tx_queue_len)
224 -                       ndev->tx_queue_len = local->hw.wiphy->tx_queue_len;
225 -
226                 dev_net_set(ndev, wiphy_net(local->hw.wiphy));
227  
228                 ndev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
229 --- a/net/mac80211/main.c
230 +++ b/net/mac80211/main.c
231 @@ -627,7 +627,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
232  
233         if (WARN_ON(!ops->tx || !ops->start || !ops->stop || !ops->config ||
234                     !ops->add_interface || !ops->remove_interface ||
235 -                   !ops->configure_filter))
236 +                   !ops->configure_filter || !ops->wake_tx_queue))
237                 return NULL;
238  
239         if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove)))
240 @@ -716,9 +716,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
241         if (!ops->set_key)
242                 wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
243  
244 -       if (ops->wake_tx_queue)
245 -               wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_TXQS);
246 -
247 +       wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_TXQS);
248         wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_RRM);
249  
250         wiphy->bss_priv_size = sizeof(struct ieee80211_bss);
251 @@ -831,10 +829,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
252                 atomic_set(&local->agg_queue_stop[i], 0);
253         }
254         tasklet_setup(&local->tx_pending_tasklet, ieee80211_tx_pending);
255 -
256 -       if (ops->wake_tx_queue)
257 -               tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs);
258 -
259 +       tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs);
260         tasklet_setup(&local->tasklet, ieee80211_tasklet_handler);
261  
262         skb_queue_head_init(&local->skb_queue);
263 --- a/net/mac80211/rx.c
264 +++ b/net/mac80211/rx.c
265 @@ -1573,9 +1573,6 @@ static void sta_ps_start(struct sta_info
266  
267         ieee80211_clear_fast_xmit(sta);
268  
269 -       if (!sta->sta.txq[0])
270 -               return;
271 -
272         for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) {
273                 struct ieee80211_txq *txq = sta->sta.txq[tid];
274                 struct txq_info *txqi = to_txq_info(txq);
275 --- a/net/mac80211/sta_info.c
276 +++ b/net/mac80211/sta_info.c
277 @@ -140,17 +140,15 @@ static void __cleanup_single_sta(struct
278                 atomic_dec(&ps->num_sta_ps);
279         }
280  
281 -       if (sta->sta.txq[0]) {
282 -               for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
283 -                       struct txq_info *txqi;
284 +       for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
285 +               struct txq_info *txqi;
286  
287 -                       if (!sta->sta.txq[i])
288 -                               continue;
289 +               if (!sta->sta.txq[i])
290 +                       continue;
291  
292 -                       txqi = to_txq_info(sta->sta.txq[i]);
293 +               txqi = to_txq_info(sta->sta.txq[i]);
294  
295 -                       ieee80211_txq_purge(local, txqi);
296 -               }
297 +               ieee80211_txq_purge(local, txqi);
298         }
299  
300         for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
301 @@ -428,8 +426,7 @@ void sta_info_free(struct ieee80211_loca
302  
303         sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
304  
305 -       if (sta->sta.txq[0])
306 -               kfree(to_txq_info(sta->sta.txq[0]));
307 +       kfree(to_txq_info(sta->sta.txq[0]));
308         kfree(rcu_dereference_raw(sta->sta.rates));
309  #ifdef CPTCFG_MAC80211_MESH
310         kfree(sta->mesh);
311 @@ -530,6 +527,8 @@ __sta_info_alloc(struct ieee80211_sub_if
312         struct ieee80211_local *local = sdata->local;
313         struct ieee80211_hw *hw = &local->hw;
314         struct sta_info *sta;
315 +       void *txq_data;
316 +       int size;
317         int i;
318  
319         sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp);
320 @@ -600,21 +599,18 @@ __sta_info_alloc(struct ieee80211_sub_if
321  
322         sta->last_connected = ktime_get_seconds();
323  
324 -       if (local->ops->wake_tx_queue) {
325 -               void *txq_data;
326 -               int size = sizeof(struct txq_info) +
327 -                          ALIGN(hw->txq_data_size, sizeof(void *));
328 +       size = sizeof(struct txq_info) +
329 +              ALIGN(hw->txq_data_size, sizeof(void *));
330  
331 -               txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp);
332 -               if (!txq_data)
333 -                       goto free;
334 +       txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp);
335 +       if (!txq_data)
336 +               goto free;
337  
338 -               for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
339 -                       struct txq_info *txq = txq_data + i * size;
340 +       for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
341 +               struct txq_info *txq = txq_data + i * size;
342  
343 -                       /* might not do anything for the bufferable MMPDU TXQ */
344 -                       ieee80211_txq_init(sdata, sta, txq, i);
345 -               }
346 +               /* might not do anything for the (bufferable) MMPDU TXQ */
347 +               ieee80211_txq_init(sdata, sta, txq, i);
348         }
349  
350         if (sta_prepare_rate_control(local, sta, gfp))
351 @@ -688,8 +684,7 @@ __sta_info_alloc(struct ieee80211_sub_if
352         return sta;
353  
354  free_txq:
355 -       if (sta->sta.txq[0])
356 -               kfree(to_txq_info(sta->sta.txq[0]));
357 +       kfree(to_txq_info(sta->sta.txq[0]));
358  free:
359         sta_info_free_link(&sta->deflink);
360  #ifdef CPTCFG_MAC80211_MESH
361 @@ -1965,9 +1960,6 @@ ieee80211_sta_ps_deliver_response(struct
362                  * TIM recalculation.
363                  */
364  
365 -               if (!sta->sta.txq[0])
366 -                       return;
367 -
368                 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
369                         if (!sta->sta.txq[tid] ||
370                             !(driver_release_tids & BIT(tid)) ||
371 @@ -2452,7 +2444,7 @@ static void sta_set_tidstats(struct sta_
372                 tidstats->tx_msdu_failed = sta->deflink.status_stats.msdu_failed[tid];
373         }
374  
375 -       if (local->ops->wake_tx_queue && tid < IEEE80211_NUM_TIDS) {
376 +       if (tid < IEEE80211_NUM_TIDS) {
377                 spin_lock_bh(&local->fq.lock);
378                 rcu_read_lock();
379  
380 @@ -2780,9 +2772,6 @@ unsigned long ieee80211_sta_last_active(
381  
382  static void sta_update_codel_params(struct sta_info *sta, u32 thr)
383  {
384 -       if (!sta->sdata->local->ops->wake_tx_queue)
385 -               return;
386 -
387         if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) {
388                 sta->cparams.target = MS2TIME(50);
389                 sta->cparams.interval = MS2TIME(300);
390 --- a/net/mac80211/tdls.c
391 +++ b/net/mac80211/tdls.c
392 @@ -1016,7 +1016,6 @@ ieee80211_tdls_prep_mgmt_packet(struct w
393                 skb->priority = 256 + 5;
394                 break;
395         }
396 -       skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb));
397  
398         /*
399          * Set the WLAN_TDLS_TEARDOWN flag to indicate a teardown in progress.
400 --- a/net/mac80211/tx.c
401 +++ b/net/mac80211/tx.c
402 @@ -1606,9 +1606,6 @@ int ieee80211_txq_setup_flows(struct iee
403         bool supp_vht = false;
404         enum nl80211_band band;
405  
406 -       if (!local->ops->wake_tx_queue)
407 -               return 0;
408 -
409         ret = fq_init(fq, 4096);
410         if (ret)
411                 return ret;
412 @@ -1656,9 +1653,6 @@ void ieee80211_txq_teardown_flows(struct
413  {
414         struct fq *fq = &local->fq;
415  
416 -       if (!local->ops->wake_tx_queue)
417 -               return;
418 -
419         kfree(local->cvars);
420         local->cvars = NULL;
421  
422 @@ -1675,8 +1669,7 @@ static bool ieee80211_queue_skb(struct i
423         struct ieee80211_vif *vif;
424         struct txq_info *txqi;
425  
426 -       if (!local->ops->wake_tx_queue ||
427 -           sdata->vif.type == NL80211_IFTYPE_MONITOR)
428 +       if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
429                 return false;
430  
431         if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
432 @@ -4201,12 +4194,7 @@ void __ieee80211_subif_start_xmit(struct
433         if (IS_ERR(sta))
434                 sta = NULL;
435  
436 -       if (local->ops->wake_tx_queue) {
437 -               u16 queue = __ieee80211_select_queue(sdata, sta, skb);
438 -               skb_set_queue_mapping(skb, queue);
439 -               skb_get_hash(skb);
440 -       }
441 -
442 +       skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
443         ieee80211_aggr_check(sdata, sta, skb);
444  
445         sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);
446 @@ -4517,11 +4505,7 @@ static void ieee80211_8023_xmit(struct i
447         struct tid_ampdu_tx *tid_tx;
448         u8 tid;
449  
450 -       if (local->ops->wake_tx_queue) {
451 -               u16 queue = __ieee80211_select_queue(sdata, sta, skb);
452 -               skb_set_queue_mapping(skb, queue);
453 -               skb_get_hash(skb);
454 -       }
455 +       skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
456  
457         if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)) &&
458             test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))
459 @@ -4775,9 +4759,6 @@ void ieee80211_tx_pending(struct tasklet
460                         if (!txok)
461                                 break;
462                 }
463 -
464 -               if (skb_queue_empty(&local->pending[i]))
465 -                       ieee80211_propagate_queue_wake(local, i);
466         }
467         spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
468  
469 @@ -5970,10 +5951,9 @@ int ieee80211_tx_control_port(struct wip
470         }
471  
472         if (!IS_ERR(sta)) {
473 -               u16 queue = __ieee80211_select_queue(sdata, sta, skb);
474 +               u16 queue = ieee80211_select_queue(sdata, sta, skb);
475  
476                 skb_set_queue_mapping(skb, queue);
477 -               skb_get_hash(skb);
478  
479                 /*
480                  * for MLO STA, the SA should be the AP MLD address, but
481 --- a/net/mac80211/util.c
482 +++ b/net/mac80211/util.c
483 @@ -444,39 +444,6 @@ void ieee80211_wake_txqs(struct tasklet_
484         spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
485  }
486  
487 -void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue)
488 -{
489 -       struct ieee80211_sub_if_data *sdata;
490 -       int n_acs = IEEE80211_NUM_ACS;
491 -
492 -       if (local->ops->wake_tx_queue)
493 -               return;
494 -
495 -       if (local->hw.queues < IEEE80211_NUM_ACS)
496 -               n_acs = 1;
497 -
498 -       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
499 -               int ac;
500 -
501 -               if (!sdata->dev)
502 -                       continue;
503 -
504 -               if (sdata->vif.cab_queue != IEEE80211_INVAL_HW_QUEUE &&
505 -                   local->queue_stop_reasons[sdata->vif.cab_queue] != 0)
506 -                       continue;
507 -
508 -               for (ac = 0; ac < n_acs; ac++) {
509 -                       int ac_queue = sdata->vif.hw_queue[ac];
510 -
511 -                       if (ac_queue == queue ||
512 -                           (sdata->vif.cab_queue == queue &&
513 -                            local->queue_stop_reasons[ac_queue] == 0 &&
514 -                            skb_queue_empty(&local->pending[ac_queue])))
515 -                               netif_wake_subqueue(sdata->dev, ac);
516 -               }
517 -       }
518 -}
519 -
520  static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
521                                    enum queue_stop_reason reason,
522                                    bool refcounted,
523 @@ -507,11 +474,7 @@ static void __ieee80211_wake_queue(struc
524                 /* someone still has this queue stopped */
525                 return;
526  
527 -       if (skb_queue_empty(&local->pending[queue])) {
528 -               rcu_read_lock();
529 -               ieee80211_propagate_queue_wake(local, queue);
530 -               rcu_read_unlock();
531 -       } else
532 +       if (!skb_queue_empty(&local->pending[queue]))
533                 tasklet_schedule(&local->tx_pending_tasklet);
534  
535         /*
536 @@ -521,12 +484,10 @@ static void __ieee80211_wake_queue(struc
537          * release someone's lock, but it is fine because all the callers of
538          * __ieee80211_wake_queue call it right before releasing the lock.
539          */
540 -       if (local->ops->wake_tx_queue) {
541 -               if (reason == IEEE80211_QUEUE_STOP_REASON_DRIVER)
542 -                       tasklet_schedule(&local->wake_txqs_tasklet);
543 -               else
544 -                       _ieee80211_wake_txqs(local, flags);
545 -       }
546 +       if (reason == IEEE80211_QUEUE_STOP_REASON_DRIVER)
547 +               tasklet_schedule(&local->wake_txqs_tasklet);
548 +       else
549 +               _ieee80211_wake_txqs(local, flags);
550  }
551  
552  void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
553 @@ -554,8 +515,6 @@ static void __ieee80211_stop_queue(struc
554                                    bool refcounted)
555  {
556         struct ieee80211_local *local = hw_to_local(hw);
557 -       struct ieee80211_sub_if_data *sdata;
558 -       int n_acs = IEEE80211_NUM_ACS;
559  
560         trace_stop_queue(local, queue, reason);
561  
562 @@ -567,27 +526,7 @@ static void __ieee80211_stop_queue(struc
563         else
564                 local->q_stop_reasons[queue][reason]++;
565  
566 -       if (__test_and_set_bit(reason, &local->queue_stop_reasons[queue]))
567 -               return;
568 -
569 -       if (local->hw.queues < IEEE80211_NUM_ACS)
570 -               n_acs = 1;
571 -
572 -       rcu_read_lock();
573 -       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
574 -               int ac;
575 -
576 -               if (!sdata->dev)
577 -                       continue;
578 -
579 -               for (ac = 0; ac < n_acs; ac++) {
580 -                       if (!local->ops->wake_tx_queue &&
581 -                           (sdata->vif.hw_queue[ac] == queue ||
582 -                            sdata->vif.cab_queue == queue))
583 -                               netif_stop_subqueue(sdata->dev, ac);
584 -               }
585 -       }
586 -       rcu_read_unlock();
587 +       set_bit(reason, &local->queue_stop_reasons[queue]);
588  }
589  
590  void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
591 --- a/net/mac80211/wme.c
592 +++ b/net/mac80211/wme.c
593 @@ -122,6 +122,9 @@ u16 ieee80211_select_queue_80211(struct
594         struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
595         u8 *p;
596  
597 +       /* Ensure hash is set prior to potential SW encryption */
598 +       skb_get_hash(skb);
599 +
600         if ((info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER) ||
601             local->hw.queues < IEEE80211_NUM_ACS)
602                 return 0;
603 @@ -141,13 +144,16 @@ u16 ieee80211_select_queue_80211(struct
604         return ieee80211_downgrade_queue(sdata, NULL, skb);
605  }
606  
607 -u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
608 -                            struct sta_info *sta, struct sk_buff *skb)
609 +u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
610 +                          struct sta_info *sta, struct sk_buff *skb)
611  {
612         const struct ethhdr *eth = (void *)skb->data;
613         struct mac80211_qos_map *qos_map;
614         bool qos;
615  
616 +       /* Ensure hash is set prior to potential SW encryption */
617 +       skb_get_hash(skb);
618 +
619         /* all mesh/ocb stations are required to support WME */
620         if ((sdata->vif.type == NL80211_IFTYPE_MESH_POINT &&
621             !is_multicast_ether_addr(eth->h_dest)) ||
622 @@ -178,59 +184,6 @@ u16 __ieee80211_select_queue(struct ieee
623         return ieee80211_downgrade_queue(sdata, sta, skb);
624  }
625  
626 -
627 -/* Indicate which queue to use. */
628 -u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
629 -                          struct sk_buff *skb)
630 -{
631 -       struct ieee80211_local *local = sdata->local;
632 -       struct sta_info *sta = NULL;
633 -       const u8 *ra = NULL;
634 -       u16 ret;
635 -
636 -       /* when using iTXQ, we can do this later */
637 -       if (local->ops->wake_tx_queue)
638 -               return 0;
639 -
640 -       if (local->hw.queues < IEEE80211_NUM_ACS || skb->len < 6) {
641 -               skb->priority = 0; /* required for correct WPA/11i MIC */
642 -               return 0;
643 -       }
644 -
645 -       rcu_read_lock();
646 -       switch (sdata->vif.type) {
647 -       case NL80211_IFTYPE_AP_VLAN:
648 -               sta = rcu_dereference(sdata->u.vlan.sta);
649 -               if (sta)
650 -                       break;
651 -               fallthrough;
652 -       case NL80211_IFTYPE_AP:
653 -               ra = skb->data;
654 -               break;
655 -       case NL80211_IFTYPE_STATION:
656 -               /* might be a TDLS station */
657 -               sta = sta_info_get(sdata, skb->data);
658 -               if (sta)
659 -                       break;
660 -
661 -               ra = sdata->deflink.u.mgd.bssid;
662 -               break;
663 -       case NL80211_IFTYPE_ADHOC:
664 -               ra = skb->data;
665 -               break;
666 -       default:
667 -               break;
668 -       }
669 -
670 -       if (!sta && ra && !is_multicast_ether_addr(ra))
671 -               sta = sta_info_get(sdata, ra);
672 -
673 -       ret = __ieee80211_select_queue(sdata, sta, skb);
674 -
675 -       rcu_read_unlock();
676 -       return ret;
677 -}
678 -
679  /**
680   * ieee80211_set_qos_hdr - Fill in the QoS header if there is one.
681   *
682 --- a/net/mac80211/wme.h
683 +++ b/net/mac80211/wme.h
684 @@ -13,10 +13,8 @@
685  u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
686                                  struct sk_buff *skb,
687                                  struct ieee80211_hdr *hdr);
688 -u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
689 -                            struct sta_info *sta, struct sk_buff *skb);
690  u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
691 -                          struct sk_buff *skb);
692 +                          struct sta_info *sta, struct sk_buff *skb);
693  void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
694                            struct sk_buff *skb);
695