summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-03-26 17:02:42 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-08 05:06:19 -0400
commita1598383241a602123b0bcf1c5210dc9617f536f (patch)
tree03c75908804eb45866ce9092087aaf35618ceed0 /net/mac80211/mlme.c
parent24aa11ab8ae03292d38ec0dbd9bc2ac49fe8a6dd (diff)
mac80211: don't fiddle with netdev queues in MLME code
The netdev queues should always represent the state that the driver gave them, so fiddling with them isn't really appropriate in the mlme code. Also, since we stop queues for flushing now, this really isn't necessary any more. As the scan/offchannel code has also been modified to no longer do this a while ago, remove the outdated smp_mb() and comments about it. While at it, also add a pair of braces that was missing. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 43bfa8199811..79647eaecc8d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1443,13 +1443,11 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
1443 1443
1444 if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) && 1444 if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
1445 !(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) { 1445 !(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) {
1446 netif_tx_stop_all_queues(sdata->dev); 1446 if (drv_tx_frames_pending(local)) {
1447
1448 if (drv_tx_frames_pending(local))
1449 mod_timer(&local->dynamic_ps_timer, jiffies + 1447 mod_timer(&local->dynamic_ps_timer, jiffies +
1450 msecs_to_jiffies( 1448 msecs_to_jiffies(
1451 local->hw.conf.dynamic_ps_timeout)); 1449 local->hw.conf.dynamic_ps_timeout));
1452 else { 1450 } else {
1453 ieee80211_send_nullfunc(local, sdata, 1); 1451 ieee80211_send_nullfunc(local, sdata, 1);
1454 /* Flush to get the tx status of nullfunc frame */ 1452 /* Flush to get the tx status of nullfunc frame */
1455 ieee80211_flush_queues(local, sdata); 1453 ieee80211_flush_queues(local, sdata);
@@ -1463,9 +1461,6 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
1463 local->hw.conf.flags |= IEEE80211_CONF_PS; 1461 local->hw.conf.flags |= IEEE80211_CONF_PS;
1464 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); 1462 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
1465 } 1463 }
1466
1467 if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)
1468 netif_tx_wake_all_queues(sdata->dev);
1469} 1464}
1470 1465
1471void ieee80211_dynamic_ps_timer(unsigned long data) 1466void ieee80211_dynamic_ps_timer(unsigned long data)
@@ -1725,7 +1720,6 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1725 ieee80211_recalc_smps(sdata); 1720 ieee80211_recalc_smps(sdata);
1726 ieee80211_recalc_ps_vif(sdata); 1721 ieee80211_recalc_ps_vif(sdata);
1727 1722
1728 netif_tx_start_all_queues(sdata->dev);
1729 netif_carrier_on(sdata->dev); 1723 netif_carrier_on(sdata->dev);
1730} 1724}
1731 1725
@@ -1748,22 +1742,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1748 ieee80211_stop_poll(sdata); 1742 ieee80211_stop_poll(sdata);
1749 1743
1750 ifmgd->associated = NULL; 1744 ifmgd->associated = NULL;
1751
1752 /*
1753 * we need to commit the associated = NULL change because the
1754 * scan code uses that to determine whether this iface should
1755 * go to/wake up from powersave or not -- and could otherwise
1756 * wake the queues erroneously.
1757 */
1758 smp_mb();
1759
1760 /*
1761 * Thus, we can only afterwards stop the queues -- to account
1762 * for the case where another CPU is finishing a scan at this
1763 * time -- we don't want the scan code to enable queues.
1764 */
1765
1766 netif_tx_stop_all_queues(sdata->dev);
1767 netif_carrier_off(sdata->dev); 1745 netif_carrier_off(sdata->dev);
1768 1746
1769 /* 1747 /*