aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/phy_n.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-17 18:21:21 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-19 16:45:35 -0500
commit2581b1434ccba6960e0b671927d87c83b5152c9d (patch)
treeae46f7d6dc8d51de7b60bb96f65187458c92e4a7 /drivers/net/wireless/b43/phy_n.c
parentd41a3552f96673480d7913c170cab31fa00b7697 (diff)
b43: N-PHY: implement and add multi-dimensional table writing
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/phy_n.c')
-rw-r--r--drivers/net/wireless/b43/phy_n.c58
1 files changed, 25 insertions, 33 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 32f837049ef9..671fbcfdc0ec 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1699,8 +1699,7 @@ static void b43_nphy_restore_cal(struct b43_wldev *dev)
1699 loft = &nphy->cal_cache.txcal_coeffs_5G[5]; 1699 loft = &nphy->cal_cache.txcal_coeffs_5G[5];
1700 } 1700 }
1701 1701
1702 /* TODO: Write an N PHY table with ID 15, length 4, offset 80, 1702 b43_ntab_write_bulk(dev, B43_NTAB16(15, 80), 4, table);
1703 width 16, and data from table */
1704 1703
1705 for (i = 0; i < 4; i++) { 1704 for (i = 0; i < 4; i++) {
1706 if (dev->phy.rev >= 3) 1705 if (dev->phy.rev >= 3)
@@ -1709,12 +1708,9 @@ static void b43_nphy_restore_cal(struct b43_wldev *dev)
1709 coef[i] = 0; 1708 coef[i] = 0;
1710 } 1709 }
1711 1710
1712 /* TODO: Write an N PHY table with ID 15, length 4, offset 88, 1711 b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4, coef);
1713 width 16, and data from coef */ 1712 b43_ntab_write_bulk(dev, B43_NTAB16(15, 85), 2, loft);
1714 /* TODO: Write an N PHY table with ID 15, length 2, offset 85, 1713 b43_ntab_write_bulk(dev, B43_NTAB16(15, 93), 2, loft);
1715 width 16 and data from loft */
1716 /* TODO: Write an N PHY table with ID 15, length 2, offset 93,
1717 width 16 and data from loft */
1718 1714
1719 if (dev->phy.rev < 2) 1715 if (dev->phy.rev < 2)
1720 b43_nphy_tx_iq_workaround(dev); 1716 b43_nphy_tx_iq_workaround(dev);
@@ -1782,8 +1778,8 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
1782 b43_nphy_iq_cal_gain_params(dev, i, target, &params[i]); 1778 b43_nphy_iq_cal_gain_params(dev, i, target, &params[i]);
1783 gain[i] = params[i].cal_gain; 1779 gain[i] = params[i].cal_gain;
1784 } 1780 }
1785 /* TODO: Write an N PHY Table with ID 7, length 2, offset 0x110, 1781
1786 width 16, and data pointer gain */ 1782 b43_ntab_write_bulk(dev, B43_NTAB16(7, 0x110), 2, gain);
1787 1783
1788 b43_nphy_tx_cal_radio_setup(dev); 1784 b43_nphy_tx_cal_radio_setup(dev);
1789 b43_nphy_tx_cal_phy_setup(dev); 1785 b43_nphy_tx_cal_phy_setup(dev);
@@ -1833,8 +1829,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
1833 } 1829 }
1834 } 1830 }
1835 1831
1836 /* TODO: Write an N PHY Table with ID 15, length from above, 1832 b43_ntab_write_bulk(dev, B43_NTAB16(15, 64), length, table);
1837 offset 64, width 16, and the data pointer from above */
1838 1833
1839 if (full) { 1834 if (full) {
1840 if (dev->phy.rev >= 3) 1835 if (dev->phy.rev >= 3)
@@ -1902,9 +1897,8 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
1902 /* TODO: Read an N PHY Table with ID 15, 1897 /* TODO: Read an N PHY Table with ID 15,
1903 length table_length, offset 96, width 16, 1898 length table_length, offset 96, width 16,
1904 and data pointer buffer */ 1899 and data pointer buffer */
1905 /* TODO: Write an N PHY Table with ID 15, 1900 b43_ntab_write_bulk(dev, B43_NTAB16(15, 64), length,
1906 length table_length, offset 64, width 16, 1901 buffer);
1907 and data pointer buffer */
1908 1902
1909 if (type == 1 || type == 3 || type == 4) 1903 if (type == 1 || type == 3 || type == 4)
1910 buffer[0] = diq_start; 1904 buffer[0] = diq_start;
@@ -1916,8 +1910,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
1916 last = (dev->phy.rev < 3) ? 6 : 7; 1910 last = (dev->phy.rev < 3) ? 6 : 7;
1917 1911
1918 if (!mphase || nphy->mphase_cal_phase_id == last) { 1912 if (!mphase || nphy->mphase_cal_phase_id == last) {
1919 /* TODO: Write an N PHY Table with ID 15, length 4, 1913 b43_ntab_write_bulk(dev, B43_NTAB16(15, 96), 4, buffer);
1920 offset 96, width 16, and data pointer buffer */
1921 /* TODO: Read an N PHY Table with ID 15, length 4, 1914 /* TODO: Read an N PHY Table with ID 15, length 4,
1922 offset 80, width 16, and data pointer buffer */ 1915 offset 80, width 16, and data pointer buffer */
1923 if (dev->phy.rev < 3) { 1916 if (dev->phy.rev < 3) {
@@ -1926,14 +1919,14 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
1926 buffer[2] = 0; 1919 buffer[2] = 0;
1927 buffer[3] = 0; 1920 buffer[3] = 0;
1928 } 1921 }
1929 /* TODO: Write an N PHY Table with ID 15, length 4, 1922 b43_ntab_write_bulk(dev, B43_NTAB16(15, 88), 4,
1930 offset 88, width 16, and data pointer buffer */ 1923 buffer);
1931 /* TODO: Read an N PHY Table with ID 15, length 2, 1924 b43_ntab_write_bulk(dev, B43_NTAB16(15, 101), 2,
1932 offset 101, width 16, and data pointer buffer*/ 1925 buffer);
1933 /* TODO: Write an N PHY Table with ID 15, length 2, 1926 b43_ntab_write_bulk(dev, B43_NTAB16(15, 85), 2,
1934 offset 85, width 16, and data pointer buffer */ 1927 buffer);
1935 /* TODO: Write an N PHY Table with ID 15, length 2, 1928 b43_ntab_write_bulk(dev, B43_NTAB16(15, 93), 2,
1936 offset 93, width 16, and data pointer buffer */ 1929 buffer);
1937 length = 11; 1930 length = 11;
1938 if (dev->phy.rev < 3) 1931 if (dev->phy.rev < 3)
1939 length -= 2; 1932 length -= 2;
@@ -1957,8 +1950,7 @@ static int b43_nphy_cal_tx_iq_lo(struct b43_wldev *dev,
1957 } 1950 }
1958 1951
1959 b43_nphy_tx_cal_phy_cleanup(dev); 1952 b43_nphy_tx_cal_phy_cleanup(dev);
1960 /* TODO: Write an N PHY Table with ID 7, length 2, offset 0x110, 1953 b43_ntab_write_bulk(dev, B43_NTAB16(7, 0x110), 2, save);
1961 width 16, and data from save */
1962 1954
1963 if (dev->phy.rev < 2 && (!mphase || nphy->mphase_cal_phase_id == last)) 1955 if (dev->phy.rev < 2 && (!mphase || nphy->mphase_cal_phase_id == last))
1964 b43_nphy_tx_iq_workaround(dev); 1956 b43_nphy_tx_iq_workaround(dev);
@@ -2008,8 +2000,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
2008 b43_nphy_iq_cal_gain_params(dev, i, target, &cal_params[i]); 2000 b43_nphy_iq_cal_gain_params(dev, i, target, &cal_params[i]);
2009 cal_gain[i] = cal_params[i].cal_gain; 2001 cal_gain[i] = cal_params[i].cal_gain;
2010 } 2002 }
2011 /* TODO: Write an N PHY Table with ID 7, length 2, offset 0x110, 2003 b43_ntab_write_bulk(dev, B43_NTAB16(7, 0x110), 2, cal_gain);
2012 width 16, and data from cal_gain */
2013 2004
2014 for (i = 0; i < 2; i++) { 2005 for (i = 0; i < 2; i++) {
2015 if (i == 0) { 2006 if (i == 0) {
@@ -2147,8 +2138,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,
2147 2138
2148 /* TODO: Call N PHY RF Ctrl Override with 0x400, 0, 3, 1 as arguments*/ 2139 /* TODO: Call N PHY RF Ctrl Override with 0x400, 0, 3, 1 as arguments*/
2149 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RESET2RX); 2140 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RESET2RX);
2150 /* TODO: Write an N PHY Table with ID 7, length 2, offset 0x110, 2141 b43_ntab_write_bulk(dev, B43_NTAB16(7, 0x110), 2, gain_save);
2151 width 16, and data from gain_save */
2152 2142
2153 b43_nphy_stay_in_carrier_search(dev, 0); 2143 b43_nphy_stay_in_carrier_search(dev, 0);
2154 2144
@@ -2290,8 +2280,10 @@ int b43_phy_initn(struct b43_wldev *dev)
2290 if (phy->rev >= 3) { 2280 if (phy->rev >= 3) {
2291 /* TODO */ 2281 /* TODO */
2292 } else { 2282 } else {
2293 /* TODO Write an N PHY table with ID 26, length 128, offset 192, width 32, and the data from Rev 2 TX Power Control Table */ 2283 b43_ntab_write_bulk(dev, B43_NTAB32(26, 192), 128,
2294 /* TODO Write an N PHY table with ID 27, length 128, offset 192, width 32, and the data from Rev 2 TX Power Control Table */ 2284 b43_ntab_tx_gain_rev0_1_2);
2285 b43_ntab_write_bulk(dev, B43_NTAB32(27, 192), 128,
2286 b43_ntab_tx_gain_rev0_1_2);
2295 } 2287 }
2296 2288
2297 if (nphy->phyrxchain != 3) 2289 if (nphy->phyrxchain != 3)