Lines Matching +full:ipa +full:- +full:reg
1 // SPDX-License-Identifier: GPL-2.0-or-later
8 Copyright (c) 2010-2011 Rafał Miłecki <zajec5@gmail.com>
32 u16 ipa[2]; member
40 u16 ipa; member
96 enum nl80211_band band = b43_current_band(dev->wl); in b43_nphy_ipa()
97 return ((dev->phy.n->ipa2g_on && band == NL80211_BAND_2GHZ) || in b43_nphy_ipa()
98 (dev->phy.n->ipa5g_on && band == NL80211_BAND_5GHZ)); in b43_nphy_ipa()
101 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCoreGetState */
112 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/ForceRFSeq */
137 b43err(dev->wl, "RF sequence status timeout\n"); in b43_nphy_force_rf_sequence()
149 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlOverrideRev7 */
154 struct b43_phy *phy = &dev->phy; in b43_nphy_rf_ctl_override_rev7()
164 if (phy->rev >= 19 || phy->rev < 3) { in b43_nphy_rf_ctl_override_rev7()
174 b43err(dev->wl, "Invalid override value %d\n", override); in b43_nphy_rf_ctl_override_rev7()
180 val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1; in b43_nphy_rf_ctl_override_rev7()
185 b43_phy_mask(dev, val_addr, ~e->val_mask); in b43_nphy_rf_ctl_override_rev7()
190 b43_phy_maskset(dev, val_addr, ~e->val_mask, (value << e->val_shift)); in b43_nphy_rf_ctl_override_rev7()
196 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlOverideOneToMany */
201 struct b43_phy *phy = &dev->phy; in b43_nphy_rf_ctl_override_one_to_many()
204 B43_WARN_ON(phy->rev < 7); in b43_nphy_rf_ctl_override_one_to_many()
240 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlOverride */
248 B43_WARN_ON(field & (~(1 << (index - 1)))); in b43_nphy_rf_ctl_override()
250 if (dev->phy.rev >= 3) { in b43_nphy_rf_ctl_override()
254 b43err(dev->wl, in b43_nphy_rf_ctl_override()
259 rf_ctrl = &tbl_rf_control_override_rev3[index - 1]; in b43_nphy_rf_ctl_override()
261 rf_ctrl->en_addr0 : rf_ctrl->en_addr1); in b43_nphy_rf_ctl_override()
263 rf_ctrl->val_addr0 : rf_ctrl->val_addr1); in b43_nphy_rf_ctl_override()
268 ~(rf_ctrl->val_mask)); in b43_nphy_rf_ctl_override()
273 ~(rf_ctrl->val_mask), in b43_nphy_rf_ctl_override()
274 (value << rf_ctrl->val_shift)); in b43_nphy_rf_ctl_override()
289 b43err(dev->wl, in b43_nphy_rf_ctl_override()
299 rf_ctrl = &tbl_rf_control_override_rev2[index - 2]; in b43_nphy_rf_ctl_override()
301 rf_ctrl->addr0 : rf_ctrl->addr1); in b43_nphy_rf_ctl_override()
304 b43_phy_maskset(dev, addr, ~(rf_ctrl->bmask), in b43_nphy_rf_ctl_override()
305 (value << rf_ctrl->shift)); in b43_nphy_rf_ctl_override()
320 u16 reg, tmp, tmp2, val; in b43_nphy_rf_ctl_intc_override_rev7() local
330 reg = (core == 0) ? B43_NPHY_RFCTL_INTC1 : B43_NPHY_RFCTL_INTC2; in b43_nphy_rf_ctl_intc_override_rev7()
334 b43_phy_write(dev, reg, 0); in b43_nphy_rf_ctl_intc_override_rev7()
339 b43_phy_maskset(dev, reg, ~0xC0, value << 6); in b43_nphy_rf_ctl_intc_override_rev7()
340 b43_phy_set(dev, reg, 0x400); in b43_nphy_rf_ctl_intc_override_rev7()
348 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) in b43_nphy_rf_ctl_intc_override_rev7()
352 b43_phy_maskset(dev, reg, ~tmp, val); in b43_nphy_rf_ctl_intc_override_rev7()
353 b43_phy_set(dev, reg, 0x1000); in b43_nphy_rf_ctl_intc_override_rev7()
356 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_rf_ctl_intc_override_rev7()
365 b43_phy_maskset(dev, reg, ~tmp, val); in b43_nphy_rf_ctl_intc_override_rev7()
366 b43_phy_mask(dev, reg, ~tmp2); in b43_nphy_rf_ctl_intc_override_rev7()
369 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_rf_ctl_intc_override_rev7()
378 b43_phy_maskset(dev, reg, ~tmp, val); in b43_nphy_rf_ctl_intc_override_rev7()
379 b43_phy_mask(dev, reg, ~tmp2); in b43_nphy_rf_ctl_intc_override_rev7()
385 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RFCtrlIntcOverride */
391 u16 reg, tmp, val; in b43_nphy_rf_ctl_intc_override() local
393 if (dev->phy.rev >= 7) { in b43_nphy_rf_ctl_intc_override()
399 B43_WARN_ON(dev->phy.rev < 3); in b43_nphy_rf_ctl_intc_override()
405 reg = (i == 0) ? in b43_nphy_rf_ctl_intc_override()
407 b43_phy_set(dev, reg, 0x400); in b43_nphy_rf_ctl_intc_override()
411 b43_phy_write(dev, reg, 0); in b43_nphy_rf_ctl_intc_override()
430 b43err(dev->wl, in b43_nphy_rf_ctl_intc_override()
449 b43err(dev->wl, in b43_nphy_rf_ctl_intc_override()
456 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_rf_ctl_intc_override()
463 b43_phy_maskset(dev, reg, ~tmp, val); in b43_nphy_rf_ctl_intc_override()
466 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_rf_ctl_intc_override()
473 b43_phy_maskset(dev, reg, ~tmp, val); in b43_nphy_rf_ctl_intc_override()
476 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_rf_ctl_intc_override()
483 b43_phy_maskset(dev, reg, ~tmp, val); in b43_nphy_rf_ctl_intc_override()
493 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/clip-detection */
501 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/clip-detection */
508 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/classifier */
513 if (dev->dev->core_rev == 16) in b43_nphy_classifier()
523 if (dev->dev->core_rev == 16) in b43_nphy_classifier()
529 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/CCA */
543 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/carriersearch */
546 struct b43_phy *phy = &dev->phy; in b43_nphy_stay_in_carrier_search()
547 struct b43_phy_n *nphy = phy->n; in b43_nphy_stay_in_carrier_search()
551 if (nphy->deaf_count++ == 0) { in b43_nphy_stay_in_carrier_search()
552 nphy->classifier_state = b43_nphy_classifier(dev, 0, 0); in b43_nphy_stay_in_carrier_search()
555 b43_nphy_read_clip_detection(dev, nphy->clip_state); in b43_nphy_stay_in_carrier_search()
560 if (--nphy->deaf_count == 0) { in b43_nphy_stay_in_carrier_search()
561 b43_nphy_classifier(dev, 0x7, nphy->classifier_state); in b43_nphy_stay_in_carrier_search()
562 b43_nphy_write_clip_detection(dev, nphy->clip_state); in b43_nphy_stay_in_carrier_search()
567 /* https://bcm-v4.sipsolutions.net/PHY/N/Read_Lpf_Bw_Ctl */
575 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/AdjustLnaGainTbl */
578 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_adjust_lna_gain_table()
585 static const u16 lna_gain[4] = { -2, 10, 19, 25 }; in b43_nphy_adjust_lna_gain_table()
587 if (nphy->hang_avoid) in b43_nphy_adjust_lna_gain_table()
590 if (nphy->gain_boost) { in b43_nphy_adjust_lna_gain_table()
591 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_adjust_lna_gain_table()
595 tmp = 40370 - 315 * dev->phy.channel; in b43_nphy_adjust_lna_gain_table()
597 tmp = 23242 - 224 * dev->phy.channel; in b43_nphy_adjust_lna_gain_table()
606 if (nphy->elna_gain_config) { in b43_nphy_adjust_lna_gain_table()
627 if (nphy->hang_avoid) in b43_nphy_adjust_lna_gain_table()
631 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/SetRfSeq */
635 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_set_rf_sequence()
637 u8 end = (dev->phy.rev >= 3) ? 0x1F : 0x0F; in b43_nphy_set_rf_sequence()
641 if (nphy->hang_avoid) in b43_nphy_set_rf_sequence()
652 if (nphy->hang_avoid) in b43_nphy_set_rf_sequence()
665 b43_radio_write(dev, R2057_VCOCAL_COUNTVAL0, e_r7_2g->radio_vcocal_countval0); in b43_radio_2057_chantab_upload()
666 b43_radio_write(dev, R2057_VCOCAL_COUNTVAL1, e_r7_2g->radio_vcocal_countval1); in b43_radio_2057_chantab_upload()
667 …b43_radio_write(dev, R2057_RFPLL_REFMASTER_SPAREXTALSIZE, e_r7_2g->radio_rfpll_refmaster_sparextal… in b43_radio_2057_chantab_upload()
668 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_R1, e_r7_2g->radio_rfpll_loopfilter_r1); in b43_radio_2057_chantab_upload()
669 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_C2, e_r7_2g->radio_rfpll_loopfilter_c2); in b43_radio_2057_chantab_upload()
670 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_C1, e_r7_2g->radio_rfpll_loopfilter_c1); in b43_radio_2057_chantab_upload()
671 b43_radio_write(dev, R2057_CP_KPD_IDAC, e_r7_2g->radio_cp_kpd_idac); in b43_radio_2057_chantab_upload()
672 b43_radio_write(dev, R2057_RFPLL_MMD0, e_r7_2g->radio_rfpll_mmd0); in b43_radio_2057_chantab_upload()
673 b43_radio_write(dev, R2057_RFPLL_MMD1, e_r7_2g->radio_rfpll_mmd1); in b43_radio_2057_chantab_upload()
674 b43_radio_write(dev, R2057_VCOBUF_TUNE, e_r7_2g->radio_vcobuf_tune); in b43_radio_2057_chantab_upload()
675 b43_radio_write(dev, R2057_LOGEN_MX2G_TUNE, e_r7_2g->radio_logen_mx2g_tune); in b43_radio_2057_chantab_upload()
676 b43_radio_write(dev, R2057_LOGEN_INDBUF2G_TUNE, e_r7_2g->radio_logen_indbuf2g_tune); in b43_radio_2057_chantab_upload()
677 …b43_radio_write(dev, R2057_TXMIX2G_TUNE_BOOST_PU_CORE0, e_r7_2g->radio_txmix2g_tune_boost_pu_core0… in b43_radio_2057_chantab_upload()
678 b43_radio_write(dev, R2057_PAD2G_TUNE_PUS_CORE0, e_r7_2g->radio_pad2g_tune_pus_core0); in b43_radio_2057_chantab_upload()
679 b43_radio_write(dev, R2057_LNA2G_TUNE_CORE0, e_r7_2g->radio_lna2g_tune_core0); in b43_radio_2057_chantab_upload()
680 …b43_radio_write(dev, R2057_TXMIX2G_TUNE_BOOST_PU_CORE1, e_r7_2g->radio_txmix2g_tune_boost_pu_core1… in b43_radio_2057_chantab_upload()
681 b43_radio_write(dev, R2057_PAD2G_TUNE_PUS_CORE1, e_r7_2g->radio_pad2g_tune_pus_core1); in b43_radio_2057_chantab_upload()
682 b43_radio_write(dev, R2057_LNA2G_TUNE_CORE1, e_r7_2g->radio_lna2g_tune_core1); in b43_radio_2057_chantab_upload()
685 b43_radio_write(dev, R2057_VCOCAL_COUNTVAL0, e_r7->radio_vcocal_countval0); in b43_radio_2057_chantab_upload()
686 b43_radio_write(dev, R2057_VCOCAL_COUNTVAL1, e_r7->radio_vcocal_countval1); in b43_radio_2057_chantab_upload()
687 …b43_radio_write(dev, R2057_RFPLL_REFMASTER_SPAREXTALSIZE, e_r7->radio_rfpll_refmaster_sparextalsiz… in b43_radio_2057_chantab_upload()
688 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_R1, e_r7->radio_rfpll_loopfilter_r1); in b43_radio_2057_chantab_upload()
689 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_C2, e_r7->radio_rfpll_loopfilter_c2); in b43_radio_2057_chantab_upload()
690 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_C1, e_r7->radio_rfpll_loopfilter_c1); in b43_radio_2057_chantab_upload()
691 b43_radio_write(dev, R2057_CP_KPD_IDAC, e_r7->radio_cp_kpd_idac); in b43_radio_2057_chantab_upload()
692 b43_radio_write(dev, R2057_RFPLL_MMD0, e_r7->radio_rfpll_mmd0); in b43_radio_2057_chantab_upload()
693 b43_radio_write(dev, R2057_RFPLL_MMD1, e_r7->radio_rfpll_mmd1); in b43_radio_2057_chantab_upload()
694 b43_radio_write(dev, R2057_VCOBUF_TUNE, e_r7->radio_vcobuf_tune); in b43_radio_2057_chantab_upload()
695 b43_radio_write(dev, R2057_LOGEN_MX2G_TUNE, e_r7->radio_logen_mx2g_tune); in b43_radio_2057_chantab_upload()
696 b43_radio_write(dev, R2057_LOGEN_MX5G_TUNE, e_r7->radio_logen_mx5g_tune); in b43_radio_2057_chantab_upload()
697 b43_radio_write(dev, R2057_LOGEN_INDBUF2G_TUNE, e_r7->radio_logen_indbuf2g_tune); in b43_radio_2057_chantab_upload()
698 b43_radio_write(dev, R2057_LOGEN_INDBUF5G_TUNE, e_r7->radio_logen_indbuf5g_tune); in b43_radio_2057_chantab_upload()
699 b43_radio_write(dev, R2057_TXMIX2G_TUNE_BOOST_PU_CORE0, e_r7->radio_txmix2g_tune_boost_pu_core0); in b43_radio_2057_chantab_upload()
700 b43_radio_write(dev, R2057_PAD2G_TUNE_PUS_CORE0, e_r7->radio_pad2g_tune_pus_core0); in b43_radio_2057_chantab_upload()
701 b43_radio_write(dev, R2057_PGA_BOOST_TUNE_CORE0, e_r7->radio_pga_boost_tune_core0); in b43_radio_2057_chantab_upload()
702 b43_radio_write(dev, R2057_TXMIX5G_BOOST_TUNE_CORE0, e_r7->radio_txmix5g_boost_tune_core0); in b43_radio_2057_chantab_upload()
703 b43_radio_write(dev, R2057_PAD5G_TUNE_MISC_PUS_CORE0, e_r7->radio_pad5g_tune_misc_pus_core0); in b43_radio_2057_chantab_upload()
704 b43_radio_write(dev, R2057_LNA2G_TUNE_CORE0, e_r7->radio_lna2g_tune_core0); in b43_radio_2057_chantab_upload()
705 b43_radio_write(dev, R2057_LNA5G_TUNE_CORE0, e_r7->radio_lna5g_tune_core0); in b43_radio_2057_chantab_upload()
706 b43_radio_write(dev, R2057_TXMIX2G_TUNE_BOOST_PU_CORE1, e_r7->radio_txmix2g_tune_boost_pu_core1); in b43_radio_2057_chantab_upload()
707 b43_radio_write(dev, R2057_PAD2G_TUNE_PUS_CORE1, e_r7->radio_pad2g_tune_pus_core1); in b43_radio_2057_chantab_upload()
708 b43_radio_write(dev, R2057_PGA_BOOST_TUNE_CORE1, e_r7->radio_pga_boost_tune_core1); in b43_radio_2057_chantab_upload()
709 b43_radio_write(dev, R2057_TXMIX5G_BOOST_TUNE_CORE1, e_r7->radio_txmix5g_boost_tune_core1); in b43_radio_2057_chantab_upload()
710 b43_radio_write(dev, R2057_PAD5G_TUNE_MISC_PUS_CORE1, e_r7->radio_pad5g_tune_misc_pus_core1); in b43_radio_2057_chantab_upload()
711 b43_radio_write(dev, R2057_LNA2G_TUNE_CORE1, e_r7->radio_lna2g_tune_core1); in b43_radio_2057_chantab_upload()
712 b43_radio_write(dev, R2057_LNA5G_TUNE_CORE1, e_r7->radio_lna5g_tune_core1); in b43_radio_2057_chantab_upload()
720 struct b43_phy *phy = &dev->phy; in b43_radio_2057_setup()
724 switch (phy->radio_rev) { in b43_radio_2057_setup()
727 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_radio_2057_setup()
742 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_radio_2057_setup()
766 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_radio_2057_setup()
771 switch (phy->radio_rev) { in b43_radio_2057_setup()
808 * https://bcm-v4.sipsolutions.net/PHY/radio205x_rcal
812 struct b43_phy *phy = &dev->phy; in b43_radio_2057_rcal()
848 switch (phy->radio_rev) { in b43_radio_2057_rcal()
884 b43err(dev->wl, "Radio 0x2057 rcal timeout\n"); in b43_radio_2057_rcal()
898 switch (phy->radio_rev) { in b43_radio_2057_rcal()
922 * https://bcm-v4.sipsolutions.net/PHY/radio2057_rccal
926 struct b43_phy *phy = &dev->phy; in b43_radio_2057_rccal()
927 bool special = (phy->radio_rev == 3 || phy->radio_rev == 4 || in b43_radio_2057_rccal()
928 phy->radio_rev == 6); in b43_radio_2057_rccal()
945 b43dbg(dev->wl, "Radio 0x2057 rccal timeout\n"); in b43_radio_2057_rccal()
966 b43dbg(dev->wl, "Radio 0x2057 rccal timeout\n"); in b43_radio_2057_rccal()
988 b43err(dev->wl, "Radio 0x2057 rcal timeout\n"); in b43_radio_2057_rccal()
1026 if (dev->phy.do_full_init) { in b43_radio_2057_init_post()
1033 /* https://bcm-v4.sipsolutions.net/802.11/Radio/2057/Init */
1048 b43_radio_write(dev, B2056_SYN_PLL_VCOCAL1, e->radio_syn_pll_vcocal1); in b43_chantab_radio_2056_upload()
1049 b43_radio_write(dev, B2056_SYN_PLL_VCOCAL2, e->radio_syn_pll_vcocal2); in b43_chantab_radio_2056_upload()
1050 b43_radio_write(dev, B2056_SYN_PLL_REFDIV, e->radio_syn_pll_refdiv); in b43_chantab_radio_2056_upload()
1051 b43_radio_write(dev, B2056_SYN_PLL_MMD2, e->radio_syn_pll_mmd2); in b43_chantab_radio_2056_upload()
1052 b43_radio_write(dev, B2056_SYN_PLL_MMD1, e->radio_syn_pll_mmd1); in b43_chantab_radio_2056_upload()
1054 e->radio_syn_pll_loopfilter1); in b43_chantab_radio_2056_upload()
1056 e->radio_syn_pll_loopfilter2); in b43_chantab_radio_2056_upload()
1058 e->radio_syn_pll_loopfilter3); in b43_chantab_radio_2056_upload()
1060 e->radio_syn_pll_loopfilter4); in b43_chantab_radio_2056_upload()
1062 e->radio_syn_pll_loopfilter5); in b43_chantab_radio_2056_upload()
1064 e->radio_syn_reserved_addr27); in b43_chantab_radio_2056_upload()
1066 e->radio_syn_reserved_addr28); in b43_chantab_radio_2056_upload()
1068 e->radio_syn_reserved_addr29); in b43_chantab_radio_2056_upload()
1070 e->radio_syn_logen_vcobuf1); in b43_chantab_radio_2056_upload()
1071 b43_radio_write(dev, B2056_SYN_LOGEN_MIXER2, e->radio_syn_logen_mixer2); in b43_chantab_radio_2056_upload()
1072 b43_radio_write(dev, B2056_SYN_LOGEN_BUF3, e->radio_syn_logen_buf3); in b43_chantab_radio_2056_upload()
1073 b43_radio_write(dev, B2056_SYN_LOGEN_BUF4, e->radio_syn_logen_buf4); in b43_chantab_radio_2056_upload()
1076 e->radio_rx0_lnaa_tune); in b43_chantab_radio_2056_upload()
1078 e->radio_rx0_lnag_tune); in b43_chantab_radio_2056_upload()
1081 e->radio_tx0_intpaa_boost_tune); in b43_chantab_radio_2056_upload()
1083 e->radio_tx0_intpag_boost_tune); in b43_chantab_radio_2056_upload()
1085 e->radio_tx0_pada_boost_tune); in b43_chantab_radio_2056_upload()
1087 e->radio_tx0_padg_boost_tune); in b43_chantab_radio_2056_upload()
1089 e->radio_tx0_pgaa_boost_tune); in b43_chantab_radio_2056_upload()
1091 e->radio_tx0_pgag_boost_tune); in b43_chantab_radio_2056_upload()
1093 e->radio_tx0_mixa_boost_tune); in b43_chantab_radio_2056_upload()
1095 e->radio_tx0_mixg_boost_tune); in b43_chantab_radio_2056_upload()
1098 e->radio_rx1_lnaa_tune); in b43_chantab_radio_2056_upload()
1100 e->radio_rx1_lnag_tune); in b43_chantab_radio_2056_upload()
1103 e->radio_tx1_intpaa_boost_tune); in b43_chantab_radio_2056_upload()
1105 e->radio_tx1_intpag_boost_tune); in b43_chantab_radio_2056_upload()
1107 e->radio_tx1_pada_boost_tune); in b43_chantab_radio_2056_upload()
1109 e->radio_tx1_padg_boost_tune); in b43_chantab_radio_2056_upload()
1111 e->radio_tx1_pgaa_boost_tune); in b43_chantab_radio_2056_upload()
1113 e->radio_tx1_pgag_boost_tune); in b43_chantab_radio_2056_upload()
1115 e->radio_tx1_mixa_boost_tune); in b43_chantab_radio_2056_upload()
1117 e->radio_tx1_mixg_boost_tune); in b43_chantab_radio_2056_upload()
1120 /* https://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2056Setup */
1124 struct b43_phy *phy = &dev->phy; in b43_radio_2056_setup()
1125 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_radio_2056_setup()
1126 enum nl80211_band band = b43_current_band(dev->wl); in b43_radio_2056_setup()
1134 B43_WARN_ON(dev->phy.rev < 3); in b43_radio_2056_setup()
1137 ((dev->dev->chip_id == BCMA_CHIP_ID_BCM43224 || in b43_radio_2056_setup()
1138 dev->dev->chip_id == BCMA_CHIP_ID_BCM43225 || in b43_radio_2056_setup()
1139 dev->dev->chip_id == BCMA_CHIP_ID_BCM43421) && in b43_radio_2056_setup()
1140 dev->dev->chip_pkg == BCMA_PKG_ID_BCM43224_FAB_SMIC); in b43_radio_2056_setup()
1145 if (sprom->boardflags2_lo & B43_BFL2_GPLL_WAR && in b43_radio_2056_setup()
1146 b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_radio_2056_setup()
1149 if (dev->dev->chip_id == BCMA_CHIP_ID_BCM4716 || in b43_radio_2056_setup()
1150 dev->dev->chip_id == BCMA_CHIP_ID_BCM47162) { in b43_radio_2056_setup()
1158 if (sprom->boardflags2_hi & B43_BFH2_GPLL_WAR2 && in b43_radio_2056_setup()
1159 b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_radio_2056_setup()
1165 if (sprom->boardflags2_lo & B43_BFL2_APLL_WAR && in b43_radio_2056_setup()
1166 b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_radio_2056_setup()
1173 if (dev->phy.n->ipa2g_on && band == NL80211_BAND_2GHZ) { in b43_radio_2056_setup()
1176 if (dev->phy.rev >= 5) { in b43_radio_2056_setup()
1180 if (dev->dev->chip_id == BCMA_CHIP_ID_BCM4716 || in b43_radio_2056_setup()
1181 dev->dev->chip_id == BCMA_CHIP_ID_BCM47162) { in b43_radio_2056_setup()
1235 } else if (dev->phy.n->ipa5g_on && band == NL80211_BAND_5GHZ) { in b43_radio_2056_setup()
1236 u16 freq = phy->chandef->chan->center_freq; in b43_radio_2056_setup()
1256 pgaa_boost = -(freq - 18) / 36 + 168; in b43_radio_2056_setup()
1302 struct b43_phy *phy = &dev->phy; in b43_radio_2056_rcal()
1305 if (phy->rev != 3) in b43_radio_2056_rcal()
1318 b43err(dev->wl, "Radio recalibration timeout\n"); in b43_radio_2056_rcal()
1353 if (dev->phy.do_full_init) in b43_radio_init2056_post()
1358 * Initialize a Broadcom 2056 N-radio
1359 * https://bcm-v4.sipsolutions.net/802.11/Radio/2056/Init
1375 b43_radio_write(dev, B2055_PLL_REF, e->radio_pll_ref); in b43_chantab_radio_upload()
1376 b43_radio_write(dev, B2055_RF_PLLMOD0, e->radio_rf_pllmod0); in b43_chantab_radio_upload()
1377 b43_radio_write(dev, B2055_RF_PLLMOD1, e->radio_rf_pllmod1); in b43_chantab_radio_upload()
1378 b43_radio_write(dev, B2055_VCO_CAPTAIL, e->radio_vco_captail); in b43_chantab_radio_upload()
1381 b43_radio_write(dev, B2055_VCO_CAL1, e->radio_vco_cal1); in b43_chantab_radio_upload()
1382 b43_radio_write(dev, B2055_VCO_CAL2, e->radio_vco_cal2); in b43_chantab_radio_upload()
1383 b43_radio_write(dev, B2055_PLL_LFC1, e->radio_pll_lfc1); in b43_chantab_radio_upload()
1384 b43_radio_write(dev, B2055_PLL_LFR1, e->radio_pll_lfr1); in b43_chantab_radio_upload()
1387 b43_radio_write(dev, B2055_PLL_LFC2, e->radio_pll_lfc2); in b43_chantab_radio_upload()
1388 b43_radio_write(dev, B2055_LGBUF_CENBUF, e->radio_lgbuf_cenbuf); in b43_chantab_radio_upload()
1389 b43_radio_write(dev, B2055_LGEN_TUNE1, e->radio_lgen_tune1); in b43_chantab_radio_upload()
1390 b43_radio_write(dev, B2055_LGEN_TUNE2, e->radio_lgen_tune2); in b43_chantab_radio_upload()
1393 b43_radio_write(dev, B2055_C1_LGBUF_ATUNE, e->radio_c1_lgbuf_atune); in b43_chantab_radio_upload()
1394 b43_radio_write(dev, B2055_C1_LGBUF_GTUNE, e->radio_c1_lgbuf_gtune); in b43_chantab_radio_upload()
1395 b43_radio_write(dev, B2055_C1_RX_RFR1, e->radio_c1_rx_rfr1); in b43_chantab_radio_upload()
1396 b43_radio_write(dev, B2055_C1_TX_PGAPADTN, e->radio_c1_tx_pgapadtn); in b43_chantab_radio_upload()
1399 b43_radio_write(dev, B2055_C1_TX_MXBGTRIM, e->radio_c1_tx_mxbgtrim); in b43_chantab_radio_upload()
1400 b43_radio_write(dev, B2055_C2_LGBUF_ATUNE, e->radio_c2_lgbuf_atune); in b43_chantab_radio_upload()
1401 b43_radio_write(dev, B2055_C2_LGBUF_GTUNE, e->radio_c2_lgbuf_gtune); in b43_chantab_radio_upload()
1402 b43_radio_write(dev, B2055_C2_RX_RFR1, e->radio_c2_rx_rfr1); in b43_chantab_radio_upload()
1405 b43_radio_write(dev, B2055_C2_TX_PGAPADTN, e->radio_c2_tx_pgapadtn); in b43_chantab_radio_upload()
1406 b43_radio_write(dev, B2055_C2_TX_MXBGTRIM, e->radio_c2_tx_mxbgtrim); in b43_chantab_radio_upload()
1409 /* https://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2055Setup */
1413 B43_WARN_ON(dev->phy.rev >= 3); in b43_radio_2055_setup()
1437 struct b43_phy_n *nphy = dev->phy.n; in b43_radio_init2055_post()
1438 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_radio_init2055_post()
1441 if (sprom->revision < 4) in b43_radio_init2055_post()
1442 workaround = (dev->dev->board_vendor != PCI_VENDOR_ID_BROADCOM in b43_radio_init2055_post()
1443 && dev->dev->board_type == SSB_BOARD_CB2_4321 in b43_radio_init2055_post()
1444 && dev->dev->board_rev >= 0x41); in b43_radio_init2055_post()
1447 !(sprom->boardflags2_lo & B43_BFL2_RXBB_INT_REG_DIS); in b43_radio_init2055_post()
1462 b43err(dev->wl, "radio post init timeout\n"); in b43_radio_init2055_post()
1464 b43_switch_channel(dev, dev->phy.channel); in b43_radio_init2055_post()
1471 if (!nphy->gain_boost) { in b43_radio_init2055_post()
1482 * Initialize a Broadcom 2055 N-radio
1483 * https://bcm-v4.sipsolutions.net/802.11/Radio/2055/Init
1492 bool ghz5 = b43_current_band(dev->wl) == NL80211_BAND_5GHZ; in b43_radio_init2055()
1502 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/LoadSampleTable */
1505 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_load_samples()
1511 b43err(dev->wl, "allocation for samples loading failed\n"); in b43_nphy_load_samples()
1512 return -ENOMEM; in b43_nphy_load_samples()
1514 if (nphy->hang_avoid) in b43_nphy_load_samples()
1524 if (nphy->hang_avoid) in b43_nphy_load_samples()
1529 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/GenLoadSamples */
1554 b43err(dev->wl, "allocation for samples generation failed\n"); in b43_nphy_gen_load_samples()
1572 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RunSamples */
1577 struct b43_phy *phy = &dev->phy; in b43_nphy_run_samples()
1578 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_run_samples()
1585 if (phy->rev >= 7) { in b43_nphy_run_samples()
1595 if (phy->rev >= 19) in b43_nphy_run_samples()
1601 nphy->lpf_bw_overrode_for_sample_play = true; in b43_nphy_run_samples()
1605 if ((nphy->bb_mult_save & 0x80000000) == 0) { in b43_nphy_run_samples()
1607 nphy->bb_mult_save = (tmp & 0xFFFF) | 0x80000000; in b43_nphy_run_samples()
1615 b43_phy_write(dev, B43_NPHY_SAMP_DEPCNT, (samps - 1)); in b43_nphy_run_samples()
1618 b43_phy_write(dev, B43_NPHY_SAMP_LOOPCNT, (loops - 1)); in b43_nphy_run_samples()
1642 b43err(dev->wl, "run samples timeout\n"); in b43_nphy_run_samples()
1653 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/ScaleOffsetRssi */
1663 offset = clamp_val(offset, -32, 31); in b43_nphy_scale_offset_rssi()
1742 u16 reg, val; in b43_nphy_rev3_rssi_select() local
1758 reg = (i == 0) ? in b43_nphy_rev3_rssi_select()
1760 b43_phy_maskset(dev, reg, 0xFDFF, 0x0200); in b43_nphy_rev3_rssi_select()
1765 reg = (i == 0) ? in b43_nphy_rev3_rssi_select()
1768 b43_phy_maskset(dev, reg, 0xFCFF, 0); in b43_nphy_rev3_rssi_select()
1770 reg = (i == 0) ? in b43_nphy_rev3_rssi_select()
1773 b43_phy_maskset(dev, reg, 0xFFC3, 0); in b43_nphy_rev3_rssi_select()
1776 val = (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) ? 4 : 8; in b43_nphy_rev3_rssi_select()
1781 b43_phy_set(dev, reg, val); in b43_nphy_rev3_rssi_select()
1783 reg = (i == 0) ? in b43_nphy_rev3_rssi_select()
1786 b43_phy_set(dev, reg, 0x0020); in b43_nphy_rev3_rssi_select()
1795 reg = (i == 0) ? in b43_nphy_rev3_rssi_select()
1799 b43_phy_maskset(dev, reg, 0xFCFF, val); in b43_nphy_rev3_rssi_select()
1800 b43_phy_maskset(dev, reg, 0xF3FF, val << 2); in b43_nphy_rev3_rssi_select()
1805 b43_current_band(dev->wl); in b43_nphy_rev3_rssi_select()
1807 if (dev->phy.rev < 7) { in b43_nphy_rev3_rssi_select()
1812 reg = (i == 0) ? B2056_TX0 : B2056_TX1; in b43_nphy_rev3_rssi_select()
1813 reg |= B2056_TX_TX_SSI_MUX; in b43_nphy_rev3_rssi_select()
1814 b43_radio_write(dev, reg, val); in b43_nphy_rev3_rssi_select()
1817 reg = (i == 0) ? in b43_nphy_rev3_rssi_select()
1820 b43_phy_set(dev, reg, 0x0200); in b43_nphy_rev3_rssi_select()
1898 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSISel */
1902 if (dev->phy.rev >= 19) in b43_nphy_rssi_select()
1904 else if (dev->phy.rev >= 3) in b43_nphy_rssi_select()
1910 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/SetRssi2055Vcm */
1939 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/PollRssi */
1950 if (dev->phy.rev >= 3) { in b43_nphy_poll_rssi()
1976 if (dev->phy.rev < 2) { in b43_nphy_poll_rssi()
1985 if (dev->phy.rev < 2) { in b43_nphy_poll_rssi()
2001 if (dev->phy.rev < 2) in b43_nphy_poll_rssi()
2004 if (dev->phy.rev >= 3) { in b43_nphy_poll_rssi()
2028 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSICalRev3 */
2031 struct b43_phy *phy = &dev->phy; in b43_nphy_rev3_rssi_cal()
2032 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_rev3_rssi_cal()
2080 if (dev->phy.rev >= 7) { in b43_nphy_rev3_rssi_cal()
2102 if (dev->phy.rev >= 7) { in b43_nphy_rev3_rssi_cal()
2111 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_rev3_rssi_cal()
2127 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_rev3_rssi_cal()
2148 if (dev->phy.rev >= 7) in b43_nphy_rev3_rssi_cal()
2182 if (dev->phy.rev >= 7) in b43_nphy_rev3_rssi_cal()
2194 offset[i] = -results[vcm_final][i]; in b43_nphy_rev3_rssi_cal()
2196 offset[i] = -((abs(offset[i]) + 4) / 8); in b43_nphy_rev3_rssi_cal()
2200 offset[i] = -32; in b43_nphy_rev3_rssi_cal()
2219 offset[j] = 232 - poll_results[j]; in b43_nphy_rev3_rssi_cal()
2221 offset[j] = -(abs(offset[j] + 4) / 8); in b43_nphy_rev3_rssi_cal()
2248 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_rev3_rssi_cal()
2249 rssical_radio_regs = nphy->rssical_cache.rssical_radio_regs_2G; in b43_nphy_rev3_rssi_cal()
2250 rssical_phy_regs = nphy->rssical_cache.rssical_phy_regs_2G; in b43_nphy_rev3_rssi_cal()
2252 rssical_radio_regs = nphy->rssical_cache.rssical_radio_regs_5G; in b43_nphy_rev3_rssi_cal()
2253 rssical_phy_regs = nphy->rssical_cache.rssical_phy_regs_5G; in b43_nphy_rev3_rssi_cal()
2255 if (dev->phy.rev >= 7) { in b43_nphy_rev3_rssi_cal()
2280 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_rev3_rssi_cal()
2281 nphy->rssical_chanspec_2G.center_freq = phy->chandef->chan->center_freq; in b43_nphy_rev3_rssi_cal()
2283 nphy->rssical_chanspec_5G.center_freq = phy->chandef->chan->center_freq; in b43_nphy_rev3_rssi_cal()
2290 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSICal */
2327 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) in b43_nphy_rev2_rssi_cal()
2373 currd = abs(results[vcm][i] - code * 8); in b43_nphy_rev2_rssi_cal()
2375 currd = abs(miniq[vcm][i / 2] - code * 8); in b43_nphy_rev2_rssi_cal()
2393 offset[i] = (code * 8) - results[vcm_final[i]][i]; in b43_nphy_rev2_rssi_cal()
2396 offset[i] = -((abs(offset[i]) + 4) / 8); in b43_nphy_rev2_rssi_cal()
2401 offset[i] = code - 32; in b43_nphy_rev2_rssi_cal()
2456 * https://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSICal
2460 if (dev->phy.rev >= 19) { in b43_nphy_rssi_cal()
2462 } else if (dev->phy.rev >= 3) { in b43_nphy_rssi_cal()
2482 struct b43_phy *phy = &dev->phy; in b43_nphy_gain_ctl_workarounds_rev7()
2484 switch (phy->rev) { in b43_nphy_gain_ctl_workarounds_rev7()
2491 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_nphy_gain_ctl_workarounds_rev3()
2503 ext_lna = ghz5 ? sprom->boardflags_hi & B43_BFH_EXTLNA_5GHZ : in b43_nphy_gain_ctl_workarounds_rev3()
2504 sprom->boardflags_lo & B43_BFL_EXTLNA; in b43_nphy_gain_ctl_workarounds_rev3()
2506 if (ghz5 && dev->phy.rev >= 5) in b43_nphy_gain_ctl_workarounds_rev3()
2536 b43_ntab_write_bulk(dev, B43_NTAB8(0, 8), 4, e->lna1_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2537 b43_ntab_write_bulk(dev, B43_NTAB8(1, 8), 4, e->lna1_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2538 b43_ntab_write_bulk(dev, B43_NTAB8(0, 16), 4, e->lna2_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2539 b43_ntab_write_bulk(dev, B43_NTAB8(1, 16), 4, e->lna2_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2540 b43_ntab_write_bulk(dev, B43_NTAB8(0, 32), 10, e->gain_db); in b43_nphy_gain_ctl_workarounds_rev3()
2541 b43_ntab_write_bulk(dev, B43_NTAB8(1, 32), 10, e->gain_db); in b43_nphy_gain_ctl_workarounds_rev3()
2542 b43_ntab_write_bulk(dev, B43_NTAB8(2, 32), 10, e->gain_bits); in b43_nphy_gain_ctl_workarounds_rev3()
2543 b43_ntab_write_bulk(dev, B43_NTAB8(3, 32), 10, e->gain_bits); in b43_nphy_gain_ctl_workarounds_rev3()
2549 b43_phy_write(dev, B43_NPHY_REV3_C1_INITGAIN_A, e->init_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2550 b43_phy_write(dev, B43_NPHY_REV3_C2_INITGAIN_A, e->init_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2553 e->rfseq_init); in b43_nphy_gain_ctl_workarounds_rev3()
2555 b43_phy_write(dev, B43_NPHY_REV3_C1_CLIP_HIGAIN_A, e->cliphi_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2556 b43_phy_write(dev, B43_NPHY_REV3_C2_CLIP_HIGAIN_A, e->cliphi_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2557 b43_phy_write(dev, B43_NPHY_REV3_C1_CLIP_MEDGAIN_A, e->clipmd_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2558 b43_phy_write(dev, B43_NPHY_REV3_C2_CLIP_MEDGAIN_A, e->clipmd_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2559 b43_phy_write(dev, B43_NPHY_REV3_C1_CLIP_LOGAIN_A, e->cliplo_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2560 b43_phy_write(dev, B43_NPHY_REV3_C2_CLIP_LOGAIN_A, e->cliplo_gain); in b43_nphy_gain_ctl_workarounds_rev3()
2562 b43_phy_maskset(dev, B43_NPHY_CRSMINPOWER0, 0xFF00, e->crsmin); in b43_nphy_gain_ctl_workarounds_rev3()
2563 b43_phy_maskset(dev, B43_NPHY_CRSMINPOWERL0, 0xFF00, e->crsminl); in b43_nphy_gain_ctl_workarounds_rev3()
2564 b43_phy_maskset(dev, B43_NPHY_CRSMINPOWERU0, 0xFF00, e->crsminu); in b43_nphy_gain_ctl_workarounds_rev3()
2565 b43_phy_write(dev, B43_NPHY_C1_NBCLIPTHRES, e->nbclip); in b43_nphy_gain_ctl_workarounds_rev3()
2566 b43_phy_write(dev, B43_NPHY_C2_NBCLIPTHRES, e->nbclip); in b43_nphy_gain_ctl_workarounds_rev3()
2568 ~B43_NPHY_C1_CLIPWBTHRES_CLIP2, e->wlclip); in b43_nphy_gain_ctl_workarounds_rev3()
2570 ~B43_NPHY_C2_CLIPWBTHRES_CLIP2, e->wlclip); in b43_nphy_gain_ctl_workarounds_rev3()
2576 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_gain_ctl_workarounds_rev1_2()
2619 if (nphy->gain_boost) { in b43_nphy_gain_ctl_workarounds_rev1_2()
2620 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ && in b43_nphy_gain_ctl_workarounds_rev1_2()
2642 if (nphy->elna_gain_config) { in b43_nphy_gain_ctl_workarounds_rev1_2()
2662 if (dev->phy.rev == 2) { in b43_nphy_gain_ctl_workarounds_rev1_2()
2679 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_gain_ctl_workarounds_rev1_2()
2683 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/WorkaroundsGainCtrl */
2686 if (dev->phy.rev >= 19) in b43_nphy_gain_ctl_workarounds()
2688 else if (dev->phy.rev >= 7) in b43_nphy_gain_ctl_workarounds()
2690 else if (dev->phy.rev >= 3) in b43_nphy_gain_ctl_workarounds()
2698 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_nphy_workarounds_rev7plus()
2699 struct b43_phy *phy = &dev->phy; in b43_nphy_workarounds_rev7plus()
2734 if (phy->rev == 7) { in b43_nphy_workarounds_rev7plus()
2754 if (phy->rev >= 16) { in b43_nphy_workarounds_rev7plus()
2757 } else if (phy->rev <= 8) { in b43_nphy_workarounds_rev7plus()
2762 if (phy->rev >= 16) in b43_nphy_workarounds_rev7plus()
2764 else if (phy->rev >= 8) in b43_nphy_workarounds_rev7plus()
2794 bool ghz2 = b43_current_band(dev->wl) == NL80211_BAND_2GHZ; in b43_nphy_workarounds_rev7plus()
2796 switch (phy->radio_rev) { in b43_nphy_workarounds_rev7plus()
2799 if (phy->rev == 8 && b43_is_40mhz(dev)) { in b43_nphy_workarounds_rev7plus()
2811 if (phy->rev == 9) { in b43_nphy_workarounds_rev7plus()
2822 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_workarounds_rev7plus()
2853 bcap_val_11n_40[core] = bcap_val - 7; in b43_nphy_workarounds_rev7plus()
2854 scap_val_11n_40[core] = scap_val - 5; in b43_nphy_workarounds_rev7plus()
2891 if (phy->radio_rev == 5) { in b43_nphy_workarounds_rev7plus()
2954 if (phy->radio_rev == 4 || phy->radio_rev == 6) in b43_nphy_workarounds_rev7plus()
2957 if (phy->radio_rev == 3 || phy->radio_rev == 4 || phy->radio_rev == 6) { in b43_nphy_workarounds_rev7plus()
2958 if (sprom->revision && in b43_nphy_workarounds_rev7plus()
2959 sprom->boardflags2_hi & B43_BFH2_IPALVLSHIFT_3P3) { in b43_nphy_workarounds_rev7plus()
2973 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_workarounds_rev7plus()
2989 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_workarounds_rev7plus()
2990 if (phy->radio_rev == 3 || phy->radio_rev == 4 || in b43_nphy_workarounds_rev7plus()
2991 phy->radio_rev == 6) { in b43_nphy_workarounds_rev7plus()
3001 switch (phy->radio_rev) { in b43_nphy_workarounds_rev7plus()
3055 u16 freq = phy->chandef->chan->center_freq; in b43_nphy_workarounds_rev7plus()
3063 if (phy->radio_rev != 5) { in b43_nphy_workarounds_rev7plus()
3076 if (phy->radio_rev == 4) { in b43_nphy_workarounds_rev7plus()
3143 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_workarounds_rev3plus()
3144 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_nphy_workarounds_rev3plus()
3201 if (nphy->hw_phyrxchain != 3 && in b43_nphy_workarounds_rev3plus()
3202 nphy->hw_phyrxchain != nphy->hw_phytxchain) { in b43_nphy_workarounds_rev3plus()
3212 tmp16 = (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) ? in b43_nphy_workarounds_rev3plus()
3231 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_workarounds_rev3plus()
3232 pdet_range = sprom->fem.ghz2.pdet_range; in b43_nphy_workarounds_rev3plus()
3234 pdet_range = sprom->fem.ghz5.pdet_range; in b43_nphy_workarounds_rev3plus()
3239 if (!(dev->phy.rev >= 4 && in b43_nphy_workarounds_rev3plus()
3240 b43_current_band(dev->wl) == NL80211_BAND_2GHZ)) in b43_nphy_workarounds_rev3plus()
3251 if (dev->phy.rev >= 6) { in b43_nphy_workarounds_rev3plus()
3252 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_workarounds_rev3plus()
3257 } else if (dev->phy.rev == 5) { in b43_nphy_workarounds_rev3plus()
3268 if (b43_current_band(dev->wl) != NL80211_BAND_2GHZ) { in b43_nphy_workarounds_rev3plus()
3312 if ((sprom->boardflags2_lo & B43_BFL2_APLL_WAR && in b43_nphy_workarounds_rev3plus()
3313 b43_current_band(dev->wl) == NL80211_BAND_5GHZ) || in b43_nphy_workarounds_rev3plus()
3314 (sprom->boardflags2_lo & B43_BFL2_GPLL_WAR && in b43_nphy_workarounds_rev3plus()
3315 b43_current_band(dev->wl) == NL80211_BAND_2GHZ)) in b43_nphy_workarounds_rev3plus()
3323 if (dev->phy.rev == 4 && in b43_nphy_workarounds_rev3plus()
3324 b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_workarounds_rev3plus()
3331 /* Dropped probably-always-true condition */ in b43_nphy_workarounds_rev3plus()
3345 if (dev->phy.rev >= 6 && sprom->boardflags2_lo & B43_BFL2_SINGLEANT_CCK) { in b43_nphy_workarounds_rev3plus()
3352 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_nphy_workarounds_rev1_2()
3353 struct b43_phy *phy = &dev->phy; in b43_nphy_workarounds_rev1_2()
3354 struct b43_phy_n *nphy = phy->n; in b43_nphy_workarounds_rev1_2()
3362 if (sprom->boardflags2_lo & B43_BFL2_SKWRKFEM_BRD || in b43_nphy_workarounds_rev1_2()
3363 dev->dev->board_type == BCMA_BOARD_TYPE_BCM943224M93) { in b43_nphy_workarounds_rev1_2()
3368 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ && in b43_nphy_workarounds_rev1_2()
3369 nphy->band5g_pwrgain) { in b43_nphy_workarounds_rev1_2()
3379 if (dev->phy.rev < 3) { in b43_nphy_workarounds_rev1_2()
3384 if (dev->phy.rev < 2) { in b43_nphy_workarounds_rev1_2()
3403 if (dev->phy.rev < 2) { in b43_nphy_workarounds_rev1_2()
3407 } else if (dev->phy.rev == 2) { in b43_nphy_workarounds_rev1_2()
3412 if (dev->phy.rev < 2) in b43_nphy_workarounds_rev1_2()
3424 if (dev->phy.rev < 3) { in b43_nphy_workarounds_rev1_2()
3432 if (dev->phy.rev == 2) in b43_nphy_workarounds_rev1_2()
3437 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/Workarounds */
3440 struct b43_phy *phy = &dev->phy; in b43_nphy_workarounds()
3441 struct b43_phy_n *nphy = phy->n; in b43_nphy_workarounds()
3443 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) in b43_nphy_workarounds()
3448 if (nphy->hang_avoid) in b43_nphy_workarounds()
3455 if (dev->phy.rev >= 7) in b43_nphy_workarounds()
3457 else if (dev->phy.rev >= 3) in b43_nphy_workarounds()
3462 if (nphy->hang_avoid) in b43_nphy_workarounds()
3472 * https://bcm-v4.sipsolutions.net/802.11/PHY/N/TXTone
3479 return -1; in b43_nphy_tx_tone()
3485 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/Chains */
3488 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_update_txrx_chain()
3493 if (nphy->txrx_chain == 0) { in b43_nphy_update_txrx_chain()
3496 } else if (nphy->txrx_chain == 1) { in b43_nphy_update_txrx_chain()
3513 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/stop-playback */
3516 struct b43_phy *phy = &dev->phy; in b43_nphy_stop_playback()
3517 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_stop_playback()
3520 if (nphy->hang_avoid) in b43_nphy_stop_playback()
3531 if (nphy->bb_mult_save & 0x80000000) { in b43_nphy_stop_playback()
3532 tmp = nphy->bb_mult_save & 0xFFFF; in b43_nphy_stop_playback()
3534 nphy->bb_mult_save = 0; in b43_nphy_stop_playback()
3537 if (phy->rev >= 7 && nphy->lpf_bw_overrode_for_sample_play) { in b43_nphy_stop_playback()
3538 if (phy->rev >= 19) in b43_nphy_stop_playback()
3543 nphy->lpf_bw_overrode_for_sample_play = false; in b43_nphy_stop_playback()
3546 if (nphy->hang_avoid) in b43_nphy_stop_playback()
3550 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/IqCalGainParams */
3555 struct b43_phy *phy = &dev->phy; in b43_nphy_iq_cal_gain_params()
3559 if (dev->phy.rev >= 3) { in b43_nphy_iq_cal_gain_params()
3560 params->tx_lpf = target.tx_lpf[core]; /* Rev 7+ */ in b43_nphy_iq_cal_gain_params()
3561 params->txgm = target.txgm[core]; in b43_nphy_iq_cal_gain_params()
3562 params->pga = target.pga[core]; in b43_nphy_iq_cal_gain_params()
3563 params->pad = target.pad[core]; in b43_nphy_iq_cal_gain_params()
3564 params->ipa = target.ipa[core]; in b43_nphy_iq_cal_gain_params()
3565 if (phy->rev >= 19) { in b43_nphy_iq_cal_gain_params()
3567 } else if (phy->rev >= 7) { in b43_nphy_iq_cal_gain_params()
3568 …params->cal_gain = (params->txgm << 12) | (params->pga << 8) | (params->pad << 3) | (params->ipa) … in b43_nphy_iq_cal_gain_params()
3570 … params->cal_gain = (params->txgm << 12) | (params->pga << 8) | (params->pad << 4) | (params->ipa); in b43_nphy_iq_cal_gain_params()
3573 params->ncorr[j] = 0x79; in b43_nphy_iq_cal_gain_params()
3578 indx = (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) ? in b43_nphy_iq_cal_gain_params()
3585 params->txgm = tbl_iqcal_gainparams[indx][i][1]; in b43_nphy_iq_cal_gain_params()
3586 params->pga = tbl_iqcal_gainparams[indx][i][2]; in b43_nphy_iq_cal_gain_params()
3587 params->pad = tbl_iqcal_gainparams[indx][i][3]; in b43_nphy_iq_cal_gain_params()
3588 params->cal_gain = (params->txgm << 7) | (params->pga << 4) | in b43_nphy_iq_cal_gain_params()
3589 (params->pad << 2); in b43_nphy_iq_cal_gain_params()
3591 params->ncorr[j] = tbl_iqcal_gainparams[indx][i][4 + j]; in b43_nphy_iq_cal_gain_params()
3599 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlEnable */
3602 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_power_ctrl()
3603 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_power_ctrl()
3606 enum nl80211_band band = b43_current_band(dev->wl); in b43_nphy_tx_power_ctrl()
3608 if (nphy->hang_avoid) in b43_nphy_tx_power_ctrl()
3611 nphy->txpwrctrl = enable; in b43_nphy_tx_power_ctrl()
3613 if (dev->phy.rev >= 3 && in b43_nphy_tx_power_ctrl()
3619 nphy->tx_pwr_idx[0] = b43_phy_read(dev, in b43_nphy_tx_power_ctrl()
3621 nphy->tx_pwr_idx[1] = b43_phy_read(dev, in b43_nphy_tx_power_ctrl()
3634 if (dev->phy.rev >= 3) in b43_nphy_tx_power_ctrl()
3638 if (dev->phy.rev >= 3) { in b43_nphy_tx_power_ctrl()
3645 if (dev->phy.rev == 2) in b43_nphy_tx_power_ctrl()
3648 else if (dev->phy.rev < 2) in b43_nphy_tx_power_ctrl()
3652 if (dev->phy.rev < 2 && b43_is_40mhz(dev)) in b43_nphy_tx_power_ctrl()
3656 nphy->adj_pwr_tbl); in b43_nphy_tx_power_ctrl()
3658 nphy->adj_pwr_tbl); in b43_nphy_tx_power_ctrl()
3664 if (dev->phy.rev >= 3) { in b43_nphy_tx_power_ctrl()
3672 if (phy->rev >= 19) { in b43_nphy_tx_power_ctrl()
3674 } else if (phy->rev >= 7) { in b43_nphy_tx_power_ctrl()
3685 if (phy->rev > 1) in b43_nphy_tx_power_ctrl()
3693 if (dev->phy.rev >= 3) { in b43_nphy_tx_power_ctrl()
3694 if (nphy->tx_pwr_idx[0] != 128 && in b43_nphy_tx_power_ctrl()
3695 nphy->tx_pwr_idx[1] != 128) { in b43_nphy_tx_power_ctrl()
3699 nphy->tx_pwr_idx[0]); in b43_nphy_tx_power_ctrl()
3700 if (dev->phy.rev > 1) in b43_nphy_tx_power_ctrl()
3703 ~0xff, nphy->tx_pwr_idx[1]); in b43_nphy_tx_power_ctrl()
3707 if (phy->rev >= 7) { in b43_nphy_tx_power_ctrl()
3711 if (dev->phy.rev >= 3) { in b43_nphy_tx_power_ctrl()
3718 if (dev->phy.rev == 2) in b43_nphy_tx_power_ctrl()
3720 else if (dev->phy.rev < 2) in b43_nphy_tx_power_ctrl()
3723 if (dev->phy.rev < 2 && b43_is_40mhz(dev)) in b43_nphy_tx_power_ctrl()
3732 if (nphy->hang_avoid) in b43_nphy_tx_power_ctrl()
3736 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrFix */
3739 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_power_fix()
3740 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_power_fix()
3741 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_nphy_tx_power_fix()
3745 u16 freq = phy->chandef->chan->center_freq; in b43_nphy_tx_power_fix()
3749 if (nphy->hang_avoid) in b43_nphy_tx_power_fix()
3753 if (dev->phy.rev >= 7) { in b43_nphy_tx_power_fix()
3755 } else if (dev->phy.rev >= 3) { in b43_nphy_tx_power_fix()
3758 } else if (sprom->revision < 4) { in b43_nphy_tx_power_fix()
3762 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_tx_power_fix()
3763 txpi[0] = sprom->txpid2g[0]; in b43_nphy_tx_power_fix()
3764 txpi[1] = sprom->txpid2g[1]; in b43_nphy_tx_power_fix()
3766 txpi[0] = sprom->txpid5gl[0]; in b43_nphy_tx_power_fix()
3767 txpi[1] = sprom->txpid5gl[1]; in b43_nphy_tx_power_fix()
3769 txpi[0] = sprom->txpid5g[0]; in b43_nphy_tx_power_fix()
3770 txpi[1] = sprom->txpid5g[1]; in b43_nphy_tx_power_fix()
3772 txpi[0] = sprom->txpid5gh[0]; in b43_nphy_tx_power_fix()
3773 txpi[1] = sprom->txpid5gh[1]; in b43_nphy_tx_power_fix()
3779 if (dev->phy.rev < 7 && in b43_nphy_tx_power_fix()
3785 nphy->txpwrindex[i].index_internal = txpi[i]; in b43_nphy_tx_power_fix()
3786 nphy->txpwrindex[i].index_internal_save = txpi[i]; in b43_nphy_tx_power_fix()
3797 if (dev->phy.rev >= 3) in b43_nphy_tx_power_fix()
3802 if (dev->phy.rev >= 7) in b43_nphy_tx_power_fix()
3808 if (dev->phy.rev >= 3) { in b43_nphy_tx_power_fix()
3833 u16 reg = (i == 0) ? in b43_nphy_tx_power_fix() local
3837 b43_phy_maskset(dev, reg, 0xE00F, (u32) tmp32 << 4); in b43_nphy_tx_power_fix()
3838 b43_phy_set(dev, reg, 0x4); in b43_nphy_tx_power_fix()
3844 if (nphy->hang_avoid) in b43_nphy_tx_power_fix()
3850 struct b43_phy *phy = &dev->phy; in b43_nphy_ipa_internal_tssi_setup()
3855 if (phy->rev >= 19) { in b43_nphy_ipa_internal_tssi_setup()
3857 } else if (phy->rev >= 7) { in b43_nphy_ipa_internal_tssi_setup()
3860 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_ipa_internal_tssi_setup()
3863 if (phy->rev != 5) in b43_nphy_ipa_internal_tssi_setup()
3865 if (phy->rev != 7) in b43_nphy_ipa_internal_tssi_setup()
3873 if (phy->rev != 5) in b43_nphy_ipa_internal_tssi_setup()
3884 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_ipa_internal_tssi_setup()
3901 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_ipa_internal_tssi_setup()
3904 if (phy->rev != 5) in b43_nphy_ipa_internal_tssi_setup()
3907 if (phy->rev >= 5) in b43_nphy_ipa_internal_tssi_setup()
3930 * https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlIdleTssi
3934 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_power_ctl_idle_tssi()
3935 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_power_ctl_idle_tssi()
3940 if (phy->chandef->chan->flags & IEEE80211_CHAN_NO_IR) in b43_nphy_tx_power_ctl_idle_tssi()
3946 if (phy->rev >= 19) in b43_nphy_tx_power_ctl_idle_tssi()
3948 else if (phy->rev >= 7) in b43_nphy_tx_power_ctl_idle_tssi()
3950 else if (phy->rev >= 3) in b43_nphy_tx_power_ctl_idle_tssi()
3961 if (phy->rev >= 19) in b43_nphy_tx_power_ctl_idle_tssi()
3963 else if (phy->rev >= 7) in b43_nphy_tx_power_ctl_idle_tssi()
3965 else if (phy->rev >= 3) in b43_nphy_tx_power_ctl_idle_tssi()
3968 if (phy->rev >= 19) { in b43_nphy_tx_power_ctl_idle_tssi()
3971 } else if (phy->rev >= 3) { in b43_nphy_tx_power_ctl_idle_tssi()
3972 nphy->pwr_ctl_info[0].idle_tssi_5g = (tmp >> 24) & 0xFF; in b43_nphy_tx_power_ctl_idle_tssi()
3973 nphy->pwr_ctl_info[1].idle_tssi_5g = (tmp >> 8) & 0xFF; in b43_nphy_tx_power_ctl_idle_tssi()
3975 nphy->pwr_ctl_info[0].idle_tssi_5g = (tmp >> 16) & 0xFF; in b43_nphy_tx_power_ctl_idle_tssi()
3976 nphy->pwr_ctl_info[1].idle_tssi_5g = tmp & 0xFF; in b43_nphy_tx_power_ctl_idle_tssi()
3978 nphy->pwr_ctl_info[0].idle_tssi_2g = (tmp >> 24) & 0xFF; in b43_nphy_tx_power_ctl_idle_tssi()
3979 nphy->pwr_ctl_info[1].idle_tssi_2g = (tmp >> 8) & 0xFF; in b43_nphy_tx_power_ctl_idle_tssi()
3982 /* https://bcm-v4.sipsolutions.net/PHY/N/TxPwrLimitToTbl */
3985 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_prepare_adjusted_power_table()
3999 * Groups 9..12 use 16-QAM (group per coding rate) in b43_nphy_tx_prepare_adjusted_power_table()
4000 * Groups 13..16 use 64-QAM (group per coding rate) in b43_nphy_tx_prepare_adjusted_power_table()
4005 nphy->adj_pwr_tbl[i] = nphy->tx_power_offset[i]; in b43_nphy_tx_prepare_adjusted_power_table()
4011 if (b43_is_40mhz(dev) && dev->phy.rev >= 5) { in b43_nphy_tx_prepare_adjusted_power_table()
4030 nphy->adj_pwr_tbl[4 + 4 * i + stf_mode] = in b43_nphy_tx_prepare_adjusted_power_table()
4031 nphy->tx_power_offset[idx]; in b43_nphy_tx_prepare_adjusted_power_table()
4035 idx += 1 - delta; in b43_nphy_tx_prepare_adjusted_power_table()
4043 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlSetup */
4046 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_power_ctl_setup()
4047 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_power_ctl_setup()
4048 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_nphy_tx_power_ctl_setup()
4057 u16 freq = phy->chandef->chan->center_freq; in b43_nphy_tx_power_ctl_setup()
4062 if (dev->dev->core_rev == 11 || dev->dev->core_rev == 12) { in b43_nphy_tx_power_ctl_setup()
4068 if (nphy->hang_avoid) in b43_nphy_tx_power_ctl_setup()
4072 if (dev->phy.rev >= 3) in b43_nphy_tx_power_ctl_setup()
4079 if (dev->dev->core_rev == 11 || dev->dev->core_rev == 12) in b43_nphy_tx_power_ctl_setup()
4082 if (sprom->revision < 4) { in b43_nphy_tx_power_ctl_setup()
4083 idle[0] = nphy->pwr_ctl_info[0].idle_tssi_2g; in b43_nphy_tx_power_ctl_setup()
4084 idle[1] = nphy->pwr_ctl_info[1].idle_tssi_2g; in b43_nphy_tx_power_ctl_setup()
4086 a1[0] = a1[1] = -424; in b43_nphy_tx_power_ctl_setup()
4088 b1[0] = b1[1] = -1393; in b43_nphy_tx_power_ctl_setup()
4090 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_tx_power_ctl_setup()
4092 idle[c] = nphy->pwr_ctl_info[c].idle_tssi_2g; in b43_nphy_tx_power_ctl_setup()
4093 target[c] = sprom->core_pwr_info[c].maxpwr_2g; in b43_nphy_tx_power_ctl_setup()
4094 a1[c] = sprom->core_pwr_info[c].pa_2g[0]; in b43_nphy_tx_power_ctl_setup()
4095 b0[c] = sprom->core_pwr_info[c].pa_2g[1]; in b43_nphy_tx_power_ctl_setup()
4096 b1[c] = sprom->core_pwr_info[c].pa_2g[2]; in b43_nphy_tx_power_ctl_setup()
4100 idle[c] = nphy->pwr_ctl_info[c].idle_tssi_5g; in b43_nphy_tx_power_ctl_setup()
4101 target[c] = sprom->core_pwr_info[c].maxpwr_5gl; in b43_nphy_tx_power_ctl_setup()
4102 a1[c] = sprom->core_pwr_info[c].pa_5gl[0]; in b43_nphy_tx_power_ctl_setup()
4103 b0[c] = sprom->core_pwr_info[c].pa_5gl[1]; in b43_nphy_tx_power_ctl_setup()
4104 b1[c] = sprom->core_pwr_info[c].pa_5gl[2]; in b43_nphy_tx_power_ctl_setup()
4108 idle[c] = nphy->pwr_ctl_info[c].idle_tssi_5g; in b43_nphy_tx_power_ctl_setup()
4109 target[c] = sprom->core_pwr_info[c].maxpwr_5g; in b43_nphy_tx_power_ctl_setup()
4110 a1[c] = sprom->core_pwr_info[c].pa_5g[0]; in b43_nphy_tx_power_ctl_setup()
4111 b0[c] = sprom->core_pwr_info[c].pa_5g[1]; in b43_nphy_tx_power_ctl_setup()
4112 b1[c] = sprom->core_pwr_info[c].pa_5g[2]; in b43_nphy_tx_power_ctl_setup()
4116 idle[c] = nphy->pwr_ctl_info[c].idle_tssi_5g; in b43_nphy_tx_power_ctl_setup()
4117 target[c] = sprom->core_pwr_info[c].maxpwr_5gh; in b43_nphy_tx_power_ctl_setup()
4118 a1[c] = sprom->core_pwr_info[c].pa_5gh[0]; in b43_nphy_tx_power_ctl_setup()
4119 b0[c] = sprom->core_pwr_info[c].pa_5gh[1]; in b43_nphy_tx_power_ctl_setup()
4120 b1[c] = sprom->core_pwr_info[c].pa_5gh[2]; in b43_nphy_tx_power_ctl_setup()
4123 idle[0] = nphy->pwr_ctl_info[0].idle_tssi_5g; in b43_nphy_tx_power_ctl_setup()
4124 idle[1] = nphy->pwr_ctl_info[1].idle_tssi_5g; in b43_nphy_tx_power_ctl_setup()
4126 a1[0] = a1[1] = -424; in b43_nphy_tx_power_ctl_setup()
4128 b1[0] = b1[1] = -1393; in b43_nphy_tx_power_ctl_setup()
4132 ppr_max = b43_ppr_get_max(dev, &nphy->tx_pwr_max_ppr); in b43_nphy_tx_power_ctl_setup()
4138 if (dev->phy.rev >= 3) { in b43_nphy_tx_power_ctl_setup()
4139 if (sprom->fem.ghz2.tssipos) in b43_nphy_tx_power_ctl_setup()
4141 if (dev->phy.rev >= 7) { in b43_nphy_tx_power_ctl_setup()
4145 b43_radio_write(dev, r + 0x9, (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) ? 0xE : 0xC); in b43_nphy_tx_power_ctl_setup()
4149 tmp = (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) ? 0xC : 0xE; in b43_nphy_tx_power_ctl_setup()
4163 if (dev->dev->core_rev == 11 || dev->dev->core_rev == 12) { in b43_nphy_tx_power_ctl_setup()
4169 if (phy->rev >= 19) { in b43_nphy_tx_power_ctl_setup()
4171 } else if (phy->rev >= 7) { in b43_nphy_tx_power_ctl_setup()
4179 if (dev->phy.rev > 1) in b43_nphy_tx_power_ctl_setup()
4184 if (dev->dev->core_rev == 11 || dev->dev->core_rev == 12) in b43_nphy_tx_power_ctl_setup()
4202 pwr = max((4 * num + den / 2) / den, -8); in b43_nphy_tx_power_ctl_setup()
4203 if (dev->phy.rev < 3 && (i <= (31 - idle[c] + 1))) in b43_nphy_tx_power_ctl_setup()
4211 b43_ntab_write_bulk(dev, B43_NTAB16(26, 64), 84, nphy->adj_pwr_tbl); in b43_nphy_tx_power_ctl_setup()
4212 b43_ntab_write_bulk(dev, B43_NTAB16(27, 64), 84, nphy->adj_pwr_tbl); in b43_nphy_tx_power_ctl_setup()
4214 if (nphy->hang_avoid) in b43_nphy_tx_power_ctl_setup()
4220 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_gain_table_upload()
4235 if (phy->rev < 3) in b43_nphy_tx_gain_table_upload()
4239 nphy->gmval = (table[0] >> 16) & 0x7000; in b43_nphy_tx_gain_table_upload()
4242 if (phy->rev >= 19) { in b43_nphy_tx_gain_table_upload()
4244 } else if (phy->rev >= 7) { in b43_nphy_tx_gain_table_upload()
4253 if (phy->rev >= 19) { in b43_nphy_tx_gain_table_upload()
4256 } else if (phy->rev >= 7) { in b43_nphy_tx_gain_table_upload()
4259 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_tx_gain_table_upload()
4265 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_tx_gain_table_upload()
4276 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/PA%20override */
4279 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_pa_override()
4284 nphy->rfctrl_intc1_save = b43_phy_read(dev, in b43_nphy_pa_override()
4286 nphy->rfctrl_intc2_save = b43_phy_read(dev, in b43_nphy_pa_override()
4288 band = b43_current_band(dev->wl); in b43_nphy_pa_override()
4289 if (dev->phy.rev >= 7) { in b43_nphy_pa_override()
4291 } else if (dev->phy.rev >= 3) { in b43_nphy_pa_override()
4306 nphy->rfctrl_intc1_save); in b43_nphy_pa_override()
4308 nphy->rfctrl_intc2_save); in b43_nphy_pa_override()
4313 * TX low-pass filter bandwidth setup
4314 * https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxLpFbw
4320 if (dev->phy.rev < 3 || dev->phy.rev >= 7) in b43_nphy_tx_lpf_bw()
4337 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RxIqEst */
4353 for (i = 1000; i; i--) { in b43_nphy_rx_iq_est()
4356 est->i0_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_IPACC_HI0) << 16) | in b43_nphy_rx_iq_est()
4358 est->q0_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_QPACC_HI0) << 16) | in b43_nphy_rx_iq_est()
4360 est->iq0_prod = (b43_phy_read(dev, B43_NPHY_IQEST_IQACC_HI0) << 16) | in b43_nphy_rx_iq_est()
4363 est->i1_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_IPACC_HI1) << 16) | in b43_nphy_rx_iq_est()
4365 est->q1_pwr = (b43_phy_read(dev, B43_NPHY_IQEST_QPACC_HI1) << 16) | in b43_nphy_rx_iq_est()
4367 est->iq1_prod = (b43_phy_read(dev, B43_NPHY_IQEST_IQACC_HI1) << 16) | in b43_nphy_rx_iq_est()
4376 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RxIqCoeffs */
4381 b43_phy_write(dev, B43_NPHY_C1_RXIQ_COMPA0, pcomp->a0); in b43_nphy_rx_iq_coeffs()
4382 b43_phy_write(dev, B43_NPHY_C1_RXIQ_COMPB0, pcomp->b0); in b43_nphy_rx_iq_coeffs()
4383 b43_phy_write(dev, B43_NPHY_C2_RXIQ_COMPA1, pcomp->a1); in b43_nphy_rx_iq_coeffs()
4384 b43_phy_write(dev, B43_NPHY_C2_RXIQ_COMPB1, pcomp->b1); in b43_nphy_rx_iq_coeffs()
4386 pcomp->a0 = b43_phy_read(dev, B43_NPHY_C1_RXIQ_COMPA0); in b43_nphy_rx_iq_coeffs()
4387 pcomp->b0 = b43_phy_read(dev, B43_NPHY_C1_RXIQ_COMPB0); in b43_nphy_rx_iq_coeffs()
4388 pcomp->a1 = b43_phy_read(dev, B43_NPHY_C2_RXIQ_COMPA1); in b43_nphy_rx_iq_coeffs()
4389 pcomp->b1 = b43_phy_read(dev, B43_NPHY_C2_RXIQ_COMPB1); in b43_nphy_rx_iq_coeffs()
4395 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCalPhyCleanup */
4398 u16 *regs = dev->phy.n->tx_rx_cal_phy_saveregs;
4418 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCalPhySetup */
4422 u16 *regs = dev->phy.n->tx_rx_cal_phy_saveregs;
4446 ((1 - core) << B43_NPHY_RFSEQCA_RXDIS_SHIFT));
4448 ((1 - core) << B43_NPHY_RFSEQCA_TXEN_SHIFT));
4476 2 - core);
4480 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/CalcRxIqComp */
4525 arsh = iq_nbits - 20; in b43_nphy_calc_rx_iq_comp()
4527 a = -((iq << (30 - iq_nbits)) + (ii >> (1 + arsh))); in b43_nphy_calc_rx_iq_comp()
4530 a = -((iq << (30 - iq_nbits)) + (ii << (-1 - arsh))); in b43_nphy_calc_rx_iq_comp()
4531 tmp = ii << -arsh; in b43_nphy_calc_rx_iq_comp()
4539 brsh = qq_nbits - 11; in b43_nphy_calc_rx_iq_comp()
4541 b = (qq << (31 - qq_nbits)); in b43_nphy_calc_rx_iq_comp()
4544 b = (qq << (31 - qq_nbits)); in b43_nphy_calc_rx_iq_comp()
4545 tmp = ii << -brsh; in b43_nphy_calc_rx_iq_comp()
4551 b = int_sqrt(b / tmp - a * a) - (1 << 10); in b43_nphy_calc_rx_iq_comp()
4554 if (dev->phy.rev >= 3) { in b43_nphy_calc_rx_iq_comp()
4562 if (dev->phy.rev >= 3) { in b43_nphy_calc_rx_iq_comp()
4578 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxIqWar */
4590 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/SpurWar */
4593 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_spur_workaround()
4595 u8 channel = dev->phy.channel; in b43_nphy_spur_workaround()
4599 B43_WARN_ON(dev->phy.rev < 3); in b43_nphy_spur_workaround()
4601 if (nphy->hang_avoid) in b43_nphy_spur_workaround()
4604 if (nphy->gband_spurwar_en) { in b43_nphy_spur_workaround()
4614 if (nphy->aband_spurwar_en) { in b43_nphy_spur_workaround()
4647 if (nphy->hang_avoid) in b43_nphy_spur_workaround()
4651 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxPwrCtrlCoefSetup */
4654 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_pwr_ctrl_coef_setup()
4661 if (nphy->hang_avoid) in b43_nphy_tx_pwr_ctrl_coef_setup()
4686 if (dev->phy.rev >= 3) { in b43_nphy_tx_pwr_ctrl_coef_setup()
4693 if (dev->phy.rev < 3) { in b43_nphy_tx_pwr_ctrl_coef_setup()
4706 if (dev->phy.rev >= 3) { in b43_nphy_tx_pwr_ctrl_coef_setup()
4713 if (nphy->hang_avoid) in b43_nphy_tx_pwr_ctrl_coef_setup()
4719 * https://bcm-v4.sipsolutions.net/802.11/PHY/N/RestoreRssiCal
4723 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_restore_rssi_cal()
4728 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_restore_rssi_cal()
4729 if (!nphy->rssical_chanspec_2G.center_freq) in b43_nphy_restore_rssi_cal()
4731 rssical_radio_regs = nphy->rssical_cache.rssical_radio_regs_2G; in b43_nphy_restore_rssi_cal()
4732 rssical_phy_regs = nphy->rssical_cache.rssical_phy_regs_2G; in b43_nphy_restore_rssi_cal()
4734 if (!nphy->rssical_chanspec_5G.center_freq) in b43_nphy_restore_rssi_cal()
4736 rssical_radio_regs = nphy->rssical_cache.rssical_radio_regs_5G; in b43_nphy_restore_rssi_cal()
4737 rssical_phy_regs = nphy->rssical_cache.rssical_phy_regs_5G; in b43_nphy_restore_rssi_cal()
4740 if (dev->phy.rev >= 19) { in b43_nphy_restore_rssi_cal()
4742 } else if (dev->phy.rev >= 7) { in b43_nphy_restore_rssi_cal()
4777 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_cal_radio_setup_rev7()
4778 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_cal_radio_setup_rev7()
4779 u16 *save = nphy->tx_rx_cal_radio_saveregs; in b43_nphy_tx_cal_radio_setup_rev7()
4793 if (phy->radio_rev != 5) in b43_nphy_tx_cal_radio_setup_rev7()
4798 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_tx_cal_radio_setup_rev7()
4804 if (nphy->use_int_tx_iq_lo_cal) { in b43_nphy_tx_cal_radio_setup_rev7()
4816 if (phy->radio_rev != 5) in b43_nphy_tx_cal_radio_setup_rev7()
4818 if (nphy->use_int_tx_iq_lo_cal) { in b43_nphy_tx_cal_radio_setup_rev7()
4828 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxCalRadioSetup */
4831 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_cal_radio_setup()
4832 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_cal_radio_setup()
4833 u16 *save = nphy->tx_rx_cal_radio_saveregs; in b43_nphy_tx_cal_radio_setup()
4837 if (phy->rev >= 19) { in b43_nphy_tx_cal_radio_setup()
4839 } else if (phy->rev >= 7) { in b43_nphy_tx_cal_radio_setup()
4841 } else if (phy->rev >= 3) { in b43_nphy_tx_cal_radio_setup()
4858 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) { in b43_nphy_tx_cal_radio_setup()
4864 if (nphy->ipa5g_on) { in b43_nphy_tx_cal_radio_setup()
4879 if (nphy->ipa2g_on) { in b43_nphy_tx_cal_radio_setup()
4882 (dev->phy.rev < 5) ? 0x11 : 0x01); in b43_nphy_tx_cal_radio_setup()
4917 if (dev->phy.rev < 2) { in b43_nphy_tx_cal_radio_setup()
4927 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/UpdateTxCalLadder */
4930 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_update_tx_cal_ladder()
4934 u16 tmp = nphy->txcal_bbmult; in b43_nphy_update_tx_cal_ladder()
4961 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/ExtPaSetTxDigiFilts */
4968 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/IpaSetTxDigiFilts */
4974 -375, 136, -407, 208, -1527, in b43_nphy_int_pa_set_tx_dig_filters()
4976 -44, 230, 201, -191, 201, in b43_nphy_int_pa_set_tx_dig_filters()
4985 if (dev->phy.rev == 16) in b43_nphy_int_pa_set_tx_dig_filters()
4989 if (dev->phy.rev == 17) { in b43_nphy_int_pa_set_tx_dig_filters()
4999 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) in b43_nphy_int_pa_set_tx_dig_filters()
5002 if (dev->phy.channel == 14) in b43_nphy_int_pa_set_tx_dig_filters()
5008 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */
5011 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_get_tx_gains()
5017 if (!nphy->txpwrctrl) { in b43_nphy_get_tx_gains()
5020 if (nphy->hang_avoid) in b43_nphy_get_tx_gains()
5023 if (nphy->hang_avoid) in b43_nphy_get_tx_gains()
5027 if (dev->phy.rev >= 7) { in b43_nphy_get_tx_gains()
5028 target.ipa[i] = curr_gain[i] & 0x0007; in b43_nphy_get_tx_gains()
5033 } else if (dev->phy.rev >= 3) { in b43_nphy_get_tx_gains()
5034 target.ipa[i] = curr_gain[i] & 0x000F; in b43_nphy_get_tx_gains()
5039 target.ipa[i] = curr_gain[i] & 0x0003; in b43_nphy_get_tx_gains()
5060 if (dev->phy.rev >= 7) { in b43_nphy_get_tx_gains()
5061 target.ipa[i] = (table[index[i]] >> 16) & 0x7; in b43_nphy_get_tx_gains()
5066 } else if (dev->phy.rev >= 3) { in b43_nphy_get_tx_gains()
5067 target.ipa[i] = (table[index[i]] >> 16) & 0xF; in b43_nphy_get_tx_gains()
5072 target.ipa[i] = (table[index[i]] >> 16) & 0x3; in b43_nphy_get_tx_gains()
5083 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxCalPhyCleanup */
5086 u16 *regs = dev->phy.n->tx_rx_cal_phy_saveregs; in b43_nphy_tx_cal_phy_cleanup()
5088 if (dev->phy.rev >= 3) { in b43_nphy_tx_cal_phy_cleanup()
5112 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/TxCalPhySetup */
5115 struct b43_phy *phy = &dev->phy; in b43_nphy_tx_cal_phy_setup()
5116 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_tx_cal_phy_setup()
5117 u16 *regs = dev->phy.n->tx_rx_cal_phy_saveregs; in b43_nphy_tx_cal_phy_setup()
5122 if (dev->phy.rev >= 3) { in b43_nphy_tx_cal_phy_setup()
5148 if (!nphy->use_int_tx_iq_lo_cal) in b43_nphy_tx_cal_phy_setup()
5163 if (phy->rev >= 19) in b43_nphy_tx_cal_phy_setup()
5166 else if (phy->rev >= 7) in b43_nphy_tx_cal_phy_setup()
5170 if (nphy->use_int_tx_iq_lo_cal && true /* FIXME */) { in b43_nphy_tx_cal_phy_setup()
5171 if (phy->rev >= 19) { in b43_nphy_tx_cal_phy_setup()
5174 } else if (phy->rev >= 8) { in b43_nphy_tx_cal_phy_setup()
5177 } else if (phy->rev == 7) { in b43_nphy_tx_cal_phy_setup()
5179 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_tx_cal_phy_setup()
5204 if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) in b43_nphy_tx_cal_phy_setup()
5213 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/SaveCal */
5216 struct b43_phy *phy = &dev->phy; in b43_nphy_save_cal()
5217 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_save_cal()
5224 if (nphy->hang_avoid) in b43_nphy_save_cal()
5227 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_save_cal()
5228 rxcal_coeffs = &nphy->cal_cache.rxcal_coeffs_2G; in b43_nphy_save_cal()
5229 txcal_radio_regs = nphy->cal_cache.txcal_radio_regs_2G; in b43_nphy_save_cal()
5230 iqcal_chanspec = &nphy->iqcal_chanspec_2G; in b43_nphy_save_cal()
5231 table = nphy->cal_cache.txcal_coeffs_2G; in b43_nphy_save_cal()
5233 rxcal_coeffs = &nphy->cal_cache.rxcal_coeffs_5G; in b43_nphy_save_cal()
5234 txcal_radio_regs = nphy->cal_cache.txcal_radio_regs_5G; in b43_nphy_save_cal()
5235 iqcal_chanspec = &nphy->iqcal_chanspec_5G; in b43_nphy_save_cal()
5236 table = nphy->cal_cache.txcal_coeffs_5G; in b43_nphy_save_cal()
5241 if (phy->rev >= 19) { in b43_nphy_save_cal()
5243 } else if (phy->rev >= 7) { in b43_nphy_save_cal()
5260 } else if (phy->rev >= 3) { in b43_nphy_save_cal()
5275 iqcal_chanspec->center_freq = dev->phy.chandef->chan->center_freq; in b43_nphy_save_cal()
5276 iqcal_chanspec->channel_type = in b43_nphy_save_cal()
5277 cfg80211_get_chandef_type(dev->phy.chandef); in b43_nphy_save_cal()
5280 if (nphy->hang_avoid) in b43_nphy_save_cal()
5284 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RestoreCal */
5287 struct b43_phy *phy = &dev->phy; in b43_nphy_restore_cal()
5288 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_restore_cal()
5298 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_restore_cal()
5299 if (!nphy->iqcal_chanspec_2G.center_freq) in b43_nphy_restore_cal()
5301 table = nphy->cal_cache.txcal_coeffs_2G; in b43_nphy_restore_cal()
5302 loft = &nphy->cal_cache.txcal_coeffs_2G[5]; in b43_nphy_restore_cal()
5304 if (!nphy->iqcal_chanspec_5G.center_freq) in b43_nphy_restore_cal()
5306 table = nphy->cal_cache.txcal_coeffs_5G; in b43_nphy_restore_cal()
5307 loft = &nphy->cal_cache.txcal_coeffs_5G[5]; in b43_nphy_restore_cal()
5313 if (dev->phy.rev >= 3) in b43_nphy_restore_cal()
5323 if (dev->phy.rev < 2) in b43_nphy_restore_cal()
5326 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_restore_cal()
5327 txcal_radio_regs = nphy->cal_cache.txcal_radio_regs_2G; in b43_nphy_restore_cal()
5328 rxcal_coeffs = &nphy->cal_cache.rxcal_coeffs_2G; in b43_nphy_restore_cal()
5330 txcal_radio_regs = nphy->cal_cache.txcal_radio_regs_5G; in b43_nphy_restore_cal()
5331 rxcal_coeffs = &nphy->cal_cache.rxcal_coeffs_5G; in b43_nphy_restore_cal()
5335 if (phy->rev >= 19) { in b43_nphy_restore_cal()
5337 } else if (phy->rev >= 7) { in b43_nphy_restore_cal()
5354 } else if (phy->rev >= 3) { in b43_nphy_restore_cal()
5372 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/CalTxIqlo */
5377 struct b43_phy *phy = &dev->phy; in b43_nphy_cal_tx_iq_lo()
5378 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_cal_tx_iq_lo()
5397 if (dev->phy.rev >= 4) { in b43_nphy_cal_tx_iq_lo()
5398 avoid = nphy->hang_avoid; in b43_nphy_cal_tx_iq_lo()
5399 nphy->hang_avoid = false; in b43_nphy_cal_tx_iq_lo()
5414 phy6or5x = dev->phy.rev >= 6 || in b43_nphy_cal_tx_iq_lo()
5415 (dev->phy.rev == 5 && nphy->ipa2g_on && in b43_nphy_cal_tx_iq_lo()
5416 b43_current_band(dev->wl) == NL80211_BAND_2GHZ); in b43_nphy_cal_tx_iq_lo()
5431 if (phy->rev >= 19) { in b43_nphy_cal_tx_iq_lo()
5433 } else if (phy->rev >= 7) { in b43_nphy_cal_tx_iq_lo()
5444 if (nphy->mphase_cal_phase_id > 2) in b43_nphy_cal_tx_iq_lo()
5451 if (nphy->mphase_cal_phase_id > 2) { in b43_nphy_cal_tx_iq_lo()
5452 table = nphy->mphase_txcal_bestcoeffs; in b43_nphy_cal_tx_iq_lo()
5454 if (dev->phy.rev < 3) in b43_nphy_cal_tx_iq_lo()
5455 length -= 2; in b43_nphy_cal_tx_iq_lo()
5457 if (!full && nphy->txiqlocal_coeffsvalid) { in b43_nphy_cal_tx_iq_lo()
5458 table = nphy->txiqlocal_bestc; in b43_nphy_cal_tx_iq_lo()
5460 if (dev->phy.rev < 3) in b43_nphy_cal_tx_iq_lo()
5461 length -= 2; in b43_nphy_cal_tx_iq_lo()
5464 if (dev->phy.rev >= 3) { in b43_nphy_cal_tx_iq_lo()
5477 if (dev->phy.rev >= 3) in b43_nphy_cal_tx_iq_lo()
5482 if (dev->phy.rev >= 3) in b43_nphy_cal_tx_iq_lo()
5489 count = nphy->mphase_txcal_cmdidx; in b43_nphy_cal_tx_iq_lo()
5491 (u16)(count + nphy->mphase_txcal_numcmds)); in b43_nphy_cal_tx_iq_lo()
5499 if (dev->phy.rev >= 3) in b43_nphy_cal_tx_iq_lo()
5504 if (dev->phy.rev >= 3) in b43_nphy_cal_tx_iq_lo()
5548 nphy->mphase_txcal_cmdidx = (numb >= max) ? 0 : numb; in b43_nphy_cal_tx_iq_lo()
5550 last = (dev->phy.rev < 3) ? 6 : 7; in b43_nphy_cal_tx_iq_lo()
5552 if (!mphase || nphy->mphase_cal_phase_id == last) { in b43_nphy_cal_tx_iq_lo()
5555 if (dev->phy.rev < 3) { in b43_nphy_cal_tx_iq_lo()
5570 if (dev->phy.rev < 3) in b43_nphy_cal_tx_iq_lo()
5571 length -= 2; in b43_nphy_cal_tx_iq_lo()
5573 nphy->txiqlocal_bestc); in b43_nphy_cal_tx_iq_lo()
5574 nphy->txiqlocal_coeffsvalid = true; in b43_nphy_cal_tx_iq_lo()
5575 nphy->txiqlocal_chanspec.center_freq = in b43_nphy_cal_tx_iq_lo()
5576 phy->chandef->chan->center_freq; in b43_nphy_cal_tx_iq_lo()
5577 nphy->txiqlocal_chanspec.channel_type = in b43_nphy_cal_tx_iq_lo()
5578 cfg80211_get_chandef_type(phy->chandef); in b43_nphy_cal_tx_iq_lo()
5581 if (dev->phy.rev < 3) in b43_nphy_cal_tx_iq_lo()
5582 length -= 2; in b43_nphy_cal_tx_iq_lo()
5584 nphy->mphase_txcal_bestcoeffs); in b43_nphy_cal_tx_iq_lo()
5594 if (dev->phy.rev < 2 && (!mphase || nphy->mphase_cal_phase_id == last)) in b43_nphy_cal_tx_iq_lo()
5597 if (dev->phy.rev >= 4) in b43_nphy_cal_tx_iq_lo()
5598 nphy->hang_avoid = avoid; in b43_nphy_cal_tx_iq_lo()
5605 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/ReapplyTxCalCoeffs */
5608 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_reapply_tx_cal_coeffs()
5613 if (!nphy->txiqlocal_coeffsvalid || in b43_nphy_reapply_tx_cal_coeffs()
5614 nphy->txiqlocal_chanspec.center_freq != dev->phy.chandef->chan->center_freq || in b43_nphy_reapply_tx_cal_coeffs()
5615 nphy->txiqlocal_chanspec.channel_type != cfg80211_get_chandef_type(dev->phy.chandef)) in b43_nphy_reapply_tx_cal_coeffs()
5620 if (buffer[i] != nphy->txiqlocal_bestc[i]) { in b43_nphy_reapply_tx_cal_coeffs()
5628 nphy->txiqlocal_bestc); in b43_nphy_reapply_tx_cal_coeffs()
5634 &nphy->txiqlocal_bestc[5]); in b43_nphy_reapply_tx_cal_coeffs()
5636 &nphy->txiqlocal_bestc[5]); in b43_nphy_reapply_tx_cal_coeffs()
5640 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/CalRxIqRev2 */
5644 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_rev2_cal_rx_iq()
5669 if (dev->phy.rev < 2) in b43_nphy_rev2_cal_rx_iq()
5697 ((1 - i) << B43_NPHY_RFSEQCA_RXDIS_SHIFT)); in b43_nphy_rev2_cal_rx_iq()
5699 (1 - i)); in b43_nphy_rev2_cal_rx_iq()
5703 band = b43_current_band(dev->wl); in b43_nphy_rev2_cal_rx_iq()
5705 if (nphy->rxcalparams & 0xFF000000) { in b43_nphy_rev2_cal_rx_iq()
5722 if (nphy->rxcalparams & 0x10000) { in b43_nphy_rev2_cal_rx_iq()
5726 (2 - i)); in b43_nphy_rev2_cal_rx_iq()
5753 cur_hpf += desired - hweight32(power[index]); in b43_nphy_rev2_cal_rx_iq()
5770 (nphy->rxcalparams & 0xFFFF), in b43_nphy_rev2_cal_rx_iq()
5824 return -1; in b43_nphy_rev3_cal_rx_iq()
5827 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/CalRxIq */
5831 if (dev->phy.rev >= 7) in b43_nphy_cal_rx_iq()
5834 if (dev->phy.rev >= 3) in b43_nphy_cal_rx_iq()
5840 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCoreSetState */
5843 struct b43_phy *phy = &dev->phy; in b43_nphy_set_rx_core_state()
5844 struct b43_phy_n *nphy = phy->n; in b43_nphy_set_rx_core_state()
5847 nphy->phyrxchain = mask; in b43_nphy_set_rx_core_state()
5854 if (nphy->hang_avoid) in b43_nphy_set_rx_core_state()
5862 if (dev->phy.rev >= 3) { in b43_nphy_set_rx_core_state()
5867 if (dev->phy.rev >= 3) { in b43_nphy_set_rx_core_state()
5874 if (nphy->hang_avoid) in b43_nphy_set_rx_core_state()
5883 struct b43_phy *phy = &dev->phy; in b43_nphy_op_recalc_txpower()
5884 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_op_recalc_txpower()
5885 struct ieee80211_channel *channel = dev->wl->hw->conf.chandef.chan; in b43_nphy_op_recalc_txpower()
5886 struct b43_ppr *ppr = &nphy->tx_pwr_max_ppr; in b43_nphy_op_recalc_txpower()
5889 if (nphy->tx_pwr_last_recalc_freq == channel->center_freq && in b43_nphy_op_recalc_txpower()
5890 nphy->tx_pwr_last_recalc_limit == phy->desired_txpower) in b43_nphy_op_recalc_txpower()
5900 max = INT_TO_Q52(phy->chandef->chan->max_power); in b43_nphy_op_recalc_txpower()
5901 if (phy->desired_txpower) in b43_nphy_op_recalc_txpower()
5902 max = min_t(u8, max, INT_TO_Q52(phy->desired_txpower)); in b43_nphy_op_recalc_txpower()
5905 b43dbg(dev->wl, "Calculated TX power: " Q52_FMT "\n", in b43_nphy_op_recalc_txpower()
5911 hw_gain = 6; /* N-PHY specific */ in b43_nphy_op_recalc_txpower()
5912 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_op_recalc_txpower()
5913 hw_gain += sprom->antenna_gain.a0; in b43_nphy_op_recalc_txpower()
5915 hw_gain += sprom->antenna_gain.a1; in b43_nphy_op_recalc_txpower()
5916 b43_ppr_add(dev, ppr, -hw_gain); in b43_nphy_op_recalc_txpower()
5925 if (dev->dev->core_rev == 11 || dev->dev->core_rev == 12) { in b43_nphy_op_recalc_txpower()
5930 b43_nphy_tx_power_ctrl(dev, nphy->txpwrctrl); in b43_nphy_op_recalc_txpower()
5931 if (dev->dev->core_rev == 11 || dev->dev->core_rev == 12) in b43_nphy_op_recalc_txpower()
5935 nphy->tx_pwr_last_recalc_freq = channel->center_freq; in b43_nphy_op_recalc_txpower()
5936 nphy->tx_pwr_last_recalc_limit = phy->desired_txpower; in b43_nphy_op_recalc_txpower()
5942 * N-PHY init
5945 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/MIMOConfig */
5959 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/BPHYInit */
5968 val -= 0x202; in b43_nphy_bphy_init()
5973 val -= 0x202; in b43_nphy_bphy_init()
5978 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/SuperSwitchInit */
5981 if (dev->phy.rev >= 7) in b43_nphy_superswitch_init()
5984 if (dev->phy.rev >= 3) { in b43_nphy_superswitch_init()
5997 switch (dev->dev->bus_type) { in b43_nphy_superswitch_init()
6000 bcma_chipco_gpio_control(&dev->dev->bdev->bus->drv_cc, in b43_nphy_superswitch_init()
6006 ssb_chipco_gpio_control(&dev->dev->sdev->bus->chipco, in b43_nphy_superswitch_init()
6026 /* http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N */
6029 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_phy_initn()
6030 struct b43_phy *phy = &dev->phy; in b43_phy_initn()
6031 struct b43_phy_n *nphy = phy->n; in b43_phy_initn()
6040 if ((dev->phy.rev >= 3) && in b43_phy_initn()
6041 (sprom->boardflags_lo & B43_BFL_EXTLNA) && in b43_phy_initn()
6042 (b43_current_band(dev->wl) == NL80211_BAND_2GHZ)) { in b43_phy_initn()
6043 switch (dev->dev->bus_type) { in b43_phy_initn()
6046 bcma_cc_set32(&dev->dev->bdev->bus->drv_cc, in b43_phy_initn()
6052 chipco_set32(&dev->dev->sdev->bus->chipco, in b43_phy_initn()
6058 nphy->use_int_tx_iq_lo_cal = b43_nphy_ipa(dev) || in b43_phy_initn()
6059 phy->rev >= 7 || in b43_phy_initn()
6060 (phy->rev >= 5 && in b43_phy_initn()
6061 sprom->boardflags2_hi & B43_BFH2_INTERNDET_TXIQCAL); in b43_phy_initn()
6062 nphy->deaf_count = 0; in b43_phy_initn()
6064 nphy->crsminpwr_adjusted = false; in b43_phy_initn()
6065 nphy->noisevars_adjusted = false; in b43_phy_initn()
6068 if (dev->phy.rev >= 3) { in b43_phy_initn()
6071 if (phy->rev >= 7) { in b43_phy_initn()
6077 if (phy->rev >= 19) { in b43_phy_initn()
6088 if (dev->phy.rev < 6) { in b43_phy_initn()
6095 if (dev->phy.rev >= 3) in b43_phy_initn()
6099 if (dev->phy.rev <= 2) { in b43_phy_initn()
6100 tmp = (dev->phy.rev == 2) ? 0x3B : 0x40; in b43_phy_initn()
6108 if (sprom->boardflags2_lo & B43_BFL2_SKWRKFEM_BRD || in b43_phy_initn()
6109 (dev->dev->board_vendor == PCI_VENDOR_ID_APPLE && in b43_phy_initn()
6110 dev->dev->board_type == BCMA_BOARD_TYPE_BCM943224M93)) in b43_phy_initn()
6118 if (phy->rev < 8) in b43_phy_initn()
6119 b43_nphy_update_mimo_config(dev, nphy->preamble_override); in b43_phy_initn()
6123 if (phy->rev < 2) { in b43_phy_initn()
6131 nphy->papd_epsilon_offset[0] << 7); in b43_phy_initn()
6134 nphy->papd_epsilon_offset[1] << 7); in b43_phy_initn()
6136 } else if (phy->rev >= 5) { in b43_phy_initn()
6151 if (phy->rev < 7) { in b43_phy_initn()
6160 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_phy_initn()
6163 tx_pwr_state = nphy->txpwrctrl; in b43_phy_initn()
6170 if (nphy->phyrxchain != 3) in b43_phy_initn()
6171 b43_nphy_set_rx_core_state(dev, nphy->phyrxchain); in b43_phy_initn()
6172 if (nphy->mphase_cal_phase_id > 0) { in b43_phy_initn()
6173 ;/* TODO PHY Periodic Calibration Multi-Phase Restart */ in b43_phy_initn()
6177 if (phy->rev >= 3) { in b43_phy_initn()
6178 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_phy_initn()
6179 do_rssi_cal = !nphy->rssical_chanspec_2G.center_freq; in b43_phy_initn()
6181 do_rssi_cal = !nphy->rssical_chanspec_5G.center_freq; in b43_phy_initn()
6191 if (!((nphy->measure_hold & 0x6) != 0)) { in b43_phy_initn()
6192 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_phy_initn()
6193 do_cal = !nphy->iqcal_chanspec_2G.center_freq; in b43_phy_initn()
6195 do_cal = !nphy->iqcal_chanspec_5G.center_freq; in b43_phy_initn()
6197 if (nphy->mute) in b43_phy_initn()
6203 if (nphy->antsel_type == 2) in b43_phy_initn()
6205 if (nphy->perical != 2) { in b43_phy_initn()
6207 if (phy->rev >= 3) { in b43_phy_initn()
6208 nphy->cal_orig_pwr_idx[0] = in b43_phy_initn()
6209 nphy->txpwrindex[0].index_internal; in b43_phy_initn()
6210 nphy->cal_orig_pwr_idx[1] = in b43_phy_initn()
6211 nphy->txpwrindex[1].index_internal; in b43_phy_initn()
6218 } else if (nphy->mphase_cal_phase_id == 0) { in b43_phy_initn()
6230 if (phy->rev >= 3 && phy->rev <= 6) in b43_phy_initn()
6233 if (phy->rev >= 3) in b43_phy_initn()
6246 b43_phy_write(dev, B43_NPHY_BW1A, e->phy_bw1a); in b43_chantab_phy_upload()
6247 b43_phy_write(dev, B43_NPHY_BW2, e->phy_bw2); in b43_chantab_phy_upload()
6248 b43_phy_write(dev, B43_NPHY_BW3, e->phy_bw3); in b43_chantab_phy_upload()
6249 b43_phy_write(dev, B43_NPHY_BW4, e->phy_bw4); in b43_chantab_phy_upload()
6250 b43_phy_write(dev, B43_NPHY_BW5, e->phy_bw5); in b43_chantab_phy_upload()
6251 b43_phy_write(dev, B43_NPHY_BW6, e->phy_bw6); in b43_chantab_phy_upload()
6254 /* https://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
6257 switch (dev->dev->bus_type) { in b43_nphy_pmu_spur_avoid()
6260 bcma_pmu_spuravoid_pllupdate(&dev->dev->bdev->bus->drv_cc, in b43_nphy_pmu_spur_avoid()
6266 ssb_pmu_spuravoid_pllupdate(&dev->dev->sdev->bus->chipco, in b43_nphy_pmu_spur_avoid()
6273 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */
6278 struct b43_phy *phy = &dev->phy; in b43_nphy_channel_setup()
6279 struct b43_phy_n *nphy = dev->phy.n; in b43_nphy_channel_setup()
6280 int ch = new_channel->hw_value; in b43_nphy_channel_setup()
6283 if (new_channel->band == NL80211_BAND_5GHZ) { in b43_nphy_channel_setup()
6294 } else if (new_channel->band == NL80211_BAND_2GHZ) { in b43_nphy_channel_setup()
6306 if (new_channel->hw_value == 14) { in b43_nphy_channel_setup()
6311 if (new_channel->band == NL80211_BAND_2GHZ) in b43_nphy_channel_setup()
6315 if (!nphy->txpwrctrl) in b43_nphy_channel_setup()
6318 if (dev->phy.rev < 3) in b43_nphy_channel_setup()
6323 if (dev->phy.rev >= 3 && in b43_nphy_channel_setup()
6324 dev->phy.n->spur_avoid != B43_SPUR_AVOID_DISABLE) { in b43_nphy_channel_setup()
6327 if (dev->phy.n->spur_avoid == B43_SPUR_AVOID_FORCE) { in b43_nphy_channel_setup()
6329 } else if (phy->rev >= 19) { in b43_nphy_channel_setup()
6331 } else if (phy->rev >= 18) { in b43_nphy_channel_setup()
6333 } else if (phy->rev >= 17) { in b43_nphy_channel_setup()
6334 /* TODO: Off for channels 1-11, but check 12-14! */ in b43_nphy_channel_setup()
6335 } else if (phy->rev >= 16) { in b43_nphy_channel_setup()
6337 } else if (phy->rev >= 7) { in b43_nphy_channel_setup()
6350 if (nphy->aband_spurwar_en && in b43_nphy_channel_setup()
6352 spuravoid = dev->dev->chip_id == 0x4716; in b43_nphy_channel_setup()
6360 if (dev->phy.rev == 3 || dev->phy.rev == 4) in b43_nphy_channel_setup()
6376 if (phy->rev >= 3) in b43_nphy_channel_setup()
6380 /* https://bcm-v4.sipsolutions.net/802.11/PHY/N/SetChanspec */
6385 struct b43_phy *phy = &dev->phy; in b43_nphy_set_channel()
6394 if (phy->rev >= 19) { in b43_nphy_set_channel()
6395 return -ESRCH; in b43_nphy_set_channel()
6397 } else if (phy->rev >= 7) { in b43_nphy_set_channel()
6398 r2057_get_chantabent_rev7(dev, channel->center_freq, in b43_nphy_set_channel()
6401 return -ESRCH; in b43_nphy_set_channel()
6402 } else if (phy->rev >= 3) { in b43_nphy_set_channel()
6404 channel->center_freq); in b43_nphy_set_channel()
6406 return -ESRCH; in b43_nphy_set_channel()
6409 channel->hw_value); in b43_nphy_set_channel()
6411 return -ESRCH; in b43_nphy_set_channel()
6416 phy->channel = channel->hw_value; in b43_nphy_set_channel()
6419 if (b43_channel_type_is_40mhz(phy->channel_type) != in b43_nphy_set_channel()
6426 if (phy->rev >= 7) in b43_nphy_set_channel()
6430 if (phy->rev >= 7) in b43_nphy_set_channel()
6434 if (phy->rev >= 19) { in b43_nphy_set_channel()
6436 } else if (phy->rev >= 7) { in b43_nphy_set_channel()
6438 &(tabent_r7->phy_regs) : &(tabent_r7_2g->phy_regs); in b43_nphy_set_channel()
6440 if (phy->radio_rev <= 4 || phy->radio_rev == 6) { in b43_nphy_set_channel()
6441 tmp = (channel->band == NL80211_BAND_5GHZ) ? 2 : 0; in b43_nphy_set_channel()
6448 } else if (phy->rev >= 3) { in b43_nphy_set_channel()
6449 tmp = (channel->band == NL80211_BAND_5GHZ) ? 4 : 0; in b43_nphy_set_channel()
6452 b43_nphy_channel_setup(dev, &(tabent_r3->phy_regs), channel); in b43_nphy_set_channel()
6454 tmp = (channel->band == NL80211_BAND_5GHZ) ? 0x0020 : 0x0050; in b43_nphy_set_channel()
6457 b43_nphy_channel_setup(dev, &(tabent_r2->phy_regs), channel); in b43_nphy_set_channel()
6473 return -ENOMEM; in b43_nphy_op_allocate()
6475 dev->phy.n = nphy; in b43_nphy_op_allocate()
6482 struct b43_phy *phy = &dev->phy; in b43_nphy_op_prepare_structs()
6483 struct b43_phy_n *nphy = phy->n; in b43_nphy_op_prepare_structs()
6484 struct ssb_sprom *sprom = dev->dev->bus_sprom; in b43_nphy_op_prepare_structs()
6488 nphy->hang_avoid = (phy->rev == 3 || phy->rev == 4); in b43_nphy_op_prepare_structs()
6489 nphy->spur_avoid = (phy->rev >= 3) ? in b43_nphy_op_prepare_structs()
6491 nphy->gain_boost = true; /* this way we follow wl, assume it is true */ in b43_nphy_op_prepare_structs()
6492 nphy->txrx_chain = 2; /* sth different than 0 and 1 for now */ in b43_nphy_op_prepare_structs()
6493 nphy->phyrxchain = 3; /* to avoid b43_nphy_set_rx_core_state like wl */ in b43_nphy_op_prepare_structs()
6494 nphy->perical = 2; /* avoid additional rssi cal on init (like wl) */ in b43_nphy_op_prepare_structs()
6495 /* 128 can mean disabled-by-default state of TX pwr ctl. Max value is in b43_nphy_op_prepare_structs()
6497 nphy->tx_pwr_idx[0] = 128; in b43_nphy_op_prepare_structs()
6498 nphy->tx_pwr_idx[1] = 128; in b43_nphy_op_prepare_structs()
6501 nphy->txpwrctrl = false; in b43_nphy_op_prepare_structs()
6502 nphy->pwg_gain_5ghz = false; in b43_nphy_op_prepare_structs()
6503 if (dev->phy.rev >= 3 || in b43_nphy_op_prepare_structs()
6504 (dev->dev->board_vendor == PCI_VENDOR_ID_APPLE && in b43_nphy_op_prepare_structs()
6505 (dev->dev->core_rev == 11 || dev->dev->core_rev == 12))) { in b43_nphy_op_prepare_structs()
6506 nphy->txpwrctrl = true; in b43_nphy_op_prepare_structs()
6507 nphy->pwg_gain_5ghz = true; in b43_nphy_op_prepare_structs()
6508 } else if (sprom->revision >= 4) { in b43_nphy_op_prepare_structs()
6509 if (dev->phy.rev >= 2 && in b43_nphy_op_prepare_structs()
6510 (sprom->boardflags2_lo & B43_BFL2_TXPWRCTRL_EN)) { in b43_nphy_op_prepare_structs()
6511 nphy->txpwrctrl = true; in b43_nphy_op_prepare_structs()
6513 if (dev->dev->bus_type == B43_BUS_SSB && in b43_nphy_op_prepare_structs()
6514 dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI) { in b43_nphy_op_prepare_structs()
6516 dev->dev->sdev->bus->host_pci; in b43_nphy_op_prepare_structs()
6517 if (pdev->device == 0x4328 || in b43_nphy_op_prepare_structs()
6518 pdev->device == 0x432a) in b43_nphy_op_prepare_structs()
6519 nphy->pwg_gain_5ghz = true; in b43_nphy_op_prepare_structs()
6522 } else if (sprom->boardflags2_lo & B43_BFL2_5G_PWRGAIN) { in b43_nphy_op_prepare_structs()
6523 nphy->pwg_gain_5ghz = true; in b43_nphy_op_prepare_structs()
6527 if (dev->phy.rev >= 3) { in b43_nphy_op_prepare_structs()
6528 nphy->ipa2g_on = sprom->fem.ghz2.extpa_gain == 2; in b43_nphy_op_prepare_structs()
6529 nphy->ipa5g_on = sprom->fem.ghz5.extpa_gain == 2; in b43_nphy_op_prepare_structs()
6535 struct b43_phy *phy = &dev->phy; in b43_nphy_op_free()
6536 struct b43_phy_n *nphy = phy->n; in b43_nphy_op_free()
6539 phy->n = NULL; in b43_nphy_op_free()
6551 /* OFDM registers are onnly available on A/G-PHYs */ in check_phyreg()
6552 b43err(dev->wl, "Invalid OFDM PHY access at " in check_phyreg()
6553 "0x%04X on N-PHY\n", offset); in check_phyreg()
6557 /* Ext-G registers are only available on G-PHYs */ in check_phyreg()
6558 b43err(dev->wl, "Invalid EXT-G PHY access at " in check_phyreg()
6559 "0x%04X on N-PHY\n", offset); in check_phyreg()
6565 static void b43_nphy_op_maskset(struct b43_wldev *dev, u16 reg, u16 mask, in b43_nphy_op_maskset() argument
6568 check_phyreg(dev, reg); in b43_nphy_op_maskset()
6569 b43_write16f(dev, B43_MMIO_PHY_CONTROL, reg); in b43_nphy_op_maskset()
6571 dev->phy.writes_counter = 1; in b43_nphy_op_maskset()
6574 static u16 b43_nphy_op_radio_read(struct b43_wldev *dev, u16 reg) in b43_nphy_op_radio_read() argument
6576 /* Register 1 is a 32-bit register. */ in b43_nphy_op_radio_read()
6577 B43_WARN_ON(dev->phy.rev < 7 && reg == 1); in b43_nphy_op_radio_read()
6579 if (dev->phy.rev >= 7) in b43_nphy_op_radio_read()
6580 reg |= 0x200; /* Radio 0x2057 */ in b43_nphy_op_radio_read()
6582 reg |= 0x100; in b43_nphy_op_radio_read()
6584 b43_write16f(dev, B43_MMIO_RADIO_CONTROL, reg); in b43_nphy_op_radio_read()
6588 static void b43_nphy_op_radio_write(struct b43_wldev *dev, u16 reg, u16 value) in b43_nphy_op_radio_write() argument
6590 /* Register 1 is a 32-bit register. */ in b43_nphy_op_radio_write()
6591 B43_WARN_ON(dev->phy.rev < 7 && reg == 1); in b43_nphy_op_radio_write()
6593 b43_write16f(dev, B43_MMIO_RADIO_CONTROL, reg); in b43_nphy_op_radio_write()
6597 /* https://bcm-v4.sipsolutions.net/802.11/Radio/Switch%20Radio */
6601 struct b43_phy *phy = &dev->phy; in b43_nphy_op_software_rfkill()
6604 b43err(dev->wl, "MAC not suspended\n"); in b43_nphy_op_software_rfkill()
6607 if (phy->rev >= 19) { in b43_nphy_op_software_rfkill()
6609 } else if (phy->rev >= 8) { in b43_nphy_op_software_rfkill()
6612 } else if (phy->rev >= 7) { in b43_nphy_op_software_rfkill()
6614 } else if (phy->rev >= 3) { in b43_nphy_op_software_rfkill()
6635 if (phy->rev >= 19) { in b43_nphy_op_software_rfkill()
6637 } else if (phy->rev >= 7) { in b43_nphy_op_software_rfkill()
6638 if (!dev->phy.radio_on) in b43_nphy_op_software_rfkill()
6640 b43_switch_channel(dev, dev->phy.channel); in b43_nphy_op_software_rfkill()
6641 } else if (phy->rev >= 3) { in b43_nphy_op_software_rfkill()
6642 if (!dev->phy.radio_on) in b43_nphy_op_software_rfkill()
6644 b43_switch_channel(dev, dev->phy.channel); in b43_nphy_op_software_rfkill()
6651 /* https://bcm-v4.sipsolutions.net/802.11/PHY/Anacore */
6654 struct b43_phy *phy = &dev->phy; in b43_nphy_op_switch_analog()
6658 if (phy->rev >= 19) { in b43_nphy_op_switch_analog()
6660 } else if (phy->rev >= 3) { in b43_nphy_op_switch_analog()
6680 struct ieee80211_channel *channel = dev->wl->hw->conf.chandef.chan; in b43_nphy_op_switch_channel()
6682 cfg80211_get_chandef_type(&dev->wl->hw->conf.chandef); in b43_nphy_op_switch_channel()
6684 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) { in b43_nphy_op_switch_channel()
6686 return -EINVAL; in b43_nphy_op_switch_channel()
6689 return -EINVAL; in b43_nphy_op_switch_channel()
6697 if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) in b43_nphy_op_get_default_chan()