]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/rt2x00/rt2400pci.c
rt2x00: Add kill_tx_queue callback function
[mv-sheeva.git] / drivers / net / wireless / rt2x00 / rt2400pci.c
index 4a2c0b971ca8e25c8f276da2e1fdf9a21799811a..b0848259b45553ab7d8aa132f6e51ef874b7858b 100644 (file)
@@ -934,21 +934,10 @@ static int rt2400pci_enable_radio(struct rt2x00_dev *rt2x00dev)
 
 static void rt2400pci_disable_radio(struct rt2x00_dev *rt2x00dev)
 {
-       u32 reg;
-
-       rt2x00pci_register_write(rt2x00dev, PWRCSR0, 0);
-
        /*
-        * Disable synchronisation.
+        * Disable power
         */
-       rt2x00pci_register_write(rt2x00dev, CSR14, 0);
-
-       /*
-        * Cancel RX and TX.
-        */
-       rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
-       rt2x00_set_field32(&reg, TXCSR0_ABORT, 1);
-       rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
+       rt2x00pci_register_write(rt2x00dev, PWRCSR0, 0);
 }
 
 static int rt2400pci_set_state(struct rt2x00_dev *rt2x00dev,
@@ -1145,6 +1134,20 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
        rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
 }
 
+static void rt2400pci_kill_tx_queue(struct rt2x00_dev *rt2x00dev,
+                                   const enum data_queue_qid qid)
+{
+       u32 reg;
+
+       if (qid == QID_BEACON) {
+               rt2x00pci_register_write(rt2x00dev, CSR14, 0);
+       } else {
+               rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
+               rt2x00_set_field32(&reg, TXCSR0_ABORT, 1);
+               rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
+       }
+}
+
 /*
  * RX control handlers
  */
@@ -1606,6 +1609,7 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = {
        .write_tx_data          = rt2x00pci_write_tx_data,
        .write_beacon           = rt2400pci_write_beacon,
        .kick_tx_queue          = rt2400pci_kick_tx_queue,
+       .kill_tx_queue          = rt2400pci_kill_tx_queue,
        .fill_rxdone            = rt2400pci_fill_rxdone,
        .config_filter          = rt2400pci_config_filter,
        .config_intf            = rt2400pci_config_intf,