diff options
Diffstat (limited to 'drivers/net/wireless/b43/tables_nphy.c')
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.c | 128 |
1 files changed, 104 insertions, 24 deletions
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c index 4b5885077b01..25d1cbd34306 100644 --- a/drivers/net/wireless/b43/tables_nphy.c +++ b/drivers/net/wireless/b43/tables_nphy.c | |||
@@ -2878,6 +2878,40 @@ const s8 b43_ntab_papd_pga_gain_delta_ipa_2g[] = { | |||
2878 | -54, -46, -39, -31, -23, -15, -8, 0 | 2878 | -54, -46, -39, -31, -23, -15, -8, 0 |
2879 | }; | 2879 | }; |
2880 | 2880 | ||
2881 | /* Extracted from MMIO dump of 6.30.223.248 | ||
2882 | * Entries: 0, 15, 17, 21, 24, 26, 27, 29, 30 were guessed | ||
2883 | */ | ||
2884 | static const s16 b43_ntab_rf_pwr_offset_2057_rev9_2g[] = { | ||
2885 | -133, -133, -107, -92, -81, | ||
2886 | -73, -66, -61, -56, -52, | ||
2887 | -48, -44, -41, -37, -34, | ||
2888 | -31, -28, -25, -22, -19, | ||
2889 | -17, -14, -12, -10, -9, | ||
2890 | -7, -5, -4, -3, -2, | ||
2891 | -1, 0, | ||
2892 | }; | ||
2893 | |||
2894 | /* Extracted from MMIO dump of 6.30.223.248 */ | ||
2895 | static const s16 b43_ntab_rf_pwr_offset_2057_rev9_5g[] = { | ||
2896 | -101, -94, -86, -79, -72, | ||
2897 | -65, -57, -50, -42, -35, | ||
2898 | -28, -21, -16, -9, -4, | ||
2899 | 0, | ||
2900 | }; | ||
2901 | |||
2902 | /* Extracted from MMIO dump of 6.30.223.248 | ||
2903 | * Entries: 0, 26, 28, 29, 30, 31 were guessed | ||
2904 | */ | ||
2905 | static const s16 b43_ntab_rf_pwr_offset_2057_rev14_2g[] = { | ||
2906 | -111, -111, -111, -84, -70, | ||
2907 | -59, -52, -45, -40, -36, | ||
2908 | -32, -29, -26, -23, -21, | ||
2909 | -18, -16, -15, -13, -11, | ||
2910 | -10, -8, -7, -6, -5, | ||
2911 | -4, -4, -3, -3, -2, | ||
2912 | -2, -1, | ||
2913 | }; | ||
2914 | |||
2881 | const u16 tbl_iqcal_gainparams[2][9][8] = { | 2915 | const u16 tbl_iqcal_gainparams[2][9][8] = { |
2882 | { | 2916 | { |
2883 | { 0x000, 0, 0, 2, 0x69, 0x69, 0x69, 0x69 }, | 2917 | { 0x000, 0, 0, 2, 0x69, 0x69, 0x69, 0x69 }, |
@@ -3197,7 +3231,7 @@ static struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_workaround[2][4] = { | |||
3197 | { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, | 3231 | { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, |
3198 | 0x527E, /* invalid for external LNA! */ | 3232 | 0x527E, /* invalid for external LNA! */ |
3199 | { 0x513F, 0x513F, 0x513F, 0x513F }, /* invalid for external LNA! */ | 3233 | { 0x513F, 0x513F, 0x513F, 0x513F }, /* invalid for external LNA! */ |
3200 | 0x1076, 0x0066, 0x0000, /* low is invalid (the last one) */ | 3234 | 0x007E, 0x0066, 0x0000, /* low is invalid (the last one) */ |
3201 | 0x18, 0x18, 0x18, | 3235 | 0x18, 0x18, 0x18, |
3202 | 0x01D0, 0x5, | 3236 | 0x01D0, 0x5, |
3203 | }, | 3237 | }, |
@@ -3708,9 +3742,43 @@ const u32 *b43_nphy_get_tx_gain_table(struct b43_wldev *dev) | |||
3708 | } | 3742 | } |
3709 | } | 3743 | } |
3710 | 3744 | ||
3745 | const s16 *b43_ntab_get_rf_pwr_offset_table(struct b43_wldev *dev) | ||
3746 | { | ||
3747 | struct b43_phy *phy = &dev->phy; | ||
3748 | |||
3749 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { | ||
3750 | switch (phy->rev) { | ||
3751 | case 17: | ||
3752 | if (phy->radio_rev == 14) | ||
3753 | return b43_ntab_rf_pwr_offset_2057_rev14_2g; | ||
3754 | break; | ||
3755 | case 16: | ||
3756 | if (phy->radio_rev == 9) | ||
3757 | return b43_ntab_rf_pwr_offset_2057_rev9_2g; | ||
3758 | break; | ||
3759 | } | ||
3760 | |||
3761 | b43err(dev->wl, | ||
3762 | "No 2GHz RF power table available for this device\n"); | ||
3763 | return NULL; | ||
3764 | } else { | ||
3765 | switch (phy->rev) { | ||
3766 | case 16: | ||
3767 | if (phy->radio_rev == 9) | ||
3768 | return b43_ntab_rf_pwr_offset_2057_rev9_5g; | ||
3769 | break; | ||
3770 | } | ||
3771 | |||
3772 | b43err(dev->wl, | ||
3773 | "No 5GHz RF power table available for this device\n"); | ||
3774 | return NULL; | ||
3775 | } | ||
3776 | } | ||
3777 | |||
3711 | struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( | 3778 | struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( |
3712 | struct b43_wldev *dev, bool ghz5, bool ext_lna) | 3779 | struct b43_wldev *dev, bool ghz5, bool ext_lna) |
3713 | { | 3780 | { |
3781 | struct b43_phy *phy = &dev->phy; | ||
3714 | struct nphy_gain_ctl_workaround_entry *e; | 3782 | struct nphy_gain_ctl_workaround_entry *e; |
3715 | u8 phy_idx; | 3783 | u8 phy_idx; |
3716 | 3784 | ||
@@ -3729,37 +3797,49 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( | |||
3729 | e = &nphy_gain_ctl_workaround[ghz5][phy_idx]; | 3797 | e = &nphy_gain_ctl_workaround[ghz5][phy_idx]; |
3730 | 3798 | ||
3731 | /* Some workarounds to the workarounds... */ | 3799 | /* Some workarounds to the workarounds... */ |
3732 | if (ghz5 && dev->phy.rev >= 6) { | 3800 | if (!ghz5) { |
3733 | if (dev->phy.radio_rev == 11 && | ||
3734 | !b43_is_40mhz(dev)) | ||
3735 | e->cliplo_gain = 0x2d; | ||
3736 | } else if (!ghz5 && dev->phy.rev >= 5) { | ||
3737 | static const int gain_data[] = {0x0062, 0x0064, 0x006a, 0x106a, | ||
3738 | 0x106c, 0x1074, 0x107c, 0x207c}; | ||
3739 | u8 tr_iso = dev->dev->bus_sprom->fem.ghz2.tr_iso; | 3801 | u8 tr_iso = dev->dev->bus_sprom->fem.ghz2.tr_iso; |
3740 | 3802 | ||
3741 | if (ext_lna) { | 3803 | if (tr_iso > 7) |
3804 | tr_iso = 3; | ||
3805 | |||
3806 | if (phy->rev >= 6) { | ||
3807 | static const int gain_data[] = { 0x106a, 0x106c, 0x1074, | ||
3808 | 0x107c, 0x007e, 0x107e, | ||
3809 | 0x207e, 0x307e, }; | ||
3810 | |||
3811 | e->cliplo_gain = gain_data[tr_iso]; | ||
3812 | } else if (phy->rev == 5) { | ||
3813 | static const int gain_data[] = { 0x0062, 0x0064, 0x006a, | ||
3814 | 0x106a, 0x106c, 0x1074, | ||
3815 | 0x107c, 0x207c, }; | ||
3816 | |||
3817 | e->cliplo_gain = gain_data[tr_iso]; | ||
3818 | } | ||
3819 | |||
3820 | if (phy->rev >= 5 && ext_lna) { | ||
3742 | e->rfseq_init[0] &= ~0x4000; | 3821 | e->rfseq_init[0] &= ~0x4000; |
3743 | e->rfseq_init[1] &= ~0x4000; | 3822 | e->rfseq_init[1] &= ~0x4000; |
3744 | e->rfseq_init[2] &= ~0x4000; | 3823 | e->rfseq_init[2] &= ~0x4000; |
3745 | e->rfseq_init[3] &= ~0x4000; | 3824 | e->rfseq_init[3] &= ~0x4000; |
3746 | e->init_gain &= ~0x4000; | 3825 | e->init_gain &= ~0x4000; |
3747 | } | 3826 | } |
3748 | if (tr_iso > 7) | 3827 | } else { |
3749 | tr_iso = 3; | 3828 | if (phy->rev >= 6) { |
3750 | e->cliplo_gain = gain_data[tr_iso]; | 3829 | if (phy->radio_rev == 11 && !b43_is_40mhz(dev)) |
3751 | 3830 | e->crsminu = 0x2d; | |
3752 | } else if (ghz5 && dev->phy.rev == 4 && ext_lna) { | 3831 | } else if (phy->rev == 4 && ext_lna) { |
3753 | e->rfseq_init[0] &= ~0x4000; | 3832 | e->rfseq_init[0] &= ~0x4000; |
3754 | e->rfseq_init[1] &= ~0x4000; | 3833 | e->rfseq_init[1] &= ~0x4000; |
3755 | e->rfseq_init[2] &= ~0x4000; | 3834 | e->rfseq_init[2] &= ~0x4000; |
3756 | e->rfseq_init[3] &= ~0x4000; | 3835 | e->rfseq_init[3] &= ~0x4000; |
3757 | e->init_gain &= ~0x4000; | 3836 | e->init_gain &= ~0x4000; |
3758 | e->rfseq_init[0] |= 0x1000; | 3837 | e->rfseq_init[0] |= 0x1000; |
3759 | e->rfseq_init[1] |= 0x1000; | 3838 | e->rfseq_init[1] |= 0x1000; |
3760 | e->rfseq_init[2] |= 0x1000; | 3839 | e->rfseq_init[2] |= 0x1000; |
3761 | e->rfseq_init[3] |= 0x1000; | 3840 | e->rfseq_init[3] |= 0x1000; |
3762 | e->init_gain |= 0x1000; | 3841 | e->init_gain |= 0x1000; |
3842 | } | ||
3763 | } | 3843 | } |
3764 | 3844 | ||
3765 | return e; | 3845 | return e; |