summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/phy_lp.c
diff options
context:
space:
mode:
authorGábor Stefanik <netrolller.3d@gmail.com>2009-08-10 20:39:47 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:58 -0400
commitc65d6fbf91517a0a955de7ce029940bc63ea8203 (patch)
treef5551585d6501b9079b07273c90af20d1516b025 /drivers/net/wireless/b43/phy_lp.c
parent62b1208e146af048e90a32bc4fe5fba85e4fa51e (diff)
downloadop-kernel-dev-c65d6fbf91517a0a955de7ce029940bc63ea8203.zip
op-kernel-dev-c65d6fbf91517a0a955de7ce029940bc63ea8203.tar.gz
b43: Implement LP-PHY baseband table initialization
Implement LP-PHY baseband table init for all revisions. Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/phy_lp.c')
-rw-r--r--drivers/net/wireless/b43/phy_lp.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index e68644d..79039c3 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -59,9 +59,43 @@ static void b43_lpphy_op_free(struct b43_wldev *dev)
dev->phy.lp = NULL;
}
+static void lpphy_adjust_gain_table(struct b43_wldev *dev)
+{
+ struct b43_phy_lp *lpphy = dev->phy.lp;
+ u32 freq = dev->wl->hw->conf.channel->center_freq;
+ u16 temp[3];
+ u16 isolation;
+
+ B43_WARN_ON(dev->phy.rev >= 2);
+
+ if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
+ isolation = lpphy->tx_isolation_med_band;
+ else if (freq <= 5320)
+ isolation = lpphy->tx_isolation_low_band;
+ else if (freq <= 5700)
+ isolation = lpphy->tx_isolation_med_band;
+ else
+ isolation = lpphy->tx_isolation_hi_band;
+
+ temp[0] = ((isolation - 26) / 12) << 12;
+ temp[1] = temp[0] + 0x1000;
+ temp[2] = temp[0] + 0x2000;
+
+ b43_lptab_write_bulk(dev, B43_LPTAB16(12, 0), 3, temp);
+ b43_lptab_write_bulk(dev, B43_LPTAB16(13, 0), 3, temp);
+}
+
static void lpphy_table_init(struct b43_wldev *dev)
{
- //TODO
+ if (dev->phy.rev < 2)
+ lpphy_rev0_1_table_init(dev);
+ else
+ lpphy_rev2plus_table_init(dev);
+
+ lpphy_init_tx_gain_table(dev);
+
+ if (dev->phy.rev < 2)
+ lpphy_adjust_gain_table(dev);
}
static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
@@ -596,13 +630,13 @@ static void lpphy_tx_pctl_init(struct b43_wldev *dev)
static int b43_lpphy_op_init(struct b43_wldev *dev)
{
/* TODO: band SPROM */
- /* TODO: tables init */
lpphy_baseband_init(dev);
lpphy_radio_init(dev);
//TODO calibrate RC
//TODO set channel
lpphy_tx_pctl_init(dev);
- //TODO full calib
+ lpphy_calibration(dev);
+ //TODO ACI init
return 0;
}
@@ -680,7 +714,6 @@ static enum b43_txpwr_result b43_lpphy_op_recalc_txpower(struct b43_wldev *dev,
return B43_TXPWR_RES_DONE;
}
-
const struct b43_phy_operations b43_phyops_lp = {
.allocate = b43_lpphy_op_allocate,
.free = b43_lpphy_op_free,
OpenPOWER on IntegriCloud