rt2x00: rt2800: use tx_power2 in rt2800_config_channel_rf3xxx
authorHelmut Schaa <helmut.schaa@googlemail.com>
Fri, 23 Apr 2010 13:54:43 +0000 (15:54 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 26 Apr 2010 18:21:23 +0000 (14:21 -0400)
Get closer to what the ralink driver does by setting the rf register 13
to tx_power2 during channel switch.

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

index ec89372..1c59dc6 100644 (file)
@@ -1566,6 +1566,11 @@ struct mac_iveiv_entry {
 #define RFCSR12_TX_POWER               FIELD8(0x1f)
 
 /*
+ * RFCSR 13:
+ */
+#define RFCSR13_TX_POWER               FIELD8(0x1f)
+
+/*
  * RFCSR 15:
  */
 #define RFCSR15_TX_LO2_EN              FIELD8(0x08)
index 867b652..2b9be79 100644 (file)
@@ -793,6 +793,11 @@ static void rt2800_config_channel_rf3xxx(struct rt2x00_dev *rt2x00dev,
                          TXPOWER_G_TO_DEV(info->tx_power1));
        rt2800_rfcsr_write(rt2x00dev, 12, rfcsr);
 
+       rt2800_rfcsr_read(rt2x00dev, 13, &rfcsr);
+       rt2x00_set_field8(&rfcsr, RFCSR13_TX_POWER,
+                         TXPOWER_G_TO_DEV(info->tx_power2));
+       rt2800_rfcsr_write(rt2x00dev, 13, rfcsr);
+
        rt2800_rfcsr_read(rt2x00dev, 23, &rfcsr);
        rt2x00_set_field8(&rfcsr, RFCSR23_FREQ_OFFSET, rt2x00dev->freq_offset);
        rt2800_rfcsr_write(rt2x00dev, 23, rfcsr);