]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/rt2x00/rt2500pci.c
rt2x00: Move duplicate code into rt2x00pci_txdone()
[linux-2.6] / drivers / net / wireless / rt2x00 / rt2500pci.c
index 869b1a7cec73410eb85743e2dffd6b73be12df38..b6bb9644e25f2bc0b59cfcad5426d27cf907bb35 100644 (file)
@@ -54,7 +54,7 @@
  * the access attempt is considered to have failed,
  * and we will print an error.
  */
-static u32 rt2500pci_bbp_check(const struct rt2x00_dev *rt2x00dev)
+static u32 rt2500pci_bbp_check(struct rt2x00_dev *rt2x00dev)
 {
        u32 reg;
        unsigned int i;
@@ -69,7 +69,7 @@ static u32 rt2500pci_bbp_check(const struct rt2x00_dev *rt2x00dev)
        return reg;
 }
 
-static void rt2500pci_bbp_write(const struct rt2x00_dev *rt2x00dev,
+static void rt2500pci_bbp_write(struct rt2x00_dev *rt2x00dev,
                                const unsigned int word, const u8 value)
 {
        u32 reg;
@@ -95,7 +95,7 @@ static void rt2500pci_bbp_write(const struct rt2x00_dev *rt2x00dev,
        rt2x00pci_register_write(rt2x00dev, BBPCSR, reg);
 }
 
-static void rt2500pci_bbp_read(const struct rt2x00_dev *rt2x00dev,
+static void rt2500pci_bbp_read(struct rt2x00_dev *rt2x00dev,
                               const unsigned int word, u8 *value)
 {
        u32 reg;
@@ -132,7 +132,7 @@ static void rt2500pci_bbp_read(const struct rt2x00_dev *rt2x00dev,
        *value = rt2x00_get_field32(reg, BBPCSR_VALUE);
 }
 
-static void rt2500pci_rf_write(const struct rt2x00_dev *rt2x00dev,
+static void rt2500pci_rf_write(struct rt2x00_dev *rt2x00dev,
                               const unsigned int word, const u32 value)
 {
        u32 reg;
@@ -195,13 +195,13 @@ static void rt2500pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
 #define CSR_OFFSET(__word)     ( CSR_REG_BASE + ((__word) * sizeof(u32)) )
 
-static void rt2500pci_read_csr(const struct rt2x00_dev *rt2x00dev,
+static void rt2500pci_read_csr(struct rt2x00_dev *rt2x00dev,
                               const unsigned int word, u32 *data)
 {
        rt2x00pci_register_read(rt2x00dev, CSR_OFFSET(word), data);
 }
 
-static void rt2500pci_write_csr(const struct rt2x00_dev *rt2x00dev,
+static void rt2500pci_write_csr(struct rt2x00_dev *rt2x00dev,
                                const unsigned int word, u32 data)
 {
        rt2x00pci_register_write(rt2x00dev, CSR_OFFSET(word), data);
@@ -691,7 +691,7 @@ dynamic_cca_tune:
 static void rt2500pci_init_rxring(struct rt2x00_dev *rt2x00dev)
 {
        struct data_ring *ring = rt2x00dev->rx;
-       struct data_desc *rxd;
+       __le32 *rxd;
        unsigned int i;
        u32 word;
 
@@ -716,7 +716,7 @@ static void rt2500pci_init_rxring(struct rt2x00_dev *rt2x00dev)
 static void rt2500pci_init_txring(struct rt2x00_dev *rt2x00dev, const int queue)
 {
        struct data_ring *ring = rt2x00lib_get_ring(rt2x00dev, queue);
-       struct data_desc *txd;
+       __le32 *txd;
        unsigned int i;
        u32 word;
 
@@ -1167,7 +1167,7 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
  * TX descriptor initialization
  */
 static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
-                                   struct data_desc *txd,
+                                   __le32 *txd,
                                    struct txdata_entry_desc *desc,
                                    struct ieee80211_hdr *ieee80211hdr,
                                    unsigned int length,
@@ -1203,7 +1203,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
                           test_bit(ENTRY_TXD_MORE_FRAG, &desc->flags));
        rt2x00_set_field32(&word, TXD_W0_ACK,
-                          !(control->flags & IEEE80211_TXCTL_NO_ACK));
+                          test_bit(ENTRY_TXD_ACK, &desc->flags));
        rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
                           test_bit(ENTRY_TXD_REQ_TIMESTAMP, &desc->flags));
        rt2x00_set_field32(&word, TXD_W0_OFDM,
@@ -1251,7 +1251,7 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
 static void rt2500pci_fill_rxdone(struct data_entry *entry,
                                  struct rxdata_entry_desc *desc)
 {
-       struct data_desc *rxd = entry->priv;
+       __le32 *rxd = entry->priv;
        u32 word0;
        u32 word2;
 
@@ -1278,7 +1278,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev, const int queue)
 {
        struct data_ring *ring = rt2x00lib_get_ring(rt2x00dev, queue);
        struct data_entry *entry;
-       struct data_desc *txd;
+       __le32 *txd;
        u32 word;
        int tx_status;
        int retry;
@@ -1298,26 +1298,8 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev, const int queue)
                tx_status = rt2x00_get_field32(word, TXD_W0_RESULT);
                retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
 
-               rt2x00lib_txdone(entry, tx_status, retry);
-
-               /*
-                * Make this entry available for reuse.
-                */
-               entry->flags = 0;
-               rt2x00_set_field32(&word, TXD_W0_VALID, 0);
-               rt2x00_desc_write(txd, 0, word);
-               rt2x00_ring_index_done_inc(ring);
+               rt2x00pci_txdone(rt2x00dev, entry, tx_status, retry);
        }
-
-       /*
-        * If the data ring was full before the txdone handler
-        * we must make sure the packet queue in the mac80211 stack
-        * is reenabled when the txdone handler has finished.
-        */
-       entry = ring->entry;
-       if (!rt2x00_ring_full(ring))
-               ieee80211_wake_queue(rt2x00dev->hw,
-                                    entry->tx_status.control.queue);
 }
 
 static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)