rt2x00: Move init_txring and init_rxring into rt2x00lib
authorIvo van Doorn <ivdoorn@gmail.com>
Sun, 6 Jan 2008 22:41:45 +0000 (23:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:09:27 +0000 (15:09 -0800)
Prior to enabling the radio rt2x00lib should go through all
rings and for each entry should call the callback function
init_txentry() and init_rxentry().

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt2x00usb.c
drivers/net/wireless/rt2x00/rt2x00usb.h
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 95db2cc..f4d0c77 100644 (file)
@@ -592,65 +592,43 @@ static void rt2400pci_link_tuner(struct rt2x00_dev *rt2x00dev)
 /*
  * Initialization functions.
  */
-static void rt2400pci_init_rxring(struct rt2x00_dev *rt2x00dev)
+static void rt2400pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
+                                  struct data_entry *entry)
 {
-       struct data_ring *ring = rt2x00dev->rx;
-       __le32 *rxd;
-       unsigned int i;
+       __le32 *rxd = entry->priv;
        u32 word;
 
-       memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-       for (i = 0; i < ring->stats.limit; i++) {
-               rxd = ring->entry[i].priv;
+       rt2x00_desc_read(rxd, 2, &word);
+       rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH, entry->ring->data_size);
+       rt2x00_desc_write(rxd, 2, word);
 
-               rt2x00_desc_read(rxd, 2, &word);
-               rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH,
-                                  ring->data_size);
-               rt2x00_desc_write(rxd, 2, word);
-
-               rt2x00_desc_read(rxd, 1, &word);
-               rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS,
-                                  ring->entry[i].data_dma);
-               rt2x00_desc_write(rxd, 1, word);
-
-               rt2x00_desc_read(rxd, 0, &word);
-               rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
-               rt2x00_desc_write(rxd, 0, word);
-       }
+       rt2x00_desc_read(rxd, 1, &word);
+       rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, entry->data_dma);
+       rt2x00_desc_write(rxd, 1, word);
 
-       rt2x00_ring_index_clear(rt2x00dev->rx);
+       rt2x00_desc_read(rxd, 0, &word);
+       rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
+       rt2x00_desc_write(rxd, 0, word);
 }
 
-static void rt2400pci_init_txring(struct rt2x00_dev *rt2x00dev, const int queue)
+static void rt2400pci_init_txentry(struct rt2x00_dev *rt2x00dev,
+                                  struct data_entry *entry)
 {
-       struct data_ring *ring = rt2x00lib_get_ring(rt2x00dev, queue);
-       __le32 *txd;
-       unsigned int i;
+       __le32 *txd = entry->priv;
        u32 word;
 
-       memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-       for (i = 0; i < ring->stats.limit; i++) {
-               txd = ring->entry[i].priv;
-
-               rt2x00_desc_read(txd, 1, &word);
-               rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS,
-                                  ring->entry[i].data_dma);
-               rt2x00_desc_write(txd, 1, word);
+       rt2x00_desc_read(txd, 1, &word);
+       rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, entry->data_dma);
+       rt2x00_desc_write(txd, 1, word);
 
-               rt2x00_desc_read(txd, 2, &word);
-               rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH,
-                                  ring->data_size);
-               rt2x00_desc_write(txd, 2, word);
-
-               rt2x00_desc_read(txd, 0, &word);
-               rt2x00_set_field32(&word, TXD_W0_VALID, 0);
-               rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
-               rt2x00_desc_write(txd, 0, word);
-       }
+       rt2x00_desc_read(txd, 2, &word);
+       rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, entry->ring->data_size);
+       rt2x00_desc_write(txd, 2, word);
 
-       rt2x00_ring_index_clear(ring);
+       rt2x00_desc_read(txd, 0, &word);
+       rt2x00_set_field32(&word, TXD_W0_VALID, 0);
+       rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
+       rt2x00_desc_write(txd, 0, word);
 }
 
 static int rt2400pci_init_rings(struct rt2x00_dev *rt2x00dev)
@@ -658,15 +636,6 @@ static int rt2400pci_init_rings(struct rt2x00_dev *rt2x00dev)
        u32 reg;
 
        /*
-        * Initialize rings.
-        */
-       rt2400pci_init_rxring(rt2x00dev);
-       rt2400pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA0);
-       rt2400pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA1);
-       rt2400pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_AFTER_BEACON);
-       rt2400pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_BEACON);
-
-       /*
         * Initialize registers.
         */
        rt2x00pci_register_read(rt2x00dev, TXCSR2, &reg);
