]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/net/wireless/rt2x00/rt2x00config.c
rt2x00: Fix HT40 operation in rt2800.
[linux-2.6.git] / drivers / net / wireless / rt2x00 / rt2x00config.c
index 098315a271ca0473486fcc9fdb8e7ad7928ecea8..8dbd634dae27dd0bd5412ae131b96302d3082c63 100644 (file)
@@ -170,23 +170,27 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
                      unsigned int ieee80211_flags)
 {
        struct rt2x00lib_conf libconf;
+       u16 hw_value;
 
        memset(&libconf, 0, sizeof(libconf));
 
        libconf.conf = conf;
 
        if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) {
-               if (conf_is_ht40(conf))
+               if (conf_is_ht40(conf)) {
                        __set_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
-               else
+                       hw_value = rt2x00ht_center_channel(rt2x00dev, conf);
+               } else {
                        __clear_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
+                       hw_value = conf->channel->hw_value;
+               }
 
                memcpy(&libconf.rf,
-                      &rt2x00dev->spec.channels[conf->channel->hw_value],
+                      &rt2x00dev->spec.channels[hw_value],
                       sizeof(libconf.rf));
 
                memcpy(&libconf.channel,
-                      &rt2x00dev->spec.channels_info[conf->channel->hw_value],
+                      &rt2x00dev->spec.channels_info[hw_value],
                       sizeof(libconf.channel));
        }