Lines Matching refs:dev
54 static void b43_calc_nrssi_threshold(struct b43_wldev *dev);
68 static void generate_rfatt_list(struct b43_wldev *dev, in generate_rfatt_list() argument
71 struct b43_phy *phy = &dev->phy; in generate_rfatt_list()
111 if (!b43_has_hardware_pctl(dev)) { in generate_rfatt_list()
134 static void generate_bbatt_list(struct b43_wldev *dev, in generate_bbatt_list() argument
155 static void b43_shm_clear_tssi(struct b43_wldev *dev) in b43_shm_clear_tssi() argument
157 b43_shm_write16(dev, B43_SHM_SHARED, 0x0058, 0x7F7F); in b43_shm_clear_tssi()
158 b43_shm_write16(dev, B43_SHM_SHARED, 0x005a, 0x7F7F); in b43_shm_clear_tssi()
159 b43_shm_write16(dev, B43_SHM_SHARED, 0x0070, 0x7F7F); in b43_shm_clear_tssi()
160 b43_shm_write16(dev, B43_SHM_SHARED, 0x0072, 0x7F7F); in b43_shm_clear_tssi()
164 static void b43_synth_pu_workaround(struct b43_wldev *dev, u8 channel) in b43_synth_pu_workaround() argument
166 struct b43_phy *phy = &dev->phy; in b43_synth_pu_workaround()
176 b43_write16(dev, B43_MMIO_CHANNEL, in b43_synth_pu_workaround()
179 b43_write16(dev, B43_MMIO_CHANNEL, channel2freq_bg(1)); in b43_synth_pu_workaround()
182 b43_write16(dev, B43_MMIO_CHANNEL, channel2freq_bg(channel)); in b43_synth_pu_workaround()
186 void b43_gphy_set_baseband_attenuation(struct b43_wldev *dev, in b43_gphy_set_baseband_attenuation() argument
189 struct b43_phy *phy = &dev->phy; in b43_gphy_set_baseband_attenuation()
192 b43_write16(dev, B43_MMIO_PHY0, (b43_read16(dev, B43_MMIO_PHY0) in b43_gphy_set_baseband_attenuation()
196 b43_phy_maskset(dev, B43_PHY_DACCTL, 0xFFC3, (baseband_attenuation << 2)); in b43_gphy_set_baseband_attenuation()
198 b43_phy_maskset(dev, B43_PHY_DACCTL, 0xFF87, (baseband_attenuation << 3)); in b43_gphy_set_baseband_attenuation()
203 static void b43_set_txpower_g(struct b43_wldev *dev, in b43_set_txpower_g() argument
207 struct b43_phy *phy = &dev->phy; in b43_set_txpower_g()
227 if (b43_debug(dev, B43_DBG_XMITPOWER)) { in b43_set_txpower_g()
228 b43dbg(dev->wl, "Tuning TX-power to bbatt(%u), " in b43_set_txpower_g()
234 b43_gphy_set_baseband_attenuation(dev, bb); in b43_set_txpower_g()
235 b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_RFATT, rf); in b43_set_txpower_g()
237 b43_radio_write16(dev, 0x43, in b43_set_txpower_g()
240 b43_radio_maskset(dev, 0x43, 0xFFF0, (rf & 0x000F)); in b43_set_txpower_g()
241 b43_radio_maskset(dev, 0x52, ~0x0070, (tx_control & 0x0070)); in b43_set_txpower_g()
244 b43_radio_write16(dev, 0x52, tx_magn | tx_bias); in b43_set_txpower_g()
246 b43_radio_maskset(dev, 0x52, 0xFFF0, (tx_bias & 0x000F)); in b43_set_txpower_g()
248 b43_lo_g_adjust(dev); in b43_set_txpower_g()
252 static void b43_gphy_tssi_power_lt_init(struct b43_wldev *dev) in b43_gphy_tssi_power_lt_init() argument
254 struct b43_phy_g *gphy = dev->phy.g; in b43_gphy_tssi_power_lt_init()
259 b43_ofdmtab_write16(dev, 0x3C20, i, gphy->tssi2dbm[i]); in b43_gphy_tssi_power_lt_init()
261 b43_ofdmtab_write16(dev, 0x3C00, i - 32, gphy->tssi2dbm[i]); in b43_gphy_tssi_power_lt_init()
265 b43_phy_write(dev, 0x380 + (i / 2), value); in b43_gphy_tssi_power_lt_init()
270 static void b43_gphy_gain_lt_init(struct b43_wldev *dev) in b43_gphy_gain_lt_init() argument
272 struct b43_phy *phy = &dev->phy; in b43_gphy_gain_lt_init()
290 b43_phy_write(dev, 0x3C0 + nr_written, tmp); in b43_gphy_gain_lt_init()
296 static void b43_set_all_gains(struct b43_wldev *dev, in b43_set_all_gains() argument
299 struct b43_phy *phy = &dev->phy; in b43_set_all_gains()
314 b43_ofdmtab_write16(dev, table, i, first); in b43_set_all_gains()
317 b43_ofdmtab_write16(dev, table, i, second); in b43_set_all_gains()
321 b43_phy_maskset(dev, 0x04A0, 0xBFBF, tmp); in b43_set_all_gains()
322 b43_phy_maskset(dev, 0x04A1, 0xBFBF, tmp); in b43_set_all_gains()
323 b43_phy_maskset(dev, 0x04A2, 0xBFBF, tmp); in b43_set_all_gains()
325 b43_dummy_transmission(dev, false, true); in b43_set_all_gains()
328 static void b43_set_original_gains(struct b43_wldev *dev) in b43_set_original_gains() argument
330 struct b43_phy *phy = &dev->phy; in b43_set_original_gains()
348 b43_ofdmtab_write16(dev, table, i, tmp); in b43_set_original_gains()
352 b43_ofdmtab_write16(dev, table, i, i - start); in b43_set_original_gains()
354 b43_phy_maskset(dev, 0x04A0, 0xBFBF, 0x4040); in b43_set_original_gains()
355 b43_phy_maskset(dev, 0x04A1, 0xBFBF, 0x4040); in b43_set_original_gains()
356 b43_phy_maskset(dev, 0x04A2, 0xBFBF, 0x4000); in b43_set_original_gains()
357 b43_dummy_transmission(dev, false, true); in b43_set_original_gains()
361 static void b43_nrssi_hw_write(struct b43_wldev *dev, u16 offset, s16 val) in b43_nrssi_hw_write() argument
363 b43_phy_write(dev, B43_PHY_NRSSILT_CTRL, offset); in b43_nrssi_hw_write()
364 b43_phy_write(dev, B43_PHY_NRSSILT_DATA, (u16) val); in b43_nrssi_hw_write()
368 static s16 b43_nrssi_hw_read(struct b43_wldev *dev, u16 offset) in b43_nrssi_hw_read() argument
372 b43_phy_write(dev, B43_PHY_NRSSILT_CTRL, offset); in b43_nrssi_hw_read()
373 val = b43_phy_read(dev, B43_PHY_NRSSILT_DATA); in b43_nrssi_hw_read()
379 static void b43_nrssi_hw_update(struct b43_wldev *dev, u16 val) in b43_nrssi_hw_update() argument
385 tmp = b43_nrssi_hw_read(dev, i); in b43_nrssi_hw_update()
388 b43_nrssi_hw_write(dev, i, tmp); in b43_nrssi_hw_update()
393 static void b43_nrssi_mem_update(struct b43_wldev *dev) in b43_nrssi_mem_update() argument
395 struct b43_phy_g *gphy = dev->phy.g; in b43_nrssi_mem_update()
409 static void b43_calc_nrssi_offset(struct b43_wldev *dev) in b43_calc_nrssi_offset() argument
411 struct b43_phy *phy = &dev->phy; in b43_calc_nrssi_offset()
417 backup[0] = b43_phy_read(dev, 0x0001); in b43_calc_nrssi_offset()
418 backup[1] = b43_phy_read(dev, 0x0811); in b43_calc_nrssi_offset()
419 backup[2] = b43_phy_read(dev, 0x0812); in b43_calc_nrssi_offset()
421 backup[3] = b43_phy_read(dev, 0x0814); in b43_calc_nrssi_offset()
422 backup[4] = b43_phy_read(dev, 0x0815); in b43_calc_nrssi_offset()
424 backup[5] = b43_phy_read(dev, 0x005A); in b43_calc_nrssi_offset()
425 backup[6] = b43_phy_read(dev, 0x0059); in b43_calc_nrssi_offset()
426 backup[7] = b43_phy_read(dev, 0x0058); in b43_calc_nrssi_offset()
427 backup[8] = b43_phy_read(dev, 0x000A); in b43_calc_nrssi_offset()
428 backup[9] = b43_phy_read(dev, 0x0003); in b43_calc_nrssi_offset()
429 backup[10] = b43_radio_read16(dev, 0x007A); in b43_calc_nrssi_offset()
430 backup[11] = b43_radio_read16(dev, 0x0043); in b43_calc_nrssi_offset()
432 b43_phy_mask(dev, 0x0429, 0x7FFF); in b43_calc_nrssi_offset()
433 b43_phy_maskset(dev, 0x0001, 0x3FFF, 0x4000); in b43_calc_nrssi_offset()
434 b43_phy_set(dev, 0x0811, 0x000C); in b43_calc_nrssi_offset()
435 b43_phy_maskset(dev, 0x0812, 0xFFF3, 0x0004); in b43_calc_nrssi_offset()
436 b43_phy_mask(dev, 0x0802, ~(0x1 | 0x2)); in b43_calc_nrssi_offset()
438 backup[12] = b43_phy_read(dev, 0x002E); in b43_calc_nrssi_offset()
439 backup[13] = b43_phy_read(dev, 0x002F); in b43_calc_nrssi_offset()
440 backup[14] = b43_phy_read(dev, 0x080F); in b43_calc_nrssi_offset()
441 backup[15] = b43_phy_read(dev, 0x0810); in b43_calc_nrssi_offset()
442 backup[16] = b43_phy_read(dev, 0x0801); in b43_calc_nrssi_offset()
443 backup[17] = b43_phy_read(dev, 0x0060); in b43_calc_nrssi_offset()
444 backup[18] = b43_phy_read(dev, 0x0014); in b43_calc_nrssi_offset()
445 backup[19] = b43_phy_read(dev, 0x0478); in b43_calc_nrssi_offset()
447 b43_phy_write(dev, 0x002E, 0); in b43_calc_nrssi_offset()
448 b43_phy_write(dev, 0x002F, 0); in b43_calc_nrssi_offset()
449 b43_phy_write(dev, 0x080F, 0); in b43_calc_nrssi_offset()
450 b43_phy_write(dev, 0x0810, 0); in b43_calc_nrssi_offset()
451 b43_phy_set(dev, 0x0478, 0x0100); in b43_calc_nrssi_offset()
452 b43_phy_set(dev, 0x0801, 0x0040); in b43_calc_nrssi_offset()
453 b43_phy_set(dev, 0x0060, 0x0040); in b43_calc_nrssi_offset()
454 b43_phy_set(dev, 0x0014, 0x0200); in b43_calc_nrssi_offset()
456 b43_radio_set(dev, 0x007A, 0x0070); in b43_calc_nrssi_offset()
457 b43_radio_set(dev, 0x007A, 0x0080); in b43_calc_nrssi_offset()
460 v47F = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43_calc_nrssi_offset()
465 b43_radio_write16(dev, 0x007B, i); in b43_calc_nrssi_offset()
468 (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43_calc_nrssi_offset()
477 b43_radio_mask(dev, 0x007A, 0x007F); in b43_calc_nrssi_offset()
479 b43_phy_set(dev, 0x0814, 0x0001); in b43_calc_nrssi_offset()
480 b43_phy_mask(dev, 0x0815, 0xFFFE); in b43_calc_nrssi_offset()
482 b43_phy_set(dev, 0x0811, 0x000C); in b43_calc_nrssi_offset()
483 b43_phy_set(dev, 0x0812, 0x000C); in b43_calc_nrssi_offset()
484 b43_phy_set(dev, 0x0811, 0x0030); in b43_calc_nrssi_offset()
485 b43_phy_set(dev, 0x0812, 0x0030); in b43_calc_nrssi_offset()
486 b43_phy_write(dev, 0x005A, 0x0480); in b43_calc_nrssi_offset()
487 b43_phy_write(dev, 0x0059, 0x0810); in b43_calc_nrssi_offset()
488 b43_phy_write(dev, 0x0058, 0x000D); in b43_calc_nrssi_offset()
490 b43_phy_write(dev, 0x0003, 0x0122); in b43_calc_nrssi_offset()
492 b43_phy_set(dev, 0x000A, 0x2000); in b43_calc_nrssi_offset()
495 b43_phy_set(dev, 0x0814, 0x0004); in b43_calc_nrssi_offset()
496 b43_phy_mask(dev, 0x0815, 0xFFFB); in b43_calc_nrssi_offset()
498 b43_phy_maskset(dev, 0x0003, 0xFF9F, 0x0040); in b43_calc_nrssi_offset()
499 b43_radio_set(dev, 0x007A, 0x000F); in b43_calc_nrssi_offset()
500 b43_set_all_gains(dev, 3, 0, 1); in b43_calc_nrssi_offset()
501 b43_radio_maskset(dev, 0x0043, 0x00F0, 0x000F); in b43_calc_nrssi_offset()
503 v47F = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43_calc_nrssi_offset()
508 b43_radio_write16(dev, 0x007B, i); in b43_calc_nrssi_offset()
511 (s16) ((b43_phy_read(dev, 0x047F) >> 8) & in b43_calc_nrssi_offset()
523 b43_radio_write16(dev, 0x007B, saved); in b43_calc_nrssi_offset()
526 b43_phy_write(dev, 0x002E, backup[12]); in b43_calc_nrssi_offset()
527 b43_phy_write(dev, 0x002F, backup[13]); in b43_calc_nrssi_offset()
528 b43_phy_write(dev, 0x080F, backup[14]); in b43_calc_nrssi_offset()
529 b43_phy_write(dev, 0x0810, backup[15]); in b43_calc_nrssi_offset()
532 b43_phy_write(dev, 0x0814, backup[3]); in b43_calc_nrssi_offset()
533 b43_phy_write(dev, 0x0815, backup[4]); in b43_calc_nrssi_offset()
535 b43_phy_write(dev, 0x005A, backup[5]); in b43_calc_nrssi_offset()
536 b43_phy_write(dev, 0x0059, backup[6]); in b43_calc_nrssi_offset()
537 b43_phy_write(dev, 0x0058, backup[7]); in b43_calc_nrssi_offset()
538 b43_phy_write(dev, 0x000A, backup[8]); in b43_calc_nrssi_offset()
539 b43_phy_write(dev, 0x0003, backup[9]); in b43_calc_nrssi_offset()
540 b43_radio_write16(dev, 0x0043, backup[11]); in b43_calc_nrssi_offset()
541 b43_radio_write16(dev, 0x007A, backup[10]); in b43_calc_nrssi_offset()
542 b43_phy_write(dev, 0x0802, b43_phy_read(dev, 0x0802) | 0x1 | 0x2); in b43_calc_nrssi_offset()
543 b43_phy_set(dev, 0x0429, 0x8000); in b43_calc_nrssi_offset()
544 b43_set_original_gains(dev); in b43_calc_nrssi_offset()
546 b43_phy_write(dev, 0x0801, backup[16]); in b43_calc_nrssi_offset()
547 b43_phy_write(dev, 0x0060, backup[17]); in b43_calc_nrssi_offset()
548 b43_phy_write(dev, 0x0014, backup[18]); in b43_calc_nrssi_offset()
549 b43_phy_write(dev, 0x0478, backup[19]); in b43_calc_nrssi_offset()
551 b43_phy_write(dev, 0x0001, backup[0]); in b43_calc_nrssi_offset()
552 b43_phy_write(dev, 0x0812, backup[2]); in b43_calc_nrssi_offset()
553 b43_phy_write(dev, 0x0811, backup[1]); in b43_calc_nrssi_offset()
556 static void b43_calc_nrssi_slope(struct b43_wldev *dev) in b43_calc_nrssi_slope() argument
558 struct b43_phy *phy = &dev->phy; in b43_calc_nrssi_slope()
569 b43_calc_nrssi_offset(dev); in b43_calc_nrssi_slope()
571 b43_phy_mask(dev, B43_PHY_G_CRS, 0x7FFF); in b43_calc_nrssi_slope()
572 b43_phy_mask(dev, 0x0802, 0xFFFC); in b43_calc_nrssi_slope()
573 backup[7] = b43_read16(dev, 0x03E2); in b43_calc_nrssi_slope()
574 b43_write16(dev, 0x03E2, b43_read16(dev, 0x03E2) | 0x8000); in b43_calc_nrssi_slope()
575 backup[0] = b43_radio_read16(dev, 0x007A); in b43_calc_nrssi_slope()
576 backup[1] = b43_radio_read16(dev, 0x0052); in b43_calc_nrssi_slope()
577 backup[2] = b43_radio_read16(dev, 0x0043); in b43_calc_nrssi_slope()
578 backup[3] = b43_phy_read(dev, 0x0015); in b43_calc_nrssi_slope()
579 backup[4] = b43_phy_read(dev, 0x005A); in b43_calc_nrssi_slope()
580 backup[5] = b43_phy_read(dev, 0x0059); in b43_calc_nrssi_slope()
581 backup[6] = b43_phy_read(dev, 0x0058); in b43_calc_nrssi_slope()
582 backup[8] = b43_read16(dev, 0x03E6); in b43_calc_nrssi_slope()
583 backup[9] = b43_read16(dev, B43_MMIO_CHANNEL_EXT); in b43_calc_nrssi_slope()
585 backup[10] = b43_phy_read(dev, 0x002E); in b43_calc_nrssi_slope()
586 backup[11] = b43_phy_read(dev, 0x002F); in b43_calc_nrssi_slope()
587 backup[12] = b43_phy_read(dev, 0x080F); in b43_calc_nrssi_slope()
588 backup[13] = b43_phy_read(dev, B43_PHY_G_LO_CONTROL); in b43_calc_nrssi_slope()
589 backup[14] = b43_phy_read(dev, 0x0801); in b43_calc_nrssi_slope()
590 backup[15] = b43_phy_read(dev, 0x0060); in b43_calc_nrssi_slope()
591 backup[16] = b43_phy_read(dev, 0x0014); in b43_calc_nrssi_slope()
592 backup[17] = b43_phy_read(dev, 0x0478); in b43_calc_nrssi_slope()
593 b43_phy_write(dev, 0x002E, 0); in b43_calc_nrssi_slope()
594 b43_phy_write(dev, B43_PHY_G_LO_CONTROL, 0); in b43_calc_nrssi_slope()
599 b43_phy_set(dev, 0x0478, 0x0100); in b43_calc_nrssi_slope()
600 b43_phy_set(dev, 0x0801, 0x0040); in b43_calc_nrssi_slope()
604 b43_phy_mask(dev, 0x0801, 0xFFBF); in b43_calc_nrssi_slope()
607 b43_phy_set(dev, 0x0060, 0x0040); in b43_calc_nrssi_slope()
608 b43_phy_set(dev, 0x0014, 0x0200); in b43_calc_nrssi_slope()
610 b43_radio_set(dev, 0x007A, 0x0070); in b43_calc_nrssi_slope()
611 b43_set_all_gains(dev, 0, 8, 0); in b43_calc_nrssi_slope()
612 b43_radio_mask(dev, 0x007A, 0x00F7); in b43_calc_nrssi_slope()
614 b43_phy_maskset(dev, 0x0811, 0xFFCF, 0x0030); in b43_calc_nrssi_slope()
615 b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0010); in b43_calc_nrssi_slope()
617 b43_radio_set(dev, 0x007A, 0x0080); in b43_calc_nrssi_slope()
620 nrssi0 = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43_calc_nrssi_slope()
624 b43_radio_mask(dev, 0x007A, 0x007F); in b43_calc_nrssi_slope()
626 b43_phy_maskset(dev, 0x0003, 0xFF9F, 0x0040); in b43_calc_nrssi_slope()
629 b43_write16(dev, B43_MMIO_CHANNEL_EXT, in b43_calc_nrssi_slope()
630 b43_read16(dev, B43_MMIO_CHANNEL_EXT) in b43_calc_nrssi_slope()
632 b43_radio_set(dev, 0x007A, 0x000F); in b43_calc_nrssi_slope()
633 b43_phy_write(dev, 0x0015, 0xF330); in b43_calc_nrssi_slope()
635 b43_phy_maskset(dev, 0x0812, 0xFFCF, 0x0020); in b43_calc_nrssi_slope()
636 b43_phy_maskset(dev, 0x0811, 0xFFCF, 0x0020); in b43_calc_nrssi_slope()
639 b43_set_all_gains(dev, 3, 0, 1); in b43_calc_nrssi_slope()
641 b43_radio_write16(dev, 0x0043, 0x001F); in b43_calc_nrssi_slope()
643 tmp = b43_radio_read16(dev, 0x0052) & 0xFF0F; in b43_calc_nrssi_slope()
644 b43_radio_write16(dev, 0x0052, tmp | 0x0060); in b43_calc_nrssi_slope()
645 tmp = b43_radio_read16(dev, 0x0043) & 0xFFF0; in b43_calc_nrssi_slope()
646 b43_radio_write16(dev, 0x0043, tmp | 0x0009); in b43_calc_nrssi_slope()
648 b43_phy_write(dev, 0x005A, 0x0480); in b43_calc_nrssi_slope()
649 b43_phy_write(dev, 0x0059, 0x0810); in b43_calc_nrssi_slope()
650 b43_phy_write(dev, 0x0058, 0x000D); in b43_calc_nrssi_slope()
652 nrssi1 = (s16) ((b43_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43_calc_nrssi_slope()
664 b43_phy_write(dev, 0x002E, backup[10]); in b43_calc_nrssi_slope()
665 b43_phy_write(dev, 0x002F, backup[11]); in b43_calc_nrssi_slope()
666 b43_phy_write(dev, 0x080F, backup[12]); in b43_calc_nrssi_slope()
667 b43_phy_write(dev, B43_PHY_G_LO_CONTROL, backup[13]); in b43_calc_nrssi_slope()
670 b43_phy_mask(dev, 0x0812, 0xFFCF); in b43_calc_nrssi_slope()
671 b43_phy_mask(dev, 0x0811, 0xFFCF); in b43_calc_nrssi_slope()
674 b43_radio_write16(dev, 0x007A, backup[0]); in b43_calc_nrssi_slope()
675 b43_radio_write16(dev, 0x0052, backup[1]); in b43_calc_nrssi_slope()
676 b43_radio_write16(dev, 0x0043, backup[2]); in b43_calc_nrssi_slope()
677 b43_write16(dev, 0x03E2, backup[7]); in b43_calc_nrssi_slope()
678 b43_write16(dev, 0x03E6, backup[8]); in b43_calc_nrssi_slope()
679 b43_write16(dev, B43_MMIO_CHANNEL_EXT, backup[9]); in b43_calc_nrssi_slope()
680 b43_phy_write(dev, 0x0015, backup[3]); in b43_calc_nrssi_slope()
681 b43_phy_write(dev, 0x005A, backup[4]); in b43_calc_nrssi_slope()
682 b43_phy_write(dev, 0x0059, backup[5]); in b43_calc_nrssi_slope()
683 b43_phy_write(dev, 0x0058, backup[6]); in b43_calc_nrssi_slope()
684 b43_synth_pu_workaround(dev, phy->channel); in b43_calc_nrssi_slope()
685 b43_phy_set(dev, 0x0802, (0x0001 | 0x0002)); in b43_calc_nrssi_slope()
686 b43_set_original_gains(dev); in b43_calc_nrssi_slope()
687 b43_phy_set(dev, B43_PHY_G_CRS, 0x8000); in b43_calc_nrssi_slope()
689 b43_phy_write(dev, 0x0801, backup[14]); in b43_calc_nrssi_slope()
690 b43_phy_write(dev, 0x0060, backup[15]); in b43_calc_nrssi_slope()
691 b43_phy_write(dev, 0x0014, backup[16]); in b43_calc_nrssi_slope()
692 b43_phy_write(dev, 0x0478, backup[17]); in b43_calc_nrssi_slope()
694 b43_nrssi_mem_update(dev); in b43_calc_nrssi_slope()
695 b43_calc_nrssi_threshold(dev); in b43_calc_nrssi_slope()
698 static void b43_calc_nrssi_threshold(struct b43_wldev *dev) in b43_calc_nrssi_threshold() argument
700 struct b43_phy *phy = &dev->phy; in b43_calc_nrssi_threshold()
709 !(dev->dev->bus_sprom->boardflags_lo & B43_BFL_RSSI)) { in b43_calc_nrssi_threshold()
710 tmp16 = b43_nrssi_hw_read(dev, 0x20); in b43_calc_nrssi_threshold()
714 b43_phy_maskset(dev, 0x048A, 0xF000, 0x09EB); in b43_calc_nrssi_threshold()
716 b43_phy_maskset(dev, 0x048A, 0xF000, 0x0AED); in b43_calc_nrssi_threshold()
748 tmp_u16 = b43_phy_read(dev, 0x048A) & 0xF000; in b43_calc_nrssi_threshold()
751 b43_phy_write(dev, 0x048A, tmp_u16); in b43_calc_nrssi_threshold()
794 b43_phy_read(dev, (offset))); \
798 b43_phy_write(dev, (offset), \
805 b43_radio_read16(dev, (offset))); \
809 b43_radio_write16(dev, (offset), \
816 b43_ofdmtab_read16(dev, (table), (offset))); \
820 b43_ofdmtab_write16(dev, (table), (offset), \
826 b43_radio_interference_mitigation_enable(struct b43_wldev *dev, int mode) in b43_radio_interference_mitigation_enable() argument
828 struct b43_phy *phy = &dev->phy; in b43_radio_interference_mitigation_enable()
837 b43_phy_set(dev, 0x042B, 0x0800); in b43_radio_interference_mitigation_enable()
838 b43_phy_mask(dev, B43_PHY_G_CRS, ~0x4000); in b43_radio_interference_mitigation_enable()
842 tmp = (b43_radio_read16(dev, 0x0078) & 0x001E); in b43_radio_interference_mitigation_enable()
850 b43_radio_write16(dev, 0x0078, flipped); in b43_radio_interference_mitigation_enable()
852 b43_calc_nrssi_threshold(dev); in b43_radio_interference_mitigation_enable()
855 b43_phy_write(dev, 0x0406, 0x7E28); in b43_radio_interference_mitigation_enable()
857 b43_phy_set(dev, 0x042B, 0x0800); in b43_radio_interference_mitigation_enable()
858 b43_phy_set(dev, B43_PHY_RADIO_BITFIELD, 0x1000); in b43_radio_interference_mitigation_enable()
861 b43_phy_maskset(dev, 0x04A0, 0xC0C0, 0x0008); in b43_radio_interference_mitigation_enable()
863 b43_phy_maskset(dev, 0x04A1, 0xC0C0, 0x0605); in b43_radio_interference_mitigation_enable()
865 b43_phy_maskset(dev, 0x04A2, 0xC0C0, 0x0204); in b43_radio_interference_mitigation_enable()
867 b43_phy_maskset(dev, 0x04A8, 0xC0C0, 0x0803); in b43_radio_interference_mitigation_enable()
869 b43_phy_maskset(dev, 0x04AB, 0xC0C0, 0x0605); in b43_radio_interference_mitigation_enable()
872 b43_phy_write(dev, 0x04A7, 0x0002); in b43_radio_interference_mitigation_enable()
874 b43_phy_write(dev, 0x04A3, 0x287A); in b43_radio_interference_mitigation_enable()
876 b43_phy_write(dev, 0x04A9, 0x2027); in b43_radio_interference_mitigation_enable()
878 b43_phy_write(dev, 0x0493, 0x32F5); in b43_radio_interference_mitigation_enable()
880 b43_phy_write(dev, 0x04AA, 0x2027); in b43_radio_interference_mitigation_enable()
882 b43_phy_write(dev, 0x04AC, 0x32F5); in b43_radio_interference_mitigation_enable()
885 if (b43_phy_read(dev, 0x0033) & 0x0800) in b43_radio_interference_mitigation_enable()
925 b43_phy_mask(dev, B43_PHY_RADIO_BITFIELD, ~0x1000); in b43_radio_interference_mitigation_enable()
926 b43_phy_maskset(dev, B43_PHY_G_CRS, 0xFFFC, 0x0002); in b43_radio_interference_mitigation_enable()
928 b43_phy_write(dev, 0x0033, 0x0800); in b43_radio_interference_mitigation_enable()
929 b43_phy_write(dev, 0x04A3, 0x2027); in b43_radio_interference_mitigation_enable()
930 b43_phy_write(dev, 0x04A9, 0x1CA8); in b43_radio_interference_mitigation_enable()
931 b43_phy_write(dev, 0x0493, 0x287A); in b43_radio_interference_mitigation_enable()
932 b43_phy_write(dev, 0x04AA, 0x1CA8); in b43_radio_interference_mitigation_enable()
933 b43_phy_write(dev, 0x04AC, 0x287A); in b43_radio_interference_mitigation_enable()
935 b43_phy_maskset(dev, 0x04A0, 0xFFC0, 0x001A); in b43_radio_interference_mitigation_enable()
936 b43_phy_write(dev, 0x04A7, 0x000D); in b43_radio_interference_mitigation_enable()
939 b43_phy_write(dev, 0x0406, 0xFF0D); in b43_radio_interference_mitigation_enable()
941 b43_phy_write(dev, 0x04C0, 0xFFFF); in b43_radio_interference_mitigation_enable()
942 b43_phy_write(dev, 0x04C1, 0x00A9); in b43_radio_interference_mitigation_enable()
944 b43_phy_write(dev, 0x04C0, 0x00C1); in b43_radio_interference_mitigation_enable()
945 b43_phy_write(dev, 0x04C1, 0x0059); in b43_radio_interference_mitigation_enable()
948 b43_phy_maskset(dev, 0x04A1, 0xC0FF, 0x1800); in b43_radio_interference_mitigation_enable()
949 b43_phy_maskset(dev, 0x04A1, 0xFFC0, 0x0015); in b43_radio_interference_mitigation_enable()
950 b43_phy_maskset(dev, 0x04A8, 0xCFFF, 0x1000); in b43_radio_interference_mitigation_enable()
951 b43_phy_maskset(dev, 0x04A8, 0xF0FF, 0x0A00); in b43_radio_interference_mitigation_enable()
952 b43_phy_maskset(dev, 0x04AB, 0xCFFF, 0x1000); in b43_radio_interference_mitigation_enable()
953 b43_phy_maskset(dev, 0x04AB, 0xF0FF, 0x0800); in b43_radio_interference_mitigation_enable()
954 b43_phy_maskset(dev, 0x04AB, 0xFFCF, 0x0010); in b43_radio_interference_mitigation_enable()
955 b43_phy_maskset(dev, 0x04AB, 0xFFF0, 0x0005); in b43_radio_interference_mitigation_enable()
956 b43_phy_maskset(dev, 0x04A8, 0xFFCF, 0x0010); in b43_radio_interference_mitigation_enable()
957 b43_phy_maskset(dev, 0x04A8, 0xFFF0, 0x0006); in b43_radio_interference_mitigation_enable()
958 b43_phy_maskset(dev, 0x04A2, 0xF0FF, 0x0800); in b43_radio_interference_mitigation_enable()
959 b43_phy_maskset(dev, 0x04A0, 0xF0FF, 0x0500); in b43_radio_interference_mitigation_enable()
960 b43_phy_maskset(dev, 0x04A2, 0xFFF0, 0x000B); in b43_radio_interference_mitigation_enable()
963 b43_phy_mask(dev, 0x048A, 0x7FFF); in b43_radio_interference_mitigation_enable()
964 b43_phy_maskset(dev, 0x0415, 0x8000, 0x36D8); in b43_radio_interference_mitigation_enable()
965 b43_phy_maskset(dev, 0x0416, 0x8000, 0x36D8); in b43_radio_interference_mitigation_enable()
966 b43_phy_maskset(dev, 0x0417, 0xFE00, 0x016D); in b43_radio_interference_mitigation_enable()
968 b43_phy_set(dev, 0x048A, 0x1000); in b43_radio_interference_mitigation_enable()
969 b43_phy_maskset(dev, 0x048A, 0x9FFF, 0x2000); in b43_radio_interference_mitigation_enable()
970 b43_hf_write(dev, b43_hf_read(dev) | B43_HF_ACIW); in b43_radio_interference_mitigation_enable()
973 b43_phy_set(dev, 0x042B, 0x0800); in b43_radio_interference_mitigation_enable()
975 b43_phy_maskset(dev, 0x048C, 0xF0FF, 0x0200); in b43_radio_interference_mitigation_enable()
977 b43_phy_maskset(dev, 0x04AE, 0xFF00, 0x007F); in b43_radio_interference_mitigation_enable()
978 b43_phy_maskset(dev, 0x04AD, 0x00FF, 0x1300); in b43_radio_interference_mitigation_enable()
980 b43_ofdmtab_write16(dev, 0x1A00, 0x3, 0x007F); in b43_radio_interference_mitigation_enable()
981 b43_ofdmtab_write16(dev, 0x1A00, 0x2, 0x007F); in b43_radio_interference_mitigation_enable()
982 b43_phy_mask(dev, 0x04AD, 0x00FF); in b43_radio_interference_mitigation_enable()
984 b43_calc_nrssi_slope(dev); in b43_radio_interference_mitigation_enable()
992 b43_radio_interference_mitigation_disable(struct b43_wldev *dev, int mode) in b43_radio_interference_mitigation_disable() argument
994 struct b43_phy *phy = &dev->phy; in b43_radio_interference_mitigation_disable()
1001 b43_phy_mask(dev, 0x042B, ~0x0800); in b43_radio_interference_mitigation_disable()
1002 b43_phy_set(dev, B43_PHY_G_CRS, 0x4000); in b43_radio_interference_mitigation_disable()
1006 b43_calc_nrssi_threshold(dev); in b43_radio_interference_mitigation_disable()
1008 b43_phy_mask(dev, 0x042B, ~0x0800); in b43_radio_interference_mitigation_disable()
1009 if (!dev->bad_frames_preempt) { in b43_radio_interference_mitigation_disable()
1010 b43_phy_mask(dev, B43_PHY_RADIO_BITFIELD, ~(1 << 11)); in b43_radio_interference_mitigation_disable()
1012 b43_phy_set(dev, B43_PHY_G_CRS, 0x4000); in b43_radio_interference_mitigation_disable()
1026 if (!(b43_phy_read(dev, 0x0033) & 0x0800)) in b43_radio_interference_mitigation_disable()
1064 b43_hf_write(dev, b43_hf_read(dev) & ~B43_HF_ACIW); in b43_radio_interference_mitigation_disable()
1065 b43_calc_nrssi_slope(dev); in b43_radio_interference_mitigation_disable()
1079 static u16 b43_radio_core_calibration_value(struct b43_wldev *dev) in b43_radio_core_calibration_value() argument
1090 reg = b43_radio_read16(dev, 0x60); in b43_radio_core_calibration_value()
1100 static u16 radio2050_rfover_val(struct b43_wldev *dev, in radio2050_rfover_val() argument
1103 struct b43_phy *phy = &dev->phy; in radio2050_rfover_val()
1105 struct ssb_sprom *sprom = dev->dev->bus_sprom; in radio2050_rfover_val()
1245 static u16 b43_radio_init2050(struct b43_wldev *dev) in b43_radio_init2050() argument
1247 struct b43_phy *phy = &dev->phy; in b43_radio_init2050()
1257 sav.radio_43 = b43_radio_read16(dev, 0x43); in b43_radio_init2050()
1258 sav.radio_51 = b43_radio_read16(dev, 0x51); in b43_radio_init2050()
1259 sav.radio_52 = b43_radio_read16(dev, 0x52); in b43_radio_init2050()
1260 sav.phy_pgactl = b43_phy_read(dev, B43_PHY_PGACTL); in b43_radio_init2050()
1261 sav.phy_cck_5A = b43_phy_read(dev, B43_PHY_CCK(0x5A)); in b43_radio_init2050()
1262 sav.phy_cck_59 = b43_phy_read(dev, B43_PHY_CCK(0x59)); in b43_radio_init2050()
1263 sav.phy_cck_58 = b43_phy_read(dev, B43_PHY_CCK(0x58)); in b43_radio_init2050()
1266 sav.phy_cck_30 = b43_phy_read(dev, B43_PHY_CCK(0x30)); in b43_radio_init2050()
1267 sav.reg_3EC = b43_read16(dev, 0x3EC); in b43_radio_init2050()
1269 b43_phy_write(dev, B43_PHY_CCK(0x30), 0xFF); in b43_radio_init2050()
1270 b43_write16(dev, 0x3EC, 0x3F3F); in b43_radio_init2050()
1272 sav.phy_rfover = b43_phy_read(dev, B43_PHY_RFOVER); in b43_radio_init2050()
1273 sav.phy_rfoverval = b43_phy_read(dev, B43_PHY_RFOVERVAL); in b43_radio_init2050()
1274 sav.phy_analogover = b43_phy_read(dev, B43_PHY_ANALOGOVER); in b43_radio_init2050()
1276 b43_phy_read(dev, B43_PHY_ANALOGOVERVAL); in b43_radio_init2050()
1277 sav.phy_crs0 = b43_phy_read(dev, B43_PHY_CRS0); in b43_radio_init2050()
1278 sav.phy_classctl = b43_phy_read(dev, B43_PHY_CLASSCTL); in b43_radio_init2050()
1280 b43_phy_set(dev, B43_PHY_ANALOGOVER, 0x0003); in b43_radio_init2050()
1281 b43_phy_mask(dev, B43_PHY_ANALOGOVERVAL, 0xFFFC); in b43_radio_init2050()
1282 b43_phy_mask(dev, B43_PHY_CRS0, 0x7FFF); in b43_radio_init2050()
1283 b43_phy_mask(dev, B43_PHY_CLASSCTL, 0xFFFC); in b43_radio_init2050()
1285 sav.phy_lo_mask = b43_phy_read(dev, B43_PHY_LO_MASK); in b43_radio_init2050()
1286 sav.phy_lo_ctl = b43_phy_read(dev, B43_PHY_LO_CTL); in b43_radio_init2050()
1289 b43_phy_write(dev, B43_PHY_LO_MASK, 0xC020); in b43_radio_init2050()
1291 b43_phy_write(dev, B43_PHY_LO_MASK, 0x8020); in b43_radio_init2050()
1292 b43_phy_write(dev, B43_PHY_LO_CTL, 0); in b43_radio_init2050()
1295 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1296 radio2050_rfover_val(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1298 b43_phy_write(dev, B43_PHY_RFOVER, in b43_radio_init2050()
1299 radio2050_rfover_val(dev, B43_PHY_RFOVER, 0)); in b43_radio_init2050()
1301 b43_write16(dev, 0x3E2, b43_read16(dev, 0x3E2) | 0x8000); in b43_radio_init2050()
1303 sav.phy_syncctl = b43_phy_read(dev, B43_PHY_SYNCCTL); in b43_radio_init2050()
1304 b43_phy_mask(dev, B43_PHY_SYNCCTL, 0xFF7F); in b43_radio_init2050()
1305 sav.reg_3E6 = b43_read16(dev, 0x3E6); in b43_radio_init2050()
1306 sav.reg_3F4 = b43_read16(dev, 0x3F4); in b43_radio_init2050()
1309 b43_write16(dev, 0x03E6, 0x0122); in b43_radio_init2050()
1312 b43_phy_maskset(dev, B43_PHY_CCK(0x03), 0xFFBF, 0x40); in b43_radio_init2050()
1314 b43_write16(dev, B43_MMIO_CHANNEL_EXT, in b43_radio_init2050()
1315 (b43_read16(dev, B43_MMIO_CHANNEL_EXT) | 0x2000)); in b43_radio_init2050()
1318 rcc = b43_radio_core_calibration_value(dev); in b43_radio_init2050()
1321 b43_radio_write16(dev, 0x78, 0x26); in b43_radio_init2050()
1323 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1324 radio2050_rfover_val(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1327 b43_phy_write(dev, B43_PHY_PGACTL, 0xBFAF); in b43_radio_init2050()
1328 b43_phy_write(dev, B43_PHY_CCK(0x2B), 0x1403); in b43_radio_init2050()
1330 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1331 radio2050_rfover_val(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1334 b43_phy_write(dev, B43_PHY_PGACTL, 0xBFA0); in b43_radio_init2050()
1335 b43_radio_set(dev, 0x51, 0x0004); in b43_radio_init2050()
1337 b43_radio_write16(dev, 0x43, 0x1F); in b43_radio_init2050()
1339 b43_radio_write16(dev, 0x52, 0); in b43_radio_init2050()
1340 b43_radio_maskset(dev, 0x43, 0xFFF0, 0x0009); in b43_radio_init2050()
1342 b43_phy_write(dev, B43_PHY_CCK(0x58), 0); in b43_radio_init2050()
1345 b43_phy_write(dev, B43_PHY_CCK(0x5A), 0x0480); in b43_radio_init2050()
1346 b43_phy_write(dev, B43_PHY_CCK(0x59), 0xC810); in b43_radio_init2050()
1347 b43_phy_write(dev, B43_PHY_CCK(0x58), 0x000D); in b43_radio_init2050()
1349 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1350 radio2050_rfover_val(dev, in b43_radio_init2050()
1354 b43_phy_write(dev, B43_PHY_PGACTL, 0xAFB0); in b43_radio_init2050()
1357 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1358 radio2050_rfover_val(dev, in b43_radio_init2050()
1362 b43_phy_write(dev, B43_PHY_PGACTL, 0xEFB0); in b43_radio_init2050()
1365 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1366 radio2050_rfover_val(dev, in b43_radio_init2050()
1370 b43_phy_write(dev, B43_PHY_PGACTL, 0xFFF0); in b43_radio_init2050()
1372 tmp1 += b43_phy_read(dev, B43_PHY_LO_LEAKAGE); in b43_radio_init2050()
1373 b43_phy_write(dev, B43_PHY_CCK(0x58), 0); in b43_radio_init2050()
1375 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1376 radio2050_rfover_val(dev, in b43_radio_init2050()
1380 b43_phy_write(dev, B43_PHY_PGACTL, 0xAFB0); in b43_radio_init2050()
1384 b43_phy_write(dev, B43_PHY_CCK(0x58), 0); in b43_radio_init2050()
1390 b43_radio_write16(dev, 0x78, radio78); in b43_radio_init2050()
1393 b43_phy_write(dev, B43_PHY_CCK(0x5A), 0x0D80); in b43_radio_init2050()
1394 b43_phy_write(dev, B43_PHY_CCK(0x59), 0xC810); in b43_radio_init2050()
1395 b43_phy_write(dev, B43_PHY_CCK(0x58), 0x000D); in b43_radio_init2050()
1397 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1398 radio2050_rfover_val(dev, in b43_radio_init2050()
1403 b43_phy_write(dev, B43_PHY_PGACTL, 0xAFB0); in b43_radio_init2050()
1406 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1407 radio2050_rfover_val(dev, in b43_radio_init2050()
1412 b43_phy_write(dev, B43_PHY_PGACTL, 0xEFB0); in b43_radio_init2050()
1415 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1416 radio2050_rfover_val(dev, in b43_radio_init2050()
1421 b43_phy_write(dev, B43_PHY_PGACTL, 0xFFF0); in b43_radio_init2050()
1423 tmp2 += b43_phy_read(dev, B43_PHY_LO_LEAKAGE); in b43_radio_init2050()
1424 b43_phy_write(dev, B43_PHY_CCK(0x58), 0); in b43_radio_init2050()
1426 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_radio_init2050()
1427 radio2050_rfover_val(dev, in b43_radio_init2050()
1432 b43_phy_write(dev, B43_PHY_PGACTL, 0xAFB0); in b43_radio_init2050()
1441 b43_phy_write(dev, B43_PHY_PGACTL, sav.phy_pgactl); in b43_radio_init2050()
1442 b43_radio_write16(dev, 0x51, sav.radio_51); in b43_radio_init2050()
1443 b43_radio_write16(dev, 0x52, sav.radio_52); in b43_radio_init2050()
1444 b43_radio_write16(dev, 0x43, sav.radio_43); in b43_radio_init2050()
1445 b43_phy_write(dev, B43_PHY_CCK(0x5A), sav.phy_cck_5A); in b43_radio_init2050()
1446 b43_phy_write(dev, B43_PHY_CCK(0x59), sav.phy_cck_59); in b43_radio_init2050()
1447 b43_phy_write(dev, B43_PHY_CCK(0x58), sav.phy_cck_58); in b43_radio_init2050()
1448 b43_write16(dev, 0x3E6, sav.reg_3E6); in b43_radio_init2050()
1450 b43_write16(dev, 0x3F4, sav.reg_3F4); in b43_radio_init2050()
1451 b43_phy_write(dev, B43_PHY_SYNCCTL, sav.phy_syncctl); in b43_radio_init2050()
1452 b43_synth_pu_workaround(dev, phy->channel); in b43_radio_init2050()
1454 b43_phy_write(dev, B43_PHY_CCK(0x30), sav.phy_cck_30); in b43_radio_init2050()
1455 b43_write16(dev, 0x3EC, sav.reg_3EC); in b43_radio_init2050()
1457 b43_write16(dev, B43_MMIO_PHY_RADIO, in b43_radio_init2050()
1458 b43_read16(dev, B43_MMIO_PHY_RADIO) in b43_radio_init2050()
1460 b43_phy_write(dev, B43_PHY_RFOVER, sav.phy_rfover); in b43_radio_init2050()
1461 b43_phy_write(dev, B43_PHY_RFOVERVAL, sav.phy_rfoverval); in b43_radio_init2050()
1462 b43_phy_write(dev, B43_PHY_ANALOGOVER, sav.phy_analogover); in b43_radio_init2050()
1463 b43_phy_write(dev, B43_PHY_ANALOGOVERVAL, in b43_radio_init2050()
1465 b43_phy_write(dev, B43_PHY_CRS0, sav.phy_crs0); in b43_radio_init2050()
1466 b43_phy_write(dev, B43_PHY_CLASSCTL, sav.phy_classctl); in b43_radio_init2050()
1468 b43_phy_write(dev, B43_PHY_LO_MASK, sav.phy_lo_mask); in b43_radio_init2050()
1469 b43_phy_write(dev, B43_PHY_LO_CTL, sav.phy_lo_ctl); in b43_radio_init2050()
1480 static void b43_phy_initb5(struct b43_wldev *dev) in b43_phy_initb5() argument
1482 struct b43_phy *phy = &dev->phy; in b43_phy_initb5()
1488 b43_radio_set(dev, 0x007A, 0x0050); in b43_phy_initb5()
1490 if ((dev->dev->board_vendor != SSB_BOARDVENDOR_BCM) && in b43_phy_initb5()
1491 (dev->dev->board_type != SSB_BOARD_BU4306)) { in b43_phy_initb5()
1494 b43_phy_write(dev, offset, value); in b43_phy_initb5()
1498 b43_phy_maskset(dev, 0x0035, 0xF0FF, 0x0700); in b43_phy_initb5()
1500 b43_phy_write(dev, 0x0038, 0x0667); in b43_phy_initb5()
1504 b43_radio_set(dev, 0x007A, 0x0020); in b43_phy_initb5()
1505 b43_radio_set(dev, 0x0051, 0x0004); in b43_phy_initb5()
1507 b43_write16(dev, B43_MMIO_PHY_RADIO, 0x0000); in b43_phy_initb5()
1509 b43_phy_set(dev, 0x0802, 0x0100); in b43_phy_initb5()
1510 b43_phy_set(dev, 0x042B, 0x2000); in b43_phy_initb5()
1512 b43_phy_write(dev, 0x001C, 0x186A); in b43_phy_initb5()
1514 b43_phy_maskset(dev, 0x0013, 0x00FF, 0x1900); in b43_phy_initb5()
1515 b43_phy_maskset(dev, 0x0035, 0xFFC0, 0x0064); in b43_phy_initb5()
1516 b43_phy_maskset(dev, 0x005D, 0xFF80, 0x000A); in b43_phy_initb5()
1519 if (dev->bad_frames_preempt) { in b43_phy_initb5()
1520 b43_phy_set(dev, B43_PHY_RADIO_BITFIELD, (1 << 11)); in b43_phy_initb5()
1524 b43_phy_write(dev, 0x0026, 0xCE00); in b43_phy_initb5()
1525 b43_phy_write(dev, 0x0021, 0x3763); in b43_phy_initb5()
1526 b43_phy_write(dev, 0x0022, 0x1BC3); in b43_phy_initb5()
1527 b43_phy_write(dev, 0x0023, 0x06F9); in b43_phy_initb5()
1528 b43_phy_write(dev, 0x0024, 0x037E); in b43_phy_initb5()
1530 b43_phy_write(dev, 0x0026, 0xCC00); in b43_phy_initb5()
1531 b43_phy_write(dev, 0x0030, 0x00C6); in b43_phy_initb5()
1532 b43_write16(dev, 0x03EC, 0x3F22); in b43_phy_initb5()
1535 b43_phy_write(dev, 0x0020, 0x3E1C); in b43_phy_initb5()
1537 b43_phy_write(dev, 0x0020, 0x301C); in b43_phy_initb5()
1540 b43_write16(dev, 0x03E4, 0x3000); in b43_phy_initb5()
1544 b43_gphy_channel_switch(dev, 7, 0); in b43_phy_initb5()
1547 b43_radio_write16(dev, 0x0075, 0x0080); in b43_phy_initb5()
1548 b43_radio_write16(dev, 0x0079, 0x0081); in b43_phy_initb5()
1551 b43_radio_write16(dev, 0x0050, 0x0020); in b43_phy_initb5()
1552 b43_radio_write16(dev, 0x0050, 0x0023); in b43_phy_initb5()
1555 b43_radio_write16(dev, 0x0050, 0x0020); in b43_phy_initb5()
1556 b43_radio_write16(dev, 0x005A, 0x0070); in b43_phy_initb5()
1559 b43_radio_write16(dev, 0x005B, 0x007B); in b43_phy_initb5()
1560 b43_radio_write16(dev, 0x005C, 0x00B0); in b43_phy_initb5()
1562 b43_radio_set(dev, 0x007A, 0x0007); in b43_phy_initb5()
1564 b43_gphy_channel_switch(dev, old_channel, 0); in b43_phy_initb5()
1566 b43_phy_write(dev, 0x0014, 0x0080); in b43_phy_initb5()
1567 b43_phy_write(dev, 0x0032, 0x00CA); in b43_phy_initb5()
1568 b43_phy_write(dev, 0x002A, 0x88A3); in b43_phy_initb5()
1570 b43_set_txpower_g(dev, &gphy->bbatt, &gphy->rfatt, gphy->tx_control); in b43_phy_initb5()
1573 b43_radio_write16(dev, 0x005D, 0x000D); in b43_phy_initb5()
1575 b43_write16(dev, 0x03E4, (b43_read16(dev, 0x03E4) & 0xFFC0) | 0x0004); in b43_phy_initb5()
1579 static void b43_phy_initb6(struct b43_wldev *dev) in b43_phy_initb6() argument
1581 struct b43_phy *phy = &dev->phy; in b43_phy_initb6()
1586 b43_phy_write(dev, 0x003E, 0x817A); in b43_phy_initb6()
1587 b43_radio_write16(dev, 0x007A, in b43_phy_initb6()
1588 (b43_radio_read16(dev, 0x007A) | 0x0058)); in b43_phy_initb6()
1590 b43_radio_write16(dev, 0x51, 0x37); in b43_phy_initb6()
1591 b43_radio_write16(dev, 0x52, 0x70); in b43_phy_initb6()
1592 b43_radio_write16(dev, 0x53, 0xB3); in b43_phy_initb6()
1593 b43_radio_write16(dev, 0x54, 0x9B); in b43_phy_initb6()
1594 b43_radio_write16(dev, 0x5A, 0x88); in b43_phy_initb6()
1595 b43_radio_write16(dev, 0x5B, 0x88); in b43_phy_initb6()
1596 b43_radio_write16(dev, 0x5D, 0x88); in b43_phy_initb6()
1597 b43_radio_write16(dev, 0x5E, 0x88); in b43_phy_initb6()
1598 b43_radio_write16(dev, 0x7D, 0x88); in b43_phy_initb6()
1599 b43_hf_write(dev, b43_hf_read(dev) in b43_phy_initb6()
1604 b43_radio_write16(dev, 0x51, 0); in b43_phy_initb6()
1605 b43_radio_write16(dev, 0x52, 0x40); in b43_phy_initb6()
1606 b43_radio_write16(dev, 0x53, 0xB7); in b43_phy_initb6()
1607 b43_radio_write16(dev, 0x54, 0x98); in b43_phy_initb6()
1608 b43_radio_write16(dev, 0x5A, 0x88); in b43_phy_initb6()
1609 b43_radio_write16(dev, 0x5B, 0x6B); in b43_phy_initb6()
1610 b43_radio_write16(dev, 0x5C, 0x0F); in b43_phy_initb6()
1611 if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_ALTIQ) { in b43_phy_initb6()
1612 b43_radio_write16(dev, 0x5D, 0xFA); in b43_phy_initb6()
1613 b43_radio_write16(dev, 0x5E, 0xD8); in b43_phy_initb6()
1615 b43_radio_write16(dev, 0x5D, 0xF5); in b43_phy_initb6()
1616 b43_radio_write16(dev, 0x5E, 0xB8); in b43_phy_initb6()
1618 b43_radio_write16(dev, 0x0073, 0x0003); in b43_phy_initb6()
1619 b43_radio_write16(dev, 0x007D, 0x00A8); in b43_phy_initb6()
1620 b43_radio_write16(dev, 0x007C, 0x0001); in b43_phy_initb6()
1621 b43_radio_write16(dev, 0x007E, 0x0008); in b43_phy_initb6()
1625 b43_phy_write(dev, offset, val); in b43_phy_initb6()
1630 b43_phy_write(dev, offset, val); in b43_phy_initb6()
1635 b43_phy_write(dev, offset, (val & 0x3F3F)); in b43_phy_initb6()
1639 b43_radio_set(dev, 0x007A, 0x0020); in b43_phy_initb6()
1640 b43_radio_set(dev, 0x0051, 0x0004); in b43_phy_initb6()
1641 b43_phy_set(dev, 0x0802, 0x0100); in b43_phy_initb6()
1642 b43_phy_set(dev, 0x042B, 0x2000); in b43_phy_initb6()
1643 b43_phy_write(dev, 0x5B, 0); in b43_phy_initb6()
1644 b43_phy_write(dev, 0x5C, 0); in b43_phy_initb6()
1649 b43_gphy_channel_switch(dev, 1, 0); in b43_phy_initb6()
1651 b43_gphy_channel_switch(dev, 13, 0); in b43_phy_initb6()
1653 b43_radio_write16(dev, 0x0050, 0x0020); in b43_phy_initb6()
1654 b43_radio_write16(dev, 0x0050, 0x0023); in b43_phy_initb6()
1657 b43_radio_write16(dev, 0x7C, (b43_radio_read16(dev, 0x7C) in b43_phy_initb6()
1659 b43_radio_write16(dev, 0x50, 0x20); in b43_phy_initb6()
1662 b43_radio_write16(dev, 0x50, 0x20); in b43_phy_initb6()
1663 b43_radio_write16(dev, 0x5A, 0x70); in b43_phy_initb6()
1664 b43_radio_write16(dev, 0x5B, 0x7B); in b43_phy_initb6()
1665 b43_radio_write16(dev, 0x5C, 0xB0); in b43_phy_initb6()
1667 b43_radio_maskset(dev, 0x007A, 0x00F8, 0x0007); in b43_phy_initb6()
1669 b43_gphy_channel_switch(dev, old_channel, 0); in b43_phy_initb6()
1671 b43_phy_write(dev, 0x0014, 0x0200); in b43_phy_initb6()
1673 b43_phy_write(dev, 0x2A, 0x88C2); in b43_phy_initb6()
1675 b43_phy_write(dev, 0x2A, 0x8AC0); in b43_phy_initb6()
1676 b43_phy_write(dev, 0x0038, 0x0668); in b43_phy_initb6()
1677 b43_set_txpower_g(dev, &gphy->bbatt, &gphy->rfatt, gphy->tx_control); in b43_phy_initb6()
1679 b43_phy_maskset(dev, 0x5D, 0xFF80, 0x0003); in b43_phy_initb6()
1681 b43_radio_write16(dev, 0x005D, 0x000D); in b43_phy_initb6()
1684 b43_write16(dev, 0x3E4, 9); in b43_phy_initb6()
1685 b43_phy_mask(dev, 0x61, 0x0FFF); in b43_phy_initb6()
1687 b43_phy_maskset(dev, 0x0002, 0xFFC0, 0x0004); in b43_phy_initb6()
1692 b43_write16(dev, 0x03E6, 0x0); in b43_phy_initb6()
1695 static void b43_calc_loopback_gain(struct b43_wldev *dev) in b43_calc_loopback_gain() argument
1697 struct b43_phy *phy = &dev->phy; in b43_calc_loopback_gain()
1706 backup_phy[0] = b43_phy_read(dev, B43_PHY_CRS0); in b43_calc_loopback_gain()
1707 backup_phy[1] = b43_phy_read(dev, B43_PHY_CCKBBANDCFG); in b43_calc_loopback_gain()
1708 backup_phy[2] = b43_phy_read(dev, B43_PHY_RFOVER); in b43_calc_loopback_gain()
1709 backup_phy[3] = b43_phy_read(dev, B43_PHY_RFOVERVAL); in b43_calc_loopback_gain()
1711 backup_phy[4] = b43_phy_read(dev, B43_PHY_ANALOGOVER); in b43_calc_loopback_gain()
1712 backup_phy[5] = b43_phy_read(dev, B43_PHY_ANALOGOVERVAL); in b43_calc_loopback_gain()
1714 backup_phy[6] = b43_phy_read(dev, B43_PHY_CCK(0x5A)); in b43_calc_loopback_gain()
1715 backup_phy[7] = b43_phy_read(dev, B43_PHY_CCK(0x59)); in b43_calc_loopback_gain()
1716 backup_phy[8] = b43_phy_read(dev, B43_PHY_CCK(0x58)); in b43_calc_loopback_gain()
1717 backup_phy[9] = b43_phy_read(dev, B43_PHY_CCK(0x0A)); in b43_calc_loopback_gain()
1718 backup_phy[10] = b43_phy_read(dev, B43_PHY_CCK(0x03)); in b43_calc_loopback_gain()
1719 backup_phy[11] = b43_phy_read(dev, B43_PHY_LO_MASK); in b43_calc_loopback_gain()
1720 backup_phy[12] = b43_phy_read(dev, B43_PHY_LO_CTL); in b43_calc_loopback_gain()
1721 backup_phy[13] = b43_phy_read(dev, B43_PHY_CCK(0x2B)); in b43_calc_loopback_gain()
1722 backup_phy[14] = b43_phy_read(dev, B43_PHY_PGACTL); in b43_calc_loopback_gain()
1723 backup_phy[15] = b43_phy_read(dev, B43_PHY_LO_LEAKAGE); in b43_calc_loopback_gain()
1725 backup_radio[0] = b43_radio_read16(dev, 0x52); in b43_calc_loopback_gain()
1726 backup_radio[1] = b43_radio_read16(dev, 0x43); in b43_calc_loopback_gain()
1727 backup_radio[2] = b43_radio_read16(dev, 0x7A); in b43_calc_loopback_gain()
1729 b43_phy_mask(dev, B43_PHY_CRS0, 0x3FFF); in b43_calc_loopback_gain()
1730 b43_phy_set(dev, B43_PHY_CCKBBANDCFG, 0x8000); in b43_calc_loopback_gain()
1731 b43_phy_set(dev, B43_PHY_RFOVER, 0x0002); in b43_calc_loopback_gain()
1732 b43_phy_mask(dev, B43_PHY_RFOVERVAL, 0xFFFD); in b43_calc_loopback_gain()
1733 b43_phy_set(dev, B43_PHY_RFOVER, 0x0001); in b43_calc_loopback_gain()
1734 b43_phy_mask(dev, B43_PHY_RFOVERVAL, 0xFFFE); in b43_calc_loopback_gain()
1736 b43_phy_set(dev, B43_PHY_ANALOGOVER, 0x0001); in b43_calc_loopback_gain()
1737 b43_phy_mask(dev, B43_PHY_ANALOGOVERVAL, 0xFFFE); in b43_calc_loopback_gain()
1738 b43_phy_set(dev, B43_PHY_ANALOGOVER, 0x0002); in b43_calc_loopback_gain()
1739 b43_phy_mask(dev, B43_PHY_ANALOGOVERVAL, 0xFFFD); in b43_calc_loopback_gain()
1741 b43_phy_set(dev, B43_PHY_RFOVER, 0x000C); in b43_calc_loopback_gain()
1742 b43_phy_set(dev, B43_PHY_RFOVERVAL, 0x000C); in b43_calc_loopback_gain()
1743 b43_phy_set(dev, B43_PHY_RFOVER, 0x0030); in b43_calc_loopback_gain()
1744 b43_phy_maskset(dev, B43_PHY_RFOVERVAL, 0xFFCF, 0x10); in b43_calc_loopback_gain()
1746 b43_phy_write(dev, B43_PHY_CCK(0x5A), 0x0780); in b43_calc_loopback_gain()
1747 b43_phy_write(dev, B43_PHY_CCK(0x59), 0xC810); in b43_calc_loopback_gain()
1748 b43_phy_write(dev, B43_PHY_CCK(0x58), 0x000D); in b43_calc_loopback_gain()
1750 b43_phy_set(dev, B43_PHY_CCK(0x0A), 0x2000); in b43_calc_loopback_gain()
1752 b43_phy_set(dev, B43_PHY_ANALOGOVER, 0x0004); in b43_calc_loopback_gain()
1753 b43_phy_mask(dev, B43_PHY_ANALOGOVERVAL, 0xFFFB); in b43_calc_loopback_gain()
1755 b43_phy_maskset(dev, B43_PHY_CCK(0x03), 0xFF9F, 0x40); in b43_calc_loopback_gain()
1758 b43_radio_write16(dev, 0x43, 0x000F); in b43_calc_loopback_gain()
1760 b43_radio_write16(dev, 0x52, 0); in b43_calc_loopback_gain()
1761 b43_radio_maskset(dev, 0x43, 0xFFF0, 0x9); in b43_calc_loopback_gain()
1763 b43_gphy_set_baseband_attenuation(dev, 11); in b43_calc_loopback_gain()
1766 b43_phy_write(dev, B43_PHY_LO_MASK, 0xC020); in b43_calc_loopback_gain()
1768 b43_phy_write(dev, B43_PHY_LO_MASK, 0x8020); in b43_calc_loopback_gain()
1769 b43_phy_write(dev, B43_PHY_LO_CTL, 0); in b43_calc_loopback_gain()
1771 b43_phy_maskset(dev, B43_PHY_CCK(0x2B), 0xFFC0, 0x01); in b43_calc_loopback_gain()
1772 b43_phy_maskset(dev, B43_PHY_CCK(0x2B), 0xC0FF, 0x800); in b43_calc_loopback_gain()
1774 b43_phy_set(dev, B43_PHY_RFOVER, 0x0100); in b43_calc_loopback_gain()
1775 b43_phy_mask(dev, B43_PHY_RFOVERVAL, 0xCFFF); in b43_calc_loopback_gain()
1777 if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_EXTLNA) { in b43_calc_loopback_gain()
1779 b43_phy_set(dev, B43_PHY_RFOVER, 0x0800); in b43_calc_loopback_gain()
1780 b43_phy_set(dev, B43_PHY_RFOVERVAL, 0x8000); in b43_calc_loopback_gain()
1783 b43_radio_mask(dev, 0x7A, 0x00F7); in b43_calc_loopback_gain()
1789 b43_radio_write16(dev, 0x43, i); in b43_calc_loopback_gain()
1790 b43_phy_maskset(dev, B43_PHY_RFOVERVAL, 0xF0FF, (j << 8)); in b43_calc_loopback_gain()
1791 b43_phy_maskset(dev, B43_PHY_PGACTL, 0x0FFF, 0xA000); in b43_calc_loopback_gain()
1792 b43_phy_set(dev, B43_PHY_PGACTL, 0xF000); in b43_calc_loopback_gain()
1794 if (b43_phy_read(dev, B43_PHY_LO_LEAKAGE) >= 0xDFC) in b43_calc_loopback_gain()
1802 b43_phy_set(dev, B43_PHY_RFOVERVAL, 0x30); in b43_calc_loopback_gain()
1805 b43_phy_maskset(dev, B43_PHY_RFOVERVAL, 0xF0FF, (j << 8)); in b43_calc_loopback_gain()
1806 b43_phy_maskset(dev, B43_PHY_PGACTL, 0x0FFF, 0xA000); in b43_calc_loopback_gain()
1807 b43_phy_set(dev, B43_PHY_PGACTL, 0xF000); in b43_calc_loopback_gain()
1810 if (b43_phy_read(dev, B43_PHY_LO_LEAKAGE) >= 0xDFC) in b43_calc_loopback_gain()
1818 b43_phy_write(dev, B43_PHY_ANALOGOVER, backup_phy[4]); in b43_calc_loopback_gain()
1819 b43_phy_write(dev, B43_PHY_ANALOGOVERVAL, backup_phy[5]); in b43_calc_loopback_gain()
1821 b43_phy_write(dev, B43_PHY_CCK(0x5A), backup_phy[6]); in b43_calc_loopback_gain()
1822 b43_phy_write(dev, B43_PHY_CCK(0x59), backup_phy[7]); in b43_calc_loopback_gain()
1823 b43_phy_write(dev, B43_PHY_CCK(0x58), backup_phy[8]); in b43_calc_loopback_gain()
1824 b43_phy_write(dev, B43_PHY_CCK(0x0A), backup_phy[9]); in b43_calc_loopback_gain()
1825 b43_phy_write(dev, B43_PHY_CCK(0x03), backup_phy[10]); in b43_calc_loopback_gain()
1826 b43_phy_write(dev, B43_PHY_LO_MASK, backup_phy[11]); in b43_calc_loopback_gain()
1827 b43_phy_write(dev, B43_PHY_LO_CTL, backup_phy[12]); in b43_calc_loopback_gain()
1828 b43_phy_write(dev, B43_PHY_CCK(0x2B), backup_phy[13]); in b43_calc_loopback_gain()
1829 b43_phy_write(dev, B43_PHY_PGACTL, backup_phy[14]); in b43_calc_loopback_gain()
1831 b43_gphy_set_baseband_attenuation(dev, backup_bband); in b43_calc_loopback_gain()
1833 b43_radio_write16(dev, 0x52, backup_radio[0]); in b43_calc_loopback_gain()
1834 b43_radio_write16(dev, 0x43, backup_radio[1]); in b43_calc_loopback_gain()
1835 b43_radio_write16(dev, 0x7A, backup_radio[2]); in b43_calc_loopback_gain()
1837 b43_phy_write(dev, B43_PHY_RFOVER, backup_phy[2] | 0x0003); in b43_calc_loopback_gain()
1839 b43_phy_write(dev, B43_PHY_RFOVER, backup_phy[2]); in b43_calc_loopback_gain()
1840 b43_phy_write(dev, B43_PHY_RFOVERVAL, backup_phy[3]); in b43_calc_loopback_gain()
1841 b43_phy_write(dev, B43_PHY_CRS0, backup_phy[0]); in b43_calc_loopback_gain()
1842 b43_phy_write(dev, B43_PHY_CCKBBANDCFG, backup_phy[1]); in b43_calc_loopback_gain()
1849 static void b43_hardware_pctl_early_init(struct b43_wldev *dev) in b43_hardware_pctl_early_init() argument
1851 struct b43_phy *phy = &dev->phy; in b43_hardware_pctl_early_init()
1853 if (!b43_has_hardware_pctl(dev)) { in b43_hardware_pctl_early_init()
1854 b43_phy_write(dev, 0x047A, 0xC111); in b43_hardware_pctl_early_init()
1858 b43_phy_mask(dev, 0x0036, 0xFEFF); in b43_hardware_pctl_early_init()
1859 b43_phy_write(dev, 0x002F, 0x0202); in b43_hardware_pctl_early_init()
1860 b43_phy_set(dev, 0x047C, 0x0002); in b43_hardware_pctl_early_init()
1861 b43_phy_set(dev, 0x047A, 0xF000); in b43_hardware_pctl_early_init()
1863 b43_phy_maskset(dev, 0x047A, 0xFF0F, 0x0010); in b43_hardware_pctl_early_init()
1864 b43_phy_set(dev, 0x005D, 0x8000); in b43_hardware_pctl_early_init()
1865 b43_phy_maskset(dev, 0x004E, 0xFFC0, 0x0010); in b43_hardware_pctl_early_init()
1866 b43_phy_write(dev, 0x002E, 0xC07F); in b43_hardware_pctl_early_init()
1867 b43_phy_set(dev, 0x0036, 0x0400); in b43_hardware_pctl_early_init()
1869 b43_phy_set(dev, 0x0036, 0x0200); in b43_hardware_pctl_early_init()
1870 b43_phy_set(dev, 0x0036, 0x0400); in b43_hardware_pctl_early_init()
1871 b43_phy_mask(dev, 0x005D, 0x7FFF); in b43_hardware_pctl_early_init()
1872 b43_phy_mask(dev, 0x004F, 0xFFFE); in b43_hardware_pctl_early_init()
1873 b43_phy_maskset(dev, 0x004E, 0xFFC0, 0x0010); in b43_hardware_pctl_early_init()
1874 b43_phy_write(dev, 0x002E, 0xC07F); in b43_hardware_pctl_early_init()
1875 b43_phy_maskset(dev, 0x047A, 0xFF0F, 0x0010); in b43_hardware_pctl_early_init()
1880 static void b43_hardware_pctl_init_gphy(struct b43_wldev *dev) in b43_hardware_pctl_init_gphy() argument
1882 struct b43_phy *phy = &dev->phy; in b43_hardware_pctl_init_gphy()
1885 if (!b43_has_hardware_pctl(dev)) { in b43_hardware_pctl_init_gphy()
1887 b43_hf_write(dev, b43_hf_read(dev) & ~B43_HF_HWPCTL); in b43_hardware_pctl_init_gphy()
1891 b43_phy_maskset(dev, 0x0036, 0xFFC0, (gphy->tgt_idle_tssi - gphy->cur_idle_tssi)); in b43_hardware_pctl_init_gphy()
1892 b43_phy_maskset(dev, 0x0478, 0xFF00, (gphy->tgt_idle_tssi - gphy->cur_idle_tssi)); in b43_hardware_pctl_init_gphy()
1893 b43_gphy_tssi_power_lt_init(dev); in b43_hardware_pctl_init_gphy()
1894 b43_gphy_gain_lt_init(dev); in b43_hardware_pctl_init_gphy()
1895 b43_phy_mask(dev, 0x0060, 0xFFBF); in b43_hardware_pctl_init_gphy()
1896 b43_phy_write(dev, 0x0014, 0x0000); in b43_hardware_pctl_init_gphy()
1899 b43_phy_set(dev, 0x0478, 0x0800); in b43_hardware_pctl_init_gphy()
1900 b43_phy_mask(dev, 0x0478, 0xFEFF); in b43_hardware_pctl_init_gphy()
1901 b43_phy_mask(dev, 0x0801, 0xFFBF); in b43_hardware_pctl_init_gphy()
1903 b43_gphy_dc_lt_init(dev, 1); in b43_hardware_pctl_init_gphy()
1906 b43_hf_write(dev, b43_hf_read(dev) | B43_HF_HWPCTL); in b43_hardware_pctl_init_gphy()
1910 static void b43_phy_init_pctl(struct b43_wldev *dev) in b43_phy_init_pctl() argument
1912 struct b43_phy *phy = &dev->phy; in b43_phy_init_pctl()
1920 if ((dev->dev->board_vendor == SSB_BOARDVENDOR_BCM) && in b43_phy_init_pctl()
1921 (dev->dev->board_type == SSB_BOARD_BU4306)) in b43_phy_init_pctl()
1924 b43_phy_write(dev, 0x0028, 0x8018); in b43_phy_init_pctl()
1927 b43_write16(dev, B43_MMIO_PHY0, b43_read16(dev, B43_MMIO_PHY0) in b43_phy_init_pctl()
1932 b43_hardware_pctl_early_init(dev); in b43_phy_init_pctl()
1935 b43_radio_maskset(dev, 0x0076, 0x00F7, 0x0084); in b43_phy_init_pctl()
1952 b43_set_txpower_g(dev, &bbatt, &rfatt, 0); in b43_phy_init_pctl()
1954 b43_dummy_transmission(dev, false, true); in b43_phy_init_pctl()
1955 gphy->cur_idle_tssi = b43_phy_read(dev, B43_PHY_ITSSI); in b43_phy_init_pctl()
1959 b43dbg(dev->wl, in b43_phy_init_pctl()
1968 b43_radio_mask(dev, 0x0076, 0xFF7B); in b43_phy_init_pctl()
1970 b43_set_txpower_g(dev, &old_bbatt, in b43_phy_init_pctl()
1974 b43_hardware_pctl_init_gphy(dev); in b43_phy_init_pctl()
1975 b43_shm_clear_tssi(dev); in b43_phy_init_pctl()
1978 static void b43_phy_inita(struct b43_wldev *dev) in b43_phy_inita() argument
1980 struct b43_phy *phy = &dev->phy; in b43_phy_inita()
1985 if (b43_phy_read(dev, B43_PHY_ENCORE) & B43_PHY_ENCORE_EN) in b43_phy_inita()
1986 b43_phy_set(dev, B43_PHY_ENCORE, 0x0010); in b43_phy_inita()
1988 b43_phy_mask(dev, B43_PHY_ENCORE, ~0x1010); in b43_phy_inita()
1991 b43_wa_all(dev); in b43_phy_inita()
1993 if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) in b43_phy_inita()
1994 b43_phy_maskset(dev, B43_PHY_OFDM(0x6E), 0xE000, 0x3CF); in b43_phy_inita()
1997 static void b43_phy_initg(struct b43_wldev *dev) in b43_phy_initg() argument
1999 struct b43_phy *phy = &dev->phy; in b43_phy_initg()
2004 b43_phy_initb5(dev); in b43_phy_initg()
2006 b43_phy_initb6(dev); in b43_phy_initg()
2009 b43_phy_inita(dev); in b43_phy_initg()
2012 b43_phy_write(dev, B43_PHY_ANALOGOVER, 0); in b43_phy_initg()
2013 b43_phy_write(dev, B43_PHY_ANALOGOVERVAL, 0); in b43_phy_initg()
2016 b43_phy_write(dev, B43_PHY_RFOVER, 0); in b43_phy_initg()
2017 b43_phy_write(dev, B43_PHY_PGACTL, 0xC0); in b43_phy_initg()
2020 b43_phy_write(dev, B43_PHY_RFOVER, 0x400); in b43_phy_initg()
2021 b43_phy_write(dev, B43_PHY_PGACTL, 0xC0); in b43_phy_initg()
2024 tmp = b43_phy_read(dev, B43_PHY_VERSION_OFDM); in b43_phy_initg()
2027 b43_phy_write(dev, B43_PHY_OFDM(0xC2), 0x1816); in b43_phy_initg()
2028 b43_phy_write(dev, B43_PHY_OFDM(0xC3), 0x8006); in b43_phy_initg()
2031 b43_phy_maskset(dev, B43_PHY_OFDM(0xCC), 0x00FF, 0x1F00); in b43_phy_initg()
2035 b43_phy_write(dev, B43_PHY_OFDM(0x7E), 0x78); in b43_phy_initg()
2037 b43_phy_set(dev, B43_PHY_EXTG(0x01), 0x80); in b43_phy_initg()
2038 b43_phy_set(dev, B43_PHY_OFDM(0x3E), 0x4); in b43_phy_initg()
2041 b43_calc_loopback_gain(dev); in b43_phy_initg()
2045 gphy->initval = b43_radio_init2050(dev); in b43_phy_initg()
2047 b43_radio_write16(dev, 0x0078, gphy->initval); in b43_phy_initg()
2049 b43_lo_g_init(dev); in b43_phy_initg()
2051 b43_radio_write16(dev, 0x52, in b43_phy_initg()
2052 (b43_radio_read16(dev, 0x52) & 0xFF00) in b43_phy_initg()
2056 b43_radio_maskset(dev, 0x52, 0xFFF0, gphy->lo_control->tx_bias); in b43_phy_initg()
2059 b43_phy_maskset(dev, B43_PHY_CCK(0x36), 0x0FFF, (gphy->lo_control->tx_bias << 12)); in b43_phy_initg()
2061 if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) in b43_phy_initg()
2062 b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x8075); in b43_phy_initg()
2064 b43_phy_write(dev, B43_PHY_CCK(0x2E), 0x807F); in b43_phy_initg()
2066 b43_phy_write(dev, B43_PHY_CCK(0x2F), 0x101); in b43_phy_initg()
2068 b43_phy_write(dev, B43_PHY_CCK(0x2F), 0x202); in b43_phy_initg()
2070 b43_lo_g_adjust(dev); in b43_phy_initg()
2071 b43_phy_write(dev, B43_PHY_LO_MASK, 0x8078); in b43_phy_initg()
2074 if (!(dev->dev->bus_sprom->boardflags_lo & B43_BFL_RSSI)) { in b43_phy_initg()
2081 b43_nrssi_hw_update(dev, 0xFFFF); //FIXME? in b43_phy_initg()
2082 b43_calc_nrssi_threshold(dev); in b43_phy_initg()
2086 b43_calc_nrssi_slope(dev); in b43_phy_initg()
2088 b43_calc_nrssi_threshold(dev); in b43_phy_initg()
2091 b43_phy_write(dev, B43_PHY_EXTG(0x05), 0x3230); in b43_phy_initg()
2092 b43_phy_init_pctl(dev); in b43_phy_initg()
2096 if ((dev->dev->chip_id == 0x4306 in b43_phy_initg()
2097 && dev->dev->chip_pkg == 2) || 0) { in b43_phy_initg()
2098 b43_phy_mask(dev, B43_PHY_CRS0, 0xBFFF); in b43_phy_initg()
2099 b43_phy_mask(dev, B43_PHY_OFDM(0xC3), 0x7FFF); in b43_phy_initg()
2103 void b43_gphy_channel_switch(struct b43_wldev *dev, in b43_gphy_channel_switch() argument
2108 b43_synth_pu_workaround(dev, channel); in b43_gphy_channel_switch()
2110 b43_write16(dev, B43_MMIO_CHANNEL, channel2freq_bg(channel)); in b43_gphy_channel_switch()
2113 if (dev->dev->bus_sprom->country_code == in b43_gphy_channel_switch()
2115 b43_hf_write(dev, in b43_gphy_channel_switch()
2116 b43_hf_read(dev) & ~B43_HF_ACPR); in b43_gphy_channel_switch()
2118 b43_hf_write(dev, in b43_gphy_channel_switch()
2119 b43_hf_read(dev) | B43_HF_ACPR); in b43_gphy_channel_switch()
2120 b43_write16(dev, B43_MMIO_CHANNEL_EXT, in b43_gphy_channel_switch()
2121 b43_read16(dev, B43_MMIO_CHANNEL_EXT) in b43_gphy_channel_switch()
2124 b43_write16(dev, B43_MMIO_CHANNEL_EXT, in b43_gphy_channel_switch()
2125 b43_read16(dev, B43_MMIO_CHANNEL_EXT) in b43_gphy_channel_switch()
2130 static void default_baseband_attenuation(struct b43_wldev *dev, in default_baseband_attenuation() argument
2133 struct b43_phy *phy = &dev->phy; in default_baseband_attenuation()
2141 static void default_radio_attenuation(struct b43_wldev *dev, in default_radio_attenuation() argument
2144 struct b43_bus_dev *bdev = dev->dev; in default_radio_attenuation()
2145 struct b43_phy *phy = &dev->phy; in default_radio_attenuation()
2149 if (dev->dev->board_vendor == SSB_BOARDVENDOR_BCM && in default_radio_attenuation()
2150 dev->dev->board_type == SSB_BOARD_BCM4309G) { in default_radio_attenuation()
2151 if (dev->dev->board_rev < 0x43) { in default_radio_attenuation()
2154 } else if (dev->dev->board_rev < 0x51) { in default_radio_attenuation()
2237 static u16 default_tx_control(struct b43_wldev *dev) in default_tx_control() argument
2239 struct b43_phy *phy = &dev->phy; in default_tx_control()
2252 static u8 b43_gphy_aci_detect(struct b43_wldev *dev, u8 channel) in b43_gphy_aci_detect() argument
2254 struct b43_phy *phy = &dev->phy; in b43_gphy_aci_detect()
2260 saved = b43_phy_read(dev, 0x0403); in b43_gphy_aci_detect()
2261 b43_switch_channel(dev, channel); in b43_gphy_aci_detect()
2262 b43_phy_write(dev, 0x0403, (saved & 0xFFF8) | 5); in b43_gphy_aci_detect()
2264 rssi = b43_phy_read(dev, 0x048A) & 0x3F; in b43_gphy_aci_detect()
2271 temp = (b43_phy_read(dev, 0x047F) >> 8) & 0x3F; in b43_gphy_aci_detect()
2279 b43_phy_write(dev, 0x0403, saved); in b43_gphy_aci_detect()
2284 static u8 b43_gphy_aci_scan(struct b43_wldev *dev) in b43_gphy_aci_scan() argument
2286 struct b43_phy *phy = &dev->phy; in b43_gphy_aci_scan()
2294 b43_phy_lock(dev); in b43_gphy_aci_scan()
2295 b43_radio_lock(dev); in b43_gphy_aci_scan()
2296 b43_phy_mask(dev, 0x0802, 0xFFFC); in b43_gphy_aci_scan()
2297 b43_phy_mask(dev, B43_PHY_G_CRS, 0x7FFF); in b43_gphy_aci_scan()
2298 b43_set_all_gains(dev, 3, 8, 1); in b43_gphy_aci_scan()
2305 ret[i - 1] = b43_gphy_aci_detect(dev, i); in b43_gphy_aci_scan()
2307 b43_switch_channel(dev, channel); in b43_gphy_aci_scan()
2308 b43_phy_maskset(dev, 0x0802, 0xFFFC, 0x0003); in b43_gphy_aci_scan()
2309 b43_phy_mask(dev, 0x0403, 0xFFF8); in b43_gphy_aci_scan()
2310 b43_phy_set(dev, B43_PHY_G_CRS, 0x8000); in b43_gphy_aci_scan()
2311 b43_set_original_gains(dev); in b43_gphy_aci_scan()
2319 b43_radio_unlock(dev); in b43_gphy_aci_scan()
2320 b43_phy_unlock(dev); in b43_gphy_aci_scan()
2354 u8 *b43_generate_dyn_tssi2dbm_tab(struct b43_wldev *dev, in b43_generate_dyn_tssi2dbm_tab() argument
2363 b43err(dev->wl, "Could not allocate memory " in b43_generate_dyn_tssi2dbm_tab()
2370 b43err(dev->wl, "Could not generate " in b43_generate_dyn_tssi2dbm_tab()
2381 static int b43_gphy_init_tssi2dbm_table(struct b43_wldev *dev) in b43_gphy_init_tssi2dbm_table() argument
2383 struct b43_phy *phy = &dev->phy; in b43_gphy_init_tssi2dbm_table()
2387 pab0 = (s16) (dev->dev->bus_sprom->pa0b0); in b43_gphy_init_tssi2dbm_table()
2388 pab1 = (s16) (dev->dev->bus_sprom->pa0b1); in b43_gphy_init_tssi2dbm_table()
2389 pab2 = (s16) (dev->dev->bus_sprom->pa0b2); in b43_gphy_init_tssi2dbm_table()
2391 B43_WARN_ON((dev->dev->chip_id == 0x4301) && in b43_gphy_init_tssi2dbm_table()
2399 if ((s8) dev->dev->bus_sprom->itssi_bg != 0 && in b43_gphy_init_tssi2dbm_table()
2400 (s8) dev->dev->bus_sprom->itssi_bg != -1) { in b43_gphy_init_tssi2dbm_table()
2402 (s8) (dev->dev->bus_sprom->itssi_bg); in b43_gphy_init_tssi2dbm_table()
2405 gphy->tssi2dbm = b43_generate_dyn_tssi2dbm_tab(dev, pab0, in b43_gphy_init_tssi2dbm_table()
2419 static int b43_gphy_op_allocate(struct b43_wldev *dev) in b43_gphy_op_allocate() argument
2430 dev->phy.g = gphy; in b43_gphy_op_allocate()
2439 err = b43_gphy_init_tssi2dbm_table(dev); in b43_gphy_op_allocate()
2453 static void b43_gphy_op_prepare_structs(struct b43_wldev *dev) in b43_gphy_op_prepare_structs() argument
2455 struct b43_phy *phy = &dev->phy; in b43_gphy_op_prepare_structs()
2500 static void b43_gphy_op_free(struct b43_wldev *dev) in b43_gphy_op_free() argument
2502 struct b43_phy *phy = &dev->phy; in b43_gphy_op_free()
2513 dev->phy.g = NULL; in b43_gphy_op_free()
2516 static int b43_gphy_op_prepare_hardware(struct b43_wldev *dev) in b43_gphy_op_prepare_hardware() argument
2518 struct b43_phy *phy = &dev->phy; in b43_gphy_op_prepare_hardware()
2524 default_baseband_attenuation(dev, &gphy->bbatt); in b43_gphy_op_prepare_hardware()
2525 default_radio_attenuation(dev, &gphy->rfatt); in b43_gphy_op_prepare_hardware()
2526 gphy->tx_control = (default_tx_control(dev) << 4); in b43_gphy_op_prepare_hardware()
2527 generate_rfatt_list(dev, &lo->rfatt_list); in b43_gphy_op_prepare_hardware()
2528 generate_bbatt_list(dev, &lo->bbatt_list); in b43_gphy_op_prepare_hardware()
2531 b43_read32(dev, B43_MMIO_MACCTL); in b43_gphy_op_prepare_hardware()
2537 b43_wireless_core_reset(dev, 0); in b43_gphy_op_prepare_hardware()
2538 b43_phy_initg(dev); in b43_gphy_op_prepare_hardware()
2540 b43_wireless_core_reset(dev, 1); in b43_gphy_op_prepare_hardware()
2546 static int b43_gphy_op_init(struct b43_wldev *dev) in b43_gphy_op_init() argument
2548 b43_phy_initg(dev); in b43_gphy_op_init()
2553 static void b43_gphy_op_exit(struct b43_wldev *dev) in b43_gphy_op_exit() argument
2555 b43_lo_g_cleanup(dev); in b43_gphy_op_exit()
2558 static u16 b43_gphy_op_read(struct b43_wldev *dev, u16 reg) in b43_gphy_op_read() argument
2560 b43_write16f(dev, B43_MMIO_PHY_CONTROL, reg); in b43_gphy_op_read()
2561 return b43_read16(dev, B43_MMIO_PHY_DATA); in b43_gphy_op_read()
2564 static void b43_gphy_op_write(struct b43_wldev *dev, u16 reg, u16 value) in b43_gphy_op_write() argument
2566 b43_write16f(dev, B43_MMIO_PHY_CONTROL, reg); in b43_gphy_op_write()
2567 b43_write16(dev, B43_MMIO_PHY_DATA, value); in b43_gphy_op_write()
2570 static u16 b43_gphy_op_radio_read(struct b43_wldev *dev, u16 reg) in b43_gphy_op_radio_read() argument
2577 b43_write16f(dev, B43_MMIO_RADIO_CONTROL, reg); in b43_gphy_op_radio_read()
2578 return b43_read16(dev, B43_MMIO_RADIO_DATA_LOW); in b43_gphy_op_radio_read()
2581 static void b43_gphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value) in b43_gphy_op_radio_write() argument
2586 b43_write16f(dev, B43_MMIO_RADIO_CONTROL, reg); in b43_gphy_op_radio_write()
2587 b43_write16(dev, B43_MMIO_RADIO_DATA_LOW, value); in b43_gphy_op_radio_write()
2590 static bool b43_gphy_op_supports_hwpctl(struct b43_wldev *dev) in b43_gphy_op_supports_hwpctl() argument
2592 return (dev->phy.rev >= 6); in b43_gphy_op_supports_hwpctl()
2595 static void b43_gphy_op_software_rfkill(struct b43_wldev *dev, in b43_gphy_op_software_rfkill() argument
2598 struct b43_phy *phy = &dev->phy; in b43_gphy_op_software_rfkill()
2609 b43_phy_write(dev, 0x0015, 0x8000); in b43_gphy_op_software_rfkill()
2610 b43_phy_write(dev, 0x0015, 0xCC00); in b43_gphy_op_software_rfkill()
2611 b43_phy_write(dev, 0x0015, (phy->gmode ? 0x00C0 : 0x0000)); in b43_gphy_op_software_rfkill()
2614 b43_phy_write(dev, B43_PHY_RFOVER, in b43_gphy_op_software_rfkill()
2616 b43_phy_write(dev, B43_PHY_RFOVERVAL, in b43_gphy_op_software_rfkill()
2621 b43_gphy_channel_switch(dev, 6, 1); in b43_gphy_op_software_rfkill()
2622 b43_gphy_channel_switch(dev, channel, 0); in b43_gphy_op_software_rfkill()
2627 rfover = b43_phy_read(dev, B43_PHY_RFOVER); in b43_gphy_op_software_rfkill()
2628 rfoverval = b43_phy_read(dev, B43_PHY_RFOVERVAL); in b43_gphy_op_software_rfkill()
2632 b43_phy_write(dev, B43_PHY_RFOVER, rfover | 0x008C); in b43_gphy_op_software_rfkill()
2633 b43_phy_write(dev, B43_PHY_RFOVERVAL, rfoverval & 0xFF73); in b43_gphy_op_software_rfkill()
2637 static int b43_gphy_op_switch_channel(struct b43_wldev *dev, in b43_gphy_op_switch_channel() argument
2642 b43_gphy_channel_switch(dev, new_channel, 0); in b43_gphy_op_switch_channel()
2647 static unsigned int b43_gphy_op_get_default_chan(struct b43_wldev *dev) in b43_gphy_op_get_default_chan() argument
2652 static void b43_gphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) in b43_gphy_op_set_rx_antenna() argument
2654 struct b43_phy *phy = &dev->phy; in b43_gphy_op_set_rx_antenna()
2661 b43_hf_write(dev, b43_hf_read(dev) & ~B43_HF_ANTDIVHELP); in b43_gphy_op_set_rx_antenna()
2663 b43_phy_maskset(dev, B43_PHY_BBANDCFG, ~B43_PHY_BBANDCFG_RXANT, in b43_gphy_op_set_rx_antenna()
2668 tmp = b43_phy_read(dev, B43_PHY_ANTDWELL); in b43_gphy_op_set_rx_antenna()
2673 b43_phy_write(dev, B43_PHY_ANTDWELL, tmp); in b43_gphy_op_set_rx_antenna()
2676 tmp = b43_phy_read(dev, B43_PHY_ANTWRSETT); in b43_gphy_op_set_rx_antenna()
2681 b43_phy_write(dev, B43_PHY_ANTWRSETT, tmp); in b43_gphy_op_set_rx_antenna()
2684 b43_phy_set(dev, B43_PHY_ANTWRSETT, B43_PHY_ANTWRSETT_ARXDIV); in b43_gphy_op_set_rx_antenna()
2686 b43_phy_mask(dev, B43_PHY_ANTWRSETT, in b43_gphy_op_set_rx_antenna()
2691 b43_phy_set(dev, B43_PHY_OFDM61, B43_PHY_OFDM61_10); in b43_gphy_op_set_rx_antenna()
2692 b43_phy_maskset(dev, B43_PHY_DIVSRCHGAINBACK, 0xFF00, 0x15); in b43_gphy_op_set_rx_antenna()
2695 b43_phy_write(dev, B43_PHY_ADIVRELATED, 8); in b43_gphy_op_set_rx_antenna()
2697 b43_phy_maskset(dev, B43_PHY_ADIVRELATED, 0xFF00, 8); in b43_gphy_op_set_rx_antenna()
2700 b43_phy_write(dev, B43_PHY_OFDM9B, 0xDC); in b43_gphy_op_set_rx_antenna()
2702 b43_hf_write(dev, b43_hf_read(dev) | B43_HF_ANTDIVHELP); in b43_gphy_op_set_rx_antenna()
2705 static int b43_gphy_op_interf_mitigation(struct b43_wldev *dev, in b43_gphy_op_interf_mitigation() argument
2708 struct b43_phy *phy = &dev->phy; in b43_gphy_op_interf_mitigation()
2737 b43_radio_interference_mitigation_disable(dev, currentmode); in b43_gphy_op_interf_mitigation()
2743 b43_radio_interference_mitigation_enable(dev, mode); in b43_gphy_op_interf_mitigation()
2752 static s8 b43_gphy_estimate_power_out(struct b43_wldev *dev, s8 tssi) in b43_gphy_estimate_power_out() argument
2754 struct b43_phy_g *gphy = dev->phy.g; in b43_gphy_estimate_power_out()
2765 static void b43_put_attenuation_into_ranges(struct b43_wldev *dev, in b43_put_attenuation_into_ranges() argument
2770 struct b43_txpower_lo_control *lo = dev->phy.g->lo_control; in b43_put_attenuation_into_ranges()
2818 static void b43_gphy_op_adjust_txpower(struct b43_wldev *dev) in b43_gphy_op_adjust_txpower() argument
2820 struct b43_phy *phy = &dev->phy; in b43_gphy_op_adjust_txpower()
2825 b43_mac_suspend(dev); in b43_gphy_op_adjust_txpower()
2833 b43_put_attenuation_into_ranges(dev, &bbatt, &rfatt); in b43_gphy_op_adjust_txpower()
2843 } else if (dev->dev->bus_sprom-> in b43_gphy_op_adjust_txpower()
2862 b43_put_attenuation_into_ranges(dev, &bbatt, &rfatt); in b43_gphy_op_adjust_txpower()
2866 if (b43_debug(dev, B43_DBG_XMITPOWER)) in b43_gphy_op_adjust_txpower()
2867 b43dbg(dev->wl, "Adjusting TX power\n"); in b43_gphy_op_adjust_txpower()
2870 b43_phy_lock(dev); in b43_gphy_op_adjust_txpower()
2871 b43_radio_lock(dev); in b43_gphy_op_adjust_txpower()
2872 b43_set_txpower_g(dev, &gphy->bbatt, &gphy->rfatt, in b43_gphy_op_adjust_txpower()
2874 b43_radio_unlock(dev); in b43_gphy_op_adjust_txpower()
2875 b43_phy_unlock(dev); in b43_gphy_op_adjust_txpower()
2877 b43_mac_enable(dev); in b43_gphy_op_adjust_txpower()
2880 static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev, in b43_gphy_op_recalc_txpower() argument
2883 struct b43_phy *phy = &dev->phy; in b43_gphy_op_recalc_txpower()
2892 cck_result = b43_phy_shm_tssi_read(dev, B43_SHM_SH_TSSI_CCK); in b43_gphy_op_recalc_txpower()
2893 ofdm_result = b43_phy_shm_tssi_read(dev, B43_SHM_SH_TSSI_OFDM_G); in b43_gphy_op_recalc_txpower()
2914 estimated_pwr = b43_gphy_estimate_power_out(dev, average_tssi); in b43_gphy_op_recalc_txpower()
2917 max_pwr = dev->dev->bus_sprom->maxpwr_bg; in b43_gphy_op_recalc_txpower()
2918 if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_PACTRL) in b43_gphy_op_recalc_txpower()
2921 b43warn(dev->wl, in b43_gphy_op_recalc_txpower()
2924 dev->dev->bus_sprom->maxpwr_bg = max_pwr; in b43_gphy_op_recalc_txpower()
2934 if (b43_debug(dev, B43_DBG_XMITPOWER)) { in b43_gphy_op_recalc_txpower()
2935 b43dbg(dev->wl, in b43_gphy_op_recalc_txpower()
2963 if (b43_debug(dev, B43_DBG_XMITPOWER)) { in b43_gphy_op_recalc_txpower()
2965 b43dbg(dev->wl, in b43_gphy_op_recalc_txpower()
2988 static void b43_gphy_op_pwork_15sec(struct b43_wldev *dev) in b43_gphy_op_pwork_15sec() argument
2990 struct b43_phy *phy = &dev->phy; in b43_gphy_op_pwork_15sec()
2993 b43_mac_suspend(dev); in b43_gphy_op_pwork_15sec()
2998 phy->ops->interf_mitigation(dev, in b43_gphy_op_pwork_15sec()
3002 if (/*(aci_average > 1000) &&*/ !b43_gphy_aci_scan(dev)) in b43_gphy_op_pwork_15sec()
3003 phy->ops->interf_mitigation(dev, B43_INTERFMODE_NONE); in b43_gphy_op_pwork_15sec()
3009 b43_lo_g_maintenance_work(dev); in b43_gphy_op_pwork_15sec()
3010 b43_mac_enable(dev); in b43_gphy_op_pwork_15sec()
3013 static void b43_gphy_op_pwork_60sec(struct b43_wldev *dev) in b43_gphy_op_pwork_60sec() argument
3015 struct b43_phy *phy = &dev->phy; in b43_gphy_op_pwork_60sec()
3017 if (!(dev->dev->bus_sprom->boardflags_lo & B43_BFL_RSSI)) in b43_gphy_op_pwork_60sec()
3020 b43_mac_suspend(dev); in b43_gphy_op_pwork_60sec()
3021 b43_calc_nrssi_slope(dev); in b43_gphy_op_pwork_60sec()
3027 b43_switch_channel(dev, 1); in b43_gphy_op_pwork_60sec()
3029 b43_switch_channel(dev, 13); in b43_gphy_op_pwork_60sec()
3030 b43_switch_channel(dev, old_chan); in b43_gphy_op_pwork_60sec()
3032 b43_mac_enable(dev); in b43_gphy_op_pwork_60sec()