@@ -1569,6 +1538,8 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = {
        .probe_hw               = rt2400pci_probe_hw,
        .initialize             = rt2x00pci_initialize,
        .uninitialize           = rt2x00pci_uninitialize,
+       .init_rxentry           = rt2400pci_init_rxentry,
+       .init_txentry           = rt2400pci_init_txentry,
        .set_device_state       = rt2400pci_set_device_state,
        .rfkill_poll            = rt2400pci_rfkill_poll,
        .link_stats             = rt2400pci_link_stats,
index 133967e..206b50f 100644 (file)
@@ -683,55 +683,35 @@ dynamic_cca_tune:
 /*
  * Initialization functions.
  */
-static void rt2500pci_init_rxring(struct rt2x00_dev *rt2x00dev)
+static void rt2500pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
+                                  struct data_entry *entry)
 {
-       struct data_ring *ring = rt2x00dev->rx;
-       __le32 *rxd;
-       unsigned int i;
+       __le32 *rxd = entry->priv;
        u32 word;
 
-       memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-       for (i = 0; i < ring->stats.limit; i++) {
-               rxd = ring->entry[i].priv;
-
-               rt2x00_desc_read(rxd, 1, &word);
-               rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS,
-                                  ring->entry[i].data_dma);
-               rt2x00_desc_write(rxd, 1, word);
-
-               rt2x00_desc_read(rxd, 0, &word);
-               rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
-               rt2x00_desc_write(rxd, 0, word);
-       }
+       rt2x00_desc_read(rxd, 1, &word);
+       rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, entry->data_dma);
+       rt2x00_desc_write(rxd, 1, word);
 
-       rt2x00_ring_index_clear(rt2x00dev->rx);
+       rt2x00_desc_read(rxd, 0, &word);
+       rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
+       rt2x00_desc_write(rxd, 0, word);
 }
 
-static void rt2500pci_init_txring(struct rt2x00_dev *rt2x00dev, const int queue)
+static void rt2500pci_init_txentry(struct rt2x00_dev *rt2x00dev,
+                                  struct data_entry *entry)
 {
-       struct data_ring *ring = rt2x00lib_get_ring(rt2x00dev, queue);
-       __le32 *txd;
-       unsigned int i;
+       __le32 *txd = entry->priv;
        u32 word;
 
-       memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-       for (i = 0; i < ring->stats.limit; i++) {
-               txd = ring->entry[i].priv;
+       rt2x00_desc_read(txd, 1, &word);
+       rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, entry->data_dma);
+       rt2x00_desc_write(txd, 1, word);
 
-               rt2x00_desc_read(txd, 1, &word);
-               rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS,
-                                  ring->entry[i].data_dma);
-               rt2x00_desc_write(txd, 1, word);
-
-               rt2x00_desc_read(txd, 0, &word);
-               rt2x00_set_field32(&word, TXD_W0_VALID, 0);
-               rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
-               rt2x00_desc_write(txd, 0, word);
-       }
-
-       rt2x00_ring_index_clear(ring);
+       rt2x00_desc_read(txd, 0, &word);
+       rt2x00_set_field32(&word, TXD_W0_VALID, 0);
+       rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
+       rt2x00_desc_write(txd, 0, word);
 }
 
 static int rt2500pci_init_rings(struct rt2x00_dev *rt2x00dev)
@@ -739,15 +719,6 @@ static int rt2500pci_init_rings(struct rt2x00_dev *rt2x00dev)
        u32 reg;
 
        /*
-        * Initialize rings.
-        */
-       rt2500pci_init_rxring(rt2x00dev);
-       rt2500pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA0);
-       rt2500pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA1);
-       rt2500pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_AFTER_BEACON);
-       rt2500pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_BEACON);
-
-       /*
         * Initialize registers.
         */
        rt2x00pci_register_read(rt2x00dev, TXCSR2, &reg);
