From: Helmut Schaa Date: Fri, 23 Apr 2010 13:54:43 +0000 (+0200) Subject: rt2x00: rt2800: use tx_power2 in rt2800_config_channel_rf3xxx X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5a673964266438784b4ebf65ee07970cde61ab5e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git rt2x00: rt2800: use tx_power2 in rt2800_config_channel_rf3xxx 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 Acked-by: Gertjan van Wingerde Acked-by: Ivo van Doorn Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h index ec893721cc80..1c59dc6a3aa2 100644 --- a/drivers/net/wireless/rt2x00/rt2800.h +++ b/drivers/net/wireless/rt2x00/rt2800.h @@ -1565,6 +1565,11 @@ struct mac_iveiv_entry { */ #define RFCSR12_TX_POWER FIELD8(0x1f) +/* + * RFCSR 13: + */ +#define RFCSR13_TX_POWER FIELD8(0x1f) + /* * RFCSR 15: */ diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 867b6527a1fd..2b9be79fc77f 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -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);