diff options
| author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-07-09 08:41:48 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2012-07-11 15:38:27 -0400 |
| commit | 7573cb5b46f878e4b3477f60f86355197e36e04a (patch) | |
| tree | e5f67e1f86c45fcc5ea9c3788d720e975d3aaad5 | |
| parent | 5d7d55d681d522d1ebaca68fd7e9166b3204245a (diff) | |
rt2800lib: merge same defines
Merge 3290 and 5390 POWER_BOUND and FREQ_OFFSET_BOUND defines.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
| -rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 068276ee8aff..e76f03c9b468 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
| @@ -1940,10 +1940,8 @@ static void rt2800_config_channel_rf3052(struct rt2x00_dev *rt2x00dev, | |||
| 1940 | rt2800_rfcsr_write(rt2x00dev, 7, rfcsr); | 1940 | rt2800_rfcsr_write(rt2x00dev, 7, rfcsr); |
| 1941 | } | 1941 | } |
| 1942 | 1942 | ||
| 1943 | #define RT3290_POWER_BOUND 0x27 | 1943 | #define POWER_BOUND 0x27 |
| 1944 | #define RT3290_FREQ_OFFSET_BOUND 0x5f | 1944 | #define FREQ_OFFSET_BOUND 0x5f |
| 1945 | #define RT5390_POWER_BOUND 0x27 | ||
| 1946 | #define RT5390_FREQ_OFFSET_BOUND 0x5f | ||
| 1947 | 1945 | ||
| 1948 | static void rt2800_config_channel_rf3290(struct rt2x00_dev *rt2x00dev, | 1946 | static void rt2800_config_channel_rf3290(struct rt2x00_dev *rt2x00dev, |
| 1949 | struct ieee80211_conf *conf, | 1947 | struct ieee80211_conf *conf, |
| @@ -1959,16 +1957,15 @@ static void rt2800_config_channel_rf3290(struct rt2x00_dev *rt2x00dev, | |||
| 1959 | rt2800_rfcsr_write(rt2x00dev, 11, rfcsr); | 1957 | rt2800_rfcsr_write(rt2x00dev, 11, rfcsr); |
| 1960 | 1958 | ||
| 1961 | rt2800_rfcsr_read(rt2x00dev, 49, &rfcsr); | 1959 | rt2800_rfcsr_read(rt2x00dev, 49, &rfcsr); |
| 1962 | if (info->default_power1 > RT3290_POWER_BOUND) | 1960 | if (info->default_power1 > POWER_BOUND) |
| 1963 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, RT3290_POWER_BOUND); | 1961 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, POWER_BOUND); |
| 1964 | else | 1962 | else |
| 1965 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, info->default_power1); | 1963 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, info->default_power1); |
| 1966 | rt2800_rfcsr_write(rt2x00dev, 49, rfcsr); | 1964 | rt2800_rfcsr_write(rt2x00dev, 49, rfcsr); |
| 1967 | 1965 | ||
| 1968 | rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr); | 1966 | rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr); |
| 1969 | if (rt2x00dev->freq_offset > RT3290_FREQ_OFFSET_BOUND) | 1967 | if (rt2x00dev->freq_offset > FREQ_OFFSET_BOUND) |
| 1970 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, | 1968 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, FREQ_OFFSET_BOUND); |
| 1971 | RT3290_FREQ_OFFSET_BOUND); | ||
| 1972 | else | 1969 | else |
| 1973 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset); | 1970 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset); |
| 1974 | rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); | 1971 | rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); |
| @@ -2002,17 +1999,16 @@ static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev, | |||
| 2002 | rt2800_rfcsr_write(rt2x00dev, 11, rfcsr); | 1999 | rt2800_rfcsr_write(rt2x00dev, 11, rfcsr); |
| 2003 | 2000 | ||
| 2004 | rt2800_rfcsr_read(rt2x00dev, 49, &rfcsr); | 2001 | rt2800_rfcsr_read(rt2x00dev, 49, &rfcsr); |
| 2005 | if (info->default_power1 > RT5390_POWER_BOUND) | 2002 | if (info->default_power1 > POWER_BOUND) |
| 2006 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, RT5390_POWER_BOUND); | 2003 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, POWER_BOUND); |
| 2007 | else | 2004 | else |
| 2008 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, info->default_power1); | 2005 | rt2x00_set_field8(&rfcsr, RFCSR49_TX, info->default_power1); |
| 2009 | rt2800_rfcsr_write(rt2x00dev, 49, rfcsr); | 2006 | rt2800_rfcsr_write(rt2x00dev, 49, rfcsr); |
| 2010 | 2007 | ||
| 2011 | if (rt2x00_rt(rt2x00dev, RT5392)) { | 2008 | if (rt2x00_rt(rt2x00dev, RT5392)) { |
| 2012 | rt2800_rfcsr_read(rt2x00dev, 50, &rfcsr); | 2009 | rt2800_rfcsr_read(rt2x00dev, 50, &rfcsr); |
| 2013 | if (info->default_power1 > RT5390_POWER_BOUND) | 2010 | if (info->default_power1 > POWER_BOUND) |
| 2014 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, | 2011 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, POWER_BOUND); |
| 2015 | RT5390_POWER_BOUND); | ||
| 2016 | else | 2012 | else |
| 2017 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, | 2013 | rt2x00_set_field8(&rfcsr, RFCSR50_TX, |
| 2018 | info->default_power2); | 2014 | info->default_power2); |
| @@ -2031,9 +2027,8 @@ static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev, | |||
| 2031 | rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); | 2027 | rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); |
| 2032 | 2028 | ||
| 2033 | rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr); | 2029 | rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr); |
| 2034 | if (rt2x00dev->freq_offset > RT5390_FREQ_OFFSET_BOUND) | 2030 | if (rt2x00dev->freq_offset > FREQ_OFFSET_BOUND) |
| 2035 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, | 2031 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, FREQ_OFFSET_BOUND); |
| 2036 | RT5390_FREQ_OFFSET_BOUND); | ||
| 2037 | else | 2032 | else |
| 2038 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset); | 2033 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset); |
| 2039 | rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); | 2034 | rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); |