@@ -1878,6 +1849,8 @@ static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = {
        .probe_hw               = rt2500pci_probe_hw,
        .initialize             = rt2x00pci_initialize,
        .uninitialize           = rt2x00pci_uninitialize,
+       .init_rxentry           = rt2500pci_init_rxentry,
+       .init_txentry           = rt2500pci_init_txentry,
        .set_device_state       = rt2500pci_set_device_state,
        .rfkill_poll            = rt2500pci_rfkill_poll,
        .link_stats             = rt2500pci_link_stats,
index 86549d5..46491ee 100644 (file)
@@ -920,8 +920,6 @@ static int rt2500usb_enable_radio(struct rt2x00_dev *rt2x00dev)
                return -EIO;
        }
 
-       rt2x00usb_enable_radio(rt2x00dev);
-
        /*
         * Enable LED
         */
@@ -1776,6 +1774,8 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
        .probe_hw               = rt2500usb_probe_hw,
        .initialize             = rt2x00usb_initialize,
        .uninitialize           = rt2x00usb_uninitialize,
+       .init_rxentry           = rt2x00usb_init_rxentry,
+       .init_txentry           = rt2x00usb_init_txentry,
        .set_device_state       = rt2500usb_set_device_state,
        .link_stats             = rt2500usb_link_stats,
        .reset_tuner            = rt2500usb_reset_tuner,
index 0cd847c..2cdde79 100644 (file)
@@ -474,6 +474,14 @@ struct rt2x00lib_ops {
        void (*uninitialize) (struct rt2x00_dev *rt2x00dev);
 
        /*
+        * Ring initialization handlers
+        */
+       void (*init_rxentry) (struct rt2x00_dev *rt2x00dev,
+                             struct data_entry *entry);
+       void (*init_txentry) (struct rt2x00_dev *rt2x00dev,
+                             struct data_entry *entry);
+
+       /*
         * Radio control handlers.
         */
        int (*set_device_state) (struct rt2x00_dev *rt2x00dev,
index a114212..b26c634 100644 (file)
@@ -103,6 +103,46 @@ void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev)
 }
 
 /*
+ * Ring initialization
+ */
+static void rt2x00lib_init_rxrings(struct rt2x00_dev *rt2x00dev)
+{
+       struct data_ring *ring = rt2x00dev->rx;
+       unsigned int i;
+
+       if (!rt2x00dev->ops->lib->init_rxentry)
+               return;
+
+       if (ring->data_addr)
+               memset(ring->data_addr, 0, rt2x00_get_ring_size(ring));
+
+       for (i = 0; i < ring->stats.limit; i++)
+               rt2x00dev->ops->lib->init_rxentry(rt2x00dev, &ring->entry[i]);
+
+       rt2x00_ring_index_clear(ring);
+}
+
+static void rt2x00lib_init_txrings(struct rt2x00_dev *rt2x00dev)
+{
+       struct data_ring *ring;
+       unsigned int i;
+
+       if (!rt2x00dev->ops->lib->init_txentry)
+               return;
+
+       txringall_for_each(rt2x00dev, ring) {
+               if (ring->data_addr)
+                       memset(ring->data_addr, 0, rt2x00_get_ring_size(ring));
+
+               for (i = 0; i < ring->stats.limit; i++)
+                       rt2x00dev->ops->lib->init_txentry(rt2x00dev,
+                                                         &ring->entry[i]);
+
+               rt2x00_ring_index_clear(ring);
+       }
+}
+
+/*
  * Radio control handlers.
  */
 int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
