b43-dev.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Gábor Stefanik" <netrolller.3d@gmail.com>
To: "John Linville" <linville@tuxdriver.com>, "Michael Büsch" <mb@bu3sch.de>
Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org,
	"Larry Finger" <larry.finger@lwfinger.net>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Gábor Stefanik" <netrolller.3d@gmail.com>
Subject: [PATCH 4/4] b43: N-PHY: Implement RX core state setting for rev.2 and earlier PHYs
Date: Mon, 16 Aug 2010 22:39:17 +0200	[thread overview]
Message-ID: <1281991157-1557-4-git-send-email-netrolller.3d@gmail.com> (raw)
In-Reply-To: <1281991157-1557-3-git-send-email-netrolller.3d@gmail.com>

Rev.3+ support coming in a later patch.

Signed-off-by: G?bor Stefanik <netrolller.3d@gmail.com>
---
 drivers/net/wireless/b43/phy_n.c |   40 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d2dab55..92cf8b8 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -3085,6 +3085,44 @@ static void b43_nphy_mac_phy_clock_set(struct b43_wldev *dev, bool on)
 	ssb_write32(dev->dev, SSB_TMSLOW, tmslow);
 }
 
+/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCoreSetState */
+static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
+{
+	struct b43_phy *phy = &dev->phy;
+	struct b43_phy_n *nphy = phy->n;
+	u16 buf[16];
+
+	if (0 /* FIXME clk */)
+		return;
+
+	b43_mac_suspend(dev);
+
+	if (nphy->hang_avoid)
+		b43_nphy_stay_in_carrier_search(dev, true);
+
+	b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXEN,
+			(mask & 0x3) << B43_NPHY_RFSEQCA_RXEN_SHIFT);
+
+	if (maskbits & 0x3 != 0x3) {
+		b43_phy_write(dev, B43_NPHY_HPANT_SWTHRES, 1);
+		if (dev->phy.rev >= 3) {
+			/* TODO */
+		}
+	} else {
+		b43_phy_write(dev, B43_NPHY_HPANT_SWTHRES, 0x1E);
+		if (dev->phy.rev >= 3) {
+			/* TODO */
+		}
+	}
+
+	b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RESET2RX);
+
+	if (nphy->hang_avoid)
+		b43_nphy_stay_in_carrier_search(dev, false);
+
+	b43_mac_enable(dev);
+}
+
 /*
  * Init N-PHY
  * http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N
@@ -3211,7 +3249,7 @@ int b43_phy_initn(struct b43_wldev *dev)
 	}
 
 	if (nphy->phyrxchain != 3)
-		;/* TODO N PHY RX Core Set State with phyrxchain as argument */
+		b43_nphy_set_rx_core_state(dev, nphy->phyrxchain);
 	if (nphy->mphase_cal_phase_id > 0)
 		;/* TODO PHY Periodic Calibration Multi-Phase Restart */
 
-- 
1.6.4.2

  reply	other threads:[~2010-08-16 20:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 20:39 [PATCH 1/4] b43: N-PHY: Implement Host Flags write during device init Gábor Stefanik
2010-08-16 20:39 ` [PATCH 2/4] b43: N-PHY: Fix typo in function name (gain_crtl -> gain_ctrl) Gábor Stefanik
2010-08-16 20:39   ` [PATCH 3/4] b43: N-PHY: Implement MAC PHY clock set Gábor Stefanik
2010-08-16 20:39     ` Gábor Stefanik [this message]
2010-08-16 20:47       ` [PATCH 4/4] b43: N-PHY: Implement RX core state setting for rev.2 and earlier PHYs Michael Büsch
2010-08-17  6:37         ` Gábor Stefanik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281991157-1557-4-git-send-email-netrolller.3d@gmail.com \
    --to=netrolller.3d@gmail.com \
    --cc=b43-dev@lists.infradead.org \
    --cc=larry.finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).