rt2x00: rt2800lib: correctly set HT20/HT40 filter
authorSerge Vasilugin <vasilugin@yandex.ru>
Mon, 16 Jan 2017 03:08:38 +0000 (04:08 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 19 Jan 2017 12:49:11 +0000 (14:49 +0200)
Simple patch to correct HT20/HT40 filter setting.
Tested with Rt3290, Rt3352 and Rt5350

Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2800.h
drivers/net/wireless/ralink/rt2x00/rt2800lib.c

index ec622a08a48607076d0f481838106b3b30264963..52743d451e72f615ce7c09c283c624cd6b3df332 100644 (file)
@@ -2286,6 +2286,8 @@ struct mac_iveiv_entry {
 #define RFCSR30_RX_H20M                        FIELD8(0x04)
 #define RFCSR30_RX_VCM                 FIELD8(0x18)
 #define RFCSR30_RF_CALIBRATION         FIELD8(0x80)
+#define RF3322_RFCSR30_TX_H20M         FIELD8(0x01)
+#define RF3322_RFCSR30_RX_H20M         FIELD8(0x02)
 
 /*
  * RFCSR 31:
index f36bc9bf55bdbdc2debbc643678d60122327b5cc..7480b28a6873b7b83e46030344d1d3d939c5c767 100644 (file)
@@ -3220,8 +3220,17 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
            rt2x00_rf(rt2x00dev, RF5390) ||
            rt2x00_rf(rt2x00dev, RF5392)) {
                rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr);
-               rt2x00_set_field8(&rfcsr, RFCSR30_TX_H20M, 0);
-               rt2x00_set_field8(&rfcsr, RFCSR30_RX_H20M, 0);
+               if (rt2x00_rf(rt2x00dev, RF3322)) {
+                       rt2x00_set_field8(&rfcsr, RF3322_RFCSR30_TX_H20M,
+                                         conf_is_ht40(conf));
+                       rt2x00_set_field8(&rfcsr, RF3322_RFCSR30_RX_H20M,
+                                         conf_is_ht40(conf));
+               } else {
+                       rt2x00_set_field8(&rfcsr, RFCSR30_TX_H20M,
+                                         conf_is_ht40(conf));
+                       rt2x00_set_field8(&rfcsr, RFCSR30_RX_H20M,
+                                         conf_is_ht40(conf));
+               }
                rt2800_rfcsr_write(rt2x00dev, 30, rfcsr);
 
                rt2800_rfcsr_read(rt2x00dev, 3, &rfcsr);