[PATCH] b43: HT-PHY: calibrate radio after switching channel

Rafał Miłecki zajec5 at gmail.com
Sun Jun 19 21:12:19 EDT 2011


After uploading radio values calibration goes in. In MMIO dump it is:
 radio_read(0x002b) -> 0x0008
radio_write(0x002b) <- 0x0008
 radio_read(0x002e) -> 0x0004
radio_write(0x002e) <- 0x0000
 radio_read(0x002e) -> 0x0000
radio_write(0x002e) <- 0x0004
 radio_read(0x002b) -> 0x0008
radio_write(0x002b) <- 0x0009
To find masks and sets, MMIO hacks were used to fool closed driver.

Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
---
First I fooled ndiswrapper to get all reads 0xFFFF:
 radio_read(0x002b) -> 0xffff
radio_write(0x002b) <- 0xfffe
 radio_read(0x002e) -> 0xffff
radio_write(0x002e) <- 0xfffb
 radio_read(0x002e) -> 0xffff
radio_write(0x002e) <- 0xffff
 radio_read(0x002b) -> 0xffff
radio_write(0x002b) <- 0xffff
This has shown two first ops are pure masking ones.

Next I fooled ndis to get 0x0000:
 radio_read(0x002b) -> 0x0000
radio_write(0x002b) <- 0x0000
 radio_read(0x002e) -> 0x0000
radio_write(0x002e) <- 0x0000
 radio_read(0x002e) -> 0x0000
radio_write(0x002e) <- 0x0004
 radio_read(0x002b) -> 0x0000
radio_write(0x002b) <- 0x0001
Which has discovered bits setting by 2 later ops.
---
 drivers/net/wireless/b43/phy_ht.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
index 0b13f6f..72f01ce 100644
--- a/drivers/net/wireless/b43/phy_ht.c
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -69,7 +69,13 @@ static void b43_radio_2059_channel_setup(struct b43_wldev *dev,
 
 	udelay(50);
 
-	/* TODO */
+	/* Calibration */
+	b43_radio_mask(dev, 0x2b, ~0x1);
+	b43_radio_mask(dev, 0x2e, ~0x4);
+	b43_radio_set(dev, 0x2e, 0x4);
+	b43_radio_set(dev, 0x2b, 0x1);
+
+	udelay(300);
 }
 
 static void b43_phy_ht_channel_setup(struct b43_wldev *dev,
-- 
1.7.3.4




More information about the b43-dev mailing list