Linux wireless drivers development
 help / color / mirror / Atom feed
From: Andre Eikmeyer <dev@deq.rocks>
To: arend.vanspriel@broadcom.com
Cc: linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev,
	brcm80211-dev-list.pdl@broadcom.com,
	linux-kernel@vger.kernel.org, Andre Eikmeyer <dev@deq.rocks>,
	Yossef Osman <Yossef.Osman@proton.me>,
	Aditya Garg <aditya.garg@linux.dev>
Subject: [PATCH wireless-next v2] wifi: brcmfmac: turn off TX beamforming on Apple BCM4364
Date: Wed, 18 Nov 2026 15:10:20 +0100	[thread overview]
Message-ID: <20261118141020.92306-1-dev@deq.rocks> (raw)
In-Reply-To: <20261104151623.70695-1-dev@deq.rocks>

brcmfmac sets "txbf" to 1 at init. The Apple firmware for the BCM4364
(9.30.514.0.32.5.94 on the MacBookPro15,1) has it on by default as
well, and then rate control settles on a single beamformed spatial
stream (nrate VHT MCS9 NSS1 TXBF) towards a two stream AP.

Beamforming more than one stream does not work on this firmware. With
"txbf" on and the rate fixed to two or three streams, the firmware takes
the rate but the uplink stalls. With "txbf" off, rate control picks two
streams (VHT MCS9 NSS2) on its own.

Uplink measured with iperf3 against a wired server was:

  0.5 m from the AP, -36 dBm:  351 -> 623 Mbit/s
  -70 dBm:                      96-130 -> 149-175 Mbit/s

Downlink and latency remain unchanged.

Set "txbf" to 0 on the BCM4364 when the board type is an Apple one.

Tested-by: Yossef Osman <Yossef.Osman@proton.me>
Tested-by: Aditya Garg <aditya.garg@linux.dev>
Signed-off-by: Andre Eikmeyer <dev@deq.rocks>
---
Changes in v2:
- Restrict the quirk to Apple boards with settings->board_type
- Spell out the txbf value with an explicit if and fix the comment
- State the cause. Beamforming more than one stream does not work
- Fix the typo
- Target wireless-next
- v1: https://lore.kernel.org/all/20261104151623.70695-1-dev@deq.rocks/

The T2 Linux community runs this patch with its kernels for quite a while
now, no regression was reported.

 .../wireless/broadcom/brcm80211/brcmfmac/common.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
index 93458c2fbc2e..f8ff6217de16 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -10,6 +10,7 @@
 #include <linux/firmware.h>
 #include <brcmu_wifi.h>
 #include <brcmu_utils.h>
+#include <brcm_hw_ids.h>
 #include "core.h"
 #include "bus.h"
 #include "debug.h"
@@ -275,6 +276,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
 	struct brcmf_rev_info *ri;
 	char *clmver;
 	char *ptr;
+	s32 txbf;
 	s32 err;
 
 	if (is_valid_ether_addr(ifp->mac_addr)) {
@@ -432,8 +434,17 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
 		goto done;
 	}
 
-	/* Enable tx beamforming, errors can be ignored (not supported) */
-	(void)brcmf_fil_iovar_int_set(ifp, "txbf", 1);
+	/* Enable tx beamforming, errors can be ignored (not supported).
+	 * The Apple firmware for the BCM4364 has it on by default and then
+	 * beamforms a single spatial stream, as beamforming more than one
+	 * stream does not work. Turn it off there, so two streams are used.
+	 */
+	txbf = 1;
+	if (drvr->bus_if->chip == BRCM_CC_4364_CHIP_ID &&
+	    drvr->settings->board_type &&
+	    strstarts(drvr->settings->board_type, "apple,"))
+		txbf = 0;
+	(void)brcmf_fil_iovar_int_set(ifp, "txbf", txbf);
 done:
 	return err;
 }

base-commit: 5dbf2415ca9821a611d09308e3b29d2c37e7cd77
-- 
2.56.0


      parent reply	other threads:[~2026-11-18 14:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 15:16 [PATCH] wifi: brcmfmac: disable TX beamforming on BCM4364 Andre Eikmeyer
2026-11-16 20:37 ` Arend van Spriel
2026-11-17 17:50   ` Aditya Garg
2026-11-17 19:46     ` Arend van Spriel
2026-11-18 14:10 ` Andre Eikmeyer [this message]

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=20261118141020.92306-1-dev@deq.rocks \
    --to=dev@deq.rocks \
    --cc=Yossef.Osman@proton.me \
    --cc=aditya.garg@linux.dev \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.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