rt2x00: Add helper function for reporting tx status
authorIvo van Doorn <ivdoorn@gmail.com>
Fri, 6 Aug 2010 18:46:53 +0000 (20:46 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Aug 2010 19:26:42 +0000 (15:26 -0400)
At some points, some drivers can't report the full TX status
information. This can happen for the UNKNOWN state, or the
FAILURE state (in case the URB failed).
Add a wrapper function to simplify reporting the
empty TX information.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt61pci.c

index 5276c19f380aeb6da2e3ef8ea8cde0c0fb213895..edfc2b759282a4aa1625a541c9826d67c693036e 100644 (file)
@@ -1078,6 +1078,7 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev);
 void rt2x00lib_pretbtt(struct rt2x00_dev *rt2x00dev);
 void rt2x00lib_txdone(struct queue_entry *entry,
                      struct txdone_entry_desc *txdesc);
+void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status);
 void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
                      struct queue_entry *entry);
 
index 94621bd4fb9bea70d51b7fd984bd758dbcd723ab..6499cc416ca3f0a083bf1f780b33650f415aab1b 100644 (file)
@@ -408,6 +408,18 @@ void rt2x00lib_txdone(struct queue_entry *entry,
 }
 EXPORT_SYMBOL_GPL(rt2x00lib_txdone);
 
+void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status)
+{
+       struct txdone_entry_desc txdesc;
+
+       txdesc.flags = 0;
+       __set_bit(status, &txdesc.flags);
+       txdesc.retry = 0;
+
+       rt2x00lib_txdone(entry, &txdesc);
+}
+EXPORT_SYMBOL_GPL(rt2x00lib_txdone_noinfo);
+
 static int rt2x00lib_rxdone_read_signal(struct rt2x00_dev *rt2x00dev,
                                        struct rxdone_entry_desc *rxdesc)
 {
index 3f131017fd21b445b8ac66b8065b2fbc5bd7818a..f76014f732cebabf591e1ea734efa3768e4d94c0 100644 (file)
@@ -170,8 +170,6 @@ EXPORT_SYMBOL_GPL(rt2x00usb_regbusy_read);
  */
 static void rt2x00usb_work_txdone_entry(struct queue_entry *entry)
 {
-       struct txdone_entry_desc txdesc;
-
        /*
         * If the transfer to hardware succeeded, it does not mean the
         * frame was send out correctly. It only means the frame
@@ -180,14 +178,10 @@ static void rt2x00usb_work_txdone_entry(struct queue_entry *entry)
         * (Only indirectly by looking at the failed TX counters
         * in the register).
         */
-       txdesc.flags = 0;
        if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags))
-               __set_bit(TXDONE_FAILURE, &txdesc.flags);
+               rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE);
        else
-               __set_bit(TXDONE_UNKNOWN, &txdesc.flags);
-       txdesc.retry = 0;
-
-       rt2x00lib_txdone(entry, &txdesc);
+               rt2x00lib_txdone_noinfo(entry, TXDONE_UNKNOWN);
 }
 
 static void rt2x00usb_work_txdone(struct work_struct *work)
index e539c6cb636fd5d429f30c50fba98e1a6512b70c..dc6f3ebb83768c2f9d57218bcd67adac7219685b 100644 (file)
@@ -2107,11 +2107,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
                                "TX status report missed for entry %d\n",
                                entry_done->entry_idx);
 
-                       txdesc.flags = 0;
-                       __set_bit(TXDONE_UNKNOWN, &txdesc.flags);
-                       txdesc.retry = 0;
-
-                       rt2x00lib_txdone(entry_done, &txdesc);
+                       rt2x00lib_txdone_noinfo(entry, TXDONE_UNKNOWN);
                        entry_done = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
                }