rt2x00: trivial: add missing \n on warnings
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / net / wireless / rt2x00 / rt2x00usb.c
index b3317df..608200e 100644 (file)
@@ -226,9 +226,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
         * Schedule the delayed work for reading the TX status
         * from the device.
         */
-       if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
-           test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
-               ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->txdone_work);
+       ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->txdone_work);
 }
 
 static void rt2x00usb_kick_tx_entry(struct queue_entry *entry)
@@ -237,6 +235,7 @@ static void rt2x00usb_kick_tx_entry(struct queue_entry *entry)
        struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
        struct queue_entry_priv_usb *entry_priv = entry->priv_data;
        u32 length;
+       int status;
 
        if (!test_and_clear_bit(ENTRY_DATA_PENDING, &entry->flags))
                return;
@@ -253,7 +252,10 @@ static void rt2x00usb_kick_tx_entry(struct queue_entry *entry)
                          entry->skb->data, length,
                          rt2x00usb_interrupt_txdone, entry);
 
-       if (usb_submit_urb(entry_priv->urb, GFP_ATOMIC)) {
+       status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
+       if (status) {
+               if (status == -ENODEV)
+                       clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
                set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
                rt2x00lib_dmadone(entry);
        }
@@ -298,7 +300,7 @@ static void rt2x00usb_watchdog_tx_dma(struct data_queue *queue)
        unsigned short threshold = queue->threshold;
 
        WARNING(queue->rt2x00dev, "TX queue %d DMA timed out,"
-               " invoke forced forced reset", queue->qid);
+               " invoke forced forced reset\n", queue->qid);
 
        /*
         * Temporarily disable the TX queue, this will force mac80211
@@ -323,21 +325,6 @@ static void rt2x00usb_watchdog_tx_dma(struct data_queue *queue)
        rt2x00dev->txdone_work.func(&rt2x00dev->txdone_work);
 
        /*
-        * Security measure: if the driver did override the
-        * txdone_work function, and the hardware did arrive
-        * in a state which causes it to malfunction, it is
-        * possible that the driver couldn't handle the txdone
-        * event correctly. So after giving the driver the
-        * chance to cleanup, we now force a cleanup of any
-        * leftovers.
-        */
-       if (!rt2x00queue_empty(queue)) {
-               WARNING(queue->rt2x00dev, "TX queue %d DMA timed out,"
-                       " status handling failed, invoke hard reset", queue->qid);
-               rt2x00usb_work_txdone(&rt2x00dev->txdone_work);
-       }
-
-       /*
         * The queue has been reset, and mac80211 is allowed to use the
         * queue again.
         */
@@ -348,7 +335,7 @@ static void rt2x00usb_watchdog_tx_dma(struct data_queue *queue)
 static void rt2x00usb_watchdog_tx_status(struct data_queue *queue)
 {
        WARNING(queue->rt2x00dev, "TX queue %d status timed out,"
-               " invoke forced tx handler", queue->qid);
+               " invoke forced tx handler\n", queue->qid);
 
        ieee80211_queue_work(queue->rt2x00dev->hw, &queue->rt2x00dev->txdone_work);
 }
@@ -361,7 +348,7 @@ void rt2x00usb_watchdog(struct rt2x00_dev *rt2x00dev)
                if (!rt2x00queue_empty(queue)) {
                        if (rt2x00queue_dma_timeout(queue))
                                rt2x00usb_watchdog_tx_dma(queue);
-                       if (rt2x00queue_timeout(queue))
+                       if (rt2x00queue_status_timeout(queue))
                                rt2x00usb_watchdog_tx_status(queue);
                }
        }
@@ -424,9 +411,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
         * Schedule the delayed work for reading the RX status
         * from the device.
         */
-       if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) &&
-           test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
-               ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->rxdone_work);
+       ieee80211_queue_work(rt2x00dev->hw, &rt2x00dev->rxdone_work);
 }
 
 /*
@@ -454,6 +439,7 @@ void rt2x00usb_clear_entry(struct queue_entry *entry)
            to_usb_device_intf(entry->queue->rt2x00dev->dev);
        struct queue_entry_priv_usb *entry_priv = entry->priv_data;
        int pipe;
+       int status;
 
        entry->flags = 0;
 
@@ -464,7 +450,12 @@ void rt2x00usb_clear_entry(struct queue_entry *entry)
                                rt2x00usb_interrupt_rxdone, entry);
 
                set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
-               if (usb_submit_urb(entry_priv->urb, GFP_ATOMIC)) {
+
+               status = usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
+               if (status) {
+                       if (status == -ENODEV)
+                               clear_bit(DEVICE_STATE_PRESENT,
+                                         &entry->queue->rt2x00dev->flags);
                        set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
                        rt2x00lib_dmadone(entry);
                }