aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2012-07-24 13:18:19 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-08-06 14:56:31 -0400
commitfa0f2b38607e19a77096173a8d592cff6f10b32e (patch)
treee6b9ea9522260a9846780516b448b17cdef2e27f /drivers/net/wireless/b43
parent858a455ba86b0b515d34972e68095ecd912c08cc (diff)
b43: N-PHY: update workarounds
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')
-rw-r--r--drivers/net/wireless/b43/phy_n.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index b92bb9c92ad1..40bb63d4c39e 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1916,7 +1916,7 @@ static void b43_nphy_workarounds_rev3plus(struct b43_wldev *dev)
1916 rx2tx_delays[6] = 1; 1916 rx2tx_delays[6] = 1;
1917 rx2tx_events[7] = 0x1F; 1917 rx2tx_events[7] = 0x1F;
1918 } 1918 }
1919 b43_nphy_set_rf_sequence(dev, 1, rx2tx_events, rx2tx_delays, 1919 b43_nphy_set_rf_sequence(dev, 0, rx2tx_events, rx2tx_delays,
1920 ARRAY_SIZE(rx2tx_events)); 1920 ARRAY_SIZE(rx2tx_events));
1921 } 1921 }
1922 1922
@@ -1926,8 +1926,13 @@ static void b43_nphy_workarounds_rev3plus(struct b43_wldev *dev)
1926 1926
1927 b43_phy_maskset(dev, 0x294, 0xF0FF, 0x0700); 1927 b43_phy_maskset(dev, 0x294, 0xF0FF, 0x0700);
1928 1928
1929 b43_ntab_write(dev, B43_NTAB32(16, 3), 0x18D); 1929 if (!dev->phy.is_40mhz) {
1930 b43_ntab_write(dev, B43_NTAB32(16, 127), 0x18D); 1930 b43_ntab_write(dev, B43_NTAB32(16, 3), 0x18D);
1931 b43_ntab_write(dev, B43_NTAB32(16, 127), 0x18D);
1932 } else {
1933 b43_ntab_write(dev, B43_NTAB32(16, 3), 0x14D);
1934 b43_ntab_write(dev, B43_NTAB32(16, 127), 0x14D);
1935 }
1931 1936
1932 b43_nphy_gain_ctl_workarounds(dev); 1937 b43_nphy_gain_ctl_workarounds(dev);
1933 1938
@@ -1963,13 +1968,14 @@ static void b43_nphy_workarounds_rev3plus(struct b43_wldev *dev)
1963 b43_ntab_write(dev, B43_NTAB32(30, 3), tmp32); 1968 b43_ntab_write(dev, B43_NTAB32(30, 3), tmp32);
1964 1969
1965 if (dev->phy.rev == 4 && 1970 if (dev->phy.rev == 4 &&
1966 b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) { 1971 b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) {
1967 b43_radio_write(dev, B2056_TX0 | B2056_TX_GMBB_IDAC, 1972 b43_radio_write(dev, B2056_TX0 | B2056_TX_GMBB_IDAC,
1968 0x70); 1973 0x70);
1969 b43_radio_write(dev, B2056_TX1 | B2056_TX_GMBB_IDAC, 1974 b43_radio_write(dev, B2056_TX1 | B2056_TX_GMBB_IDAC,
1970 0x70); 1975 0x70);
1971 } 1976 }
1972 1977
1978 /* Dropped probably-always-true condition */
1973 b43_phy_write(dev, 0x224, 0x03eb); 1979 b43_phy_write(dev, 0x224, 0x03eb);
1974 b43_phy_write(dev, 0x225, 0x03eb); 1980 b43_phy_write(dev, 0x225, 0x03eb);
1975 b43_phy_write(dev, 0x226, 0x0341); 1981 b43_phy_write(dev, 0x226, 0x0341);
@@ -1982,6 +1988,9 @@ static void b43_nphy_workarounds_rev3plus(struct b43_wldev *dev)
1982 b43_phy_write(dev, 0x22d, 0x042b); 1988 b43_phy_write(dev, 0x22d, 0x042b);
1983 b43_phy_write(dev, 0x22e, 0x0381); 1989 b43_phy_write(dev, 0x22e, 0x0381);
1984 b43_phy_write(dev, 0x22f, 0x0381); 1990 b43_phy_write(dev, 0x22f, 0x0381);
1991
1992 if (dev->phy.rev >= 6 && sprom->boardflags2_lo & B43_BFL2_SINGLEANT_CCK)
1993 ; /* TODO: 0x0080000000000000 HF */
1985} 1994}
1986 1995
1987static void b43_nphy_workarounds_rev1_2(struct b43_wldev *dev) 1996static void b43_nphy_workarounds_rev1_2(struct b43_wldev *dev)
@@ -1996,6 +2005,12 @@ static void b43_nphy_workarounds_rev1_2(struct b43_wldev *dev)
1996 u8 events2[7] = { 0x0, 0x3, 0x5, 0x4, 0x2, 0x1, 0x8 }; 2005 u8 events2[7] = { 0x0, 0x3, 0x5, 0x4, 0x2, 0x1, 0x8 };
1997 u8 delays2[7] = { 0x8, 0x6, 0x2, 0x4, 0x4, 0x6, 0x1 }; 2006 u8 delays2[7] = { 0x8, 0x6, 0x2, 0x4, 0x4, 0x6, 0x1 };
1998 2007
2008 if (sprom->boardflags2_lo & B43_BFL2_SKWRKFEM_BRD ||
2009 dev->dev->board_type == 0x8B) {
2010 delays1[0] = 0x1;
2011 delays1[5] = 0x14;
2012 }
2013
1999 if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ && 2014 if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ &&
2000 nphy->band5g_pwrgain) { 2015 nphy->band5g_pwrgain) {
2001 b43_radio_mask(dev, B2055_C1_TX_RF_SPARE, ~0x8); 2016 b43_radio_mask(dev, B2055_C1_TX_RF_SPARE, ~0x8);
@@ -2007,8 +2022,10 @@ static void b43_nphy_workarounds_rev1_2(struct b43_wldev *dev)
2007 2022
2008 b43_ntab_write(dev, B43_NTAB16(8, 0x00), 0x000A); 2023 b43_ntab_write(dev, B43_NTAB16(8, 0x00), 0x000A);
2009 b43_ntab_write(dev, B43_NTAB16(8, 0x10), 0x000A); 2024 b43_ntab_write(dev, B43_NTAB16(8, 0x10), 0x000A);
2010 b43_ntab_write(dev, B43_NTAB16(8, 0x02), 0xCDAA); 2025 if (dev->phy.rev < 3) {
2011 b43_ntab_write(dev, B43_NTAB16(8, 0x12), 0xCDAA); 2026 b43_ntab_write(dev, B43_NTAB16(8, 0x02), 0xCDAA);
2027 b43_ntab_write(dev, B43_NTAB16(8, 0x12), 0xCDAA);
2028 }
2012 2029
2013 if (dev->phy.rev < 2) { 2030 if (dev->phy.rev < 2) {
2014 b43_ntab_write(dev, B43_NTAB16(8, 0x08), 0x0000); 2031 b43_ntab_write(dev, B43_NTAB16(8, 0x08), 0x0000);
@@ -2024,11 +2041,6 @@ static void b43_nphy_workarounds_rev1_2(struct b43_wldev *dev)
2024 b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_LO2, 0x2D8); 2041 b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_LO2, 0x2D8);
2025 b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_UP2, 0x301); 2042 b43_phy_write(dev, B43_NPHY_RFCTL_LUT_TRSW_UP2, 0x301);
2026 2043
2027 if (sprom->boardflags2_lo & B43_BFL2_SKWRKFEM_BRD &&
2028 dev->dev->board_type == 0x8B) {
2029 delays1[0] = 0x1;
2030 delays1[5] = 0x14;
2031 }
2032 b43_nphy_set_rf_sequence(dev, 0, events1, delays1, 7); 2044 b43_nphy_set_rf_sequence(dev, 0, events1, delays1, 7);
2033 b43_nphy_set_rf_sequence(dev, 1, events2, delays2, 7); 2045 b43_nphy_set_rf_sequence(dev, 1, events2, delays2, 7);
2034 2046
@@ -2055,11 +2067,13 @@ static void b43_nphy_workarounds_rev1_2(struct b43_wldev *dev)
2055 b43_phy_write(dev, B43_NPHY_PHASETR_B1, 0xCD); 2067 b43_phy_write(dev, B43_NPHY_PHASETR_B1, 0xCD);
2056 b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20); 2068 b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20);
2057 2069
2058 b43_phy_mask(dev, B43_NPHY_PIL_DW1, 2070 if (dev->phy.rev < 3) {
2059 ~B43_NPHY_PIL_DW_64QAM & 0xFFFF); 2071 b43_phy_mask(dev, B43_NPHY_PIL_DW1,
2060 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B1, 0xB5); 2072 ~B43_NPHY_PIL_DW_64QAM & 0xFFFF);
2061 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B2, 0xA4); 2073 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B1, 0xB5);
2062 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B3, 0x00); 2074 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B2, 0xA4);
2075 b43_phy_write(dev, B43_NPHY_TXF_20CO_S2B3, 0x00);
2076 }
2063 2077
2064 if (dev->phy.rev == 2) 2078 if (dev->phy.rev == 2)
2065 b43_phy_set(dev, B43_NPHY_FINERX2_CGC, 2079 b43_phy_set(dev, B43_NPHY_FINERX2_CGC,