mac80211: let drivers wake but not start queues
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 15 May 2008 10:55:26 +0000 (12:55 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 22 May 2008 01:48:08 +0000 (21:48 -0400)
Having drivers start queues is just confusing, their ->start()
callback can block and do whatever is necessary, so let mac80211
start queues and have drivers wake queues when necessary (to get
packets flowing again right away.)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 files changed:
drivers/net/wireless/adm8211.c
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/b43/main.c
drivers/net/wireless/b43legacy/main.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/iwlwifi/iwl4965-base.c
drivers/net/wireless/p54/p54common.c
drivers/net/wireless/p54/p54pci.c
drivers/net/wireless/rt2x00/rt2x00dev.c
include/net/mac80211.h
net/mac80211/main.c
net/mac80211/util.c

index 7af5d8851f6782f6f576c7efe96f4ba02ffb97d6..79dfca546c895416a5b71d934a45a8bd81c3183b 100644 (file)
@@ -2015,7 +2015,7 @@ static int adm8211_resume(struct pci_dev *pdev)
 
        if (priv->mode != IEEE80211_IF_TYPE_INVALID) {
                adm8211_start(dev);
-               ieee80211_start_queues(dev);
+               ieee80211_wake_queues(dev);
        }
 
        return 0;
index c76ada178781b71c46d4b1fc7d20efbd85830836..3f16ad66bdb51478de991d73e18a8ac44194b9fe 100644 (file)
@@ -1599,7 +1599,7 @@ ath5k_txq_cleanup(struct ath5k_softc *sc)
                                        sc->txqs[i].link);
                        }
        }
-       ieee80211_start_queues(sc->hw); /* XXX move to callers */
+       ieee80211_wake_queues(sc->hw); /* XXX move to callers */
 
        for (i = 0; i < ARRAY_SIZE(sc->txqs); i++)
                if (sc->txqs[i].setup)
index fc23ba5309bd08aaa579fec578f0d75e644904da..9445a604a96663a32b819fecb114032afb09367a 100644 (file)
@@ -3497,7 +3497,6 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
        /* Start data flow (TX/RX). */
        b43_mac_enable(dev);
        b43_interrupt_enable(dev, dev->irq_savedstate);
-       ieee80211_start_queues(dev->wl->hw);
 
        /* Start maintainance work */
        b43_periodic_tasks_setup(dev);
index 7755c59e0803bb88dde4ef18b69b63e734125c6a..b05a507ed44dd8b6d6ce14c8acea4c2db471a7a5 100644 (file)
@@ -2794,7 +2794,6 @@ static int b43legacy_wireless_core_start(struct b43legacy_wldev *dev)
        /* Start data flow (TX/RX) */
        b43legacy_mac_enable(dev);
        b43legacy_interrupt_enable(dev, dev->irq_savedstate);
-       ieee80211_start_queues(dev->wl->hw);
 
        /* Start maintenance work */
        b43legacy_periodic_tasks_setup(dev);
index b8fb8d8d95ffb362ddfa5cdda9a237307cd4da64..54cde8a7b5fabe6e5a7330c28f7639d5cf7ebdef 100644 (file)
@@ -5823,7 +5823,7 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
        if (iwl3945_is_rfkill(priv))
                return;
 
-       ieee80211_start_queues(priv->hw);
+       ieee80211_wake_queues(priv->hw);
 
        priv->active_rate = priv->rates_mask;
        priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
index 48c59cbefb4a0c831aad6dcd2577c6d91e0b2a75..db4f606bad500f8253c349bfdd6f1374544dc0bd 100644 (file)
@@ -3367,7 +3367,7 @@ static void iwl4965_alive_start(struct iwl_priv *priv)
        if (iwl_is_rfkill(priv))
                return;
 
-       ieee80211_start_queues(priv->hw);
+       ieee80211_wake_queues(priv->hw);
 
        priv->active_rate = priv->rates_mask;
        priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
