diff options
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 58 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.c | 40 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.h | 2 |
3 files changed, 67 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, ¶ms[i]); | 1778 | b43_nphy_iq_cal_gain_params(dev, i, target, ¶ms[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) |
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c index 7dff853ab962..fc08be0b976e 100644 --- a/drivers/net/wireless/b43/tables_nphy.c +++ b/drivers/net/wireless/b43/tables_nphy.c | |||
@@ -2952,6 +2952,46 @@ void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value) | |||
2952 | assert_ntab_array_sizes(); | 2952 | assert_ntab_array_sizes(); |
2953 | } | 2953 | } |
2954 | 2954 | ||
2955 | void b43_ntab_write_bulk(struct b43_wldev *dev, u32 offset, | ||
2956 | unsigned int nr_elements, const void *_data) | ||
2957 | { | ||
2958 | u32 type, value; | ||
2959 | const u8 *data = _data; | ||
2960 | unsigned int i; | ||
2961 | |||
2962 | type = offset & B43_NTAB_TYPEMASK; | ||
2963 | offset &= ~B43_NTAB_TYPEMASK; | ||
2964 | B43_WARN_ON(offset > 0xFFFF); | ||
2965 | |||
2966 | b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset); | ||
2967 | |||
2968 | for (i = 0; i < nr_elements; i++) { | ||
2969 | switch (type) { | ||
2970 | case B43_NTAB_8BIT: | ||
2971 | value = *data; | ||
2972 | data++; | ||
2973 | B43_WARN_ON(value & ~0xFF); | ||
2974 | b43_phy_write(dev, B43_NPHY_TABLE_DATALO, value); | ||
2975 | break; | ||
2976 | case B43_NTAB_16BIT: | ||
2977 | value = *((u16 *)data); | ||
2978 | data += 2; | ||
2979 | B43_WARN_ON(value & ~0xFFFF); | ||
2980 | b43_phy_write(dev, B43_NPHY_TABLE_DATALO, value); | ||
2981 | break; | ||
2982 | case B43_NTAB_32BIT: | ||
2983 | value = *((u32 *)data); | ||
2984 | data += 4; | ||
2985 | b43_phy_write(dev, B43_NPHY_TABLE_DATAHI, value >> 16); | ||
2986 | b43_phy_write(dev, B43_NPHY_TABLE_DATALO, | ||
2987 | value & 0xFFFF); | ||
2988 | break; | ||
2989 | default: | ||
2990 | B43_WARN_ON(1); | ||
2991 | } | ||
2992 | } | ||
2993 | } | ||
2994 | |||
2955 | #define ntab_upload(dev, offset, data) do { \ | 2995 | #define ntab_upload(dev, offset, data) do { \ |
2956 | unsigned int i; \ | 2996 | unsigned int i; \ |
2957 | for (i = 0; i < (offset##_SIZE); i++) \ | 2997 | for (i = 0; i < (offset##_SIZE); i++) \ |
diff --git a/drivers/net/wireless/b43/tables_nphy.h b/drivers/net/wireless/b43/tables_nphy.h index 51636d02f8b1..d5605df5d6b8 100644 --- a/drivers/net/wireless/b43/tables_nphy.h +++ b/drivers/net/wireless/b43/tables_nphy.h | |||
@@ -143,6 +143,8 @@ b43_nphy_get_chantabent(struct b43_wldev *dev, u8 channel); | |||
143 | #define B43_NTAB_TX_IQLO_CAL_CMDS_FULLCAL_REV3 12 | 143 | #define B43_NTAB_TX_IQLO_CAL_CMDS_FULLCAL_REV3 12 |
144 | 144 | ||
145 | void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value); | 145 | void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value); |
146 | void b43_ntab_write_bulk(struct b43_wldev *dev, u32 offset, | ||
147 | unsigned int nr_elements, const void *_data); | ||
146 | 148 | ||
147 | void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev); | 149 | void b43_nphy_rev0_1_2_tables_init(struct b43_wldev *dev); |
148 | void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev); | 150 | void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev); |