diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-01-17 18:21:17 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-19 16:44:18 -0500 |
commit | d41a3552f96673480d7913c170cab31fa00b7697 (patch) | |
tree | f2844ede63464b1e55767a2f236664533cc7e39c /drivers | |
parent | d713804c6032b95cd3035014e16fadebb9655c6f (diff) |
b43: N-PHY: add writing one element tables
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 95190d42372c..32f837049ef9 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -808,8 +808,7 @@ static void b43_nphy_stop_playback(struct b43_wldev *dev) | |||
808 | 808 | ||
809 | if (nphy->bb_mult_save & 0x80000000) { | 809 | if (nphy->bb_mult_save & 0x80000000) { |
810 | tmp = nphy->bb_mult_save & 0xFFFF; | 810 | tmp = nphy->bb_mult_save & 0xFFFF; |
811 | /* TODO: Write an N PHY Table with ID 15, length 1, offset 87, | 811 | b43_ntab_write(dev, B43_NTAB16(15, 87), tmp); |
812 | width 16 and data from tmp */ | ||
813 | nphy->bb_mult_save = 0; | 812 | nphy->bb_mult_save = 0; |
814 | } | 813 | } |
815 | 814 | ||
@@ -1486,13 +1485,11 @@ static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core) | |||
1486 | for (i = 0; i < 18; i++) { | 1485 | for (i = 0; i < 18; i++) { |
1487 | scale = (ladder_lo[i].percent * tmp) / 100; | 1486 | scale = (ladder_lo[i].percent * tmp) / 100; |
1488 | entry = ((scale & 0xFF) << 8) | ladder_lo[i].g_env; | 1487 | entry = ((scale & 0xFF) << 8) | ladder_lo[i].g_env; |
1489 | /* TODO: Write an N PHY Table with ID 15, length 1, | 1488 | b43_ntab_write(dev, B43_NTAB16(15, i), entry); |
1490 | offset i, width 16, and data entry */ | ||
1491 | 1489 | ||
1492 | scale = (ladder_iq[i].percent * tmp) / 100; | 1490 | scale = (ladder_iq[i].percent * tmp) / 100; |
1493 | entry = ((scale & 0xFF) << 8) | ladder_iq[i].g_env; | 1491 | entry = ((scale & 0xFF) << 8) | ladder_iq[i].g_env; |
1494 | /* TODO: Write an N PHY Table with ID 15, length 1, | 1492 | b43_ntab_write(dev, B43_NTAB16(15, i + 32), entry); |
1495 | offset i + 32, width 16, and data entry */ | ||
1496 | } | 1493 | } |
1497 | } | 1494 | } |
1498 | 1495 | ||
@@ -1590,10 +1587,8 @@ static void b43_nphy_tx_cal_phy_cleanup(struct b43_wldev *dev) | |||
1590 | b43_phy_write(dev, B43_NPHY_AFECTL_OVER1, regs[2]); | 1587 | b43_phy_write(dev, B43_NPHY_AFECTL_OVER1, regs[2]); |
1591 | b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[3]); | 1588 | b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[3]); |
1592 | b43_phy_write(dev, B43_NPHY_BBCFG, regs[4]); | 1589 | b43_phy_write(dev, B43_NPHY_BBCFG, regs[4]); |
1593 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 3, | 1590 | b43_ntab_write(dev, B43_NTAB16(8, 3), regs[5]); |
1594 | width 16, and data from regs[5] */ | 1591 | b43_ntab_write(dev, B43_NTAB16(8, 19), regs[6]); |
1595 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 19, | ||
1596 | width 16, and data from regs[6] */ | ||
1597 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[7]); | 1592 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[7]); |
1598 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[8]); | 1593 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[8]); |
1599 | b43_phy_write(dev, B43_NPHY_PAPD_EN0, regs[9]); | 1594 | b43_phy_write(dev, B43_NPHY_PAPD_EN0, regs[9]); |
@@ -1603,10 +1598,8 @@ static void b43_nphy_tx_cal_phy_cleanup(struct b43_wldev *dev) | |||
1603 | b43_phy_maskset(dev, B43_NPHY_AFECTL_C1, 0x0FFF, regs[0]); | 1598 | b43_phy_maskset(dev, B43_NPHY_AFECTL_C1, 0x0FFF, regs[0]); |
1604 | b43_phy_maskset(dev, B43_NPHY_AFECTL_C2, 0x0FFF, regs[1]); | 1599 | b43_phy_maskset(dev, B43_NPHY_AFECTL_C2, 0x0FFF, regs[1]); |
1605 | b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[2]); | 1600 | b43_phy_write(dev, B43_NPHY_AFECTL_OVER, regs[2]); |
1606 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 2, | 1601 | b43_ntab_write(dev, B43_NTAB16(8, 2), regs[3]); |
1607 | width 16, and data from regs[3] */ | 1602 | b43_ntab_write(dev, B43_NTAB16(8, 18), regs[4]); |
1608 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 18, | ||
1609 | width 16, and data from regs[4] */ | ||
1610 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[5]); | 1603 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, regs[5]); |
1611 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[6]); | 1604 | b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, regs[6]); |
1612 | } | 1605 | } |
@@ -1638,15 +1631,11 @@ static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev) | |||
1638 | /* TODO: Read an N PHY Table with ID 8, length 1, offset 3, | 1631 | /* TODO: Read an N PHY Table with ID 8, length 1, offset 3, |
1639 | width 16, and data pointing to tmp */ | 1632 | width 16, and data pointing to tmp */ |
1640 | regs[5] = tmp; | 1633 | regs[5] = tmp; |
1641 | 1634 | b43_ntab_write(dev, B43_NTAB16(8, 3), 0); | |
1642 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 3, | ||
1643 | width 16, and data 0 */ | ||
1644 | /* TODO: Read an N PHY Table with ID 8, length 1, offset 19, | 1635 | /* TODO: Read an N PHY Table with ID 8, length 1, offset 19, |
1645 | width 16, and data pointing to tmp */ | 1636 | width 16, and data pointing to tmp */ |
1646 | regs[6] = tmp; | 1637 | regs[6] = tmp; |
1647 | 1638 | b43_ntab_write(dev, B43_NTAB16(8, 19), 0); | |
1648 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 19, | ||
1649 | width 16, and data 0 */ | ||
1650 | regs[7] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1); | 1639 | regs[7] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1); |
1651 | regs[8] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2); | 1640 | regs[8] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2); |
1652 | 1641 | ||
@@ -1668,14 +1657,12 @@ static void b43_nphy_tx_cal_phy_setup(struct b43_wldev *dev) | |||
1668 | width 16, and data pointing to tmp */ | 1657 | width 16, and data pointing to tmp */ |
1669 | regs[3] = tmp; | 1658 | regs[3] = tmp; |
1670 | tmp |= 0x2000; | 1659 | tmp |= 0x2000; |
1671 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 2, | 1660 | b43_ntab_write(dev, B43_NTAB16(8, 2), tmp); |
1672 | width 16, and data pointer tmp */ | ||
1673 | /* TODO: Read an N PHY Table with ID 8, length 1, offset 18, | 1661 | /* TODO: Read an N PHY Table with ID 8, length 1, offset 18, |
1674 | width 16, and data pointer tmp */ | 1662 | width 16, and data pointer tmp */ |
1675 | regs[4] = tmp; | 1663 | regs[4] = tmp; |
1676 | tmp |= 0x2000; | 1664 | tmp |= 0x2000; |
1677 | /* TODO: Write an N PHY Table with ID 8, length 1, offset 18, | 1665 | b43_ntab_write(dev, B43_NTAB16(8, 18), tmp); |
1678 | width 16, and data pointer tmp */ | ||
1679 | regs[5] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1); | 1666 | regs[5] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC1); |
1680 | regs[6] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2); | 1667 | regs[6] = b43_phy_read(dev, B43_NPHY_RFCTL_INTC2); |
1681 | if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) | 1668 | if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) |
@@ -1900,9 +1887,8 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev, | |||
1900 | width 16, and data pointer buffer */ | 1887 | width 16, and data pointer buffer */ |
1901 | diq_start = buffer[0]; | 1888 | diq_start = buffer[0]; |
1902 | buffer[0] = 0; | 1889 | buffer[0] = 0; |
1903 | /* TODO: Write an N PHY Table with ID 15, | 1890 | b43_ntab_write(dev, B43_NTAB16(15, 69 + core), |
1904 | length 1, offset 69 + core, width 16, | 1891 | 0); |
1905 | and data of 0 */ | ||
1906 | } | 1892 | } |
1907 | 1893 | ||
1908 | b43_phy_write(dev, B43_NPHY_IQLOCAL_CMD, cmd); | 1894 | b43_phy_write(dev, B43_NPHY_IQLOCAL_CMD, cmd); |