diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2011-03-28 07:31:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-04 16:20:02 -0400 |
commit | 75faae8b80171b447bfc4bac448308676fb8a663 (patch) | |
tree | e0699a7e0c7056db1859aa3e523e9323ceeedd1c /drivers/net/wireless/rt2x00/rt2800lib.c | |
parent | aca7305be5cd9e07f042e6bf6547e7c5635f0041 (diff) |
rt2x00: Restructure bw_comp calculation
Move the HT40 check inside the calculation function to make it easier
for a later cleanup.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800lib.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 2ee6cebb9b25..2f8af7a806ec 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -1819,11 +1819,15 @@ static int rt2800_get_txpower_bw_comp(struct rt2x00_dev *rt2x00dev, | |||
1819 | u16 eeprom; | 1819 | u16 eeprom; |
1820 | u8 comp_en; | 1820 | u8 comp_en; |
1821 | u8 comp_type; | 1821 | u8 comp_type; |
1822 | int comp_value; | 1822 | int comp_value = 0; |
1823 | 1823 | ||
1824 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TXPOWER_DELTA, &eeprom); | 1824 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TXPOWER_DELTA, &eeprom); |
1825 | 1825 | ||
1826 | if (eeprom == 0xffff) | 1826 | /* |
1827 | * HT40 compensation not required. | ||
1828 | */ | ||
1829 | if (eeprom == 0xffff || | ||
1830 | !test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)) | ||
1827 | return 0; | 1831 | return 0; |
1828 | 1832 | ||
1829 | if (band == IEEE80211_BAND_2GHZ) { | 1833 | if (band == IEEE80211_BAND_2GHZ) { |
@@ -1865,13 +1869,12 @@ static u8 rt2800_compesate_txpower(struct rt2x00_dev *rt2x00dev, | |||
1865 | u8 eirp_txpower; | 1869 | u8 eirp_txpower; |
1866 | u8 eirp_txpower_criterion; | 1870 | u8 eirp_txpower_criterion; |
1867 | u8 reg_limit; | 1871 | u8 reg_limit; |
1868 | int bw_comp = 0; | 1872 | int bw_comp; |
1869 | 1873 | ||
1870 | if (!((band == IEEE80211_BAND_5GHZ) && is_rate_b)) | 1874 | if (!((band == IEEE80211_BAND_5GHZ) && is_rate_b)) |
1871 | return txpower; | 1875 | return txpower; |
1872 | 1876 | ||
1873 | if (test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)) | 1877 | bw_comp = rt2800_get_txpower_bw_comp(rt2x00dev, band); |
1874 | bw_comp = rt2800_get_txpower_bw_comp(rt2x00dev, band); | ||
1875 | 1878 | ||
1876 | if (test_bit(CONFIG_SUPPORT_POWER_LIMIT, &rt2x00dev->flags)) { | 1879 | if (test_bit(CONFIG_SUPPORT_POWER_LIMIT, &rt2x00dev->flags)) { |
1877 | /* | 1880 | /* |