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 3/5] b43: HT-PHY: perform some tables ops on channel switching
Date: Mon, 27 Jun 2011 14:58:52 +0200 [thread overview]
Message-ID: <1309179534-8081-3-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1309179534-8081-1-git-send-email-zajec5@gmail.com>
Starring at MMIO dumps around PHY channel switching has led to finding
serie of 3 similar ops this patch implements.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
The interesting part of MMIO dump:
phy_write(0x01ce) <- 0x03dd
phy_write(0x01cf) <- 0x03d9
phy_write(0x01d0) <- 0x03d5
phy_write(0x01d1) <- 0x0424
phy_write(0x01d2) <- 0x0429
phy_write(0x01d3) <- 0x042d
>>> Uploading PHY tables end
>>> Some magic ops start
phy_read(0x00b0) -> 0x0df7
phy_read(0x00b0) -> 0x0df7
phy_write(0x00b0) <- 0x0df7
phy_read(0x0c0a) -> 0x0100
phy_write(0x0c0a) <- 0x0100
>>> Some magic ops end
phy_write(0x0072) <- 0x68e8
phy_read(0x0073) -> 0x0033
phy_read(0x0074) -> 0x1019
phy_read(0x0908) -> 0x0000
phy_write(0x0908) <- 0x0000
phy_write(0x0072) <- 0x1d10
phy_write(0x0073) <- 0x1019
phy_write(0x0072) <- 0x3463
phy_write(0x0073) <- 0x0033
phy_write(0x0072) <- 0x3473
phy_write(0x0073) <- 0x0033
phy_write(0x0072) <- 0x68e8
phy_read(0x0073) -> 0x0033
phy_read(0x0074) -> 0x1019
phy_read(0x0908) -> 0x0000
phy_write(0x0908) <- 0x0000
phy_write(0x0072) <- 0x1d11
phy_write(0x0073) <- 0x1019
phy_write(0x0072) <- 0x3467
phy_write(0x0073) <- 0x0033
phy_write(0x0072) <- 0x3477
phy_write(0x0073) <- 0x0033
phy_write(0x0072) <- 0x68e8
phy_read(0x0073) -> 0x0033
phy_read(0x0074) -> 0x1019
phy_read(0x0908) -> 0x0000
phy_write(0x0908) <- 0x0000
phy_write(0x0072) <- 0x1d12
phy_write(0x0073) <- 0x1019
phy_write(0x0072) <- 0x346b
phy_write(0x0073) <- 0x0033
phy_write(0x0072) <- 0x347b
phy_write(0x0073) <- 0x0033
---
drivers/net/wireless/b43/phy_ht.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
index c48bcf6..42bea30 100644
--- a/drivers/net/wireless/b43/phy_ht.c
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -24,6 +24,7 @@
#include "b43.h"
#include "phy_ht.h"
+#include "tables_phy_ht.h"
#include "radio_2059.h"
#include "main.h"
@@ -83,6 +84,7 @@ 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) {
@@ -97,6 +99,23 @@ static void b43_phy_ht_channel_setup(struct b43_wldev *dev,
b43_phy_write(dev, B43_PHY_HT_BW4, e->bw4);
b43_phy_write(dev, B43_PHY_HT_BW5, e->bw5);
b43_phy_write(dev, B43_PHY_HT_BW6, e->bw6);
+
+ /* TODO: some ops on PHY regs 0x0B0 and 0xC0A */
+
+ /* TODO: separated function? */
+ for (i = 0; i < 3; i++) {
+ u32 tmp = b43_httab_read(dev, B43_HTTAB32(26, 0xE8));
+
+ /* TODO: some op on PHY reg 0x908 */
+
+ 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);
+ }
+
+ b43_phy_write(dev, 0x017e, 0x3830);
}
static int b43_phy_ht_set_channel(struct b43_wldev *dev,
--
1.7.1
next prev parent reply other threads:[~2011-06-27 12:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-27 12:58 [PATCH 1/5] b43: HT-PHY: prepare place for HT-PHY tables Rafał Miłecki
2011-06-27 12:58 ` [PATCH 2/5] b43: HT-PHY: upload PHY values when switching channel Rafał Miłecki
2011-06-27 12:58 ` Rafał Miłecki [this message]
2011-06-27 12:58 ` [PATCH 4/5] b43: HT-PHY: implement lacking 0x908 PHY reg op Rafał Miłecki
2011-06-27 12:58 ` [PATCH 5/5] b43: HT-PHY: add channel switching tables for 2 GHz band 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=1309179534-8081-3-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).