Lines Matching refs:dev
33 void b43_wa_initgains(struct b43_wldev *dev) in b43_wa_initgains() argument
35 struct b43_phy *phy = &dev->phy; in b43_wa_initgains()
37 b43_phy_write(dev, B43_PHY_LNAHPFCTL, 0x1FF9); in b43_wa_initgains()
38 b43_phy_mask(dev, B43_PHY_LPFGAINCTL, 0xFF0F); in b43_wa_initgains()
40 b43_ofdmtab_write16(dev, B43_OFDMTAB_LPFGAIN, 0, 0x1FBF); in b43_wa_initgains()
41 b43_radio_write16(dev, 0x0002, 0x1FBF); in b43_wa_initgains()
43 b43_phy_write(dev, 0x0024, 0x4680); in b43_wa_initgains()
44 b43_phy_write(dev, 0x0020, 0x0003); in b43_wa_initgains()
45 b43_phy_write(dev, 0x001D, 0x0F40); in b43_wa_initgains()
46 b43_phy_write(dev, 0x001F, 0x1C00); in b43_wa_initgains()
48 b43_phy_maskset(dev, 0x002A, 0x00FF, 0x0400); in b43_wa_initgains()
50 b43_phy_maskset(dev, 0x002A, 0x00FF, 0x1A00); in b43_wa_initgains()
51 b43_phy_write(dev, 0x00CC, 0x2121); in b43_wa_initgains()
54 b43_phy_write(dev, 0x00BA, 0x3ED5); in b43_wa_initgains()
57 static void b43_wa_rssi_lt(struct b43_wldev *dev) /* RSSI lookup table */ in b43_wa_rssi_lt() argument
63 b43_ofdmtab_write16(dev, B43_OFDMTAB_RSSI, i, i + 8); in b43_wa_rssi_lt()
65 b43_ofdmtab_write16(dev, B43_OFDMTAB_RSSI, i, i - 8); in b43_wa_rssi_lt()
68 b43_ofdmtab_write16(dev, B43_OFDMTAB_RSSI, i, i); in b43_wa_rssi_lt()
72 static void b43_wa_analog(struct b43_wldev *dev) in b43_wa_analog() argument
76 ofdmrev = b43_phy_read(dev, B43_PHY_VERSION_OFDM) & B43_PHYVER_VERSION; in b43_wa_analog()
78 b43_phy_write(dev, B43_PHY_PWRDOWN, 0x1000); in b43_wa_analog()
80 b43_ofdmtab_write16(dev, B43_OFDMTAB_DAC, 3, 0x1044); in b43_wa_analog()
81 b43_ofdmtab_write16(dev, B43_OFDMTAB_DAC, 4, 0x7201); in b43_wa_analog()
82 b43_ofdmtab_write16(dev, B43_OFDMTAB_DAC, 6, 0x0040); in b43_wa_analog()
86 static void b43_wa_fft(struct b43_wldev *dev) /* Fine frequency table */ in b43_wa_fft() argument
91 b43_ofdmtab_write16(dev, B43_OFDMTAB_DACRFPABB, i, in b43_wa_fft()
95 static void b43_wa_nft(struct b43_wldev *dev) /* Noise figure table */ in b43_wa_nft() argument
97 struct b43_phy *phy = &dev->phy; in b43_wa_nft()
102 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC2, i, in b43_wa_nft()
106 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC2, i, in b43_wa_nft()
110 static void b43_wa_rt(struct b43_wldev *dev) /* Rotor table */ in b43_wa_rt() argument
115 b43_ofdmtab_write32(dev, B43_OFDMTAB_ROTOR, i, b43_tab_rotor[i]); in b43_wa_rt()
118 static void b43_write_nst(struct b43_wldev *dev, const u16 *nst) in b43_write_nst() argument
123 b43_ofdmtab_write16(dev, B43_OFDMTAB_NOISESCALE, i, nst[i]); in b43_write_nst()
126 static void b43_wa_nst(struct b43_wldev *dev) /* Noise scale table */ in b43_wa_nst() argument
128 struct b43_phy *phy = &dev->phy; in b43_wa_nst()
131 if (b43_phy_read(dev, B43_PHY_ENCORE) & B43_PHY_ENCORE_EN) in b43_wa_nst()
132 b43_write_nst(dev, b43_tab_noisescaleg3); in b43_wa_nst()
134 b43_write_nst(dev, b43_tab_noisescaleg2); in b43_wa_nst()
136 b43_write_nst(dev, b43_tab_noisescaleg1); in b43_wa_nst()
140 static void b43_wa_art(struct b43_wldev *dev) /* ADV retard table */ in b43_wa_art() argument
145 b43_ofdmtab_write32(dev, B43_OFDMTAB_ADVRETARD, in b43_wa_art()
149 static void b43_wa_msst(struct b43_wldev *dev) /* Min sigma square table */ in b43_wa_msst() argument
151 struct b43_phy *phy = &dev->phy; in b43_wa_msst()
163 b43_ofdmtab_write16(dev, B43_OFDMTAB_MINSIGSQ, in b43_wa_msst()
168 static void b43_wa_crs_ed(struct b43_wldev *dev) in b43_wa_crs_ed() argument
170 struct b43_phy *phy = &dev->phy; in b43_wa_crs_ed()
173 b43_phy_write(dev, B43_PHY_CRSTHRES1_R1, 0x4F19); in b43_wa_crs_ed()
175 b43_phy_write(dev, B43_PHY_CRSTHRES1, 0x1861); in b43_wa_crs_ed()
176 b43_phy_write(dev, B43_PHY_CRSTHRES2, 0x0271); in b43_wa_crs_ed()
177 b43_phy_set(dev, B43_PHY_ANTDWELL, 0x0800); in b43_wa_crs_ed()
179 b43_phy_write(dev, B43_PHY_CRSTHRES1, 0x0098); in b43_wa_crs_ed()
180 b43_phy_write(dev, B43_PHY_CRSTHRES2, 0x0070); in b43_wa_crs_ed()
181 b43_phy_write(dev, B43_PHY_OFDM(0xC9), 0x0080); in b43_wa_crs_ed()
182 b43_phy_set(dev, B43_PHY_ANTDWELL, 0x0800); in b43_wa_crs_ed()
186 static void b43_wa_crs_thr(struct b43_wldev *dev) in b43_wa_crs_thr() argument
188 b43_phy_maskset(dev, B43_PHY_CRS0, ~0x03C0, 0xD000); in b43_wa_crs_thr()
191 static void b43_wa_crs_blank(struct b43_wldev *dev) in b43_wa_crs_blank() argument
193 b43_phy_write(dev, B43_PHY_OFDM(0x2C), 0x005A); in b43_wa_crs_blank()
196 static void b43_wa_cck_shiftbits(struct b43_wldev *dev) in b43_wa_cck_shiftbits() argument
198 b43_phy_write(dev, B43_PHY_CCKSHIFTBITS, 0x0026); in b43_wa_cck_shiftbits()
201 static void b43_wa_wrssi_offset(struct b43_wldev *dev) in b43_wa_wrssi_offset() argument
205 if (dev->phy.rev == 1) { in b43_wa_wrssi_offset()
207 b43_ofdmtab_write16(dev, B43_OFDMTAB_WRSSI_R1, in b43_wa_wrssi_offset()
212 b43_ofdmtab_write16(dev, B43_OFDMTAB_WRSSI, in b43_wa_wrssi_offset()
218 static void b43_wa_txpuoff_rxpuon(struct b43_wldev *dev) in b43_wa_txpuoff_rxpuon() argument
220 b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_0F, 2, 15); in b43_wa_txpuoff_rxpuon()
221 b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_0F, 3, 20); in b43_wa_txpuoff_rxpuon()
224 static void b43_wa_altagc(struct b43_wldev *dev) in b43_wa_altagc() argument
226 struct b43_phy *phy = &dev->phy; in b43_wa_altagc()
229 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1_R1, 0, 254); in b43_wa_altagc()
230 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1_R1, 1, 13); in b43_wa_altagc()
231 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1_R1, 2, 19); in b43_wa_altagc()
232 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1_R1, 3, 25); in b43_wa_altagc()
233 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC2, 0, 0x2710); in b43_wa_altagc()
234 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC2, 1, 0x9B83); in b43_wa_altagc()
235 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC2, 2, 0x9B83); in b43_wa_altagc()
236 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC2, 3, 0x0F8D); in b43_wa_altagc()
237 b43_phy_write(dev, B43_PHY_LMS, 4); in b43_wa_altagc()
239 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 0, 254); in b43_wa_altagc()
240 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 1, 13); in b43_wa_altagc()
241 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 2, 19); in b43_wa_altagc()
242 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC1, 3, 25); in b43_wa_altagc()
245 b43_phy_maskset(dev, B43_PHY_CCKSHIFTBITS_WA, 0x00FF, 0x5700); in b43_wa_altagc()
246 b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x007F, 0x000F); in b43_wa_altagc()
247 b43_phy_maskset(dev, B43_PHY_OFDM(0x1A), ~0x3F80, 0x2B80); in b43_wa_altagc()
248 b43_phy_maskset(dev, B43_PHY_ANTWRSETT, 0xF0FF, 0x0300); in b43_wa_altagc()
249 b43_radio_set(dev, 0x7A, 0x0008); in b43_wa_altagc()
250 b43_phy_maskset(dev, B43_PHY_N1P1GAIN, ~0x000F, 0x0008); in b43_wa_altagc()
251 b43_phy_maskset(dev, B43_PHY_P1P2GAIN, ~0x0F00, 0x0600); in b43_wa_altagc()
252 b43_phy_maskset(dev, B43_PHY_N1N2GAIN, ~0x0F00, 0x0700); in b43_wa_altagc()
253 b43_phy_maskset(dev, B43_PHY_N1P1GAIN, ~0x0F00, 0x0100); in b43_wa_altagc()
255 b43_phy_maskset(dev, B43_PHY_N1N2GAIN, ~0x000F, 0x0007); in b43_wa_altagc()
257 b43_phy_maskset(dev, B43_PHY_OFDM(0x88), ~0x00FF, 0x001C); in b43_wa_altagc()
258 b43_phy_maskset(dev, B43_PHY_OFDM(0x88), ~0x3F00, 0x0200); in b43_wa_altagc()
259 b43_phy_maskset(dev, B43_PHY_OFDM(0x96), ~0x00FF, 0x001C); in b43_wa_altagc()
260 b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x00FF, 0x0020); in b43_wa_altagc()
261 b43_phy_maskset(dev, B43_PHY_OFDM(0x89), ~0x3F00, 0x0200); in b43_wa_altagc()
262 b43_phy_maskset(dev, B43_PHY_OFDM(0x82), ~0x00FF, 0x002E); in b43_wa_altagc()
263 b43_phy_maskset(dev, B43_PHY_OFDM(0x96), 0x00FF, 0x1A00); in b43_wa_altagc()
264 b43_phy_maskset(dev, B43_PHY_OFDM(0x81), ~0x00FF, 0x0028); in b43_wa_altagc()
265 b43_phy_maskset(dev, B43_PHY_OFDM(0x81), 0x00FF, 0x2C00); in b43_wa_altagc()
267 b43_phy_write(dev, B43_PHY_PEAK_COUNT, 0x092B); in b43_wa_altagc()
268 b43_phy_maskset(dev, B43_PHY_OFDM(0x1B), ~0x001E, 0x0002); in b43_wa_altagc()
270 b43_phy_mask(dev, B43_PHY_OFDM(0x1B), ~0x001E); in b43_wa_altagc()
271 b43_phy_write(dev, B43_PHY_OFDM(0x1F), 0x287A); in b43_wa_altagc()
272 b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, ~0x000F, 0x0004); in b43_wa_altagc()
274 b43_phy_write(dev, B43_PHY_OFDM(0x22), 0x287A); in b43_wa_altagc()
275 b43_phy_maskset(dev, B43_PHY_LPFGAINCTL, 0x0FFF, 0x3000); in b43_wa_altagc()
278 b43_phy_maskset(dev, B43_PHY_DIVSRCHIDX, 0x8080, 0x7874); in b43_wa_altagc()
279 b43_phy_write(dev, B43_PHY_OFDM(0x8E), 0x1C00); in b43_wa_altagc()
281 b43_phy_maskset(dev, B43_PHY_DIVP1P2GAIN, ~0x0F00, 0x0600); in b43_wa_altagc()
282 b43_phy_write(dev, B43_PHY_OFDM(0x8B), 0x005E); in b43_wa_altagc()
283 b43_phy_maskset(dev, B43_PHY_ANTWRSETT, ~0x00FF, 0x001E); in b43_wa_altagc()
284 b43_phy_write(dev, B43_PHY_OFDM(0x8D), 0x0002); in b43_wa_altagc()
285 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3_R1, 0, 0); in b43_wa_altagc()
286 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3_R1, 1, 7); in b43_wa_altagc()
287 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3_R1, 2, 16); in b43_wa_altagc()
288 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3_R1, 3, 28); in b43_wa_altagc()
290 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3, 0, 0); in b43_wa_altagc()
291 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3, 1, 7); in b43_wa_altagc()
292 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3, 2, 16); in b43_wa_altagc()
293 b43_ofdmtab_write16(dev, B43_OFDMTAB_AGC3, 3, 28); in b43_wa_altagc()
296 b43_phy_mask(dev, B43_PHY_OFDM(0x26), ~0x0003); in b43_wa_altagc()
297 b43_phy_mask(dev, B43_PHY_OFDM(0x26), ~0x1000); in b43_wa_altagc()
299 b43_phy_read(dev, B43_PHY_VERSION_OFDM); /* Dummy read */ in b43_wa_altagc()
302 static void b43_wa_tr_ltov(struct b43_wldev *dev) /* TR Lookup Table Original Values */ in b43_wa_tr_ltov() argument
304 b43_gtab_write(dev, B43_GTAB_ORIGTR, 0, 0x7654); in b43_wa_tr_ltov()
307 static void b43_wa_cpll_nonpilot(struct b43_wldev *dev) in b43_wa_cpll_nonpilot() argument
309 b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_11, 0, 0); in b43_wa_cpll_nonpilot()
310 b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_11, 1, 0); in b43_wa_cpll_nonpilot()
313 static void b43_wa_boards_g(struct b43_wldev *dev) in b43_wa_boards_g() argument
315 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_wa_boards_g()
316 struct b43_phy *phy = &dev->phy; in b43_wa_boards_g()
318 if (dev->dev->board_vendor != SSB_BOARDVENDOR_BCM || in b43_wa_boards_g()
319 dev->dev->board_type != SSB_BOARD_BU4306 || in b43_wa_boards_g()
320 dev->dev->board_rev != 0x17) { in b43_wa_boards_g()
322 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX_R1, 1, 0x0002); in b43_wa_boards_g()
323 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX_R1, 2, 0x0001); in b43_wa_boards_g()
325 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 1, 0x0002); in b43_wa_boards_g()
326 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 2, 0x0001); in b43_wa_boards_g()
329 b43_phy_mask(dev, B43_PHY_EXTG(0x11), 0xF7FF); in b43_wa_boards_g()
330 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0020, 0x0001); in b43_wa_boards_g()
331 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0021, 0x0001); in b43_wa_boards_g()
332 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0022, 0x0001); in b43_wa_boards_g()
333 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0023, 0x0000); in b43_wa_boards_g()
334 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0000, 0x0000); in b43_wa_boards_g()
335 b43_ofdmtab_write16(dev, B43_OFDMTAB_GAINX, 0x0003, 0x0002); in b43_wa_boards_g()
340 b43_phy_write(dev, B43_PHY_GTABCTL, 0x3120); in b43_wa_boards_g()
341 b43_phy_write(dev, B43_PHY_GTABDATA, 0xC480); in b43_wa_boards_g()
345 void b43_wa_all(struct b43_wldev *dev) in b43_wa_all() argument
347 struct b43_phy *phy = &dev->phy; in b43_wa_all()
352 b43_wa_crs_ed(dev); in b43_wa_all()
353 b43_wa_crs_thr(dev); in b43_wa_all()
354 b43_wa_crs_blank(dev); in b43_wa_all()
355 b43_wa_cck_shiftbits(dev); in b43_wa_all()
356 b43_wa_fft(dev); in b43_wa_all()
357 b43_wa_nft(dev); in b43_wa_all()
358 b43_wa_rt(dev); in b43_wa_all()
359 b43_wa_nst(dev); in b43_wa_all()
360 b43_wa_art(dev); in b43_wa_all()
361 b43_wa_wrssi_offset(dev); in b43_wa_all()
362 b43_wa_altagc(dev); in b43_wa_all()
369 b43_wa_tr_ltov(dev); in b43_wa_all()
370 b43_wa_crs_ed(dev); in b43_wa_all()
371 b43_wa_rssi_lt(dev); in b43_wa_all()
372 b43_wa_nft(dev); in b43_wa_all()
373 b43_wa_nst(dev); in b43_wa_all()
374 b43_wa_msst(dev); in b43_wa_all()
375 b43_wa_wrssi_offset(dev); in b43_wa_all()
376 b43_wa_altagc(dev); in b43_wa_all()
377 b43_wa_analog(dev); in b43_wa_all()
378 b43_wa_txpuoff_rxpuon(dev); in b43_wa_all()
383 b43_wa_boards_g(dev); in b43_wa_all()
388 b43_wa_cpll_nonpilot(dev); in b43_wa_all()