]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rt2x00: correctly set max_report_rates in rt61pci and rt2800
authorHelmut Schaa <helmut.schaa@googlemail.com>
Sat, 2 Oct 2010 09:32:16 +0000 (11:32 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 5 Oct 2010 17:35:28 +0000 (13:35 -0400)
rt61pci and rt2800 devices can use up to 7 different rates per tx frame.
However, the device uses a global fallback table. Hence, the rc
algortihm cannot specify multiple rates to try but the device is able to
report multiple rates (based on the retry table). Specify that behavior
by correctly setting max_report_rates and max_rates.

This makes rt2x00 and minstrel play nicer together.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800lib.c
drivers/net/wireless/rt2x00/rt61pci.c

index 99b505f8e7178cfd205046249af0f2e5db73fe9a..403e2ed0f44f396cfa6e6990d1296a2287147e71 100644 (file)
@@ -3188,12 +3188,13 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
         * As rt2800 has a global fallback table we cannot specify
         * more then one tx rate per frame but since the hw will
         * try several rates (based on the fallback table) we should
-        * still initialize max_rates to the maximum number of rates
+        * initialize max_report_rates to the maximum number of rates
         * we are going to try. Otherwise mac80211 will truncate our
         * reported tx rates and the rc algortihm will end up with
         * incorrect data.
         */
-       rt2x00dev->hw->max_rates = 7;
+       rt2x00dev->hw->max_rates = 1;
+       rt2x00dev->hw->max_report_rates = 7;
        rt2x00dev->hw->max_rate_tries = 1;
 
        rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
index 8940070fe2a2e4b36a80ecb1e635f50e478ab504..ac370f11e74fc88b594aaff223f224798bc3fbd9 100644 (file)
@@ -2630,12 +2630,13 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
         * As rt61 has a global fallback table we cannot specify
         * more then one tx rate per frame but since the hw will
         * try several rates (based on the fallback table) we should
-        * still initialize max_rates to the maximum number of rates
+        * initialize max_report_rates to the maximum number of rates
         * we are going to try. Otherwise mac80211 will truncate our
         * reported tx rates and the rc algortihm will end up with
         * incorrect data.
         */
-       rt2x00dev->hw->max_rates = 7;
+       rt2x00dev->hw->max_rates = 1;
+       rt2x00dev->hw->max_report_rates = 7;
        rt2x00dev->hw->max_rate_tries = 1;
 
        /*