Commit 4a933c85 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: N-PHY: update CCA reset

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0988a7a1
...@@ -343,18 +343,34 @@ static void b43_nphy_workarounds(struct b43_wldev *dev) ...@@ -343,18 +343,34 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)
b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20); b43_phy_write(dev, B43_NPHY_PHASETR_B2, 0x20);
} }
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/BmacPhyClkFgc */
static void b43_nphy_bmac_clock_fgc(struct b43_wldev *dev, bool force)
{
u32 tmslow;
if (dev->phy.type != B43_PHYTYPE_N)
return;
tmslow = ssb_read32(dev->dev, SSB_TMSLOW);
if (force)
tmslow |= SSB_TMSLOW_FGC;
else
tmslow &= ~SSB_TMSLOW_FGC;
ssb_write32(dev->dev, SSB_TMSLOW, tmslow);
}
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/CCA */
static void b43_nphy_reset_cca(struct b43_wldev *dev) static void b43_nphy_reset_cca(struct b43_wldev *dev)
{ {
u16 bbcfg; u16 bbcfg;
ssb_write32(dev->dev, SSB_TMSLOW, b43_nphy_bmac_clock_fgc(dev, 1);
ssb_read32(dev->dev, SSB_TMSLOW) | SSB_TMSLOW_FGC);
bbcfg = b43_phy_read(dev, B43_NPHY_BBCFG); bbcfg = b43_phy_read(dev, B43_NPHY_BBCFG);
b43_phy_set(dev, B43_NPHY_BBCFG, B43_NPHY_BBCFG_RSTCCA); b43_phy_write(dev, B43_NPHY_BBCFG, bbcfg | B43_NPHY_BBCFG_RSTCCA);
b43_phy_write(dev, B43_NPHY_BBCFG, udelay(1);
bbcfg & ~B43_NPHY_BBCFG_RSTCCA); b43_phy_write(dev, B43_NPHY_BBCFG, bbcfg & ~B43_NPHY_BBCFG_RSTCCA);
ssb_write32(dev->dev, SSB_TMSLOW, b43_nphy_bmac_clock_fgc(dev, 0);
ssb_read32(dev->dev, SSB_TMSLOW) & ~SSB_TMSLOW_FGC); /* TODO: N PHY Force RF Seq with argument 2 */
} }
enum b43_nphy_rf_sequence { enum b43_nphy_rf_sequence {
......
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