b43-dev.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Cc: b43-dev@lists.infradead.org, "Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH 03/13] b43: HT-PHY: move TX fix to the separated function
Date: Thu,  7 Mar 2013 16:47:17 +0100	[thread overview]
Message-ID: <1362671247-10766-4-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1362671247-10766-1-git-send-email-zajec5@gmail.com>

On N-PHY after B43_PHY_B_TEST operation there is a call to TX power fix
function which iterates over available cores. It matches our HT-PHY code
which means it's probably also some TX fix.

Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
 drivers/net/wireless/b43/phy_ht.c |   46 ++++++++++++++++++++++---------------
 1 file changed, 28 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
index 2a65d01..f7463aa 100644
--- a/drivers/net/wireless/b43/phy_ht.c
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -256,6 +256,32 @@ static void b43_phy_ht_bphy_init(struct b43_wldev *dev)
 }
 
 /**************************************************
+ * Tx/Rx
+ **************************************************/
+
+static void b43_phy_ht_tx_power_fix(struct b43_wldev *dev)
+{
+	int i;
+
+	for (i = 0; i < 3; i++) {
+		u16 mask;
+		u32 tmp = b43_httab_read(dev, B43_HTTAB32(26, 0xE8));
+
+		if (0) /* FIXME */
+			mask = 0x2 << (i * 4);
+		else
+			mask = 0;
+		b43_phy_mask(dev, B43_PHY_EXTG(0x108), mask);
+
+		b43_httab_write(dev, B43_HTTAB16(7, 0x110 + i), tmp >> 16);
+		b43_httab_write(dev, B43_HTTAB8(13, 0x63 + (i * 4)),
+				tmp & 0xFF);
+		b43_httab_write(dev, B43_HTTAB8(13, 0x73 + (i * 4)),
+				tmp & 0xFF);
+	}
+}
+
+/**************************************************
  * Channel switching ops.
  **************************************************/
 
@@ -264,7 +290,6 @@ static void b43_phy_ht_channel_setup(struct b43_wldev *dev,
 				struct ieee80211_channel *new_channel)
 {
 	bool old_band_5ghz;
-	u8 i;
 
 	old_band_5ghz = b43_phy_read(dev, B43_PHY_HT_BANDCTL) & 0; /* FIXME */
 	if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) {
@@ -290,23 +315,8 @@ static void b43_phy_ht_channel_setup(struct b43_wldev *dev,
 			b43_phy_mask(dev, B43_PHY_HT_TEST, ~0x840);
 	}
 
-	/* TODO: separated function? */
-	for (i = 0; i < 3; i++) {
-		u16 mask;
-		u32 tmp = b43_httab_read(dev, B43_HTTAB32(26, 0xE8));
-
-		if (0) /* FIXME */
-			mask = 0x2 << (i * 4);
-		else
-			mask = 0;
-		b43_phy_mask(dev, B43_PHY_EXTG(0x108), mask);
-
-		b43_httab_write(dev, B43_HTTAB16(7, 0x110 + i), tmp >> 16);
-		b43_httab_write(dev, B43_HTTAB8(13, 0x63 + (i * 4)),
-				tmp & 0xFF);
-		b43_httab_write(dev, B43_HTTAB8(13, 0x73 + (i * 4)),
-				tmp & 0xFF);
-	}
+	if (1) /* TODO: On N it's for early devices only, what about HT? */
+		b43_phy_ht_tx_power_fix(dev);
 
 	b43_phy_write(dev, 0x017e, 0x3830);
 }
-- 
1.7.10.4

  parent reply	other threads:[~2013-03-07 15:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 15:47 [PATCH 00/13] b43: implement basic TX power mgmt Rafał Miłecki
2013-03-07 15:47 ` [PATCH 01/13] b43: HT-PHY: rename AFE defines Rafał Miłecki
2013-03-09 12:43   ` [PATCH V3 " Rafał Miłecki
2013-03-07 15:47 ` [PATCH 02/13] b43: HT-PHY: add classifier control function Rafał Miłecki
2013-03-07 15:47 ` Rafał Miłecki [this message]
2013-03-07 15:47 ` [PATCH 04/13] b43: HT-PHY: implement spurious tone avoidance Rafał Miłecki
2013-03-07 15:47 ` [PATCH 05/13] b43: HT-PHY: implement MAC reclocking Rafał Miłecki
2013-03-07 15:47 ` [PATCH 06/13] b43: HT-PHY: implement CCA reset Rafał Miłecki
2013-03-07 15:47 ` [PATCH 07/13] b43: HT-PHY: implement PA override Rafał Miłecki
2013-03-09 12:49   ` [PATCH V2 " Rafał Miłecki
2013-03-07 15:47 ` [PATCH 08/13] b43: HT-PHY: implement controlling TX power control Rafał Miłecki
2013-03-09 12:52   ` [PATCH V2 " Rafał Miłecki
2013-03-07 15:47 ` [PATCH 09/13] b43: HT-PHY: implement stopping sample tone playback Rafał Miłecki
2013-03-07 15:47 ` [PATCH 10/13] b43: HT-PHY: implement playing sample tone Rafał Miłecki
2013-03-07 15:47 ` [PATCH 11/13] b43: HT-PHY: implement RSSI polling Rafał Miłecki
2013-03-07 16:35   ` Michael Büsch
2013-03-07 16:41     ` Rafał Miłecki
2013-03-09 12:41   ` [PATCH V2 01/13] b43: HT-PHY: rename AFE defines Rafał Miłecki
2013-03-09 12:56   ` [PATCH V2 11/13] b43: HT-PHY: implement RSSI polling Rafał Miłecki
2013-03-07 15:47 ` [PATCH 12/13] b43: HT-PHY: setup TX power control Rafał Miłecki
2013-03-07 15:47 ` [PATCH 13/13] b43: HT-PHY: enable basic TX power setup Rafał Miłecki
2013-03-07 18:09 ` [PATCH 00/13] b43: implement basic TX power mgmt Larry Finger
2013-03-07 18:43   ` Rafał Miłecki
2013-03-07 18:55   ` Rafał Miłecki
2013-03-07 19:01     ` Larry Finger
2013-03-09 11:20   ` Rafał Miłecki
2013-03-09 11:59     ` Hauke Mehrtens
2013-03-09 12:58 ` Rafał Miłecki
2013-03-09 17:21   ` Larry Finger
2013-03-13 10:41 ` David Woodhouse
2013-03-13 23:19   ` Rafał Miłecki
2013-03-14 14:58     ` David Woodhouse
2013-03-16 13:50       ` Rafał Miłecki
2013-03-18 21:30         ` David Woodhouse
2013-03-19  8:38           ` Rafał Miłecki

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=1362671247-10766-4-git-send-email-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).