@@ -4062,10 +4062,13 @@ static void b43_nphy_op_prepare_structs(struct b43_wldev *dev)
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 */
@@ -4074,6 +4077,38 @@ static void b43_nphy_op_prepare_structs(struct b43_wldev *dev)
4074
4077
* 0x7f == 127 and we check for 128 when restoring TX pwr ctl. */
4075
4078
nphy -> tx_pwr_idx [0 ] = 128 ;
4076
4079
nphy -> tx_pwr_idx [1 ] = 128 ;
4080
+
4081
+ /* Hardware TX power control and 5GHz power gain */
4082
+ nphy -> txpwrctrl = false;
4083
+ nphy -> pwg_gain_5ghz = false;
4084
+ if (dev -> phy .rev >= 3 ||
4085
+ (dev -> dev -> board_vendor == PCI_VENDOR_ID_APPLE &&
4086
+ (dev -> dev -> core_rev == 11 || dev -> dev -> core_rev == 12 ))) {
4087
+ nphy -> txpwrctrl = true;
4088
+ nphy -> pwg_gain_5ghz = true;
4089
+ } else if (sprom -> revision >= 4 ) {
4090
+ if (dev -> phy .rev >= 2 &&
4091
+ (sprom -> boardflags2_lo & B43_BFL2_TXPWRCTRL_EN )) {
4092
+ nphy -> txpwrctrl = true;
4093
+ #ifdef CONFIG_B43_SSB
4094
+ if (dev -> dev -> bus_type == B43_BUS_SSB &&
4095
+ dev -> dev -> sdev -> bus -> bustype == SSB_BUSTYPE_PCI ) {
4096
+ struct pci_dev * pdev =
4097
+ dev -> dev -> sdev -> bus -> host_pci ;
4098
+ if (pdev -> device == 0x4328 ||
4099
+ pdev -> device == 0x432a )
4100
+ nphy -> pwg_gain_5ghz = true;
4101
+ }
4102
+ #endif
4103
+ } else if (sprom -> boardflags2_lo & B43_BFL2_5G_PWRGAIN ) {
4104
+ nphy -> pwg_gain_5ghz = true;
4105
+ }
4106
+ }
4107
+
4108
+ if (dev -> phy .rev >= 3 ) {
4109
+ nphy -> ipa2g_on = sprom -> fem .ghz2 .extpa_gain == 2 ;
4110
+ nphy -> ipa5g_on = sprom -> fem .ghz5 .extpa_gain == 2 ;
4111
+ }
4077
4112
}
4078
4113
4079
4114
static void b43_nphy_op_free (struct b43_wldev * dev )
0 commit comments