Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

b43: N-PHY: determine various PHY params

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Rafał Miłecki and committed by
John W. Linville
c7d64310 66d80a51

+43
+35
drivers/net/wireless/b43/phy_n.c
··· 4062 4062 { 4063 4063 struct b43_phy *phy = &dev->phy; 4064 4064 struct b43_phy_n *nphy = phy->n; 4065 + struct ssb_sprom *sprom = dev->dev->bus_sprom; 4065 4066 4066 4067 memset(nphy, 0, sizeof(*nphy)); 4067 4068 4068 4069 nphy->hang_avoid = (phy->rev == 3 || phy->rev == 4); 4070 + nphy->spur_avoid = (phy->rev >= 3) ? 4071 + B43_SPUR_AVOID_AUTO : B43_SPUR_AVOID_DISABLE; 4069 4072 nphy->gain_boost = true; /* this way we follow wl, assume it is true */ 4070 4073 nphy->txrx_chain = 2; /* sth different than 0 and 1 for now */ 4071 4074 nphy->phyrxchain = 3; /* to avoid b43_nphy_set_rx_core_state like wl */ ··· 4077 4074 * 0x7f == 127 and we check for 128 when restoring TX pwr ctl. */ 4078 4075 nphy->tx_pwr_idx[0] = 128; 4079 4076 nphy->tx_pwr_idx[1] = 128; 4077 + 4078 + /* Hardware TX power control and 5GHz power gain */ 4079 + nphy->txpwrctrl = false; 4080 + nphy->pwg_gain_5ghz = false; 4081 + if (dev->phy.rev >= 3 || 4082 + (dev->dev->board_vendor == PCI_VENDOR_ID_APPLE && 4083 + (dev->dev->core_rev == 11 || dev->dev->core_rev == 12))) { 4084 + nphy->txpwrctrl = true; 4085 + nphy->pwg_gain_5ghz = true; 4086 + } else if (sprom->revision >= 4) { 4087 + if (dev->phy.rev >= 2 && 4088 + (sprom->boardflags2_lo & B43_BFL2_TXPWRCTRL_EN)) { 4089 + nphy->txpwrctrl = true; 4090 + #ifdef CONFIG_B43_SSB 4091 + if (dev->dev->bus_type == B43_BUS_SSB && 4092 + dev->dev->sdev->bus->bustype == SSB_BUSTYPE_PCI) { 4093 + struct pci_dev *pdev = 4094 + dev->dev->sdev->bus->host_pci; 4095 + if (pdev->device == 0x4328 || 4096 + pdev->device == 0x432a) 4097 + nphy->pwg_gain_5ghz = true; 4098 + } 4099 + #endif 4100 + } else if (sprom->boardflags2_lo & B43_BFL2_5G_PWRGAIN) { 4101 + nphy->pwg_gain_5ghz = true; 4102 + } 4103 + } 4104 + 4105 + if (dev->phy.rev >= 3) { 4106 + nphy->ipa2g_on = sprom->fem.ghz2.extpa_gain == 2; 4107 + nphy->ipa5g_on = sprom->fem.ghz5.extpa_gain == 2; 4108 + } 4080 4109 } 4081 4110 4082 4111 static void b43_nphy_op_free(struct b43_wldev *dev)
+8
drivers/net/wireless/b43/phy_n.h
··· 716 716 717 717 struct b43_wldev; 718 718 719 + enum b43_nphy_spur_avoid { 720 + B43_SPUR_AVOID_DISABLE, 721 + B43_SPUR_AVOID_AUTO, 722 + B43_SPUR_AVOID_FORCE, 723 + }; 724 + 719 725 struct b43_chanspec { 720 726 u16 center_freq; 721 727 enum nl80211_channel_type channel_type; ··· 791 785 u16 mphase_txcal_bestcoeffs[11]; 792 786 793 787 bool txpwrctrl; 788 + bool pwg_gain_5ghz; 794 789 u8 tx_pwr_idx[2]; 795 790 u16 adj_pwr_tbl[84]; 796 791 u16 txcal_bbmult; ··· 810 803 u16 classifier_state; 811 804 u16 clip_state[2]; 812 805 806 + enum b43_nphy_spur_avoid spur_avoid; 813 807 bool aband_spurwar_en; 814 808 bool gband_spurwar_en; 815 809