aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800lib.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2010-08-23 13:55:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:34:55 -0400
commit46323e112ce2a0fdaf2dd5389f95b248576b8fda (patch)
tree5fe469ee74d2a25066d34a138539c8fefdf78448 /drivers/net/wireless/rt2x00/rt2800lib.c
parentb9a07ae9d9e09662013992088fd58ffbcb2f9a30 (diff)
rt2x00: Fix channel configuration for RF3052
We missed a check for RF3052 in the config_channel configuration function. As a result the channel is not properly configured for RF3052 devices. This also requires rt2800_config_channel_rf3xxx to support 5GHz channels, so we must apply the TXPOWER_A_TO_DEV and TXPOWER_G_TO_DEV conversions during rt2800_config_channel() Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.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.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index b2f9b04134eb..cbab2e126167 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1244,8 +1244,7 @@ static void rt2800_config_channel_rf2xxx(struct rt2x00_dev *rt2x00dev,
1244 if (info->tx_power1 < 0) 1244 if (info->tx_power1 < 0)
1245 info->tx_power1 += 7; 1245 info->tx_power1 += 7;
1246 1246
1247 rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_A, 1247 rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_A, info->tx_power1);
1248 TXPOWER_A_TO_DEV(info->tx_power1));
1249 1248
1250 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A_7DBM_BOOST, 1249 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A_7DBM_BOOST,
1251 (info->tx_power2 >= 0)); 1250 (info->tx_power2 >= 0));
@@ -1253,13 +1252,10 @@ static void rt2800_config_channel_rf2xxx(struct rt2x00_dev *rt2x00dev,
1253 if (info->tx_power2 < 0) 1252 if (info->tx_power2 < 0)
1254 info->tx_power2 += 7; 1253 info->tx_power2 += 7;
1255 1254
1256 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A, 1255 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A, info->tx_power2);
1257 TXPOWER_A_TO_DEV(info->tx_power2));
1258 } else { 1256 } else {
1259 rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_G, 1257 rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_G, info->tx_power1);
1260 TXPOWER_G_TO_DEV(info->tx_power1)); 1258 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_G, info->tx_power2);
1261 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_G,
1262 TXPOWER_G_TO_DEV(info->tx_power2));
1263 } 1259 }
1264 1260
1265 rt2x00_set_field32(&rf->rf4, RF4_HT40, conf_is_ht40(conf)); 1261 rt2x00_set_field32(&rf->rf4, RF4_HT40, conf_is_ht40(conf));
@@ -1299,13 +1295,11 @@ static void rt2800_config_channel_rf3xxx(struct rt2x00_dev *rt2x00dev,
1299 rt2800_rfcsr_write(rt2x00dev, 6, rfcsr); 1295 rt2800_rfcsr_write(rt2x00dev, 6, rfcsr);
1300 1296
1301 rt2800_rfcsr_read(rt2x00dev, 12, &rfcsr); 1297 rt2800_rfcsr_read(rt2x00dev, 12, &rfcsr);
1302 rt2x00_set_field8(&rfcsr, RFCSR12_TX_POWER, 1298 rt2x00_set_field8(&rfcsr, RFCSR12_TX_POWER, info->tx_power1);
1303 TXPOWER_G_TO_DEV(info->tx_power1));
1304 rt2800_rfcsr_write(rt2x00dev, 12, rfcsr); 1299 rt2800_rfcsr_write(rt2x00dev, 12, rfcsr);
1305 1300
1306 rt2800_rfcsr_read(rt2x00dev, 13, &rfcsr); 1301 rt2800_rfcsr_read(rt2x00dev, 13, &rfcsr);
1307 rt2x00_set_field8(&rfcsr, RFCSR13_TX_POWER, 1302 rt2x00_set_field8(&rfcsr, RFCSR13_TX_POWER, info->tx_power2);
1308 TXPOWER_G_TO_DEV(info->tx_power2));
1309 rt2800_rfcsr_write(rt2x00dev, 13, rfcsr); 1303 rt2800_rfcsr_write(rt2x00dev, 13, rfcsr);
1310 1304
1311 rt2800_rfcsr_read(rt2x00dev, 23, &rfcsr); 1305 rt2800_rfcsr_read(rt2x00dev, 23, &rfcsr);
@@ -1329,10 +1323,19 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
1329 unsigned int tx_pin; 1323 unsigned int tx_pin;
1330 u8 bbp; 1324 u8 bbp;
1331 1325
1326 if (rf->channel <= 14) {
1327 info->tx_power1 = TXPOWER_G_TO_DEV(info->tx_power1);
1328 info->tx_power2 = TXPOWER_G_TO_DEV(info->tx_power2);
1329 } else {
1330 info->tx_power1 = TXPOWER_A_TO_DEV(info->tx_power1);
1331 info->tx_power2 = TXPOWER_A_TO_DEV(info->tx_power2);
1332 }
1333
1332 if (rt2x00_rf(rt2x00dev, RF2020) || 1334 if (rt2x00_rf(rt2x00dev, RF2020) ||
1333 rt2x00_rf(rt2x00dev, RF3020) || 1335 rt2x00_rf(rt2x00dev, RF3020) ||
1334 rt2x00_rf(rt2x00dev, RF3021) || 1336 rt2x00_rf(rt2x00dev, RF3021) ||
1335 rt2x00_rf(rt2x00dev, RF3022)) 1337 rt2x00_rf(rt2x00dev, RF3022) ||
1338 rt2x00_rf(rt2x00dev, RF3052))
1336 rt2800_config_channel_rf3xxx(rt2x00dev, conf, rf, info); 1339 rt2800_config_channel_rf3xxx(rt2x00dev, conf, rf, info);
1337 else 1340 else
1338 rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info); 1341 rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info);