diff options
Diffstat (limited to 'drivers/net/wireless/b43/tables_nphy.c')
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.c | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c index c42b2acea24e..2de483b3d3ba 100644 --- a/drivers/net/wireless/b43/tables_nphy.c +++ b/drivers/net/wireless/b43/tables_nphy.c | |||
@@ -2709,6 +2709,79 @@ const struct nphy_rf_control_override_rev3 tbl_rf_control_override_rev3[] = { | |||
2709 | { 0x00C0, 6, 0xE7, 0xF9, 0xEC, 0xFB } /* field == 0x4000 (fls 15) */ | 2709 | { 0x00C0, 6, 0xE7, 0xF9, 0xEC, 0xFB } /* field == 0x4000 (fls 15) */ |
2710 | }; | 2710 | }; |
2711 | 2711 | ||
2712 | struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_workaround[2][3] = { | ||
2713 | { /* 2GHz */ | ||
2714 | { /* PHY rev 3 */ | ||
2715 | { 7, 11, 16, 23 }, | ||
2716 | { -5, 6, 10, 14 }, | ||
2717 | { 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA }, | ||
2718 | { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, | ||
2719 | 0x627E, | ||
2720 | { 0x613F, 0x613F, 0x613F, 0x613F }, | ||
2721 | 0x107E, 0x0066, 0x0074, | ||
2722 | 0x18, 0x18, 0x18, | ||
2723 | 0x020D, 0x5, | ||
2724 | }, | ||
2725 | { /* PHY rev 4 */ | ||
2726 | { 8, 12, 17, 25 }, | ||
2727 | { -5, 6, 10, 14 }, | ||
2728 | { 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA }, | ||
2729 | { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, | ||
2730 | 0x527E, | ||
2731 | { 0x513F, 0x513F, 0x513F, 0x513F }, | ||
2732 | 0x007E, 0x0066, 0x0074, | ||
2733 | 0x18, 0x18, 0x18, | ||
2734 | 0x01A1, 0x5, | ||
2735 | }, | ||
2736 | { /* PHY rev 5+ */ | ||
2737 | { 9, 13, 18, 26 }, | ||
2738 | { -3, 7, 11, 16 }, | ||
2739 | { 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA }, | ||
2740 | { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, | ||
2741 | 0x427E, /* invalid for external LNA! */ | ||
2742 | { 0x413F, 0x413F, 0x413F, 0x413F }, /* invalid for external LNA! */ | ||
2743 | 0x1076, 0x0066, 0x106A, | ||
2744 | 0xC, 0xC, 0xC, | ||
2745 | 0x01D0, 0x5, | ||
2746 | }, | ||
2747 | }, | ||
2748 | { /* 5GHz */ | ||
2749 | { /* PHY rev 3 */ | ||
2750 | { 7, 11, 17, 23 }, | ||
2751 | { -6, 2, 6, 10 }, | ||
2752 | { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, | ||
2753 | { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, | ||
2754 | 0x52DE, | ||
2755 | { 0x516F, 0x516F, 0x516F, 0x516F }, | ||
2756 | 0x00DE, 0x00CA, 0x00CC, | ||
2757 | 0x1E, 0x1E, 0x1E, | ||
2758 | 0x01A1, 25, | ||
2759 | }, | ||
2760 | { /* PHY rev 4 */ | ||
2761 | { 8, 12, 18, 23 }, | ||
2762 | { -5, 2, 6, 10 }, | ||
2763 | { 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD }, | ||
2764 | { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, | ||
2765 | 0x629E, | ||
2766 | { 0x614F, 0x614F, 0x614F, 0x614F }, | ||
2767 | 0x029E, 0x1084, 0x0086, | ||
2768 | 0x24, 0x24, 0x24, | ||
2769 | 0x0107, 25, | ||
2770 | }, | ||
2771 | { /* PHY rev 5+ */ | ||
2772 | { 6, 10, 16, 21 }, | ||
2773 | { -7, 0, 4, 8 }, | ||
2774 | { 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD, 0xD }, | ||
2775 | { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, | ||
2776 | 0x729E, | ||
2777 | { 0x714F, 0x714F, 0x714F, 0x714F }, | ||
2778 | 0x029E, 0x2084, 0x2086, | ||
2779 | 0x24, 0x24, 0x24, | ||
2780 | 0x00A9, 25, | ||
2781 | }, | ||
2782 | }, | ||
2783 | }; | ||
2784 | |||
2712 | static inline void assert_ntab_array_sizes(void) | 2785 | static inline void assert_ntab_array_sizes(void) |
2713 | { | 2786 | { |
2714 | #undef check | 2787 | #undef check |
@@ -2957,3 +3030,33 @@ void b43_nphy_rev3plus_tables_init(struct b43_wldev *dev) | |||
2957 | /* Volatile tables */ | 3030 | /* Volatile tables */ |
2958 | /* TODO */ | 3031 | /* TODO */ |
2959 | } | 3032 | } |
3033 | |||
3034 | struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( | ||
3035 | struct b43_wldev *dev, bool ghz5, bool ext_lna) | ||
3036 | { | ||
3037 | struct nphy_gain_ctl_workaround_entry *e; | ||
3038 | u8 phy_idx; | ||
3039 | |||
3040 | B43_WARN_ON(dev->phy.rev < 3); | ||
3041 | if (dev->phy.rev >= 5) | ||
3042 | phy_idx = 2; | ||
3043 | else if (dev->phy.rev == 4) | ||
3044 | phy_idx = 1; | ||
3045 | else | ||
3046 | phy_idx = 0; | ||
3047 | |||
3048 | e = &nphy_gain_ctl_workaround[ghz5][phy_idx]; | ||
3049 | |||
3050 | /* Only one entry differs for external LNA, so instead making whole | ||
3051 | * table 2 times bigger, hack is here | ||
3052 | */ | ||
3053 | if (!ghz5 && dev->phy.rev >= 5 && ext_lna) { | ||
3054 | e->rfseq_init[0] &= 0x0FFF; | ||
3055 | e->rfseq_init[1] &= 0x0FFF; | ||
3056 | e->rfseq_init[2] &= 0x0FFF; | ||
3057 | e->rfseq_init[3] &= 0x0FFF; | ||
3058 | e->init_gain &= 0x0FFF; | ||
3059 | } | ||
3060 | |||
3061 | return e; | ||
3062 | } | ||