diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-01-15 09:55:18 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-15 17:05:41 -0500 |
commit | c4a92003b0d02367bb1be94867a79651897e91ed (patch) | |
tree | bdca43667c99bc42d999755b7ce0bc8889efbf8f /drivers/net/wireless/b43 | |
parent | fe3e46e881daad2c7e3886e767bda90871d5f4d6 (diff) |
b43: N-PHY: add RX radio cores calibration
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 242f16d489f..3e587d73619 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -1173,6 +1173,49 @@ static const u32 *b43_nphy_get_ipa_gain_table(struct b43_wldev *dev) | |||
1173 | } | 1173 | } |
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/TxCalRadioSetup */ | ||
1177 | static void b43_nphy_tx_cal_radio_setup(struct b43_wldev *dev) | ||
1178 | { | ||
1179 | struct b43_phy_n *nphy = dev->phy.n; | ||
1180 | u16 *save = nphy->tx_rx_cal_radio_saveregs; | ||
1181 | |||
1182 | if (dev->phy.rev >= 3) { | ||
1183 | /* TODO */ | ||
1184 | } else { | ||
1185 | save[0] = b43_radio_read16(dev, B2055_C1_TX_RF_IQCAL1); | ||
1186 | b43_radio_write16(dev, B2055_C1_TX_RF_IQCAL1, 0x29); | ||
1187 | |||
1188 | save[1] = b43_radio_read16(dev, B2055_C1_TX_RF_IQCAL2); | ||
1189 | b43_radio_write16(dev, B2055_C1_TX_RF_IQCAL2, 0x54); | ||
1190 | |||
1191 | save[2] = b43_radio_read16(dev, B2055_C2_TX_RF_IQCAL1); | ||
1192 | b43_radio_write16(dev, B2055_C2_TX_RF_IQCAL1, 0x29); | ||
1193 | |||
1194 | save[3] = b43_radio_read16(dev, B2055_C2_TX_RF_IQCAL2); | ||
1195 | b43_radio_write16(dev, B2055_C2_TX_RF_IQCAL2, 0x54); | ||
1196 | |||
1197 | save[3] = b43_radio_read16(dev, B2055_C1_PWRDET_RXTX); | ||
1198 | save[4] = b43_radio_read16(dev, B2055_C2_PWRDET_RXTX); | ||
1199 | |||
1200 | if (!(b43_phy_read(dev, B43_NPHY_BANDCTL) & | ||
1201 | B43_NPHY_BANDCTL_5GHZ)) { | ||
1202 | b43_radio_write16(dev, B2055_C1_PWRDET_RXTX, 0x04); | ||
1203 | b43_radio_write16(dev, B2055_C2_PWRDET_RXTX, 0x04); | ||
1204 | } else { | ||
1205 | b43_radio_write16(dev, B2055_C1_PWRDET_RXTX, 0x20); | ||
1206 | b43_radio_write16(dev, B2055_C2_PWRDET_RXTX, 0x20); | ||
1207 | } | ||
1208 | |||
1209 | if (dev->phy.rev < 2) { | ||
1210 | b43_radio_set(dev, B2055_C1_TX_BB_MXGM, 0x20); | ||
1211 | b43_radio_set(dev, B2055_C2_TX_BB_MXGM, 0x20); | ||
1212 | } else { | ||
1213 | b43_radio_mask(dev, B2055_C1_TX_BB_MXGM, ~0x20); | ||
1214 | b43_radio_mask(dev, B2055_C2_TX_BB_MXGM, ~0x20); | ||
1215 | } | ||
1216 | } | ||
1217 | } | ||
1218 | |||
1176 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */ | 1219 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */ |
1177 | static struct nphy_txgains b43_nphy_get_tx_gains(struct b43_wldev *dev) | 1220 | static struct nphy_txgains b43_nphy_get_tx_gains(struct b43_wldev *dev) |
1178 | { | 1221 | { |