diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-01-15 10:08:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-15 17:05:42 -0500 |
commit | e9762492f5c7176660ed030e9dd816b3208def12 (patch) | |
tree | ace8103467ba39e42b5a5c8f4d79e2040331432e | |
parent | de7ed0c6245276eaa62523ffb36512d88bf1efb3 (diff) |
b43: N-PHY: implement calculating IQ gain params
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.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index d09a16f76007..8a3bc2c58a81 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -1216,6 +1216,44 @@ static void b43_nphy_tx_cal_radio_setup(struct b43_wldev *dev) | |||
1216 | } | 1216 | } |
1217 | } | 1217 | } |
1218 | 1218 | ||
1219 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/IqCalGainParams */ | ||
1220 | static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core, | ||
1221 | struct nphy_txgains target, | ||
1222 | struct nphy_iqcal_params *params) | ||
1223 | { | ||
1224 | int i, j, indx; | ||
1225 | u16 gain; | ||
1226 | |||
1227 | if (dev->phy.rev >= 3) { | ||
1228 | params->txgm = target.txgm[core]; | ||
1229 | params->pga = target.pga[core]; | ||
1230 | params->pad = target.pad[core]; | ||
1231 | params->ipa = target.ipa[core]; | ||
1232 | params->cal_gain = (params->txgm << 12) | (params->pga << 8) | | ||
1233 | (params->pad << 4) | (params->ipa); | ||
1234 | for (j = 0; j < 5; j++) | ||
1235 | params->ncorr[j] = 0x79; | ||
1236 | } else { | ||
1237 | gain = (target.pad[core]) | (target.pga[core] << 4) | | ||
1238 | (target.txgm[core] << 8); | ||
1239 | |||
1240 | indx = (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) ? | ||
1241 | 1 : 0; | ||
1242 | for (i = 0; i < 9; i++) | ||
1243 | if (tbl_iqcal_gainparams[indx][i][0] == gain) | ||
1244 | break; | ||
1245 | i = min(i, 8); | ||
1246 | |||
1247 | params->txgm = tbl_iqcal_gainparams[indx][i][1]; | ||
1248 | params->pga = tbl_iqcal_gainparams[indx][i][2]; | ||
1249 | params->pad = tbl_iqcal_gainparams[indx][i][3]; | ||
1250 | params->cal_gain = (params->txgm << 7) | (params->pga << 4) | | ||
1251 | (params->pad << 2); | ||
1252 | for (j = 0; j < 4; j++) | ||
1253 | params->ncorr[j] = tbl_iqcal_gainparams[indx][i][4 + j]; | ||
1254 | } | ||
1255 | } | ||
1256 | |||
1219 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/UpdateTxCalLadder */ | 1257 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/UpdateTxCalLadder */ |
1220 | static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core) | 1258 | static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core) |
1221 | { | 1259 | { |