From: Rosen Penev <rosenp@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: "John W. Linville" <linville@tuxdriver.com>,
"Rafał Miłecki" <zajec5@gmail.com>,
b43-dev@lists.infradead.org (open list:B43 WIRELESS DRIVER),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH wireless] wifi: b43: keep the HT-PHY TX power control enabled
Date: Sun, 18 Oct 2026 13:12:16 -0700 [thread overview]
Message-ID: <20261018201216.51975-1-rosenp@gmail.com> (raw)
b43_phy_ht_tx_power_ctl() enables the TX power control by setting the
enable bits in TXPCTL_CMD_C1, then writes the saved TX power index of
each core to its command register. For core 1 that register is
TXPCTL_CMD_C1 itself, so the write clears the enable bits again, as
does the write of index 0x32 on 5 GHz. A TX power index is saved
whenever the control is turned off, which b43_phy_ht_op_init() does
before turning it back on, so the control ends up off and the TX gain
stays where the saved index left it.
Change only the index field of the command registers. With that, and
with the TX power estimates fixed, the hardware TX power control
(ht_txgain_idx=-1) keeps TXPCTL_CMD_C1 at 0xe019 as with wl, and a
BCM4331 holds its 2.4 GHz target power of 19 dBm from the SPROM: the
TX power control status registers report 19-20.3 dBm at gain indices
14-17.
Fixes: 60e8fb9233e1 ("b43: HT-PHY: implement controlling TX power control")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/wireless/broadcom/b43/phy_ht.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/broadcom/b43/phy_ht.c b/drivers/net/wireless/broadcom/b43/phy_ht.c
index fab8399c64f7..412e520bbcec 100644
--- a/drivers/net/wireless/broadcom/b43/phy_ht.c
+++ b/drivers/net/wireless/broadcom/b43/phy_ht.c
@@ -555,16 +555,23 @@ static void b43_phy_ht_tx_power_ctl(struct b43_wldev *dev, bool enable)
} else {
b43_phy_set(dev, B43_PHY_HT_TXPCTL_CMD_C1, en_bits);
+ /*
+ * Only touch the index: the enable bits are in the same
+ * register for core 1
+ */
if (b43_current_band(dev->wl) == NL80211_BAND_5GHZ) {
for (i = 0; i < 3; i++)
- b43_phy_write(dev, cmd_regs[i], 0x32);
+ b43_phy_maskset(dev, cmd_regs[i],
+ ~B43_PHY_HT_TXPCTL_CMD_C1_INIT,
+ 0x32);
}
for (i = 0; i < 3; i++)
if (phy_ht->tx_pwr_idx[i] <=
B43_PHY_HT_TXPCTL_CMD_C1_INIT)
- b43_phy_write(dev, cmd_regs[i],
- phy_ht->tx_pwr_idx[i]);
+ b43_phy_maskset(dev, cmd_regs[i],
+ ~B43_PHY_HT_TXPCTL_CMD_C1_INIT,
+ phy_ht->tx_pwr_idx[i]);
}
phy_ht->tx_pwr_ctl = enable;
--
2.56.0
reply other threads:[~2026-10-18 20:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261018201216.51975-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=b43-dev@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--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
all inboxes | Powered by JetHome®