aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-02-04 06:23:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-08 16:50:55 -0500
commit9442e5b58edb4a108ec5aae420a6fff3a63acab0 (patch)
tree9d1c7ab58f660aa9780fbcf4930d9c27901eefcb /drivers
parentbbc6dc121de92dee506e359eeb9b1d3973d0740a (diff)
b43: N-PHY: partly implement SPUR workaround
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/phy_n.c64
-rw-r--r--drivers/net/wireless/b43/phy_n.h3
2 files changed, 66 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index b332ffbe59d8..74642d43e1ff 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -717,6 +717,67 @@ static void b43_nphy_stop_playback(struct b43_wldev *dev)
717 b43_nphy_stay_in_carrier_search(dev, 0); 717 b43_nphy_stay_in_carrier_search(dev, 0);
718} 718}
719 719
720/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/SpurWar */
721static void b43_nphy_spur_workaround(struct b43_wldev *dev)
722{
723 struct b43_phy_n *nphy = dev->phy.n;
724
725 unsigned int channel;
726 int tone[2] = { 57, 58 };
727 u32 noise[2] = { 0x3FF, 0x3FF };
728
729 B43_WARN_ON(dev->phy.rev < 3);
730
731 if (nphy->hang_avoid)
732 b43_nphy_stay_in_carrier_search(dev, 1);
733
734 /* FIXME: channel = radio_chanspec */
735
736 if (nphy->gband_spurwar_en) {
737 /* TODO: N PHY Adjust Analog Pfbw (7) */
738 if (channel == 11 && dev->phy.is_40mhz)
739 ; /* TODO: N PHY Adjust Min Noise Var(2, tone, noise)*/
740 else
741 ; /* TODO: N PHY Adjust Min Noise Var(0, NULL, NULL)*/
742 /* TODO: N PHY Adjust CRS Min Power (0x1E) */
743 }
744
745 if (nphy->aband_spurwar_en) {
746 if (channel == 54) {
747 tone[0] = 0x20;
748 noise[0] = 0x25F;
749 } else if (channel == 38 || channel == 102 || channel == 118) {
750 if (0 /* FIXME */) {
751 tone[0] = 0x20;
752 noise[0] = 0x21F;
753 } else {
754 tone[0] = 0;
755 noise[0] = 0;
756 }
757 } else if (channel == 134) {
758 tone[0] = 0x20;
759 noise[0] = 0x21F;
760 } else if (channel == 151) {
761 tone[0] = 0x10;
762 noise[0] = 0x23F;
763 } else if (channel == 153 || channel == 161) {
764 tone[0] = 0x30;
765 noise[0] = 0x23F;
766 } else {
767 tone[0] = 0;
768 noise[0] = 0;
769 }
770
771 if (!tone[0] && !noise[0])
772 ; /* TODO: N PHY Adjust Min Noise Var(1, tone, noise)*/
773 else
774 ; /* TODO: N PHY Adjust Min Noise Var(0, NULL, NULL)*/
775 }
776
777 if (nphy->hang_avoid)
778 b43_nphy_stay_in_carrier_search(dev, 0);
779}
780
720/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/WorkaroundsGainCtrl */ 781/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/WorkaroundsGainCtrl */
721static void b43_nphy_gain_crtl_workarounds(struct b43_wldev *dev) 782static void b43_nphy_gain_crtl_workarounds(struct b43_wldev *dev)
722{ 783{
@@ -3055,7 +3116,8 @@ int b43_phy_initn(struct b43_wldev *dev)
3055 if (phy->rev >= 3 && phy->rev <= 6) 3116 if (phy->rev >= 3 && phy->rev <= 6)
3056 b43_phy_write(dev, B43_NPHY_PLOAD_CSENSE_EXTLEN, 0x0014); 3117 b43_phy_write(dev, B43_NPHY_PLOAD_CSENSE_EXTLEN, 0x0014);
3057 b43_nphy_tx_lp_fbw(dev); 3118 b43_nphy_tx_lp_fbw(dev);
3058 /* TODO N PHY Spur Workaround */ 3119 if (phy->rev >= 3)
3120 b43_nphy_spur_workaround(dev);
3059 3121
3060 b43err(dev->wl, "IEEE 802.11n devices are not supported, yet.\n"); 3122 b43err(dev->wl, "IEEE 802.11n devices are not supported, yet.\n");
3061 return 0; 3123 return 0;
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index 0400a2cb76a9..403aad3f894f 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -1002,6 +1002,9 @@ struct b43_phy_n {
1002 u16 classifier_state; 1002 u16 classifier_state;
1003 u16 clip_state[2]; 1003 u16 clip_state[2];
1004 1004
1005 bool aband_spurwar_en;
1006 bool gband_spurwar_en;
1007
1005 bool ipa2g_on; 1008 bool ipa2g_on;
1006 u8 iqcal_chanspec_2G; 1009 u8 iqcal_chanspec_2G;
1007 u8 rssical_chanspec_2G; 1010 u8 rssical_chanspec_2G;