Commit 5b5ee450 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: N-PHY: add helper for setting digital filters

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 81df6caf
...@@ -4809,41 +4809,46 @@ static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core) ...@@ -4809,41 +4809,46 @@ static void b43_nphy_update_tx_cal_ladder(struct b43_wldev *dev, u16 core)
} }
} }
static void b43_nphy_pa_set_tx_dig_filter(struct b43_wldev *dev, u16 offset,
const s16 *filter)
{
int i;
offset = B43_PHY_N(offset);
for (i = 0; i < 15; i++, offset++)
b43_phy_write(dev, offset, filter[i]);
}
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ExtPaSetTxDigiFilts */ /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ExtPaSetTxDigiFilts */
static void b43_nphy_ext_pa_set_tx_dig_filters(struct b43_wldev *dev) static void b43_nphy_ext_pa_set_tx_dig_filters(struct b43_wldev *dev)
{ {
int i; b43_nphy_pa_set_tx_dig_filter(dev, 0x2C5,
for (i = 0; i < 15; i++) tbl_tx_filter_coef_rev4[2]);
b43_phy_write(dev, B43_PHY_N(0x2C5 + i),
tbl_tx_filter_coef_rev4[2][i]);
} }
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/IpaSetTxDigiFilts */ /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/IpaSetTxDigiFilts */
static void b43_nphy_int_pa_set_tx_dig_filters(struct b43_wldev *dev) static void b43_nphy_int_pa_set_tx_dig_filters(struct b43_wldev *dev)
{ {
int i, j;
/* B43_NPHY_TXF_20CO_S0A1, B43_NPHY_TXF_40CO_S0A1, unknown */ /* B43_NPHY_TXF_20CO_S0A1, B43_NPHY_TXF_40CO_S0A1, unknown */
static const u16 offset[] = { 0x186, 0x195, 0x2C5 }; static const u16 offset[] = { 0x186, 0x195, 0x2C5 };
int i;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
for (j = 0; j < 15; j++) b43_nphy_pa_set_tx_dig_filter(dev, offset[i],
b43_phy_write(dev, B43_PHY_N(offset[i] + j), tbl_tx_filter_coef_rev4[i]);
tbl_tx_filter_coef_rev4[i][j]);
if (b43_is_40mhz(dev)) { if (b43_is_40mhz(dev)) {
for (j = 0; j < 15; j++) b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
b43_phy_write(dev, B43_PHY_N(offset[0] + j), tbl_tx_filter_coef_rev4[3]);
tbl_tx_filter_coef_rev4[3][j]);
} else if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) { } else if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) {
for (j = 0; j < 15; j++) b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
b43_phy_write(dev, B43_PHY_N(offset[0] + j), tbl_tx_filter_coef_rev4[5]);
tbl_tx_filter_coef_rev4[5][j]);
} }
if (dev->phy.channel == 14) if (dev->phy.channel == 14)
for (j = 0; j < 15; j++) b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
b43_phy_write(dev, B43_PHY_N(offset[0] + j), tbl_tx_filter_coef_rev4[6]);
tbl_tx_filter_coef_rev4[6][j]);
} }
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */ /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment