Search Linux Wireless

[PATCH 2/2] b43: N-PHY: update reset_cca operation and add rssi_cal calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Update b43_nphy_reset_cca to match current specs and add rssi_cal calls to init code.



From 71c10442cd0b1b277f483a81db7f2e8f579b3d59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@xxxxxxxxx>
Date: Tue, 5 Jan 2010 20:52:43 +0100
Subject: [PATCH 2/2] b43: N-PHY: update reset_cca operation and add rssi_cal calls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Rafał Miłecki <zajec5@xxxxxxxxx>
---
 drivers/net/wireless/b43/phy_n.c |   49 +++++++++++++++++++++++++++----------
 1 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 6479d6e..ceb429a 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -343,16 +343,9 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)

 static void b43_nphy_reset_cca(struct b43_wldev *dev)
 {
-	u16 bbcfg;
-
-	ssb_write32(dev->dev, SSB_TMSLOW,
-		    ssb_read32(dev->dev, SSB_TMSLOW) | SSB_TMSLOW_FGC);
-	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);
-	ssb_write32(dev->dev, SSB_TMSLOW,
-		    ssb_read32(dev->dev, SSB_TMSLOW) & ~SSB_TMSLOW_FGC);
+	u16 bbcfg = b43_phy_read(dev, B43_NPHY_BBCFG);
+	b43_phy_write(dev, B43_NPHY_BBCFG, bbcfg | B43_NPHY_BBCFG_RSTCCA);
+	b43_phy_write(dev, B43_NPHY_BBCFG, bbcfg & ~B43_NPHY_BBCFG_RSTCCA);
 }

 enum b43_nphy_rf_sequence {
@@ -411,8 +404,30 @@ static void b43_nphy_bphy_init(struct b43_wldev *dev)
 	b43_phy_write(dev, B43_PHY_N_BMODE(0x38), 0x668);
 }

+static void b43_nphy_rev2_rssi_cal(struct b43_wldev *dev, u8 type)
+{
+	//TODO
+}
+
+static void b43_nphy_rev3_rssi_cal(struct b43_wldev *dev)
+{
+	//TODO
+}
+
 /* RSSI Calibration */
-static void b43_nphy_rssi_cal(struct b43_wldev *dev, u8 type)
+static void b43_nphy_rssi_cal(struct b43_wldev *dev)
+{
+	if (dev->phy.rev >= 3) {
+		b43_nphy_rev3_rssi_cal(dev);
+	} else {
+		b43_nphy_rev2_rssi_cal(dev, 2);
+		b43_nphy_rev2_rssi_cal(dev, 0);
+		b43_nphy_rev2_rssi_cal(dev, 1);
+	}
+}
+
+/* Restore RSSI Calibration */
+static void b43_nphy_restore_rssi_cal(struct b43_wldev *dev)
 {
 	//TODO
 }
@@ -536,9 +551,17 @@ int b43_phy_initn(struct b43_wldev *dev)

 	do_rssi_cal = false;
 	if (phy->rev >= 3) {
-		//TODO
+		if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
+			do_rssi_cal = (nphy->rssical_chanspec_2G == 0);
+		else
+			do_rssi_cal = (nphy->rssical_chanspec_5G == 0);
+
+		if (do_rssi_cal)
+			b43_nphy_rssi_cal(dev);
+		else
+			b43_nphy_restore_rssi_cal(dev);
 	} else {
-		//TODO
+		b43_nphy_rssi_cal(dev);
 	}

 	if (!((nphy->measure_hold & 0x6) != 0)) {
--
1.6.4.2

Attachment: binEWP6zvgDKL.bin
Description: Binary data


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux