Commit cca07b00 authored by Luciano Coelho's avatar Luciano Coelho Committed by Johannes Berg

mac80211: introduce refcount for queue_stop_reasons

Sometimes different vifs may be stopping the queues for the same
reason (e.g. when several interfaces are performing a channel switch).
Instead of using a bitmask for the reasons, use an integer that holds
a refcount instead.  In order to keep it backwards compatible,
introduce a boolean in some functions that tell us whether the queue
stopping should be refcounted or not.  For now, use not refcounted for
all calls to keep it functionally the same as before.
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 59f48fe2
...@@ -170,10 +170,13 @@ ieee80211_stop_queue_agg(struct ieee80211_sub_if_data *sdata, int tid) ...@@ -170,10 +170,13 @@ ieee80211_stop_queue_agg(struct ieee80211_sub_if_data *sdata, int tid)
{ {
int queue = sdata->vif.hw_queue[ieee80211_ac_from_tid(tid)]; int queue = sdata->vif.hw_queue[ieee80211_ac_from_tid(tid)];
/* we do refcounting here, so don't use the queue reason refcounting */
if (atomic_inc_return(&sdata->local->agg_queue_stop[queue]) == 1) if (atomic_inc_return(&sdata->local->agg_queue_stop[queue]) == 1)
ieee80211_stop_queue_by_reason( ieee80211_stop_queue_by_reason(
&sdata->local->hw, queue, &sdata->local->hw, queue,
IEEE80211_QUEUE_STOP_REASON_AGGREGATION); IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
false);
__acquire(agg_queue); __acquire(agg_queue);
} }
...@@ -185,7 +188,8 @@ ieee80211_wake_queue_agg(struct ieee80211_sub_if_data *sdata, int tid) ...@@ -185,7 +188,8 @@ ieee80211_wake_queue_agg(struct ieee80211_sub_if_data *sdata, int tid)
if (atomic_dec_return(&sdata->local->agg_queue_stop[queue]) == 0) if (atomic_dec_return(&sdata->local->agg_queue_stop[queue]) == 0)
ieee80211_wake_queue_by_reason( ieee80211_wake_queue_by_reason(
&sdata->local->hw, queue, &sdata->local->hw, queue,
IEEE80211_QUEUE_STOP_REASON_AGGREGATION); IEEE80211_QUEUE_STOP_REASON_AGGREGATION,
false);
__release(agg_queue); __release(agg_queue);
} }
......
...@@ -837,7 +837,8 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) ...@@ -837,7 +837,8 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
if (!ieee80211_csa_needs_block_tx(local)) if (!ieee80211_csa_needs_block_tx(local))
ieee80211_wake_queues_by_reason(&local->hw, ieee80211_wake_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
kfree(sdata->u.ap.next_beacon); kfree(sdata->u.ap.next_beacon);
...@@ -2828,7 +2829,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata) ...@@ -2828,7 +2829,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
if (!ieee80211_csa_needs_block_tx(local)) if (!ieee80211_csa_needs_block_tx(local))
ieee80211_wake_queues_by_reason(&local->hw, ieee80211_wake_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
return 0; return 0;
} }
...@@ -3060,7 +3062,8 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, ...@@ -3060,7 +3062,8 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
if (sdata->csa_block_tx) if (sdata->csa_block_tx)
ieee80211_stop_queues_by_reason(&local->hw, ieee80211_stop_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
if (changed) { if (changed) {
ieee80211_bss_info_change_notify(sdata, changed); ieee80211_bss_info_change_notify(sdata, changed);
......
...@@ -922,6 +922,8 @@ enum queue_stop_reason { ...@@ -922,6 +922,8 @@ enum queue_stop_reason {
IEEE80211_QUEUE_STOP_REASON_SKB_ADD, IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL, IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
IEEE80211_QUEUE_STOP_REASON_FLUSH, IEEE80211_QUEUE_STOP_REASON_FLUSH,
IEEE80211_QUEUE_STOP_REASONS,
}; };
#ifdef CONFIG_MAC80211_LEDS #ifdef CONFIG_MAC80211_LEDS
...@@ -1018,6 +1020,7 @@ struct ieee80211_local { ...@@ -1018,6 +1020,7 @@ struct ieee80211_local {
struct workqueue_struct *workqueue; struct workqueue_struct *workqueue;
unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES]; unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
int q_stop_reasons[IEEE80211_MAX_QUEUES][IEEE80211_QUEUE_STOP_REASONS];
/* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */ /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
spinlock_t queue_stop_reason_lock; spinlock_t queue_stop_reason_lock;
...@@ -1715,14 +1718,18 @@ void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata, ...@@ -1715,14 +1718,18 @@ void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
unsigned long queues, unsigned long queues,
enum queue_stop_reason reason); enum queue_stop_reason reason,
bool refcounted);
void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
unsigned long queues, unsigned long queues,
enum queue_stop_reason reason); enum queue_stop_reason reason,
bool refcounted);
void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
enum queue_stop_reason reason); enum queue_stop_reason reason,
bool refcounted);
void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
enum queue_stop_reason reason); enum queue_stop_reason reason,
bool refcounted);
void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue); void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
void ieee80211_add_pending_skb(struct ieee80211_local *local, void ieee80211_add_pending_skb(struct ieee80211_local *local,
struct sk_buff *skb); struct sk_buff *skb);
......
...@@ -844,7 +844,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, ...@@ -844,7 +844,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
if (!ieee80211_csa_needs_block_tx(local)) if (!ieee80211_csa_needs_block_tx(local))
ieee80211_wake_queues_by_reason(&local->hw, ieee80211_wake_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
sdata_unlock(sdata); sdata_unlock(sdata);
......
...@@ -272,7 +272,8 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw) ...@@ -272,7 +272,8 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw)
/* use this reason, ieee80211_reconfig will unblock it */ /* use this reason, ieee80211_reconfig will unblock it */
ieee80211_stop_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_stop_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_SUSPEND); IEEE80211_QUEUE_STOP_REASON_SUSPEND,
false);
/* /*
* Stop all Rx during the reconfig. We don't want state changes * Stop all Rx during the reconfig. We don't want state changes
......
...@@ -983,7 +983,8 @@ static void ieee80211_chswitch_work(struct work_struct *work) ...@@ -983,7 +983,8 @@ static void ieee80211_chswitch_work(struct work_struct *work)
if (!ieee80211_csa_needs_block_tx(local)) if (!ieee80211_csa_needs_block_tx(local))
ieee80211_wake_queues_by_reason(&local->hw, ieee80211_wake_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
ifmgd->flags &= ~IEEE80211_STA_CSA_RECEIVED; ifmgd->flags &= ~IEEE80211_STA_CSA_RECEIVED;
...@@ -1115,7 +1116,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata, ...@@ -1115,7 +1116,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
if (sdata->csa_block_tx) if (sdata->csa_block_tx)
ieee80211_stop_queues_by_reason(&local->hw, ieee80211_stop_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
if (local->ops->channel_switch) { if (local->ops->channel_switch) {
...@@ -1385,7 +1387,8 @@ void ieee80211_dynamic_ps_disable_work(struct work_struct *work) ...@@ -1385,7 +1387,8 @@ void ieee80211_dynamic_ps_disable_work(struct work_struct *work)
ieee80211_wake_queues_by_reason(&local->hw, ieee80211_wake_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_PS); IEEE80211_QUEUE_STOP_REASON_PS,
false);
} }
void ieee80211_dynamic_ps_enable_work(struct work_struct *work) void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
...@@ -1833,7 +1836,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -1833,7 +1836,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
if (!ieee80211_csa_needs_block_tx(local)) if (!ieee80211_csa_needs_block_tx(local))
ieee80211_wake_queues_by_reason(&local->hw, ieee80211_wake_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
sdata->encrypt_headroom = IEEE80211_ENCRYPT_HEADROOM; sdata->encrypt_headroom = IEEE80211_ENCRYPT_HEADROOM;
...@@ -2082,7 +2086,8 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata) ...@@ -2082,7 +2086,8 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata)
if (!ieee80211_csa_needs_block_tx(local)) if (!ieee80211_csa_needs_block_tx(local))
ieee80211_wake_queues_by_reason(&local->hw, ieee80211_wake_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_CSA); IEEE80211_QUEUE_STOP_REASON_CSA,
false);
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf, cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
......
...@@ -119,7 +119,8 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local) ...@@ -119,7 +119,8 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local)
* before sending nullfunc to enable powersave at the AP. * before sending nullfunc to enable powersave at the AP.
*/ */
ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL); IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
false);
ieee80211_flush_queues(local, NULL); ieee80211_flush_queues(local, NULL);
mutex_lock(&local->iflist_mtx); mutex_lock(&local->iflist_mtx);
...@@ -182,7 +183,8 @@ void ieee80211_offchannel_return(struct ieee80211_local *local) ...@@ -182,7 +183,8 @@ void ieee80211_offchannel_return(struct ieee80211_local *local)
mutex_unlock(&local->iflist_mtx); mutex_unlock(&local->iflist_mtx);
ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL); IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL,
false);
} }
void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc) void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc)
......
...@@ -35,7 +35,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) ...@@ -35,7 +35,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
ieee80211_stop_queues_by_reason(hw, ieee80211_stop_queues_by_reason(hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_SUSPEND); IEEE80211_QUEUE_STOP_REASON_SUSPEND,
false);
/* flush out all packets */ /* flush out all packets */
synchronize_net(); synchronize_net();
...@@ -74,7 +75,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) ...@@ -74,7 +75,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
} }
ieee80211_wake_queues_by_reason(hw, ieee80211_wake_queues_by_reason(hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_SUSPEND); IEEE80211_QUEUE_STOP_REASON_SUSPEND,
false);
return err; return err;
} else if (err > 0) { } else if (err > 0) {
WARN_ON(err != 1); WARN_ON(err != 1);
......
...@@ -250,7 +250,8 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx) ...@@ -250,7 +250,8 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
if (local->hw.conf.flags & IEEE80211_CONF_PS) { if (local->hw.conf.flags & IEEE80211_CONF_PS) {
ieee80211_stop_queues_by_reason(&local->hw, ieee80211_stop_queues_by_reason(&local->hw,
IEEE80211_MAX_QUEUE_MAP, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_PS); IEEE80211_QUEUE_STOP_REASON_PS,
false);
ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED; ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
ieee80211_queue_work(&local->hw, ieee80211_queue_work(&local->hw,
&local->dynamic_ps_disable_work); &local->dynamic_ps_disable_work);
......
...@@ -317,7 +317,8 @@ void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue) ...@@ -317,7 +317,8 @@ void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue)
} }
static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
enum queue_stop_reason reason) enum queue_stop_reason reason,
bool refcounted)
{ {
struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_local *local = hw_to_local(hw);
...@@ -329,7 +330,13 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, ...@@ -329,7 +330,13 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
if (!test_bit(reason, &local->queue_stop_reasons[queue])) if (!test_bit(reason, &local->queue_stop_reasons[queue]))
return; return;
__clear_bit(reason, &local->queue_stop_reasons[queue]); if (!refcounted)
local->q_stop_reasons[queue][reason] = 0;
else
local->q_stop_reasons[queue][reason]--;
if (local->q_stop_reasons[queue][reason] == 0)
__clear_bit(reason, &local->queue_stop_reasons[queue]);
if (local->queue_stop_reasons[queue] != 0) if (local->queue_stop_reasons[queue] != 0)
/* someone still has this queue stopped */ /* someone still has this queue stopped */
...@@ -344,25 +351,28 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, ...@@ -344,25 +351,28 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
} }
void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue, void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
enum queue_stop_reason reason) enum queue_stop_reason reason,
bool refcounted)
{ {
struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_local *local = hw_to_local(hw);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&local->queue_stop_reason_lock, flags); spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
__ieee80211_wake_queue(hw, queue, reason); __ieee80211_wake_queue(hw, queue, reason, refcounted);
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
} }
void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue) void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue)
{ {
ieee80211_wake_queue_by_reason(hw, queue, ieee80211_wake_queue_by_reason(hw, queue,
IEEE80211_QUEUE_STOP_REASON_DRIVER); IEEE80211_QUEUE_STOP_REASON_DRIVER,
false);
} }
EXPORT_SYMBOL(ieee80211_wake_queue); EXPORT_SYMBOL(ieee80211_wake_queue);
static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue, static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue,
enum queue_stop_reason reason) enum queue_stop_reason reason,
bool refcounted)
{ {
struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata; struct ieee80211_sub_if_data *sdata;
...@@ -373,10 +383,13 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue, ...@@ -373,10 +383,13 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue,
if (WARN_ON(queue >= hw->queues)) if (WARN_ON(queue >= hw->queues))
return; return;
if (test_bit(reason, &local->queue_stop_reasons[queue])) if (!refcounted)
return; local->q_stop_reasons[queue][reason] = 1;
else
local->q_stop_reasons[queue][reason]++;
__set_bit(reason, &local->queue_stop_reasons[queue]); if (__test_and_set_bit(reason, &local->queue_stop_reasons[queue]))
return;
if (local->hw.queues < IEEE80211_NUM_ACS) if (local->hw.queues < IEEE80211_NUM_ACS)
n_acs = 1; n_acs = 1;
...@@ -398,20 +411,22 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue, ...@@ -398,20 +411,22 @@ static void __ieee80211_stop_queue(struct ieee80211_hw *hw, int queue,
} }
void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue, void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
enum queue_stop_reason reason) enum queue_stop_reason reason,
bool refcounted)
{ {
struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_local *local = hw_to_local(hw);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&local->queue_stop_reason_lock, flags); spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
__ieee80211_stop_queue(hw, queue, reason); __ieee80211_stop_queue(hw, queue, reason, refcounted);
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
} }
void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue) void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue)
{ {
ieee80211_stop_queue_by_reason(hw, queue, ieee80211_stop_queue_by_reason(hw, queue,
IEEE80211_QUEUE_STOP_REASON_DRIVER); IEEE80211_QUEUE_STOP_REASON_DRIVER,
false);
} }
EXPORT_SYMBOL(ieee80211_stop_queue); EXPORT_SYMBOL(ieee80211_stop_queue);
...@@ -429,9 +444,11 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local, ...@@ -429,9 +444,11 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local,
} }
spin_lock_irqsave(&local->queue_stop_reason_lock, flags); spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
__ieee80211_stop_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); __ieee80211_stop_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
false);
__skb_queue_tail(&local->pending[queue], skb); __skb_queue_tail(&local->pending[queue], skb);
__ieee80211_wake_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD); __ieee80211_wake_queue(hw, queue, IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
false);
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
} }
...@@ -455,20 +472,23 @@ void ieee80211_add_pending_skbs(struct ieee80211_local *local, ...@@ -455,20 +472,23 @@ void ieee80211_add_pending_skbs(struct ieee80211_local *local,
queue = info->hw_queue; queue = info->hw_queue;
__ieee80211_stop_queue(hw, queue, __ieee80211_stop_queue(hw, queue,
IEEE80211_QUEUE_STOP_REASON_SKB_ADD); IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
false);
__skb_queue_tail(&local->pending[queue], skb); __skb_queue_tail(&local->pending[queue], skb);
} }
for (i = 0; i < hw->queues; i++) for (i = 0; i < hw->queues; i++)
__ieee80211_wake_queue(hw, i, __ieee80211_wake_queue(hw, i,
IEEE80211_QUEUE_STOP_REASON_SKB_ADD); IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
false);
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
} }
void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
unsigned long queues, unsigned long queues,
enum queue_stop_reason reason) enum queue_stop_reason reason,
bool refcounted)
{ {
struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_local *local = hw_to_local(hw);
unsigned long flags; unsigned long flags;
...@@ -477,7 +497,7 @@ void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, ...@@ -477,7 +497,7 @@ void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
spin_lock_irqsave(&local->queue_stop_reason_lock, flags); spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
for_each_set_bit(i, &queues, hw->queues) for_each_set_bit(i, &queues, hw->queues)
__ieee80211_stop_queue(hw, i, reason); __ieee80211_stop_queue(hw, i, reason, refcounted);
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
} }
...@@ -485,7 +505,8 @@ void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw, ...@@ -485,7 +505,8 @@ void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
void ieee80211_stop_queues(struct ieee80211_hw *hw) void ieee80211_stop_queues(struct ieee80211_hw *hw)
{ {
ieee80211_stop_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_stop_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_DRIVER); IEEE80211_QUEUE_STOP_REASON_DRIVER,
false);
} }
EXPORT_SYMBOL(ieee80211_stop_queues); EXPORT_SYMBOL(ieee80211_stop_queues);
...@@ -508,7 +529,8 @@ EXPORT_SYMBOL(ieee80211_queue_stopped); ...@@ -508,7 +529,8 @@ EXPORT_SYMBOL(ieee80211_queue_stopped);
void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
unsigned long queues, unsigned long queues,
enum queue_stop_reason reason) enum queue_stop_reason reason,
bool refcounted)
{ {
struct ieee80211_local *local = hw_to_local(hw); struct ieee80211_local *local = hw_to_local(hw);
unsigned long flags; unsigned long flags;
...@@ -517,7 +539,7 @@ void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, ...@@ -517,7 +539,7 @@ void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
spin_lock_irqsave(&local->queue_stop_reason_lock, flags); spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
for_each_set_bit(i, &queues, hw->queues) for_each_set_bit(i, &queues, hw->queues)
__ieee80211_wake_queue(hw, i, reason); __ieee80211_wake_queue(hw, i, reason, refcounted);
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
} }
...@@ -525,7 +547,8 @@ void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, ...@@ -525,7 +547,8 @@ void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
void ieee80211_wake_queues(struct ieee80211_hw *hw) void ieee80211_wake_queues(struct ieee80211_hw *hw)
{ {
ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_DRIVER); IEEE80211_QUEUE_STOP_REASON_DRIVER,
false);
} }
EXPORT_SYMBOL(ieee80211_wake_queues); EXPORT_SYMBOL(ieee80211_wake_queues);
...@@ -552,12 +575,14 @@ void ieee80211_flush_queues(struct ieee80211_local *local, ...@@ -552,12 +575,14 @@ void ieee80211_flush_queues(struct ieee80211_local *local,
} }
ieee80211_stop_queues_by_reason(&local->hw, queues, ieee80211_stop_queues_by_reason(&local->hw, queues,
IEEE80211_QUEUE_STOP_REASON_FLUSH); IEEE80211_QUEUE_STOP_REASON_FLUSH,
false);
drv_flush(local, sdata, queues, false); drv_flush(local, sdata, queues, false);
ieee80211_wake_queues_by_reason(&local->hw, queues, ieee80211_wake_queues_by_reason(&local->hw, queues,
IEEE80211_QUEUE_STOP_REASON_FLUSH); IEEE80211_QUEUE_STOP_REASON_FLUSH,
false);
} }
static void __iterate_active_interfaces(struct ieee80211_local *local, static void __iterate_active_interfaces(struct ieee80211_local *local,
...@@ -1797,7 +1822,8 @@ int ieee80211_reconfig(struct ieee80211_local *local) ...@@ -1797,7 +1822,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
} }
ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_SUSPEND); IEEE80211_QUEUE_STOP_REASON_SUSPEND,
false);
/* /*
* Reconfigure sched scan if it was interrupted by FW restart or * Reconfigure sched scan if it was interrupted by FW restart or
......
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