aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-15 09:26:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-15 17:05:39 -0500
commit2faa6b832fb44b1910fe668a4ae127a69e998936 (patch)
treeda7cf0070d48742d1a6ca1113d0ef606d9954bbb
parent2f258b74d13c200944ef018c71ed9d9a7d4da0b0 (diff)
b43: N-PHY: implement RX IQ estimation
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.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 68c1582db712..776d0082ef1c 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -408,6 +408,45 @@ static void b43_nphy_reset_cca(struct b43_wldev *dev)
408 /* TODO: N PHY Force RF Seq with argument 2 */ 408 /* TODO: N PHY Force RF Seq with argument 2 */
409} 409}
410 410
411/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxIqEst */
412static void b43_nphy_rx_iq_est(struct b43_wldev *dev, struct nphy_iq_est *est,
413 u16 samps, u8 time, bool wait)
414{
415 int i;
416 u16 tmp;
417
418 b43_phy_write(dev, B43_NPHY_IQEST_SAMCNT, samps);
419 b43_phy_maskset(dev, B43_NPHY_IQEST_WT, ~B43_NPHY_IQEST_WT_VAL, time);
420 if (wait)
421 b43_phy_set(dev, B43_NPHY_IQEST_CMD, B43_NPHY_IQEST_CMD_MODE);
422 else
423 b43_phy_mask(dev, B43_NPHY_IQEST_CMD, ~B43_NPHY_IQEST_CMD_MODE);
424
425 b43_phy_set(dev, B43_NPHY_IQEST_CMD, B43_NPHY_IQEST_CMD_START);
426
427 for (i = 1000; i; i--) {
428 tmp = b43_phy_read(dev, B43_NPHY_IQEST_CMD);
429 if (!(tmp & B43_NPHY_IQEST_CMD_START)) {
430 est->i0_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_IPACC_HI0) << 16) |
431 b43_phy_read(dev, B43_NPHY_IQEST_IPACC_LO0);
432 est->q0_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_QPACC_HI0) << 16) |
433 b43_phy_read(dev, B43_NPHY_IQEST_QPACC_LO0);
434 est->iq0_prod = (b43_phy_read(dev, B43_NPHY_IQEST_IQACC_HI0) << 16) |
435 b43_phy_read(dev, B43_NPHY_IQEST_IQACC_LO0);
436
437 est->i1_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_IPACC_HI1) << 16) |
438 b43_phy_read(dev, B43_NPHY_IQEST_IPACC_LO1);
439 est->q1_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_QPACC_HI1) << 16) |
440 b43_phy_read(dev, B43_NPHY_IQEST_QPACC_LO1);
441 est->iq1_prod = (b43_phy_read(dev, B43_NPHY_IQEST_IQACC_HI1) << 16) |
442 b43_phy_read(dev, B43_NPHY_IQEST_IQACC_LO1);
443 return;
444 }
445 udelay(10);
446 }
447 memset(est, 0, sizeof(*est));
448}
449
411/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxIqCoeffs */ 450/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxIqCoeffs */
412static void b43_nphy_rx_iq_coeffs(struct b43_wldev *dev, bool write, 451static void b43_nphy_rx_iq_coeffs(struct b43_wldev *dev, bool write,
413 struct b43_phy_n_iq_comp *pcomp) 452 struct b43_phy_n_iq_comp *pcomp)