From: "Rafał Miłecki" <zajec5@gmail.com>
To: b43-dev@lists.infradead.org
Subject: [PATCH 3/4] b43: HT-PHY: finish calculating values for idle TSSI
Date: Sun, 17 Mar 2013 19:00:20 +0100 [thread overview]
Message-ID: <1363543221-10651-4-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1363543221-10651-1-git-send-email-zajec5@gmail.com>
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
index afb13f2..204b9f0 100644
--- a/drivers/net/wireless/b43/phy_ht.c
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -529,9 +529,21 @@ static void b43_phy_ht_tx_power_ctl(struct b43_wldev *dev, bool enable)
static void b43_phy_ht_tx_power_ctl_idle_tssi(struct b43_wldev *dev)
{
struct b43_phy_ht *phy_ht = dev->phy.ht;
+ static const u16 base[] = { 0x840, 0x860, 0x880 };
+ u16 save_regs[3][3];
s32 rssi_buf[6];
+ int i;
- /* TODO */
+ for (i = 0; i < 3; i++) {
+ save_regs[i][1] = b43_phy_read(dev, base[i] + 6);
+ save_regs[i][2] = b43_phy_read(dev, base[i] + 7);
+ save_regs[i][0] = b43_phy_read(dev, base[i] + 0);
+
+ b43_phy_write(dev, base[i] + 6, 0);
+ b43_phy_mask(dev, base[i] + 7, ~0xF); /* 0xF? Or just 0x6? */
+ b43_phy_set(dev, base[i] + 0, 0x0400);
+ b43_phy_set(dev, base[i] + 0, 0x1000);
+ }
b43_phy_ht_tx_tone(dev);
udelay(20);
@@ -543,7 +555,11 @@ static void b43_phy_ht_tx_power_ctl_idle_tssi(struct b43_wldev *dev)
phy_ht->idle_tssi[1] = rssi_buf[2] & 0xff;
phy_ht->idle_tssi[2] = rssi_buf[4] & 0xff;
- /* TODO */
+ for (i = 0; i < 3; i++) {
+ b43_phy_write(dev, base[i] + 0, save_regs[i][0]);
+ b43_phy_write(dev, base[i] + 6, save_regs[i][1]);
+ b43_phy_write(dev, base[i] + 7, save_regs[i][2]);
+ }
}
static void b43_phy_ht_tx_power_ctl_setup(struct b43_wldev *dev)
--
1.7.10.4
next prev parent reply other threads:[~2013-03-17 18:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-17 18:00 [PATCH 0/4] more HT-PHY improvements Rafał Miłecki
2013-03-17 18:00 ` [PATCH 1/4] b43: HT-PHY: rename defines addressing cores on the 2059 radio Rafał Miłecki
2013-03-17 18:00 ` [PATCH 2/4] b43: HT-PHY: tables: don't duplicate core-generic regs Rafał Miłecki
2013-03-17 18:00 ` Rafał Miłecki [this message]
2013-03-17 18:00 ` [PATCH 4/4] b43: HT-PHY: do some extra TSSI setup after configuring TX 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=1363543221-10651-4-git-send-email-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=b43-dev@lists.infradead.org \
/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).