aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-15 09:06:47 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-15 17:05:37 -0500
commit42e1547e5199ebfd41e3fb63db69dac8c4ed8d1c (patch)
tree975dd4bc2b91e39e4be4ed806219eb5499818e06
parente50cbcf6741684753da401722f337efacfa4a98f (diff)
b43: N-PHY: add RSSI calibration restore
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>` Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/b43/phy_n.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 0e379427270a..b0ff3a3aaa7b 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -897,6 +897,49 @@ static void b43_nphy_rssi_cal(struct b43_wldev *dev)
897} 897}
898 898
899/* 899/*
900 * Restore RSSI Calibration
901 * http://bcm-v4.sipsolutions.net/802.11/PHY/N/RestoreRssiCal
902 */
903static void b43_nphy_restore_rssi_cal(struct b43_wldev *dev)
904{
905 struct b43_phy_n *nphy = dev->phy.n;
906
907 u16 *rssical_radio_regs = NULL;
908 u16 *rssical_phy_regs = NULL;
909
910 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
911 if (!nphy->rssical_chanspec_2G)
912 return;
913 rssical_radio_regs = nphy->rssical_cache.rssical_radio_regs_2G;
914 rssical_phy_regs = nphy->rssical_cache.rssical_phy_regs_2G;
915 } else {
916 if (!nphy->rssical_chanspec_5G)
917 return;
918 rssical_radio_regs = nphy->rssical_cache.rssical_radio_regs_5G;
919 rssical_phy_regs = nphy->rssical_cache.rssical_phy_regs_5G;
920 }
921
922 /* TODO use some definitions */
923 b43_radio_maskset(dev, 0x602B, 0xE3, rssical_radio_regs[0]);
924 b43_radio_maskset(dev, 0x702B, 0xE3, rssical_radio_regs[1]);
925
926 b43_phy_write(dev, B43_NPHY_RSSIMC_0I_RSSI_Z, rssical_phy_regs[0]);
927 b43_phy_write(dev, B43_NPHY_RSSIMC_0Q_RSSI_Z, rssical_phy_regs[1]);
928 b43_phy_write(dev, B43_NPHY_RSSIMC_1I_RSSI_Z, rssical_phy_regs[2]);
929 b43_phy_write(dev, B43_NPHY_RSSIMC_1Q_RSSI_Z, rssical_phy_regs[3]);
930
931 b43_phy_write(dev, B43_NPHY_RSSIMC_0I_RSSI_X, rssical_phy_regs[4]);
932 b43_phy_write(dev, B43_NPHY_RSSIMC_0Q_RSSI_X, rssical_phy_regs[5]);
933 b43_phy_write(dev, B43_NPHY_RSSIMC_1I_RSSI_X, rssical_phy_regs[6]);
934 b43_phy_write(dev, B43_NPHY_RSSIMC_1Q_RSSI_X, rssical_phy_regs[7]);
935
936 b43_phy_write(dev, B43_NPHY_RSSIMC_0I_RSSI_Y, rssical_phy_regs[8]);
937 b43_phy_write(dev, B43_NPHY_RSSIMC_0Q_RSSI_Y, rssical_phy_regs[9]);
938 b43_phy_write(dev, B43_NPHY_RSSIMC_1I_RSSI_Y, rssical_phy_regs[10]);
939 b43_phy_write(dev, B43_NPHY_RSSIMC_1Q_RSSI_Y, rssical_phy_regs[11]);
940}
941
942/*
900 * Init N-PHY 943 * Init N-PHY
901 * http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N 944 * http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N
902 */ 945 */
@@ -1034,7 +1077,7 @@ int b43_phy_initn(struct b43_wldev *dev)
1034 if (do_rssi_cal) 1077 if (do_rssi_cal)
1035 b43_nphy_rssi_cal(dev); 1078 b43_nphy_rssi_cal(dev);
1036 else 1079 else
1037 ;/* b43_nphy_restore_rssi_cal(dev); */ 1080 b43_nphy_restore_rssi_cal(dev);
1038 } else { 1081 } else {
1039 b43_nphy_rssi_cal(dev); 1082 b43_nphy_rssi_cal(dev);
1040 } 1083 }