]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rt2x00: configure different txdesc parameters for non HT channel
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 4 Apr 2012 14:15:33 +0000 (16:15 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 11 Apr 2012 20:23:44 +0000 (16:23 -0400)
This is needed when we are concted to non 11n AP.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00config.c
drivers/net/wireless/rt2x00/rt2x00queue.c

index 471f87cab4abe53650de055058d3c9d61a2a2ecc..8de9bfc4e51aa0b0aec2a52fff8ad849eadca6e9 100644 (file)
@@ -692,6 +692,7 @@ enum rt2x00_state_flags {
         */
        CONFIG_CHANNEL_HT40,
        CONFIG_POWERSAVING,
+       CONFIG_HT_DISABLED,
 
        /*
         * Mark we currently are sequentially reading TX_STA_FIFO register
index 293676bfa5711352fa3c989183a8360ebfae97af..e7361d913e8e2a8008f240ffdfb3269a0ee4c753 100644 (file)
@@ -217,6 +217,11 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
        libconf.conf = conf;
 
        if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) {
+               if (!conf_is_ht(conf))
+                       set_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags);
+               else
+                       clear_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags);
+
                if (conf_is_ht40(conf)) {
                        set_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
                        hw_value = rt2x00ht_center_channel(rt2x00dev, conf);
index 9b1b2b7a7807226717a6a1b463cdf9fdc7a70f2e..acd013353cc731d4fdac71dc16b93eafadcfb359 100644 (file)
@@ -320,14 +320,6 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
                txdesc->u.ht.wcid = sta_priv->wcid;
        }
 
-       txdesc->u.ht.ba_size = 7;       /* FIXME: What value is needed? */
-
-       /*
-        * Only one STBC stream is supported for now.
-        */
-       if (tx_info->flags & IEEE80211_TX_CTL_STBC)
-               txdesc->u.ht.stbc = 1;
-
        /*
         * If IEEE80211_TX_RC_MCS is set txrate->idx just contains the
         * mcs rate to be used
@@ -351,6 +343,24 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
                        txdesc->u.ht.mcs |= 0x08;
        }
 
+       if (test_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags)) {
+               if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT))
+                       txdesc->u.ht.txop = TXOP_SIFS;
+               else
+                       txdesc->u.ht.txop = TXOP_BACKOFF;
+
+               /* Left zero on all other settings. */
+               return;
+       }
+
+       txdesc->u.ht.ba_size = 7;       /* FIXME: What value is needed? */
+
+       /*
+        * Only one STBC stream is supported for now.
+        */
+       if (tx_info->flags & IEEE80211_TX_CTL_STBC)
+               txdesc->u.ht.stbc = 1;
+
        /*
         * This frame is eligible for an AMPDU, however, don't aggregate
         * frames that are intended to probe a specific tx rate.