@@ -453,23 +453,24 @@ void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local,
453453}
454454
455455void ieee80211_stop_queues_by_reason (struct ieee80211_hw * hw ,
456- enum queue_stop_reason reason )
456+ unsigned long queues ,
457+ enum queue_stop_reason reason )
457458{
458459 struct ieee80211_local * local = hw_to_local (hw );
459460 unsigned long flags ;
460461 int i ;
461462
462463 spin_lock_irqsave (& local -> queue_stop_reason_lock , flags );
463464
464- for ( i = 0 ; i < hw -> queues ; i ++ )
465+ for_each_set_bit ( i , & queues , hw -> queues )
465466 __ieee80211_stop_queue (hw , i , reason );
466467
467468 spin_unlock_irqrestore (& local -> queue_stop_reason_lock , flags );
468469}
469470
470471void ieee80211_stop_queues (struct ieee80211_hw * hw )
471472{
472- ieee80211_stop_queues_by_reason (hw ,
473+ ieee80211_stop_queues_by_reason (hw , IEEE80211_MAX_QUEUE_MAP ,
473474 IEEE80211_QUEUE_STOP_REASON_DRIVER );
474475}
475476EXPORT_SYMBOL (ieee80211_stop_queues );
@@ -491,6 +492,7 @@ int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue)
491492EXPORT_SYMBOL (ieee80211_queue_stopped );
492493
493494void ieee80211_wake_queues_by_reason (struct ieee80211_hw * hw ,
495+ unsigned long queues ,
494496 enum queue_stop_reason reason )
495497{
496498 struct ieee80211_local * local = hw_to_local (hw );
@@ -499,15 +501,16 @@ void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
499501
500502 spin_lock_irqsave (& local -> queue_stop_reason_lock , flags );
501503
502- for ( i = 0 ; i < hw -> queues ; i ++ )
504+ for_each_set_bit ( i , & queues , hw -> queues )
503505 __ieee80211_wake_queue (hw , i , reason );
504506
505507 spin_unlock_irqrestore (& local -> queue_stop_reason_lock , flags );
506508}
507509
508510void ieee80211_wake_queues (struct ieee80211_hw * hw )
509511{
510- ieee80211_wake_queues_by_reason (hw , IEEE80211_QUEUE_STOP_REASON_DRIVER );
512+ ieee80211_wake_queues_by_reason (hw , IEEE80211_MAX_QUEUE_MAP ,
513+ IEEE80211_QUEUE_STOP_REASON_DRIVER );
511514}
512515EXPORT_SYMBOL (ieee80211_wake_queues );
513516
@@ -533,7 +536,13 @@ void ieee80211_flush_queues(struct ieee80211_local *local,
533536 queues = BIT (local -> hw .queues ) - 1 ;
534537 }
535538
539+ ieee80211_stop_queues_by_reason (& local -> hw , IEEE80211_MAX_QUEUE_MAP ,
540+ IEEE80211_QUEUE_STOP_REASON_FLUSH );
541+
536542 drv_flush (local , queues , false);
543+
544+ ieee80211_wake_queues_by_reason (& local -> hw , IEEE80211_MAX_QUEUE_MAP ,
545+ IEEE80211_QUEUE_STOP_REASON_FLUSH );
537546}
538547
539548void ieee80211_iterate_active_interfaces (
@@ -1676,8 +1685,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
16761685 mutex_unlock (& local -> sta_mtx );
16771686 }
16781687
1679- ieee80211_wake_queues_by_reason (hw ,
1680- IEEE80211_QUEUE_STOP_REASON_SUSPEND );
1688+ ieee80211_wake_queues_by_reason (hw , IEEE80211_MAX_QUEUE_MAP ,
1689+ IEEE80211_QUEUE_STOP_REASON_SUSPEND );
16811690
16821691 /*
16831692 * If this is for hw restart things are still running.
0 commit comments