diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-06-21 05:23:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-22 16:09:56 -0400 |
commit | e7ef5bc079672058dcb791a378dc3beb134bd84e (patch) | |
tree | ac9110dea09c5c79dd6fca6e772fa1bd37ac1bc0 /drivers | |
parent | 223c5a87851369de99fa6e6f22c443ed08a0332b (diff) |
ath9k: add fast_div_bias configuration for diversity group 1
The patch adds the missing configuration code for diversity
group 1.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 99f55b3f84e6..80bb04f950eb 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -1364,6 +1364,89 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf, | |||
1364 | default: | 1364 | default: |
1365 | break; | 1365 | break; |
1366 | } | 1366 | } |
1367 | } else if (ant_conf->div_group == 1) { | ||
1368 | /* Adjust the fast_div_bias based on main and alt_lna_conf */ | ||
1369 | switch ((ant_conf->main_lna_conf << 4) | | ||
1370 | ant_conf->alt_lna_conf) { | ||
1371 | case 0x01: /* A-B LNA2 */ | ||
1372 | ant_conf->fast_div_bias = 0x1; | ||
1373 | ant_conf->main_gaintb = 0; | ||
1374 | ant_conf->alt_gaintb = 0; | ||
1375 | break; | ||
1376 | case 0x02: /* A-B LNA1 */ | ||
1377 | ant_conf->fast_div_bias = 0x1; | ||
1378 | ant_conf->main_gaintb = 0; | ||
1379 | ant_conf->alt_gaintb = 0; | ||
1380 | break; | ||
1381 | case 0x03: /* A-B A+B */ | ||
1382 | ant_conf->fast_div_bias = 0x1; | ||
1383 | ant_conf->main_gaintb = 0; | ||
1384 | ant_conf->alt_gaintb = 0; | ||
1385 | break; | ||
1386 | case 0x10: /* LNA2 A-B */ | ||
1387 | if (!(antcomb->scan) && | ||
1388 | (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) | ||
1389 | ant_conf->fast_div_bias = 0x3f; | ||
1390 | else | ||
1391 | ant_conf->fast_div_bias = 0x1; | ||
1392 | ant_conf->main_gaintb = 0; | ||
1393 | ant_conf->alt_gaintb = 0; | ||
1394 | break; | ||
1395 | case 0x12: /* LNA2 LNA1 */ | ||
1396 | ant_conf->fast_div_bias = 0x1; | ||
1397 | ant_conf->main_gaintb = 0; | ||
1398 | ant_conf->alt_gaintb = 0; | ||
1399 | break; | ||
1400 | case 0x13: /* LNA2 A+B */ | ||
1401 | if (!(antcomb->scan) && | ||
1402 | (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) | ||
1403 | ant_conf->fast_div_bias = 0x3f; | ||
1404 | else | ||
1405 | ant_conf->fast_div_bias = 0x1; | ||
1406 | ant_conf->main_gaintb = 0; | ||
1407 | ant_conf->alt_gaintb = 0; | ||
1408 | break; | ||
1409 | case 0x20: /* LNA1 A-B */ | ||
1410 | if (!(antcomb->scan) && | ||
1411 | (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) | ||
1412 | ant_conf->fast_div_bias = 0x3f; | ||
1413 | else | ||
1414 | ant_conf->fast_div_bias = 0x1; | ||
1415 | ant_conf->main_gaintb = 0; | ||
1416 | ant_conf->alt_gaintb = 0; | ||
1417 | break; | ||
1418 | case 0x21: /* LNA1 LNA2 */ | ||
1419 | ant_conf->fast_div_bias = 0x1; | ||
1420 | ant_conf->main_gaintb = 0; | ||
1421 | ant_conf->alt_gaintb = 0; | ||
1422 | break; | ||
1423 | case 0x23: /* LNA1 A+B */ | ||
1424 | if (!(antcomb->scan) && | ||
1425 | (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) | ||
1426 | ant_conf->fast_div_bias = 0x3f; | ||
1427 | else | ||
1428 | ant_conf->fast_div_bias = 0x1; | ||
1429 | ant_conf->main_gaintb = 0; | ||
1430 | ant_conf->alt_gaintb = 0; | ||
1431 | break; | ||
1432 | case 0x30: /* A+B A-B */ | ||
1433 | ant_conf->fast_div_bias = 0x1; | ||
1434 | ant_conf->main_gaintb = 0; | ||
1435 | ant_conf->alt_gaintb = 0; | ||
1436 | break; | ||
1437 | case 0x31: /* A+B LNA2 */ | ||
1438 | ant_conf->fast_div_bias = 0x1; | ||
1439 | ant_conf->main_gaintb = 0; | ||
1440 | ant_conf->alt_gaintb = 0; | ||
1441 | break; | ||
1442 | case 0x32: /* A+B LNA1 */ | ||
1443 | ant_conf->fast_div_bias = 0x1; | ||
1444 | ant_conf->main_gaintb = 0; | ||
1445 | ant_conf->alt_gaintb = 0; | ||
1446 | break; | ||
1447 | default: | ||
1448 | break; | ||
1449 | } | ||
1367 | } else if (ant_conf->div_group == 2) { | 1450 | } else if (ant_conf->div_group == 2) { |
1368 | /* Adjust the fast_div_bias based on main and alt_lna_conf */ | 1451 | /* Adjust the fast_div_bias based on main and alt_lna_conf */ |
1369 | switch ((ant_conf->main_lna_conf << 4) | | 1452 | switch ((ant_conf->main_lna_conf << 4) | |