index 9cbef5bce0f6fbb7360a6a2cef88b7b0c7108961..3d35fe6a8f5f743a7a701ee785e0765c6026e813 100644 (file)
@@ -375,9 +375,6 @@ static void inline p54_wake_free_queues(struct ieee80211_hw *dev)
        struct p54_common *priv = dev->priv;
        int i;
 
-       /* ieee80211_start_queues is great if all queues are really empty.
-        * But, what if some are full? */
-
        for (i = 0; i < dev->queues; i++)
                if (priv->tx_stats[i].len < priv->tx_stats[i].limit)
                        ieee80211_wake_queue(dev, i);
index fa527723fbe0e210f7e774d0e22a13f5fcb4bfea..7dd4add4bf4e55c13efeaef04ca9e9ac4def0e07 100644 (file)
@@ -665,7 +665,7 @@ static int p54p_resume(struct pci_dev *pdev)
 
        if (priv->common.mode != IEEE80211_IF_TYPE_INVALID) {
                p54p_open(dev);
-               ieee80211_start_queues(dev);
+               ieee80211_wake_queues(dev);
        }
 
        return 0;
index 171f445962dbd21178d4ef9b32d3e01b6c4c6abf..d341764e1b2472af81f32d8781c90cdf52119b9c 100644 (file)
@@ -125,7 +125,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
        /*
         * Start the TX queues.
         */
-       ieee80211_start_queues(rt2x00dev->hw);
+       ieee80211_wake_queues(rt2x00dev->hw);
 
        return 0;
 }
@@ -1186,7 +1186,7 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)
         * In that case we have disabled the TX queue and should
         * now enable it again
         */
-       ieee80211_start_queues(rt2x00dev->hw);
+       ieee80211_wake_queues(rt2x00dev->hw);
 
        /*
         * During interface iteration we might have changed the
index 909956c97c448f776228b6eba42b5fb87b091503..f00fc76a7344a56b92cf8127bdb9d119cb6caca4 100644 (file)
@@ -1566,14 +1566,6 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue);
  */
 void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
 
-/**
- * ieee80211_start_queues - start all queues
- * @hw: pointer to as obtained from ieee80211_alloc_hw().
- *
- * Drivers should use this function instead of netif_start_queue.
- */
-void ieee80211_start_queues(struct ieee80211_hw *hw);
-
 /**
  * ieee80211_stop_queues - stop all queues
  * @hw: pointer as obtained from ieee80211_alloc_hw().
index b0fddb7de5492af40ef63bc98fd95cdd69882996..9761d9bd5a79338006600a2a43863a53155da8a6 100644 (file)
@@ -110,7 +110,13 @@ static int ieee80211_master_open(struct net_device *dev)
                        break;
                }
        }
-       return res;
+
+       if (res)
+               return res;
+
+       netif_start_queue(local->mdev);
+
+       return 0;
 }
 
 static int ieee80211_master_stop(struct net_device *dev)
index 9cd07e1031afcdc686ea3f8d5939cf69b288ef88..800c15aff6e7bc8bca62c70e217ce7fe2f8462d7 100644 (file)
@@ -350,18 +350,6 @@ void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue)
 }
 EXPORT_SYMBOL(ieee80211_stop_queue);
 
-void ieee80211_start_queues(struct ieee80211_hw *hw)
-{
-       struct ieee80211_local *local = hw_to_local(hw);
-       int i;
-
-       for (i = 0; i < hw->queues + hw->ampdu_queues; i++)
-               clear_bit(IEEE80211_LINK_STATE_XOFF, &local->state[i]);
-       if (!ieee80211_qdisc_installed(local->mdev))
-               netif_start_queue(local->mdev);
-}
-EXPORT_SYMBOL(ieee80211_start_queues);
-
 void ieee80211_stop_queues(struct ieee80211_hw *hw)
 {
        int i;