diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-12-12 17:40:22 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:47:51 -0500 |
commit | dd5f13b8a4b5f86e645e7e6662075004d116d5ad (patch) | |
tree | 47e1e81fa7ba55ffbcda8d2327385824ae6b711a | |
parent | 6a6865ef32065102a32ebe1a604d3b88426410fa (diff) |
b43: N-PHY: update TX power fix
Specs were updated.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 730f5a451de3..6b95fd29514f 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -475,7 +475,9 @@ static void b43_nphy_tx_power_fix(struct b43_wldev *dev) | |||
475 | if (nphy->hang_avoid) | 475 | if (nphy->hang_avoid) |
476 | b43_nphy_stay_in_carrier_search(dev, 1); | 476 | b43_nphy_stay_in_carrier_search(dev, 1); |
477 | 477 | ||
478 | if (dev->phy.rev >= 3) { | 478 | if (dev->phy.rev >= 7) { |
479 | txpi[0] = txpi[1] = 30; | ||
480 | } else if (dev->phy.rev >= 3) { | ||
479 | txpi[0] = 40; | 481 | txpi[0] = 40; |
480 | txpi[1] = 40; | 482 | txpi[1] = 40; |
481 | } else if (sprom->revision < 4) { | 483 | } else if (sprom->revision < 4) { |
@@ -499,6 +501,9 @@ static void b43_nphy_tx_power_fix(struct b43_wldev *dev) | |||
499 | txpi[1] = 91; | 501 | txpi[1] = 91; |
500 | } | 502 | } |
501 | } | 503 | } |
504 | if (dev->phy.rev < 7 && | ||
505 | (txpi[0] < 40 || txpi[0] > 100 || txpi[1] < 40 || txpi[1] > 10)) | ||
506 | txpi[0] = txpi[1] = 91; | ||
502 | 507 | ||
503 | /* | 508 | /* |
504 | for (i = 0; i < 2; i++) { | 509 | for (i = 0; i < 2; i++) { |
@@ -509,15 +514,31 @@ static void b43_nphy_tx_power_fix(struct b43_wldev *dev) | |||
509 | 514 | ||
510 | for (i = 0; i < 2; i++) { | 515 | for (i = 0; i < 2; i++) { |
511 | if (dev->phy.rev >= 3) { | 516 | if (dev->phy.rev >= 3) { |
512 | /* FIXME: support 5GHz */ | 517 | if (b43_nphy_ipa(dev)) { |
513 | txgain = b43_ntab_tx_gain_rev3plus_2ghz[txpi[i]]; | 518 | txgain = *(b43_nphy_get_ipa_gain_table(dev) + |
519 | txpi[i]); | ||
520 | } else if (b43_current_band(dev->wl) == | ||
521 | IEEE80211_BAND_5GHZ) { | ||
522 | /* FIXME: use 5GHz tables */ | ||
523 | txgain = | ||
524 | b43_ntab_tx_gain_rev3plus_2ghz[txpi[i]]; | ||
525 | } else { | ||
526 | if (dev->phy.rev >= 5 && | ||
527 | sprom->fem.ghz5.extpa_gain == 3) | ||
528 | ; /* FIXME: 5GHz_txgain_HiPwrEPA */ | ||
529 | txgain = | ||
530 | b43_ntab_tx_gain_rev3plus_2ghz[txpi[i]]; | ||
531 | } | ||
514 | radio_gain = (txgain >> 16) & 0x1FFFF; | 532 | radio_gain = (txgain >> 16) & 0x1FFFF; |
515 | } else { | 533 | } else { |
516 | txgain = b43_ntab_tx_gain_rev0_1_2[txpi[i]]; | 534 | txgain = b43_ntab_tx_gain_rev0_1_2[txpi[i]]; |
517 | radio_gain = (txgain >> 16) & 0x1FFF; | 535 | radio_gain = (txgain >> 16) & 0x1FFF; |
518 | } | 536 | } |
519 | 537 | ||
520 | dac_gain = (txgain >> 8) & 0x3F; | 538 | if (dev->phy.rev >= 7) |
539 | dac_gain = (txgain >> 8) & 0x7; | ||
540 | else | ||
541 | dac_gain = (txgain >> 8) & 0x3F; | ||
521 | bbmult = txgain & 0xFF; | 542 | bbmult = txgain & 0xFF; |
522 | 543 | ||
523 | if (dev->phy.rev >= 3) { | 544 | if (dev->phy.rev >= 3) { |
@@ -547,7 +568,8 @@ static void b43_nphy_tx_power_fix(struct b43_wldev *dev) | |||
547 | u32 tmp32; | 568 | u32 tmp32; |
548 | u16 reg = (i == 0) ? | 569 | u16 reg = (i == 0) ? |
549 | B43_NPHY_PAPD_EN0 : B43_NPHY_PAPD_EN1; | 570 | B43_NPHY_PAPD_EN0 : B43_NPHY_PAPD_EN1; |
550 | tmp32 = b43_ntab_read(dev, B43_NTAB32(26 + i, txpi[i])); | 571 | tmp32 = b43_ntab_read(dev, B43_NTAB32(26 + i, |
572 | 576 + txpi[i])); | ||
551 | b43_phy_maskset(dev, reg, 0xE00F, (u32) tmp32 << 4); | 573 | b43_phy_maskset(dev, reg, 0xE00F, (u32) tmp32 << 4); |
552 | b43_phy_set(dev, reg, 0x4); | 574 | b43_phy_set(dev, reg, 0x4); |
553 | } | 575 | } |