aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-15 09:02:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-15 17:05:36 -0500
commite50cbcf6741684753da401722f337efacfa4a98f (patch)
tree12927fd8b03ee50e5ad2711882eb9caad7bb8082 /drivers/net
parent90b9738d85395d46ffdc961e1a0c80a17e8f4d32 (diff)
b43: N-PHY: implement PA overriding (RF control related)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/phy_n.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 126c0afa5da2..0e379427270a 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -344,6 +344,40 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)
344 b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20); 344 b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20);
345} 345}
346 346
347/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/PA%20override */
348static void b43_nphy_pa_override(struct b43_wldev *dev, bool enable)
349{
350 struct b43_phy_n *nphy = dev->phy.n;
351 enum ieee80211_band band;
352 u16 tmp;
353
354 if (!enable) {
355 nphy->rfctrl_intc1_save = b43_phy_read(dev,
356 B43_NPHY_RFCTL_INTC1);
357 nphy->rfctrl_intc2_save = b43_phy_read(dev,
358 B43_NPHY_RFCTL_INTC2);
359 band = b43_current_band(dev->wl);
360 if (dev->phy.rev >= 3) {
361 if (band == IEEE80211_BAND_5GHZ)
362 tmp = 0x600;
363 else
364 tmp = 0x480;
365 } else {
366 if (band == IEEE80211_BAND_5GHZ)
367 tmp = 0x180;
368 else
369 tmp = 0x120;
370 }
371 b43_phy_write(dev, B43_NPHY_RFCTL_INTC1, tmp);
372 b43_phy_write(dev, B43_NPHY_RFCTL_INTC2, tmp);
373 } else {
374 b43_phy_write(dev, B43_NPHY_RFCTL_INTC1,
375 nphy->rfctrl_intc1_save);
376 b43_phy_write(dev, B43_NPHY_RFCTL_INTC2,
377 nphy->rfctrl_intc2_save);
378 }
379}
380
347/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/BmacPhyClkFgc */ 381/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/BmacPhyClkFgc */
348static void b43_nphy_bmac_clock_fgc(struct b43_wldev *dev, bool force) 382static void b43_nphy_bmac_clock_fgc(struct b43_wldev *dev, bool force)
349{ 383{
@@ -964,10 +998,10 @@ int b43_phy_initn(struct b43_wldev *dev)
964 998
965 /* TODO N PHY MAC PHY Clock Set with argument 1 */ 999 /* TODO N PHY MAC PHY Clock Set with argument 1 */
966 1000
967 /* b43_nphy_pa_override(dev, false); */ 1001 b43_nphy_pa_override(dev, false);
968 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RX2TX); 1002 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RX2TX);
969 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RESET2RX); 1003 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RESET2RX);
970 /* b43_nphy_pa_override(dev, true); */ 1004 b43_nphy_pa_override(dev, true);
971 1005
972 b43_nphy_classifier(dev, 0, 0); 1006 b43_nphy_classifier(dev, 0, 0);
973 b43_nphy_read_clip_detection(dev, clip); 1007 b43_nphy_read_clip_detection(dev, clip);