rt2x00: Rename CONFIG_DISABLE_LINK_TUNING
authorIvo van Doorn <ivdoorn@gmail.com>
Sun, 11 Jul 2010 10:24:22 +0000 (12:24 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 12 Jul 2010 20:05:33 +0000 (16:05 -0400)
Rename CONFIG_DISABLE_LINK_TUNING to DRIVER_SUPPORT_LINK_TUNING
Link tuning support is not only based on EEPROM decisions, but
also if the device actually supports it.

Currently only rt2500usb doesn't support link tuning because
of hardware problems. But rt2800usb is also suspected of having
problems with link tuning.

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/rt2800pci.c
drivers/net/wireless/rt2x00/rt2800usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00link.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 3bedf566c8ee95c4b8418923e357c2481efb0b10..5d5047fa0a260a66f15769ec16b3c9f4f48dd7f0 100644 (file)
@@ -1399,8 +1399,8 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
        /*
         * Check if the BBP tuning should be enabled.
         */
-       if (!rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RX_AGCVGC_TUNING))
-               __set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags);
+       if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RX_AGCVGC_TUNING))
+               __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);
 
        return 0;
 }
index 69d231d83952759feb0a25c9d6ef0b6b5f64b5f6..1d4758ac131102485bf92afcba700361b46b6b95 100644 (file)
@@ -1557,9 +1557,8 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
         * Check if the BBP tuning should be enabled.
         */
        rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom);
-
-       if (rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE))
-               __set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags);
+       if (!rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE))
+               __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);
 
        /*
         * Read the RSSI <-> dBm offset information.
index 44205526013f78ac10a46c9c76ab307a1d430711..6e48a15af4c5bb3fb07fcab439e3f0224716166a 100644 (file)
@@ -1470,13 +1470,6 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
        if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO))
                __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags);
 
-       /*
-        * Check if the BBP tuning should be disabled.
-        */
-       rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom);
-       if (rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE))
-               __set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags);
-
        /*
         * Read the RSSI <-> dBm offset information.
         */
@@ -1743,7 +1736,6 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev)
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
                __set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags);
        }
-       __set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.
index faf71e2aeb640eab3e2596031a75fa41678c89a7..a9eca99d416c892acafa54fb75c6f8c8cfa352ca 100644 (file)
@@ -1037,6 +1037,7 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev)
        __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
        if (!modparam_nohwcrypt)
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
+       __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.
index f2cd37e5aea822626b5a95ecad61a2be02aa8ec4..e4ab4db66ca0b4200d62c84224afe2fdff821964 100644 (file)
@@ -632,6 +632,7 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev)
        __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
        if (!modparam_nohwcrypt)
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
+       __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.
index 788b0e452cc7a046315fddb49fbb66821ed23235..42f4661632786ba7604c37100bc9155e7ce3dea2 100644 (file)
@@ -646,6 +646,7 @@ enum rt2x00_flags {
        CONFIG_SUPPORT_HW_CRYPTO,
        DRIVER_SUPPORT_CONTROL_FILTERS,
        DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL,
+       DRIVER_SUPPORT_LINK_TUNING,
 
        /*
         * Driver configuration
@@ -655,7 +656,6 @@ enum rt2x00_flags {
        CONFIG_EXTERNAL_LNA_A,
        CONFIG_EXTERNAL_LNA_BG,
        CONFIG_DOUBLE_ANTENNA,
-       CONFIG_DISABLE_LINK_TUNING,
        CONFIG_CHANNEL_HT40,
 };
 
index 2f8136cab7d8acd414b4d1e297fa0beba9ae2ece..801925bb157f76c5e4ab80b1a254dd489a7b1d0f 100644 (file)
@@ -359,10 +359,11 @@ static void rt2x00link_tuner(struct work_struct *work)
                qual->rssi = link->avg_rssi.avg;
 
        /*
-        * Only perform the link tuning when Link tuning
-        * has been enabled (This could have been disabled from the EEPROM).
+        * Check if link tuning is supported by the hardware, some hardware
+        * do not support link tuning at all, while other devices can disable
+        * the feature from the EEPROM.
         */
-       if (!test_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags))
+       if (test_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags))
                rt2x00dev->ops->lib->link_tuner(rt2x00dev, qual, link->count);
 
        /*
index 0123fbc22ca27580bcab8b9368d1c7a5580b83a5..ee84536fb9f00eea90e27be3e3ce93abec77f1fe 100644 (file)
@@ -2690,6 +2690,7 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
        __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
        if (!modparam_nohwcrypt)
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
+       __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.
index 286dd97e51d89c6beaaecdbd0689b95133618970..156f5d3660137720bd80049bff7cf9d44824e042 100644 (file)
@@ -2135,6 +2135,7 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
        __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
        if (!modparam_nohwcrypt)
                __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
+       __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags);
 
        /*
         * Set the rssi offset.