aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2010-04-11 08:31:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-12 15:22:10 -0400
commit06855ef4c8cf3d86d831c6317ca6a3563d271350 (patch)
tree733fc6aa74aa148711747125e0ab1a41ab9b9bb5 /drivers/net/wireless/rt2x00
parent5988f385b4cffa9ca72c5be0188e5f4c9ef46d82 (diff)
rt2x00: Let RF chipset decide the RF channel switch method to use in rt2800.
It seems that the distinction between RF channel switch method is solely based on the RF chipset that is used. Refactor the channel switch decision to just take the RF chipset into account, thereby greatly simplifying the check. 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>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index ec3ec786f350..6fdec1536db7 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -717,10 +717,10 @@ static void rt2800_config_lna_gain(struct rt2x00_dev *rt2x00dev,
717 rt2x00dev->lna_gain = lna_gain; 717 rt2x00dev->lna_gain = lna_gain;
718} 718}
719 719
720static void rt2800_config_channel_rt2x(struct rt2x00_dev *rt2x00dev, 720static void rt2800_config_channel_rf2xxx(struct rt2x00_dev *rt2x00dev,
721 struct ieee80211_conf *conf, 721 struct ieee80211_conf *conf,
722 struct rf_channel *rf, 722 struct rf_channel *rf,
723 struct channel_info *info) 723 struct channel_info *info)
724{ 724{
725 rt2x00_set_field32(&rf->rf4, RF4_FREQ_OFFSET, rt2x00dev->freq_offset); 725 rt2x00_set_field32(&rf->rf4, RF4_FREQ_OFFSET, rt2x00dev->freq_offset);
726 726
@@ -786,10 +786,10 @@ static void rt2800_config_channel_rt2x(struct rt2x00_dev *rt2x00dev,
786 rt2800_rf_write(rt2x00dev, 4, rf->rf4); 786 rt2800_rf_write(rt2x00dev, 4, rf->rf4);
787} 787}
788 788
789static void rt2800_config_channel_rt3x(struct rt2x00_dev *rt2x00dev, 789static void rt2800_config_channel_rf3xxx(struct rt2x00_dev *rt2x00dev,
790 struct ieee80211_conf *conf, 790 struct ieee80211_conf *conf,
791 struct rf_channel *rf, 791 struct rf_channel *rf,
792 struct channel_info *info) 792 struct channel_info *info)
793{ 793{
794 u8 rfcsr; 794 u8 rfcsr;
795 795
@@ -826,16 +826,13 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
826 unsigned int tx_pin; 826 unsigned int tx_pin;
827 u8 bbp; 827 u8 bbp;
828 828
829 if ((rt2x00_rt(rt2x00dev, RT3070) || 829 if (rt2x00_rf(rt2x00dev, RF2020) ||
830 rt2x00_rt(rt2x00dev, RT3090) || 830 rt2x00_rf(rt2x00dev, RF3020) ||
831 rt2x00_rt(rt2x00dev, RT2872)) && 831 rt2x00_rf(rt2x00dev, RF3021) ||
832 (rt2x00_rf(rt2x00dev, RF2020) || 832 rt2x00_rf(rt2x00dev, RF3022))
833 rt2x00_rf(rt2x00dev, RF3020) || 833 rt2800_config_channel_rf3xxx(rt2x00dev, conf, rf, info);
834 rt2x00_rf(rt2x00dev, RF3021) ||
835 rt2x00_rf(rt2x00dev, RF3022)))
836 rt2800_config_channel_rt3x(rt2x00dev, conf, rf, info);
837 else 834 else
838 rt2800_config_channel_rt2x(rt2x00dev, conf, rf, info); 835 rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info);
839 836
840 /* 837 /*
841 * Change BBP settings 838 * Change BBP settings