diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-02-04 06:23:10 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-08 16:50:55 -0500 |
commit | 984ff4ffb7fa36b9ac440a3802fd19658eccc84e (patch) | |
tree | ff1db376382dba4933766bebf3931d300eec0ae1 /drivers/net/wireless/b43 | |
parent | 67cbc3ed5b96a5acfddae142fa0e2adb1b6270d5 (diff) |
b43: N-PHY: prepare code for reapplying TX cal coeffs
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 8992457b0c0..3dd22bc527d 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -2587,6 +2587,39 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev, | |||
2587 | return error; | 2587 | return error; |
2588 | } | 2588 | } |
2589 | 2589 | ||
2590 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ReapplyTxCalCoeffs */ | ||
2591 | static void b43_nphy_reapply_tx_cal_coeffs(struct b43_wldev *dev) | ||
2592 | { | ||
2593 | struct b43_phy_n *nphy = dev->phy.n; | ||
2594 | u8 i; | ||
2595 | u16 buffer[7]; | ||
2596 | bool equal = true; | ||
2597 | |||
2598 | if (!nphy->txiqlocal_coeffsvalid || 1 /* FIXME */) | ||
2599 | return; | ||
2600 | |||
2601 | b43_ntab_read_bulk(dev, B43_NTAB16(15, 80), 7, buffer); | ||
2602 | for (i = 0; i < 4; i++) { | ||
2603 | if (buffer[i] != nphy->txiqlocal_bestc[i]) { | ||
2604 | equal = false; | ||
2605 | break; | ||
2606 | } | ||
2607 | } | ||
2608 | |||
2609 | if (!equal) { | ||
2610 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 80), 4, | ||
2611 | nphy->txiqlocal_bestc); | ||
2612 | for (i = 0; i < 4; i++) | ||
2613 | buffer[i] = 0; | ||
2614 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4, | ||
2615 | buffer); | ||
2616 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 85), 2, | ||
2617 | &nphy->txiqlocal_bestc[5]); | ||
2618 | b43_ntab_write_bulk(dev, B43_NTAB16(15, 93), 2, | ||
2619 | &nphy->txiqlocal_bestc[5]); | ||
2620 | } | ||
2621 | } | ||
2622 | |||
2590 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CalRxIqRev2 */ | 2623 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CalRxIqRev2 */ |
2591 | static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev, | 2624 | static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev, |
2592 | struct nphy_txgains target, u8 type, bool debug) | 2625 | struct nphy_txgains target, u8 type, bool debug) |
@@ -2617,7 +2650,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev, | |||
2617 | b43_nphy_stay_in_carrier_search(dev, 1); | 2650 | b43_nphy_stay_in_carrier_search(dev, 1); |
2618 | 2651 | ||
2619 | if (dev->phy.rev < 2) | 2652 | if (dev->phy.rev < 2) |
2620 | ;/* TODO: Call N PHY Reapply TX Cal Coeffs */ | 2653 | b43_nphy_reapply_tx_cal_coeffs(dev); |
2621 | b43_ntab_read_bulk(dev, B43_NTAB16(7, 0x110), 2, gain_save); | 2654 | b43_ntab_read_bulk(dev, B43_NTAB16(7, 0x110), 2, gain_save); |
2622 | for (i = 0; i < 2; i++) { | 2655 | for (i = 0; i < 2; i++) { |
2623 | b43_nphy_iq_cal_gain_params(dev, i, target, &cal_params[i]); | 2656 | b43_nphy_iq_cal_gain_params(dev, i, target, &cal_params[i]); |