rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.
authorGertjan van Wingerde <gwingerde@gmail.com>
Thu, 3 Jun 2010 08:51:43 +0000 (10:51 +0200)
committerIvo van Doorn <IvDoorn@gmail.com>
Thu, 3 Jun 2010 08:51:43 +0000 (10:51 +0200)
For rt2800 reverse the calling order of rt2x00pci_write_data and
rt2800pci_write_data. Currently rt2800pci_write_data calls rt2x00pci_write_data
as there can be only 1 driver callback function specified by the driver.
Reverse this calling order by introducing a new driver callback function,
called write_tx_datadesc, which is called from the bus-specific write_tx_data
functions.
Preparation for futher cleanups in the skb data handling of rt2x00.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
drivers/net/wireless/rt2x00/rt2800pci.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00pci.c
drivers/net/wireless/rt2x00/rt2x00usb.c

index 88dba7f76aeff521a9b23a81078e9684ed918888..72e4f29a2fc73fbe8e3bb6960fcce97e70cd3d1e 100644 (file)
@@ -613,18 +613,10 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
 /*
  * TX descriptor initialization
  */
-static int rt2800pci_write_tx_data(struct queue_entry* entry,
-                                  struct txentry_desc *txdesc)
+static void rt2800pci_write_tx_datadesc(struct queue_entry* entry,
+                                        struct txentry_desc *txdesc)
 {
-       int ret;
-
-       ret = rt2x00pci_write_tx_data(entry, txdesc);
-       if (ret)
-               return ret;
-
        rt2800_write_txwi(entry->skb, txdesc);
-
-       return 0;
 }
 
 
@@ -1079,7 +1071,8 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
        .reset_tuner            = rt2800_reset_tuner,
        .link_tuner             = rt2800_link_tuner,
        .write_tx_desc          = rt2800pci_write_tx_desc,
-       .write_tx_data          = rt2800pci_write_tx_data,
+       .write_tx_data          = rt2x00pci_write_tx_data,
+       .write_tx_datadesc      = rt2800pci_write_tx_datadesc,
        .write_beacon           = rt2800pci_write_beacon,
        .kick_tx_queue          = rt2800pci_kick_tx_queue,
        .kill_tx_queue          = rt2800pci_kill_tx_queue,
index c8e5fed4dc079f117b81f32d172579eaaa71728a..811844be00530a4adb2450c0ea4753150d5770ce 100644 (file)
@@ -552,6 +552,8 @@ struct rt2x00lib_ops {
                               struct txentry_desc *txdesc);
        int (*write_tx_data) (struct queue_entry *entry,
                              struct txentry_desc *txdesc);
+       void (*write_tx_datadesc) (struct queue_entry *entry,
+                                  struct txentry_desc *txdesc);
        void (*write_beacon) (struct queue_entry *entry,
                              struct txentry_desc *txdesc);
        int (*get_tx_data_len) (struct queue_entry *entry);
index f71eee67f977de43e0c2aa61b0355ff29dc8d3ae..494b960e811ce8837c4a10058c4061177ced0b11 100644 (file)
@@ -81,6 +81,12 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry,
                return -EINVAL;
        }
 
+       /*
+        * Call the driver's write_tx_datadesc function, if it exists.
+        */
+       if (rt2x00dev->ops->lib->write_tx_datadesc)
+               rt2x00dev->ops->lib->write_tx_datadesc(entry, txdesc);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data);
index bd1546ba7ad27206c1d17f00e012c2ca942c17cf..25cc376d388e7e29f0cfee708e7588d6ae8c6e47 100644 (file)
@@ -248,6 +248,12 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry,
         */
        skb_pull(entry->skb, entry->queue->desc_size);
 
+       /*
+        * Call the driver's write_tx_datadesc function, if it exists.
+        */
+       if (rt2x00dev->ops->lib->write_tx_datadesc)
+               rt2x00dev->ops->lib->write_tx_datadesc(entry, txdesc);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data);