aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-30 14:18:07 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-01 15:40:07 -0500
commit9501fefec6aa9a3319bb61edb99851ba30653f30 (patch)
tree3bd2d069365e9054837428f52d83bf7ac99e4b80 /drivers/net/wireless
parent52cb5e978f505ba6436dfe1867da0d2818fdb9b7 (diff)
b43: N-PHY: implement setting RF sequence
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/phy_n.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 78e0cf6c78ca..6392da25efed 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -64,6 +64,8 @@ enum b43_nphy_rf_sequence {
64 B43_RFSEQ_UPDATE_GAINU, 64 B43_RFSEQ_UPDATE_GAINU,
65}; 65};
66 66
67static void b43_nphy_set_rf_sequence(struct b43_wldev *dev, u8 cmd,
68 u8 *events, u8 *delays, u8 length);
67static void b43_nphy_force_rf_sequence(struct b43_wldev *dev, 69static void b43_nphy_force_rf_sequence(struct b43_wldev *dev,
68 enum b43_nphy_rf_sequence seq); 70 enum b43_nphy_rf_sequence seq);
69 71
@@ -827,8 +829,8 @@ static void b43_nphy_gain_crtl_workarounds(struct b43_wldev *dev)
827 B43_NPHY_TABLE_DATALO, 3 * j); 829 B43_NPHY_TABLE_DATALO, 3 * j);
828 } 830 }
829 831
830 /* TODO: b43_nphy_set_rf_sequence(dev, 5, 832 b43_nphy_set_rf_sequence(dev, 5,
831 rfseq_events, rfseq_delays, 3);*/ 833 rfseq_events, rfseq_delays, 3);
832 b43_phy_maskset(dev, B43_NPHY_OVER_DGAIN1, 834 b43_phy_maskset(dev, B43_NPHY_OVER_DGAIN1,
833 (u16)~B43_NPHY_OVER_DGAIN_CCKDGECV, 835 (u16)~B43_NPHY_OVER_DGAIN_CCKDGECV,
834 0x5A << B43_NPHY_OVER_DGAIN_CCKDGECV_SHIFT); 836 0x5A << B43_NPHY_OVER_DGAIN_CCKDGECV_SHIFT);
@@ -911,8 +913,8 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)
911 delays1[0] = 0x1; 913 delays1[0] = 0x1;
912 delays1[5] = 0x14; 914 delays1[5] = 0x14;
913 } 915 }
914 /*TODO:b43_nphy_set_rf_sequence(dev, 0, events1, delays1, 7);*/ 916 b43_nphy_set_rf_sequence(dev, 0, events1, delays1, 7);
915 /*TODO:b43_nphy_set_rf_sequence(dev, 1, events2, delays2, 7);*/ 917 b43_nphy_set_rf_sequence(dev, 1, events2, delays2, 7);
916 918
917 b43_nphy_gain_crtl_workarounds(dev); 919 b43_nphy_gain_crtl_workarounds(dev);
918 920
@@ -1131,6 +1133,31 @@ static void b43_nphy_tx_pwr_ctrl_coef_setup(struct b43_wldev *dev)
1131 b43_nphy_stay_in_carrier_search(dev, false); 1133 b43_nphy_stay_in_carrier_search(dev, false);
1132} 1134}
1133 1135
1136/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/SetRfSeq */
1137static void b43_nphy_set_rf_sequence(struct b43_wldev *dev, u8 cmd,
1138 u8 *events, u8 *delays, u8 length)
1139{
1140 struct b43_phy_n *nphy = dev->phy.n;
1141 u8 i;
1142 u8 end = (dev->phy.rev >= 3) ? 0x1F : 0x0F;
1143 u16 offset1 = cmd << 4;
1144 u16 offset2 = offset1 + 0x80;
1145
1146 if (nphy->hang_avoid)
1147 b43_nphy_stay_in_carrier_search(dev, true);
1148
1149 b43_ntab_write_bulk(dev, B43_NTAB8(7, offset1), length, events);
1150 b43_ntab_write_bulk(dev, B43_NTAB8(7, offset2), length, delays);
1151
1152 for (i = length; i < 16; i++) {
1153 b43_ntab_write(dev, B43_NTAB8(7, offset1 + i), end);
1154 b43_ntab_write(dev, B43_NTAB8(7, offset2 + i), 1);
1155 }
1156
1157 if (nphy->hang_avoid)
1158 b43_nphy_stay_in_carrier_search(dev, false);
1159}
1160
1134/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ForceRFSeq */ 1161/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ForceRFSeq */
1135static void b43_nphy_force_rf_sequence(struct b43_wldev *dev, 1162static void b43_nphy_force_rf_sequence(struct b43_wldev *dev,
1136 enum b43_nphy_rf_sequence seq) 1163 enum b43_nphy_rf_sequence seq)