]> err.no Git - linux-2.6/commitdiff
libertas: kill internal tx queue for PS mode
authorDavid Woodhouse <dwmw2@infradead.org>
Sun, 9 Dec 2007 17:37:27 +0000 (12:37 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:06:22 +0000 (15:06 -0800)
It was buggy as hell anyway, since it was just spewing packets at the
device when it wasn't necessarily ready for them (in the USB case, while
the URB was still busy).

We could probably do with a better way of flushing packets to the device
_immediately_, before we stick it back into sleep mode. But we can no
longer just dequeue packets directly, it seems.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/decl.h
drivers/net/wireless/libertas/dev.h
drivers/net/wireless/libertas/main.c
drivers/net/wireless/libertas/tx.c

index e255b19157420416c45b8c9756c7f93f849da207..b0945140ba1c5bea8c4bf90f1777a2b542f16867 100644 (file)
@@ -62,8 +62,6 @@ void lbs_ps_sleep(struct lbs_private *priv, int wait_option);
 void lbs_ps_confirm_sleep(struct lbs_private *priv, u16 psmode);
 void lbs_ps_wakeup(struct lbs_private *priv, int wait_option);
 
-void lbs_tx_runqueue(struct lbs_private *priv);
-
 struct chan_freq_power *lbs_find_cfp_by_band_and_channel(
        struct lbs_private *priv,
        u8 band,
index 21b0d382096b3a8dafabe272c26177b145331774..a9c3adc421b779f7c0e9940aca5cc38dd66c4eba 100644 (file)
@@ -197,11 +197,6 @@ struct lbs_private {
        /** Timers */
        struct timer_list command_timer;
 
-       /* TX queue used in PS mode */
-       spinlock_t txqueue_lock;
-       struct sk_buff *tx_queue_ps[NR_TX_QUEUE];
-       unsigned int tx_queue_idx;
-
        u8 hisregcpy;
 
        /** current ssid/bssid related parameters*/
index 2ff5f1b77b12249ea0c26d3609ed07eb927da0b2..c638995182495b848c2708dd9f6933cc0487d0c3 100644 (file)
@@ -914,8 +914,6 @@ static int lbs_thread(void *data)
                 */
                if (!list_empty(&priv->cmdpendingq))
                        wake_up_all(&priv->cmd_pending);
-
-               lbs_tx_runqueue(priv);
        }
 
        del_timer(&priv->command_timer);
@@ -1072,10 +1070,6 @@ static int lbs_init_adapter(struct lbs_private *priv)
 
        mutex_init(&priv->lock);
 
-       memset(&priv->tx_queue_ps, 0, NR_TX_QUEUE*sizeof(struct sk_buff*));
-       priv->tx_queue_idx = 0;
-       spin_lock_init(&priv->txqueue_lock);
-
        setup_timer(&priv->command_timer, command_timer_fn,
                    (unsigned long)priv);
 
index 4cb39d33003c8018f1e20e53385a4b8d4f111eb5..749535e3f770e02a355d28197bdc90039ad144bd 100644 (file)
@@ -164,41 +164,6 @@ done:
 }
 
 
-void lbs_tx_runqueue(struct lbs_private *priv)
-{
-       int i;
-
-       spin_lock(&priv->txqueue_lock);
-       for (i = 0; i < priv->tx_queue_idx; i++) {
-               struct sk_buff *skb = priv->tx_queue_ps[i];
-               spin_unlock(&priv->txqueue_lock);
-               SendSinglePacket(priv, skb);
-               spin_lock(&priv->txqueue_lock);
-       }
-       priv->tx_queue_idx = 0;
-       spin_unlock(&priv->txqueue_lock);
-}
-
-static void lbs_tx_queue(struct lbs_private *priv, struct sk_buff *skb)
-{
-
-       spin_lock(&priv->txqueue_lock);
-
-       WARN_ON(priv->tx_queue_idx >= NR_TX_QUEUE);
-       priv->tx_queue_ps[priv->tx_queue_idx++] = skb;
-       if (priv->tx_queue_idx == NR_TX_QUEUE) {
-               netif_stop_queue(priv->dev);
-               if (priv->mesh_dev)
-                       netif_stop_queue(priv->mesh_dev);
-       } else {
-               netif_start_queue(priv->dev);
-               if (priv->mesh_dev)
-                       netif_start_queue(priv->mesh_dev);
-       }
-
-       spin_unlock(&priv->txqueue_lock);
-}
-
 /**
  *  @brief This function checks the conditions and sends packet to IF
  *  layer if everything is ok.
@@ -221,8 +186,9 @@ int lbs_process_tx(struct lbs_private *priv, struct sk_buff *skb)
 
        if ((priv->psstate == PS_STATE_SLEEP) ||
            (priv->psstate == PS_STATE_PRE_SLEEP)) {
-               lbs_tx_queue(priv, skb);
-               return ret;
+               lbs_pr_alert("TX error: packet xmit in %ssleep mode\n",
+                            priv->psstate == PS_STATE_SLEEP?"":"pre-");
+               goto done;
        }
 
        ret = SendSinglePacket(priv, skb);