@@ -118,6 +158,12 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
                return 0;
 
        /*
+        * Initialize all data rings.
+        */
+       rt2x00lib_init_rxrings(rt2x00dev);
+       rt2x00lib_init_txrings(rt2x00dev);
+
+       /*
         * Enable radio.
         */
        status = rt2x00dev->ops->lib->set_device_state(rt2x00dev,
index fa0cdd8..63726a1 100644 (file)
@@ -333,43 +333,6 @@ skip_entry:
 /*
  * Radio handlers
  */
-void rt2x00usb_enable_radio(struct rt2x00_dev *rt2x00dev)
-{
-       struct usb_device *usb_dev =
-           interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
-       struct data_ring *ring;
-       struct data_entry *entry;
-       unsigned int i;
-
-       /*
-        * Initialize the TX rings
-        */
-       txringall_for_each(rt2x00dev, ring) {
-               for (i = 0; i < ring->stats.limit; i++)
-                       ring->entry[i].flags = 0;
-
-               rt2x00_ring_index_clear(ring);
-       }
-
-       /*
-        * Initialize and start the RX ring.
-        */
-       rt2x00_ring_index_clear(rt2x00dev->rx);
-
-       for (i = 0; i < rt2x00dev->rx->stats.limit; i++) {
-               entry = &rt2x00dev->rx->entry[i];
-
-               usb_fill_bulk_urb(entry->priv, usb_dev,
-                                 usb_rcvbulkpipe(usb_dev, 1),
-                                 entry->skb->data, entry->skb->len,
-                                 rt2x00usb_interrupt_rxdone, entry);
-
-               __set_bit(ENTRY_OWNER_NIC, &entry->flags);
-               usb_submit_urb(entry->priv, GFP_ATOMIC);
-       }
-}
-EXPORT_SYMBOL_GPL(rt2x00usb_enable_radio);
-
 void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
 {
        struct data_ring *ring;
@@ -391,6 +354,29 @@ EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio);
 /*
  * Device initialization handlers.
  */
+void rt2x00usb_init_rxentry(struct rt2x00_dev *rt2x00dev,
+                           struct data_entry *entry)
+{
+       struct usb_device *usb_dev =
+            interface_to_usbdev(rt2x00dev_usb(rt2x00dev));
+
+       usb_fill_bulk_urb(entry->priv, usb_dev,
+                         usb_rcvbulkpipe(usb_dev, 1),
+                         entry->skb->data, entry->skb->len,
+                         rt2x00usb_interrupt_rxdone, entry);
+
+       __set_bit(ENTRY_OWNER_NIC, &entry->flags);
+       usb_submit_urb(entry->priv, GFP_ATOMIC);
+}
+EXPORT_SYMBOL_GPL(rt2x00usb_init_rxentry);
+
+void rt2x00usb_init_txentry(struct rt2x00_dev *rt2x00dev,
+                           struct data_entry *entry)
+{
+       entry->flags = 0;
+}
+EXPORT_SYMBOL_GPL(rt2x00usb_init_txentry);
+
 static int rt2x00usb_alloc_urb(struct rt2x00_dev *rt2x00dev,
                               struct data_ring *ring)
 {
index 2fa45c5..e40df40 100644 (file)
@@ -154,7 +154,6 @@ static inline int rt2x00usb_eeprom_read(struct rt2x00_dev *rt2x00dev,
 /*
  * Radio handlers
  */
-void rt2x00usb_enable_radio(struct rt2x00_dev *rt2x00dev);
 void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev);
 
 /*
@@ -167,6 +166,10 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
 /*
  * Device initialization handlers.
  */
+void rt2x00usb_init_rxentry(struct rt2x00_dev *rt2x00dev,
+                           struct data_entry *entry);
+void rt2x00usb_init_txentry(struct rt2x00_dev *rt2x00dev,
+                           struct data_entry *entry);
 int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev);
 void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev);
 
index eb81024..88d1698 100644 (file)
@@ -989,66 +989,46 @@ static int rt61pci_load_firmware(struct rt2x00_dev *rt2x00dev, void *data,
        return 0;
 }
 
-static void rt61pci_init_rxring(struct rt2x00_dev *rt2x00dev)
+static void rt61pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
+                                struct data_entry *entry)
 {
-       struct data_ring *ring = rt2x00dev->rx;
-       __le32 *rxd;
-       unsigned int i;
+       __le32 *rxd = entry->priv;
        u32 word;
 
-       memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-       for (i = 0; i < ring->stats.limit; i++) {
-               rxd = ring->entry[i].priv;
-
-               rt2x00_desc_read(rxd, 5, &word);
-               rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS,
-                                  ring->entry[i].data_dma);
-               rt2x00_desc_write(rxd, 5, word);
-
-               rt2x00_desc_read(rxd, 0, &word);
-               rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
-               rt2x00_desc_write(rxd, 0, word);
-       }
+       rt2x00_desc_read(rxd, 5, &word);
+       rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS,
+                          entry->data_dma);
+       rt2x00_desc_write(rxd, 5, word);
 
-       rt2x00_ring_index_clear(rt2x00dev->rx);
+       rt2x00_desc_read(rxd, 0, &word);
+       rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
+       rt2x00_desc_write(rxd, 0, word);
 }
 
