diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-04-28 20:50:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-16 12:45:23 -0400 |
commit | 898d3c3b2462cd439edb575f43b732425693aff0 (patch) | |
tree | 51e4fe1eec628acbed53fbfc37808bdc52e401bd /drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | |
parent | 2b2715b83c433d22b10bd654e102baea6f5589b0 (diff) |
brcmsmac: use sprom from bcma
bcma now provides all sprom attributes needed by brcmsmac and also
parses them from the pci sprom ant otp.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | 67 |
1 files changed, 25 insertions, 42 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c index 0fce56235f38..abfd78822fb8 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c | |||
@@ -4817,28 +4817,23 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi) | |||
4817 | s8 txpwr = 0; | 4817 | s8 txpwr = 0; |
4818 | int i; | 4818 | int i; |
4819 | struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; | 4819 | struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; |
4820 | struct phy_shim_info *shim = pi->sh->physhim; | 4820 | struct ssb_sprom *sprom = &pi->d11core->bus->sprom; |
4821 | 4821 | ||
4822 | if (CHSPEC_IS2G(pi->radio_chanspec)) { | 4822 | if (CHSPEC_IS2G(pi->radio_chanspec)) { |
4823 | u16 cckpo = 0; | 4823 | u16 cckpo = 0; |
4824 | u32 offset_ofdm, offset_mcs; | 4824 | u32 offset_ofdm, offset_mcs; |
4825 | 4825 | ||
4826 | pi_lcn->lcnphy_tr_isolation_mid = | 4826 | pi_lcn->lcnphy_tr_isolation_mid = sprom->fem.ghz2.tr_iso; |
4827 | (u8)wlapi_getintvar(shim, BRCMS_SROM_TRISO2G); | ||
4828 | 4827 | ||
4829 | pi_lcn->lcnphy_rx_power_offset = | 4828 | pi_lcn->lcnphy_rx_power_offset = sprom->rxpo2g; |
4830 | (u8)wlapi_getintvar(shim, BRCMS_SROM_RXPO2G); | ||
4831 | 4829 | ||
4832 | pi->txpa_2g[0] = (s16)wlapi_getintvar(shim, BRCMS_SROM_PA0B0); | 4830 | pi->txpa_2g[0] = sprom->pa0b0; |
4833 | pi->txpa_2g[1] = (s16)wlapi_getintvar(shim, BRCMS_SROM_PA0B1); | 4831 | pi->txpa_2g[1] = sprom->pa0b1; |
4834 | pi->txpa_2g[2] = (s16)wlapi_getintvar(shim, BRCMS_SROM_PA0B2); | 4832 | pi->txpa_2g[2] = sprom->pa0b2; |
4835 | 4833 | ||
4836 | pi_lcn->lcnphy_rssi_vf = | 4834 | pi_lcn->lcnphy_rssi_vf = sprom->rssismf2g; |
4837 | (u8)wlapi_getintvar(shim, BRCMS_SROM_RSSISMF2G); | 4835 | pi_lcn->lcnphy_rssi_vc = sprom->rssismc2g; |
4838 | pi_lcn->lcnphy_rssi_vc = | 4836 | pi_lcn->lcnphy_rssi_gs = sprom->rssisav2g; |
4839 | (u8)wlapi_getintvar(shim, BRCMS_SROM_RSSISMC2G); | ||
4840 | pi_lcn->lcnphy_rssi_gs = | ||
4841 | (u8)wlapi_getintvar(shim, BRCMS_SROM_RSSISAV2G); | ||
4842 | 4837 | ||
4843 | pi_lcn->lcnphy_rssi_vf_lowtemp = pi_lcn->lcnphy_rssi_vf; | 4838 | pi_lcn->lcnphy_rssi_vf_lowtemp = pi_lcn->lcnphy_rssi_vf; |
4844 | pi_lcn->lcnphy_rssi_vc_lowtemp = pi_lcn->lcnphy_rssi_vc; | 4839 | pi_lcn->lcnphy_rssi_vc_lowtemp = pi_lcn->lcnphy_rssi_vc; |
@@ -4848,7 +4843,7 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi) | |||
4848 | pi_lcn->lcnphy_rssi_vc_hightemp = pi_lcn->lcnphy_rssi_vc; | 4843 | pi_lcn->lcnphy_rssi_vc_hightemp = pi_lcn->lcnphy_rssi_vc; |
4849 | pi_lcn->lcnphy_rssi_gs_hightemp = pi_lcn->lcnphy_rssi_gs; | 4844 | pi_lcn->lcnphy_rssi_gs_hightemp = pi_lcn->lcnphy_rssi_gs; |
4850 | 4845 | ||
4851 | txpwr = (s8)wlapi_getintvar(shim, BRCMS_SROM_MAXP2GA0); | 4846 | txpwr = sprom->core_pwr_info[0].maxpwr_2g; |
4852 | pi->tx_srom_max_2g = txpwr; | 4847 | pi->tx_srom_max_2g = txpwr; |
4853 | 4848 | ||
4854 | for (i = 0; i < PWRTBL_NUM_COEFF; i++) { | 4849 | for (i = 0; i < PWRTBL_NUM_COEFF; i++) { |
@@ -4856,8 +4851,8 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi) | |||
4856 | pi->txpa_2g_high_temp[i] = pi->txpa_2g[i]; | 4851 | pi->txpa_2g_high_temp[i] = pi->txpa_2g[i]; |
4857 | } | 4852 | } |
4858 | 4853 | ||
4859 | cckpo = (u16)wlapi_getintvar(shim, BRCMS_SROM_CCK2GPO); | 4854 | cckpo = sprom->cck2gpo; |
4860 | offset_ofdm = (u32)wlapi_getintvar(shim, BRCMS_SROM_OFDM2GPO); | 4855 | offset_ofdm = sprom->ofdm2gpo; |
4861 | if (cckpo) { | 4856 | if (cckpo) { |
4862 | uint max_pwr_chan = txpwr; | 4857 | uint max_pwr_chan = txpwr; |
4863 | 4858 | ||
@@ -4876,7 +4871,7 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi) | |||
4876 | } else { | 4871 | } else { |
4877 | u8 opo = 0; | 4872 | u8 opo = 0; |
4878 | 4873 | ||
4879 | opo = (u8)wlapi_getintvar(shim, BRCMS_SROM_OPO); | 4874 | opo = sprom->opo; |
4880 | 4875 | ||
4881 | for (i = TXP_FIRST_CCK; i <= TXP_LAST_CCK; i++) | 4876 | for (i = TXP_FIRST_CCK; i <= TXP_LAST_CCK; i++) |
4882 | pi->tx_srom_max_rate_2g[i] = txpwr; | 4877 | pi->tx_srom_max_rate_2g[i] = txpwr; |
@@ -4886,12 +4881,8 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi) | |||
4886 | ((offset_ofdm & 0xf) * 2); | 4881 | ((offset_ofdm & 0xf) * 2); |
4887 | offset_ofdm >>= 4; | 4882 | offset_ofdm >>= 4; |
4888 | } | 4883 | } |
4889 | offset_mcs = | 4884 | offset_mcs = sprom->mcs2gpo[1] << 16; |
4890 | wlapi_getintvar(shim, | 4885 | offset_mcs |= sprom->mcs2gpo[0]; |
4891 | BRCMS_SROM_MCS2GPO1) << 16; | ||
4892 | offset_mcs |= | ||
4893 | (u16) wlapi_getintvar(shim, | ||
4894 | BRCMS_SROM_MCS2GPO0); | ||
4895 | pi_lcn->lcnphy_mcs20_po = offset_mcs; | 4886 | pi_lcn->lcnphy_mcs20_po = offset_mcs; |
4896 | for (i = TXP_FIRST_SISO_MCS_20; | 4887 | for (i = TXP_FIRST_SISO_MCS_20; |
4897 | i <= TXP_LAST_SISO_MCS_20; i++) { | 4888 | i <= TXP_LAST_SISO_MCS_20; i++) { |
@@ -4901,25 +4892,17 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi) | |||
4901 | } | 4892 | } |
4902 | } | 4893 | } |
4903 | 4894 | ||
4904 | pi_lcn->lcnphy_rawtempsense = | 4895 | pi_lcn->lcnphy_rawtempsense = sprom->rawtempsense; |
4905 | (u16)wlapi_getintvar(shim, BRCMS_SROM_RAWTEMPSENSE); | 4896 | pi_lcn->lcnphy_measPower = sprom->measpower; |
4906 | pi_lcn->lcnphy_measPower = | 4897 | pi_lcn->lcnphy_tempsense_slope = sprom->tempsense_slope; |
4907 | (u8)wlapi_getintvar(shim, BRCMS_SROM_MEASPOWER); | 4898 | pi_lcn->lcnphy_hw_iqcal_en = sprom->hw_iqcal_en; |
4908 | pi_lcn->lcnphy_tempsense_slope = | 4899 | pi_lcn->lcnphy_iqcal_swp_dis = sprom->iqcal_swp_dis; |
4909 | (u8)wlapi_getintvar(shim, BRCMS_SROM_TEMPSENSE_SLOPE); | 4900 | pi_lcn->lcnphy_tempcorrx = sprom->tempcorrx; |
4910 | pi_lcn->lcnphy_hw_iqcal_en = | 4901 | pi_lcn->lcnphy_tempsense_option = sprom->tempsense_option; |
4911 | (bool)wlapi_getintvar(shim, BRCMS_SROM_HW_IQCAL_EN); | 4902 | pi_lcn->lcnphy_freqoffset_corr = sprom->freqoffset_corr; |
4912 | pi_lcn->lcnphy_iqcal_swp_dis = | 4903 | if (sprom->ant_available_bg > 1) |
4913 | (bool)wlapi_getintvar(shim, BRCMS_SROM_IQCAL_SWP_DIS); | ||
4914 | pi_lcn->lcnphy_tempcorrx = | ||
4915 | (u8)wlapi_getintvar(shim, BRCMS_SROM_TEMPCORRX); | ||
4916 | pi_lcn->lcnphy_tempsense_option = | ||
4917 | (u8)wlapi_getintvar(shim, BRCMS_SROM_TEMPSENSE_OPTION); | ||
4918 | pi_lcn->lcnphy_freqoffset_corr = | ||
4919 | (u8)wlapi_getintvar(shim, BRCMS_SROM_FREQOFFSET_CORR); | ||
4920 | if ((u8)wlapi_getintvar(shim, BRCMS_SROM_AA2G) > 1) | ||
4921 | wlc_phy_ant_rxdiv_set((struct brcms_phy_pub *) pi, | 4904 | wlc_phy_ant_rxdiv_set((struct brcms_phy_pub *) pi, |
4922 | (u8) wlapi_getintvar(shim, BRCMS_SROM_AA2G)); | 4905 | sprom->ant_available_bg); |
4923 | } | 4906 | } |
4924 | pi_lcn->lcnphy_cck_dig_filt_type = -1; | 4907 | pi_lcn->lcnphy_cck_dig_filt_type = -1; |
4925 | 4908 | ||