diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2012-09-16 16:29:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-09-24 14:59:13 -0400 |
commit | 7ad630352216c5f4f2750978f661bc9c748423cc (patch) | |
tree | be3d6e43d11836d70a8805be60fecc21a32aa4a2 | |
parent | 5b196139e57a96d06b86a99533a438c86d6354c9 (diff) |
rt2x00: Clean up RFCSR1 programming in rt2800_config_channel_rf3xxx.
Setting of the individual fields of the RF register can be simplified.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index d745c32a7361..540c94f8505a 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -1763,36 +1763,15 @@ static void rt2800_config_channel_rf3xxx(struct rt2x00_dev *rt2x00dev, | |||
1763 | 1763 | ||
1764 | rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr); | 1764 | rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr); |
1765 | rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 0); | 1765 | rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 0); |
1766 | rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, | ||
1767 | rt2x00dev->default_ant.rx_chain_num <= 1); | ||
1768 | rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, | ||
1769 | rt2x00dev->default_ant.rx_chain_num <= 2); | ||
1766 | rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 0); | 1770 | rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 0); |
1767 | if (rt2x00_rt(rt2x00dev, RT3390)) { | 1771 | rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, |
1768 | rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, | 1772 | rt2x00dev->default_ant.tx_chain_num <= 1); |
1769 | rt2x00dev->default_ant.rx_chain_num == 1); | 1773 | rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, |
1770 | rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, | 1774 | rt2x00dev->default_ant.tx_chain_num <= 2); |
1771 | rt2x00dev->default_ant.tx_chain_num == 1); | ||
1772 | } else { | ||
1773 | rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 0); | ||
1774 | rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 0); | ||
1775 | rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 0); | ||
1776 | rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 0); | ||
1777 | |||
1778 | switch (rt2x00dev->default_ant.tx_chain_num) { | ||
1779 | case 1: | ||
1780 | rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1); | ||
1781 | /* fall through */ | ||
1782 | case 2: | ||
1783 | rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 1); | ||
1784 | break; | ||
1785 | } | ||
1786 | |||
1787 | switch (rt2x00dev->default_ant.rx_chain_num) { | ||
1788 | case 1: | ||
1789 | rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1); | ||
1790 | /* fall through */ | ||
1791 | case 2: | ||
1792 | rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 1); | ||
1793 | break; | ||
1794 | } | ||
1795 | } | ||
1796 | rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); | 1775 | rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); |
1797 | 1776 | ||
1798 | rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); | 1777 | rt2800_rfcsr_read(rt2x00dev, 30, &rfcsr); |