]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rt2x00: Centralize setting of extra TX headroom requested by rt2x00.
authorGertjan van Wingerde <gwingerde@gmail.com>
Mon, 23 Nov 2009 21:44:52 +0000 (22:44 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 May 2011 22:55:23 +0000 (15:55 -0700)
commit e6218cc47bd54710dc523e8c983ceddba625e3ae upstream.

Set the value of extra_tx_headroom in a central place, rather than in each
of the drivers. This is preparatory for taking alignment space into account
in the TX headroom requested by rt2x00.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Adjust for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2800usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 798f625e38f70a718a70c21027d9f9aab1ac36d5..f6b8a9b4ec2c07db2a4ebab6231e74c92d288ef0 100644 (file)
@@ -1431,7 +1431,6 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
                               IEEE80211_HW_SIGNAL_DBM |
                               IEEE80211_HW_SUPPORTS_PS |
                               IEEE80211_HW_PS_NULLFUNC_STACK;
-       rt2x00dev->hw->extra_tx_headroom = 0;
 
        SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
        SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -1628,6 +1627,7 @@ static const struct rt2x00_ops rt2400pci_ops = {
        .eeprom_size    = EEPROM_SIZE,
        .rf_size        = RF_SIZE,
        .tx_queues      = NUM_TX_QUEUES,
+       .extra_tx_headroom = 0,
        .rx             = &rt2400pci_queue_rx,
        .tx             = &rt2400pci_queue_tx,
        .bcn            = &rt2400pci_queue_bcn,
index 2e872ac6982673018733f66654afccb7cdf6bf69..5a4b9ba1b20409248e526ff82185081012101404 100644 (file)
@@ -1732,8 +1732,6 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
                               IEEE80211_HW_SUPPORTS_PS |
                               IEEE80211_HW_PS_NULLFUNC_STACK;
 
-       rt2x00dev->hw->extra_tx_headroom = 0;
-
        SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
        SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
                                rt2x00_eeprom_addr(rt2x00dev,
@@ -1927,6 +1925,7 @@ static const struct rt2x00_ops rt2500pci_ops = {
        .eeprom_size    = EEPROM_SIZE,
        .rf_size        = RF_SIZE,
        .tx_queues      = NUM_TX_QUEUES,
+       .extra_tx_headroom = 0,
        .rx             = &rt2500pci_queue_rx,
        .tx             = &rt2500pci_queue_tx,
        .bcn            = &rt2500pci_queue_bcn,
index 22dd6d9e29812b60d4326ff5324e4e8dd1a2ffb7..56f4ea19edacc53d67a7f550041d7fe4d5e03d29 100644 (file)
@@ -1788,8 +1788,6 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
            IEEE80211_HW_SUPPORTS_PS |
            IEEE80211_HW_PS_NULLFUNC_STACK;
 
-       rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE;
-
        SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
        SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
                                rt2x00_eeprom_addr(rt2x00dev,
@@ -1962,6 +1960,7 @@ static const struct rt2x00_ops rt2500usb_ops = {
        .eeprom_size    = EEPROM_SIZE,
        .rf_size        = RF_SIZE,
        .tx_queues      = NUM_TX_QUEUES,
+       .extra_tx_headroom = TXD_DESC_SIZE,
        .rx             = &rt2500usb_queue_rx,
        .tx             = &rt2500usb_queue_tx,
        .bcn            = &rt2500usb_queue_bcn,
index 9fe770f7d7bb497146ae88a708beaf254185de18..db2b635ce7cd20152c25a313261d7f70e2c831c2 100644 (file)
@@ -2509,7 +2509,6 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
            IEEE80211_HW_SIGNAL_DBM |
            IEEE80211_HW_SUPPORTS_PS |
            IEEE80211_HW_PS_NULLFUNC_STACK;
-       rt2x00dev->hw->extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE;
 
        SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
        SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -2858,6 +2857,7 @@ static const struct rt2x00_ops rt2800usb_ops = {
        .eeprom_size    = EEPROM_SIZE,
        .rf_size        = RF_SIZE,
        .tx_queues      = NUM_TX_QUEUES,
+       .extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE,
        .rx             = &rt2800usb_queue_rx,
        .tx             = &rt2800usb_queue_tx,
        .bcn            = &rt2800usb_queue_bcn,
index 27bc6b7fbfdeffb6d610f4c4a3a5a2de294f0c99..cfb15560e533b8a72144e342e1f9e8dfee794652 100644 (file)
@@ -579,6 +579,7 @@ struct rt2x00_ops {
        const unsigned int eeprom_size;
        const unsigned int rf_size;
        const unsigned int tx_queues;
+       const unsigned int extra_tx_headroom;
        const struct data_queue_desc *rx;
        const struct data_queue_desc *tx;
        const struct data_queue_desc *bcn;
index 73bbec58341ecd6362fe95caa3b5b1900454a20d..a145657ed0cce393542f336021ae3b7d38ebd1a8 100644 (file)
@@ -683,6 +683,11 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
         */
        rt2x00dev->hw->queues = rt2x00dev->ops->tx_queues;
 
+       /*
+        * Initialize extra TX headroom required.
+        */
+       rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom;
+
        /*
         * Register HW.
         */
index 9a6ceb4e28d8b94cbcc74ea965789a423474321f..da8366dc6d84f8a15fc5ca1c7d939fcccdd218b8 100644 (file)
@@ -2550,7 +2550,6 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
            IEEE80211_HW_SIGNAL_DBM |
            IEEE80211_HW_SUPPORTS_PS |
            IEEE80211_HW_PS_NULLFUNC_STACK;
-       rt2x00dev->hw->extra_tx_headroom = 0;
 
        SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
        SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -2798,6 +2797,7 @@ static const struct rt2x00_ops rt61pci_ops = {
        .eeprom_size    = EEPROM_SIZE,
        .rf_size        = RF_SIZE,
        .tx_queues      = NUM_TX_QUEUES,
+       .extra_tx_headroom = 0,
        .rx             = &rt61pci_queue_rx,
        .tx             = &rt61pci_queue_tx,
        .bcn            = &rt61pci_queue_bcn,
index 15855775cf38a43d6d1ac2ddcc81447e68f269d1..a3ceef2c4af33ecffb4a320b6da9bf51d1d27f81 100644 (file)
@@ -2068,7 +2068,6 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
            IEEE80211_HW_SIGNAL_DBM |
            IEEE80211_HW_SUPPORTS_PS |
            IEEE80211_HW_PS_NULLFUNC_STACK;
-       rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE;
 
        SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
        SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -2311,6 +2310,7 @@ static const struct rt2x00_ops rt73usb_ops = {
        .eeprom_size    = EEPROM_SIZE,
        .rf_size        = RF_SIZE,
        .tx_queues      = NUM_TX_QUEUES,
+       .extra_tx_headroom = TXD_DESC_SIZE,
        .rx             = &rt73usb_queue_rx,
        .tx             = &rt73usb_queue_tx,
        .bcn            = &rt73usb_queue_bcn,