mwifiex: add custom IE framework
[deliverable/linux.git] / drivers / net / wireless / rt2x00 / rt2400pci.c
index 76bcc3547976703842747ae4369d47bf734da3f1..5e6b5014316591114884536de8c349e7a2ec0b4b 100644 (file)
@@ -645,11 +645,6 @@ static void rt2400pci_start_queue(struct data_queue *queue)
                rt2x00pci_register_write(rt2x00dev, RXCSR0, reg);
                break;
        case QID_BEACON:
-               /*
-                * Allow the tbtt tasklet to be scheduled.
-                */
-               tasklet_enable(&rt2x00dev->tbtt_tasklet);
-
                rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
                rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
                rt2x00_set_field32(&reg, CSR14_TBCN, 1);
@@ -715,7 +710,7 @@ static void rt2400pci_stop_queue(struct data_queue *queue)
                /*
                 * Wait for possibly running tbtt tasklets.
                 */
-               tasklet_disable(&rt2x00dev->tbtt_tasklet);
+               tasklet_kill(&rt2x00dev->tbtt_tasklet);
                break;
        default:
                break;
@@ -982,12 +977,6 @@ static void rt2400pci_toggle_irq(struct rt2x00_dev *rt2x00dev,
        if (state == STATE_RADIO_IRQ_ON) {
                rt2x00pci_register_read(rt2x00dev, CSR7, &reg);
                rt2x00pci_register_write(rt2x00dev, CSR7, reg);
-
-               /*
-                * Enable tasklets.
-                */
-               tasklet_enable(&rt2x00dev->txstatus_tasklet);
-               tasklet_enable(&rt2x00dev->rxdone_tasklet);
        }
 
        /*
@@ -1011,8 +1000,9 @@ static void rt2400pci_toggle_irq(struct rt2x00_dev *rt2x00dev,
                 * Ensure that all tasklets are finished before
                 * disabling the interrupts.
                 */
-               tasklet_disable(&rt2x00dev->txstatus_tasklet);
-               tasklet_disable(&rt2x00dev->rxdone_tasklet);
+               tasklet_kill(&rt2x00dev->txstatus_tasklet);
+               tasklet_kill(&rt2x00dev->rxdone_tasklet);
+               tasklet_kill(&rt2x00dev->tbtt_tasklet);
        }
 }
 
@@ -1249,7 +1239,7 @@ static void rt2400pci_fill_rxdone(struct queue_entry *entry,
         * call, we must decrease the higher 32bits with 1 to get
         * to correct value.
         */
-       tsf = rt2x00dev->ops->hw->get_tsf(rt2x00dev->hw);
+       tsf = rt2x00dev->ops->hw->get_tsf(rt2x00dev->hw, NULL);
        rx_low = rt2x00_get_field32(word4, RXD_W4_RX_END_TIME);
        rx_high = upper_32_bits(tsf);
 
@@ -1347,22 +1337,25 @@ static void rt2400pci_txstatus_tasklet(unsigned long data)
        /*
         * Enable all TXDONE interrupts again.
         */
-       spin_lock_irq(&rt2x00dev->irqmask_lock);
+       if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) {
+               spin_lock_irq(&rt2x00dev->irqmask_lock);
 
-       rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
-       rt2x00_set_field32(&reg, CSR8_TXDONE_TXRING, 0);
-       rt2x00_set_field32(&reg, CSR8_TXDONE_ATIMRING, 0);
-       rt2x00_set_field32(&reg, CSR8_TXDONE_PRIORING, 0);
-       rt2x00pci_register_write(rt2x00dev, CSR8, reg);
+               rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
+               rt2x00_set_field32(&reg, CSR8_TXDONE_TXRING, 0);
+               rt2x00_set_field32(&reg, CSR8_TXDONE_ATIMRING, 0);
+               rt2x00_set_field32(&reg, CSR8_TXDONE_PRIORING, 0);
+               rt2x00pci_register_write(rt2x00dev, CSR8, reg);
 
-       spin_unlock_irq(&rt2x00dev->irqmask_lock);
+               spin_unlock_irq(&rt2x00dev->irqmask_lock);
+       }
 }
 
 static void rt2400pci_tbtt_tasklet(unsigned long data)
 {
        struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
        rt2x00lib_beacondone(rt2x00dev);
-       rt2400pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE);
+       if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
+               rt2400pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE);
 }
 
 static void rt2400pci_rxdone_tasklet(unsigned long data)
@@ -1370,7 +1363,7 @@ static void rt2400pci_rxdone_tasklet(unsigned long data)
        struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
        if (rt2x00pci_rxdone(rt2x00dev))
                tasklet_schedule(&rt2x00dev->rxdone_tasklet);
-       else
+       else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
                rt2400pci_enable_interrupt(rt2x00dev, CSR8_RXDONE);
 }
 
@@ -1655,7 +1648,8 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
 /*
  * IEEE80211 stack callback functions.
  */
-static int rt2400pci_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int rt2400pci_conf_tx(struct ieee80211_hw *hw,
+                            struct ieee80211_vif *vif, u16 queue,
                             const struct ieee80211_tx_queue_params *params)
 {
        struct rt2x00_dev *rt2x00dev = hw->priv;
@@ -1668,7 +1662,7 @@ static int rt2400pci_conf_tx(struct ieee80211_hw *hw, u16 queue,
        if (queue != 0)
                return -EINVAL;
 
-       if (rt2x00mac_conf_tx(hw, queue, params))
+       if (rt2x00mac_conf_tx(hw, vif, queue, params))
                return -EINVAL;
 
        /*
@@ -1680,7 +1674,8 @@ static int rt2400pci_conf_tx(struct ieee80211_hw *hw, u16 queue,
        return 0;
 }
 
-static u64 rt2400pci_get_tsf(struct ieee80211_hw *hw)
+static u64 rt2400pci_get_tsf(struct ieee80211_hw *hw,
+                            struct ieee80211_vif *vif)
 {
        struct rt2x00_dev *rt2x00dev = hw->priv;
        u64 tsf;
@@ -1833,15 +1828,4 @@ static struct pci_driver rt2400pci_driver = {
        .resume         = rt2x00pci_resume,
 };
 
-static int __init rt2400pci_init(void)
-{
-       return pci_register_driver(&rt2400pci_driver);
-}
-
-static void __exit rt2400pci_exit(void)
-{
-       pci_unregister_driver(&rt2400pci_driver);
-}
-
-module_init(rt2400pci_init);
-module_exit(rt2400pci_exit);
+module_pci_driver(rt2400pci_driver);
This page took 0.048535 seconds and 5 git commands to generate.