-static void rt61pci_init_txring(struct rt2x00_dev *rt2x00dev, const int queue)
+static void rt61pci_init_txentry(struct rt2x00_dev *rt2x00dev,
+                                struct data_entry *entry)
 {
-       struct data_ring *ring = rt2x00lib_get_ring(rt2x00dev, queue);
-       __le32 *txd;
-       unsigned int i;
+       __le32 *txd = entry->priv;
        u32 word;
 
-       memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
-
-       for (i = 0; i < ring->stats.limit; i++) {
-               txd = ring->entry[i].priv;
-
-               rt2x00_desc_read(txd, 1, &word);
-               rt2x00_set_field32(&word, TXD_W1_BUFFER_COUNT, 1);
-               rt2x00_desc_write(txd, 1, word);
-
-               rt2x00_desc_read(txd, 5, &word);
-               rt2x00_set_field32(&word, TXD_W5_PID_TYPE,
-                                  ring->queue_idx);
-               rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE,
-                                  ring->entry[i].entry_idx);
-               rt2x00_desc_write(txd, 5, word);
+       rt2x00_desc_read(txd, 1, &word);
+       rt2x00_set_field32(&word, TXD_W1_BUFFER_COUNT, 1);
+       rt2x00_desc_write(txd, 1, word);
 
-               rt2x00_desc_read(txd, 6, &word);
-               rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
-                                  ring->entry[i].data_dma);
-               rt2x00_desc_write(txd, 6, word);
+       rt2x00_desc_read(txd, 5, &word);
+       rt2x00_set_field32(&word, TXD_W5_PID_TYPE, entry->ring->queue_idx);
+       rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE, entry->entry_idx);
+       rt2x00_desc_write(txd, 5, word);
 
-               rt2x00_desc_read(txd, 0, &word);
-               rt2x00_set_field32(&word, TXD_W0_VALID, 0);
-               rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
-               rt2x00_desc_write(txd, 0, word);
-       }
+       rt2x00_desc_read(txd, 6, &word);
+       rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
+                          entry->data_dma);
+       rt2x00_desc_write(txd, 6, word);
 
-       rt2x00_ring_index_clear(ring);
+       rt2x00_desc_read(txd, 0, &word);
+       rt2x00_set_field32(&word, TXD_W0_VALID, 0);
+       rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
+       rt2x00_desc_write(txd, 0, word);
 }
 
 static int rt61pci_init_rings(struct rt2x00_dev *rt2x00dev)
@@ -1056,16 +1036,6 @@ static int rt61pci_init_rings(struct rt2x00_dev *rt2x00dev)
        u32 reg;
 
        /*
-        * Initialize rings.
-        */
-       rt61pci_init_rxring(rt2x00dev);
-       rt61pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA0);
-       rt61pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA1);
-       rt61pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA2);
-       rt61pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA3);
-       rt61pci_init_txring(rt2x00dev, IEEE80211_TX_QUEUE_DATA4);
-
-       /*
         * Initialize registers.
         */
        rt2x00pci_register_read(rt2x00dev, TX_RING_CSR0, &reg);
@@ -2486,6 +2456,8 @@ static const struct rt2x00lib_ops rt61pci_rt2x00_ops = {
        .load_firmware          = rt61pci_load_firmware,
        .initialize             = rt2x00pci_initialize,
        .uninitialize           = rt2x00pci_uninitialize,
+       .init_rxentry           = rt61pci_init_rxentry,
+       .init_txentry           = rt61pci_init_txentry,
        .set_device_state       = rt61pci_set_device_state,
        .rfkill_poll            = rt61pci_rfkill_poll,
        .link_stats             = rt61pci_link_stats,
index beaa264..78217dc 100644 (file)
@@ -1136,8 +1136,6 @@ static int rt73usb_enable_radio(struct rt2x00_dev *rt2x00dev)
                return -EIO;
        }
 
-       rt2x00usb_enable_radio(rt2x00dev);
-
        /*
         * Enable LED
         */
@@ -2033,6 +2031,8 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {
        .load_firmware          = rt73usb_load_firmware,
        .initialize             = rt2x00usb_initialize,
        .uninitialize           = rt2x00usb_uninitialize,
+       .init_rxentry           = rt2x00usb_init_rxentry,
+       .init_txentry           = rt2x00usb_init_txentry,
        .set_device_state       = rt73usb_set_device_state,
        .link_stats             = rt73usb_link_stats,
        .reset_tuner            = rt73usb_reset_tuner,