aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-30 14:18:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-01 15:40:06 -0500
commit52cb5e978f505ba6436dfe1867da0d2818fdb9b7 (patch)
tree808f33dd46776a1f9c8befaee8a5557e9c10250a /drivers/net/wireless
parent38bb902921dc31c15a707b74ebc6896438bb357e (diff)
b43: N-PHY: add TX radio setup for newer PHYs
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/phy_n.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 1dace55d243a..78e0cf6c78ca 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1803,9 +1803,60 @@ static void b43_nphy_tx_cal_radio_setup(struct b43_wldev *dev)
1803{ 1803{
1804 struct b43_phy_n *nphy = dev->phy.n; 1804 struct b43_phy_n *nphy = dev->phy.n;
1805 u16 *save = nphy->tx_rx_cal_radio_saveregs; 1805 u16 *save = nphy->tx_rx_cal_radio_saveregs;
1806 u16 tmp;
1807 u8 offset, i;
1806 1808
1807 if (dev->phy.rev >= 3) { 1809 if (dev->phy.rev >= 3) {
1808 /* TODO */ 1810 for (i = 0; i < 2; i++) {
1811 tmp = (i == 0) ? 0x2000 : 0x3000;
1812 offset = i * 11;
1813
1814 save[offset + 0] = b43_radio_read16(dev, B2055_CAL_RVARCTL);
1815 save[offset + 1] = b43_radio_read16(dev, B2055_CAL_LPOCTL);
1816 save[offset + 2] = b43_radio_read16(dev, B2055_CAL_TS);
1817 save[offset + 3] = b43_radio_read16(dev, B2055_CAL_RCCALRTS);
1818 save[offset + 4] = b43_radio_read16(dev, B2055_CAL_RCALRTS);
1819 save[offset + 5] = b43_radio_read16(dev, B2055_PADDRV);
1820 save[offset + 6] = b43_radio_read16(dev, B2055_XOCTL1);
1821 save[offset + 7] = b43_radio_read16(dev, B2055_XOCTL2);
1822 save[offset + 8] = b43_radio_read16(dev, B2055_XOREGUL);
1823 save[offset + 9] = b43_radio_read16(dev, B2055_XOMISC);
1824 save[offset + 10] = b43_radio_read16(dev, B2055_PLL_LFC1);
1825
1826 if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) {
1827 b43_radio_write16(dev, tmp | B2055_CAL_RVARCTL, 0x0A);
1828 b43_radio_write16(dev, tmp | B2055_CAL_LPOCTL, 0x40);
1829 b43_radio_write16(dev, tmp | B2055_CAL_TS, 0x55);
1830 b43_radio_write16(dev, tmp | B2055_CAL_RCCALRTS, 0);
1831 b43_radio_write16(dev, tmp | B2055_CAL_RCALRTS, 0);
1832 if (nphy->ipa5g_on) {
1833 b43_radio_write16(dev, tmp | B2055_PADDRV, 4);
1834 b43_radio_write16(dev, tmp | B2055_XOCTL1, 1);
1835 } else {
1836 b43_radio_write16(dev, tmp | B2055_PADDRV, 0);
1837 b43_radio_write16(dev, tmp | B2055_XOCTL1, 0x2F);
1838 }
1839 b43_radio_write16(dev, tmp | B2055_XOCTL2, 0);
1840 } else {
1841 b43_radio_write16(dev, tmp | B2055_CAL_RVARCTL, 0x06);
1842 b43_radio_write16(dev, tmp | B2055_CAL_LPOCTL, 0x40);
1843 b43_radio_write16(dev, tmp | B2055_CAL_TS, 0x55);
1844 b43_radio_write16(dev, tmp | B2055_CAL_RCCALRTS, 0);
1845 b43_radio_write16(dev, tmp | B2055_CAL_RCALRTS, 0);
1846 b43_radio_write16(dev, tmp | B2055_XOCTL1, 0);
1847 if (nphy->ipa2g_on) {
1848 b43_radio_write16(dev, tmp | B2055_PADDRV, 6);
1849 b43_radio_write16(dev, tmp | B2055_XOCTL2,
1850 (dev->phy.rev < 5) ? 0x11 : 0x01);
1851 } else {
1852 b43_radio_write16(dev, tmp | B2055_PADDRV, 0);
1853 b43_radio_write16(dev, tmp | B2055_XOCTL2, 0);
1854 }
1855 }
1856 b43_radio_write16(dev, tmp | B2055_XOREGUL, 0);
1857 b43_radio_write16(dev, tmp | B2055_XOMISC, 0);
1858 b43_radio_write16(dev, tmp | B2055_PLL_LFC1, 0);
1859 }
1809 } else { 1860 } else {
1810 save[0] = b43_radio_read16(dev, B2055_C1_TX_RF_IQCAL1); 1861 save[0] = b43_radio_read16(dev, B2055_C1_TX_RF_IQCAL1);
1811 b43_radio_write16(dev, B2055_C1_TX_RF_IQCAL1, 0x29); 1862 b43_radio_write16(dev, B2055_C1_TX_RF_IQCAL1, 0x29);