diff options
author | Gábor Stefanik <netrolller.3d@gmail.com> | 2009-08-26 14:51:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:52 -0400 |
commit | 68ec53292c7f09056152efa9a6ee2591c794f08c (patch) | |
tree | d0b0441033a8a885c93f4b94ee4ee9eb044e0233 /drivers/net/wireless/b43/phy_lp.c | |
parent | d8fa338ee01e7de029d2441a8c2b9c5fbfeac82f (diff) |
b43: Fix and update LP-PHY code
-Fix a few nasty typos (b43_phy_* operations instead of b43_radio_*)
in the channel tune routines.
-Fix some typos & spec errors found by MMIO tracing.
-Optimize b43_phy_write & b43_phy_mask/set/maskset to use
only the minimal number of MMIO accesses. (Write is possible
using a single 32-bit MMIO write, while set/mask/maskset can
be done in 3 16-bit MMIOs).
-Set the default channel back to 1, as the bug forcing us to use
channel 7 is now fixed.
With this, the device comes up, scans, associates, transmits,
receives, monitors and injects on all channels - in other words,
it's fully functional. Sensitivity and TX power are still sub-optimal,
due to the lack of calibration (that's next on my list).
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/phy_lp.c')
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.c | 91 |
1 files changed, 50 insertions, 41 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c index 5306f2c66b34..1a57d3390e92 100644 --- a/drivers/net/wireless/b43/phy_lp.c +++ b/drivers/net/wireless/b43/phy_lp.c | |||
@@ -44,7 +44,7 @@ static inline u16 channel2freq_lp(u8 channel) | |||
44 | static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev) | 44 | static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev) |
45 | { | 45 | { |
46 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | 46 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |
47 | return 7; //FIXME temporary - channel 1 is broken | 47 | return 1; |
48 | return 36; | 48 | return 36; |
49 | } | 49 | } |
50 | 50 | ||
@@ -182,8 +182,8 @@ static void lpphy_adjust_gain_table(struct b43_wldev *dev, u32 freq) | |||
182 | temp[1] = temp[0] + 0x1000; | 182 | temp[1] = temp[0] + 0x1000; |
183 | temp[2] = temp[0] + 0x2000; | 183 | temp[2] = temp[0] + 0x2000; |
184 | 184 | ||
185 | b43_lptab_write_bulk(dev, B43_LPTAB16(12, 0), 3, temp); | ||
186 | b43_lptab_write_bulk(dev, B43_LPTAB16(13, 0), 3, temp); | 185 | b43_lptab_write_bulk(dev, B43_LPTAB16(13, 0), 3, temp); |
186 | b43_lptab_write_bulk(dev, B43_LPTAB16(12, 0), 3, temp); | ||
187 | } | 187 | } |
188 | 188 | ||
189 | static void lpphy_table_init(struct b43_wldev *dev) | 189 | static void lpphy_table_init(struct b43_wldev *dev) |
@@ -223,8 +223,8 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
223 | b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0xFF00, 0x0006); | 223 | b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0xFF00, 0x0006); |
224 | b43_phy_mask(dev, B43_LPPHY_RX_RADIO_CTL, 0xFFFE); | 224 | b43_phy_mask(dev, B43_LPPHY_RX_RADIO_CTL, 0xFFFE); |
225 | b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x0005); | 225 | b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x0005); |
226 | b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC10, 0x0180); | 226 | b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFC1F, 0x0180); |
227 | b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x3800); | 227 | b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x3C00); |
228 | b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xFFF0, 0x0005); | 228 | b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xFFF0, 0x0005); |
229 | b43_phy_maskset(dev, B43_LPPHY_GAIN_MISMATCH_LIMIT, 0xFFC0, 0x001A); | 229 | b43_phy_maskset(dev, B43_LPPHY_GAIN_MISMATCH_LIMIT, 0xFFC0, 0x001A); |
230 | b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0xFF00, 0x00B3); | 230 | b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0xFF00, 0x00B3); |
@@ -237,7 +237,7 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
237 | /* TODO: | 237 | /* TODO: |
238 | * Set the LDO voltage to 0x0028 - FIXME: What is this? | 238 | * Set the LDO voltage to 0x0028 - FIXME: What is this? |
239 | * Call sb_pmu_set_ldo_voltage with 4 and the LDO voltage | 239 | * Call sb_pmu_set_ldo_voltage with 4 and the LDO voltage |
240 | * as arguments | 240 | * as arguments |
241 | * Call sb_pmu_paref_ldo_enable with argument TRUE | 241 | * Call sb_pmu_paref_ldo_enable with argument TRUE |
242 | */ | 242 | */ |
243 | if (dev->phy.rev == 0) { | 243 | if (dev->phy.rev == 0) { |
@@ -340,11 +340,11 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev) | |||
340 | if (dev->phy.rev == 1) { | 340 | if (dev->phy.rev == 1) { |
341 | tmp = b43_phy_read(dev, B43_LPPHY_CLIPCTRTHRESH); | 341 | tmp = b43_phy_read(dev, B43_LPPHY_CLIPCTRTHRESH); |
342 | tmp2 = (tmp & 0x03E0) >> 5; | 342 | tmp2 = (tmp & 0x03E0) >> 5; |
343 | tmp2 |= tmp << 5; | 343 | tmp2 |= tmp2 << 5; |
344 | b43_phy_write(dev, B43_LPPHY_4C3, tmp2); | 344 | b43_phy_write(dev, B43_LPPHY_4C3, tmp2); |
345 | tmp = b43_phy_read(dev, B43_LPPHY_OFDMSYNCTHRESH0); | 345 | tmp = b43_phy_read(dev, B43_LPPHY_GAINDIRECTMISMATCH); |
346 | tmp2 = (tmp & 0x1F00) >> 8; | 346 | tmp2 = (tmp & 0x1F00) >> 8; |
347 | tmp2 |= tmp << 5; | 347 | tmp2 |= tmp2 << 5; |
348 | b43_phy_write(dev, B43_LPPHY_4C4, tmp2); | 348 | b43_phy_write(dev, B43_LPPHY_4C4, tmp2); |
349 | tmp = b43_phy_read(dev, B43_LPPHY_VERYLOWGAINDB); | 349 | tmp = b43_phy_read(dev, B43_LPPHY_VERYLOWGAINDB); |
350 | tmp2 = tmp & 0x00FF; | 350 | tmp2 = tmp & 0x00FF; |
@@ -761,7 +761,7 @@ static void lpphy_disable_crs(struct b43_wldev *dev, bool user) | |||
761 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x3); | 761 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x3); |
762 | b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xFFFB); | 762 | b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xFFFB); |
763 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x4); | 763 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x4); |
764 | b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_0, 0xFFF7); | 764 | b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xFFF7); |
765 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x8); | 765 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x8); |
766 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0x10); | 766 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0x10); |
767 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x10); | 767 | b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x10); |
@@ -956,7 +956,7 @@ static void lpphy_run_ddfs(struct b43_wldev *dev, int i_on, int q_on, | |||
956 | b43_phy_maskset(dev, B43_LPPHY_AFE_DDFS, 0xFF9F, scale_idx << 5); | 956 | b43_phy_maskset(dev, B43_LPPHY_AFE_DDFS, 0xFF9F, scale_idx << 5); |
957 | b43_phy_mask(dev, B43_LPPHY_AFE_DDFS, 0xFFFB); | 957 | b43_phy_mask(dev, B43_LPPHY_AFE_DDFS, 0xFFFB); |
958 | b43_phy_set(dev, B43_LPPHY_AFE_DDFS, 0x2); | 958 | b43_phy_set(dev, B43_LPPHY_AFE_DDFS, 0x2); |
959 | b43_phy_set(dev, B43_LPPHY_AFE_DDFS, 0x20); | 959 | b43_phy_set(dev, B43_LPPHY_LP_PHY_CTL, 0x20); |
960 | } | 960 | } |
961 | 961 | ||
962 | static bool lpphy_rx_iq_est(struct b43_wldev *dev, u16 samples, u8 time, | 962 | static bool lpphy_rx_iq_est(struct b43_wldev *dev, u16 samples, u8 time, |
@@ -968,7 +968,7 @@ static bool lpphy_rx_iq_est(struct b43_wldev *dev, u16 samples, u8 time, | |||
968 | b43_phy_write(dev, B43_LPPHY_IQ_NUM_SMPLS_ADDR, samples); | 968 | b43_phy_write(dev, B43_LPPHY_IQ_NUM_SMPLS_ADDR, samples); |
969 | b43_phy_maskset(dev, B43_LPPHY_IQ_ENABLE_WAIT_TIME_ADDR, 0xFF00, time); | 969 | b43_phy_maskset(dev, B43_LPPHY_IQ_ENABLE_WAIT_TIME_ADDR, 0xFF00, time); |
970 | b43_phy_mask(dev, B43_LPPHY_IQ_ENABLE_WAIT_TIME_ADDR, 0xFEFF); | 970 | b43_phy_mask(dev, B43_LPPHY_IQ_ENABLE_WAIT_TIME_ADDR, 0xFEFF); |
971 | b43_phy_set(dev, B43_LPPHY_IQ_ENABLE_WAIT_TIME_ADDR, 0xFDFF); | 971 | b43_phy_set(dev, B43_LPPHY_IQ_ENABLE_WAIT_TIME_ADDR, 0x200); |
972 | 972 | ||
973 | for (i = 0; i < 500; i++) { | 973 | for (i = 0; i < 500; i++) { |
974 | if (!(b43_phy_read(dev, | 974 | if (!(b43_phy_read(dev, |
@@ -1135,9 +1135,9 @@ static void lpphy_set_tx_power_control(struct b43_wldev *dev, | |||
1135 | } | 1135 | } |
1136 | if (dev->phy.rev >= 2) { | 1136 | if (dev->phy.rev >= 2) { |
1137 | if (mode == B43_LPPHY_TXPCTL_HW) | 1137 | if (mode == B43_LPPHY_TXPCTL_HW) |
1138 | b43_phy_maskset(dev, B43_PHY_OFDM(0xD0), 0xFD, 0x2); | 1138 | b43_phy_set(dev, B43_PHY_OFDM(0xD0), 0x2); |
1139 | else | 1139 | else |
1140 | b43_phy_maskset(dev, B43_PHY_OFDM(0xD0), 0xFD, 0); | 1140 | b43_phy_mask(dev, B43_PHY_OFDM(0xD0), 0xFFFD); |
1141 | } | 1141 | } |
1142 | lpphy_write_tx_pctl_mode_to_hardware(dev); | 1142 | lpphy_write_tx_pctl_mode_to_hardware(dev); |
1143 | } | 1143 | } |
@@ -1169,7 +1169,7 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev) | |||
1169 | err = b43_lpphy_op_switch_channel(dev, 7); | 1169 | err = b43_lpphy_op_switch_channel(dev, 7); |
1170 | if (err) { | 1170 | if (err) { |
1171 | b43dbg(dev->wl, | 1171 | b43dbg(dev->wl, |
1172 | "RC calib: Failed to switch to channel 7, error = %d", | 1172 | "RC calib: Failed to switch to channel 7, error = %d\n", |
1173 | err); | 1173 | err); |
1174 | } | 1174 | } |
1175 | old_txg_ovr = !!(b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) & 0x40); | 1175 | old_txg_ovr = !!(b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) & 0x40); |
@@ -1500,8 +1500,15 @@ static u16 b43_lpphy_op_read(struct b43_wldev *dev, u16 reg) | |||
1500 | 1500 | ||
1501 | static void b43_lpphy_op_write(struct b43_wldev *dev, u16 reg, u16 value) | 1501 | static void b43_lpphy_op_write(struct b43_wldev *dev, u16 reg, u16 value) |
1502 | { | 1502 | { |
1503 | b43_write32(dev, B43_MMIO_PHY_CONTROL, ((u32)value << 16) | reg); | ||
1504 | } | ||
1505 | |||
1506 | static void b43_lpphy_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask, | ||
1507 | u16 set) | ||
1508 | { | ||
1503 | b43_write16(dev, B43_MMIO_PHY_CONTROL, reg); | 1509 | b43_write16(dev, B43_MMIO_PHY_CONTROL, reg); |
1504 | b43_write16(dev, B43_MMIO_PHY_DATA, value); | 1510 | b43_write16(dev, B43_MMIO_PHY_DATA, |
1511 | (b43_read16(dev, B43_MMIO_PHY_DATA) & mask) | set); | ||
1505 | } | 1512 | } |
1506 | 1513 | ||
1507 | static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev, u16 reg) | 1514 | static u16 b43_lpphy_op_radio_read(struct b43_wldev *dev, u16 reg) |
@@ -1920,8 +1927,8 @@ static void lpphy_b2062_reset_pll_bias(struct b43_wldev *dev) | |||
1920 | 1927 | ||
1921 | static void lpphy_b2062_vco_calib(struct b43_wldev *dev) | 1928 | static void lpphy_b2062_vco_calib(struct b43_wldev *dev) |
1922 | { | 1929 | { |
1923 | b43_phy_write(dev, B2062_S_RFPLL_CTL21, 0x42); | 1930 | b43_radio_write(dev, B2062_S_RFPLL_CTL21, 0x42); |
1924 | b43_phy_write(dev, B2062_S_RFPLL_CTL21, 0x62); | 1931 | b43_radio_write(dev, B2062_S_RFPLL_CTL21, 0x62); |
1925 | udelay(200); | 1932 | udelay(200); |
1926 | } | 1933 | } |
1927 | 1934 | ||
@@ -1980,7 +1987,7 @@ static int lpphy_b2062_tune(struct b43_wldev *dev, | |||
1980 | tmp6 = tmp5 / tmp4; | 1987 | tmp6 = tmp5 / tmp4; |
1981 | tmp7 = tmp5 % tmp4; | 1988 | tmp7 = tmp5 % tmp4; |
1982 | b43_radio_write(dev, B2062_S_RFPLL_CTL29, tmp6 + ((2 * tmp7) / tmp4)); | 1989 | b43_radio_write(dev, B2062_S_RFPLL_CTL29, tmp6 + ((2 * tmp7) / tmp4)); |
1983 | tmp8 = b43_phy_read(dev, B2062_S_RFPLL_CTL19); | 1990 | tmp8 = b43_radio_read(dev, B2062_S_RFPLL_CTL19); |
1984 | tmp9 = ((2 * tmp3 * (tmp8 + 1)) + (3 * tmp1)) / (6 * tmp1); | 1991 | tmp9 = ((2 * tmp3 * (tmp8 + 1)) + (3 * tmp1)) / (6 * tmp1); |
1985 | b43_radio_write(dev, B2062_S_RFPLL_CTL23, (tmp9 >> 8) + 16); | 1992 | b43_radio_write(dev, B2062_S_RFPLL_CTL23, (tmp9 >> 8) + 16); |
1986 | b43_radio_write(dev, B2062_S_RFPLL_CTL24, tmp9 & 0xFF); | 1993 | b43_radio_write(dev, B2062_S_RFPLL_CTL24, tmp9 & 0xFF); |
@@ -2019,17 +2026,17 @@ static void lpphy_b2063_vco_calib(struct b43_wldev *dev) | |||
2019 | { | 2026 | { |
2020 | u16 tmp; | 2027 | u16 tmp; |
2021 | 2028 | ||
2022 | b43_phy_mask(dev, B2063_PLL_SP1, ~0x40); | 2029 | b43_radio_mask(dev, B2063_PLL_SP1, ~0x40); |
2023 | tmp = b43_phy_read(dev, B2063_PLL_JTAG_CALNRST) & 0xF8; | 2030 | tmp = b43_radio_read(dev, B2063_PLL_JTAG_CALNRST) & 0xF8; |
2024 | b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp); | 2031 | b43_radio_write(dev, B2063_PLL_JTAG_CALNRST, tmp); |
2025 | udelay(1); | 2032 | udelay(1); |
2026 | b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x4); | 2033 | b43_radio_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x4); |
2027 | udelay(1); | 2034 | udelay(1); |
2028 | b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x6); | 2035 | b43_radio_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x6); |
2029 | udelay(1); | 2036 | udelay(1); |
2030 | b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x7); | 2037 | b43_radio_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x7); |
2031 | udelay(300); | 2038 | udelay(300); |
2032 | b43_phy_set(dev, B2063_PLL_SP1, 0x40); | 2039 | b43_radio_set(dev, B2063_PLL_SP1, 0x40); |
2033 | } | 2040 | } |
2034 | 2041 | ||
2035 | static int lpphy_b2063_tune(struct b43_wldev *dev, | 2042 | static int lpphy_b2063_tune(struct b43_wldev *dev, |
@@ -2124,31 +2131,31 @@ static int lpphy_b2063_tune(struct b43_wldev *dev, | |||
2124 | scale = 0; | 2131 | scale = 0; |
2125 | tmp5 = ((tmp4 + (tmp3 >> 1)) / tmp3) - 8; | 2132 | tmp5 = ((tmp4 + (tmp3 >> 1)) / tmp3) - 8; |
2126 | } | 2133 | } |
2127 | b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFC0, tmp5); | 2134 | b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFC0, tmp5); |
2128 | b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFBF, scale << 6); | 2135 | b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFBF, scale << 6); |
2129 | 2136 | ||
2130 | tmp6 = lpphy_qdiv_roundup(100 * val1, val3, 16); | 2137 | tmp6 = lpphy_qdiv_roundup(100 * val1, val3, 16); |
2131 | tmp6 *= (tmp5 * 8) * (scale + 1); | 2138 | tmp6 *= (tmp5 * 8) * (scale + 1); |
2132 | if (tmp6 > 150) | 2139 | if (tmp6 > 150) |
2133 | tmp6 = 0; | 2140 | tmp6 = 0; |
2134 | 2141 | ||
2135 | b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFE0, tmp6); | 2142 | b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFE0, tmp6); |
2136 | b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFDF, scale << 5); | 2143 | b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFDF, scale << 5); |
2137 | 2144 | ||
2138 | b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFFFB, 0x4); | 2145 | b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFFFB, 0x4); |
2139 | if (crystal_freq > 26000000) | 2146 | if (crystal_freq > 26000000) |
2140 | b43_phy_set(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0x2); | 2147 | b43_radio_set(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0x2); |
2141 | else | 2148 | else |
2142 | b43_phy_mask(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFD); | 2149 | b43_radio_mask(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFD); |
2143 | 2150 | ||
2144 | if (val1 == 45) | 2151 | if (val1 == 45) |
2145 | b43_phy_set(dev, B2063_PLL_JTAG_PLL_VCO1, 0x2); | 2152 | b43_radio_set(dev, B2063_PLL_JTAG_PLL_VCO1, 0x2); |
2146 | else | 2153 | else |
2147 | b43_phy_mask(dev, B2063_PLL_JTAG_PLL_VCO1, 0xFD); | 2154 | b43_radio_mask(dev, B2063_PLL_JTAG_PLL_VCO1, 0xFD); |
2148 | 2155 | ||
2149 | b43_phy_set(dev, B2063_PLL_SP2, 0x3); | 2156 | b43_radio_set(dev, B2063_PLL_SP2, 0x3); |
2150 | udelay(1); | 2157 | udelay(1); |
2151 | b43_phy_mask(dev, B2063_PLL_SP2, 0xFFFC); | 2158 | b43_radio_mask(dev, B2063_PLL_SP2, 0xFFFC); |
2152 | lpphy_b2063_vco_calib(dev); | 2159 | lpphy_b2063_vco_calib(dev); |
2153 | b43_radio_write(dev, B2063_COMM15, old_comm15); | 2160 | b43_radio_write(dev, B2063_COMM15, old_comm15); |
2154 | 2161 | ||
@@ -2158,10 +2165,9 @@ static int lpphy_b2063_tune(struct b43_wldev *dev, | |||
2158 | static int b43_lpphy_op_switch_channel(struct b43_wldev *dev, | 2165 | static int b43_lpphy_op_switch_channel(struct b43_wldev *dev, |
2159 | unsigned int new_channel) | 2166 | unsigned int new_channel) |
2160 | { | 2167 | { |
2168 | struct b43_phy_lp *lpphy = dev->phy.lp; | ||
2161 | int err; | 2169 | int err; |
2162 | 2170 | ||
2163 | b43_write16(dev, B43_MMIO_CHANNEL, new_channel); | ||
2164 | |||
2165 | if (dev->phy.radio_ver == 0x2063) { | 2171 | if (dev->phy.radio_ver == 0x2063) { |
2166 | err = lpphy_b2063_tune(dev, new_channel); | 2172 | err = lpphy_b2063_tune(dev, new_channel); |
2167 | if (err) | 2173 | if (err) |
@@ -2174,6 +2180,9 @@ static int b43_lpphy_op_switch_channel(struct b43_wldev *dev, | |||
2174 | lpphy_adjust_gain_table(dev, channel2freq_lp(new_channel)); | 2180 | lpphy_adjust_gain_table(dev, channel2freq_lp(new_channel)); |
2175 | } | 2181 | } |
2176 | 2182 | ||
2183 | lpphy->channel = new_channel; | ||
2184 | b43_write16(dev, B43_MMIO_CHANNEL, new_channel); | ||
2185 | |||
2177 | return 0; | 2186 | return 0; |
2178 | } | 2187 | } |
2179 | 2188 | ||
@@ -2185,10 +2194,9 @@ static int b43_lpphy_op_init(struct b43_wldev *dev) | |||
2185 | lpphy_baseband_init(dev); | 2194 | lpphy_baseband_init(dev); |
2186 | lpphy_radio_init(dev); | 2195 | lpphy_radio_init(dev); |
2187 | lpphy_calibrate_rc(dev); | 2196 | lpphy_calibrate_rc(dev); |
2188 | err = b43_lpphy_op_switch_channel(dev, | 2197 | err = b43_lpphy_op_switch_channel(dev, 7); |
2189 | b43_lpphy_op_get_default_chan(dev)); | ||
2190 | if (err) { | 2198 | if (err) { |
2191 | b43dbg(dev->wl, "Switch to init channel failed, error = %d.\n", | 2199 | b43dbg(dev->wl, "Switch to channel 7 failed, error = %d.\n", |
2192 | err); | 2200 | err); |
2193 | } | 2201 | } |
2194 | lpphy_tx_pctl_init(dev); | 2202 | lpphy_tx_pctl_init(dev); |
@@ -2222,6 +2230,7 @@ const struct b43_phy_operations b43_phyops_lp = { | |||
2222 | .init = b43_lpphy_op_init, | 2230 | .init = b43_lpphy_op_init, |
2223 | .phy_read = b43_lpphy_op_read, | 2231 | .phy_read = b43_lpphy_op_read, |
2224 | .phy_write = b43_lpphy_op_write, | 2232 | .phy_write = b43_lpphy_op_write, |
2233 | .phy_maskset = b43_lpphy_op_maskset, | ||
2225 | .radio_read = b43_lpphy_op_radio_read, | 2234 | .radio_read = b43_lpphy_op_radio_read, |
2226 | .radio_write = b43_lpphy_op_radio_write, | 2235 | .radio_write = b43_lpphy_op_radio_write, |
2227 | .software_rfkill = b43_lpphy_op_software_rfkill, | 2236 | .software_rfkill = b43_lpphy_op_software_rfkill, |