mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Campbell <inca.jeff.campbell@gmail.com>
To: Arend van Spriel <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
Subject: [PATCH wireless-next] wifi: brcmfmac: enable 2.4 GHz VHT on BCM4366 before AP bring-up
Date: Wed,  4 Nov 2026 17:04:26 +0000	[thread overview]
Message-ID: <20261104170426.4129715-1-inca.jeff.campbell@gmail.com> (raw)

On BCM4366 firmware 10.28.2 (r769115) the 2.4 GHz radio defaults to
vht_features 6: proprietary rates and 1024-QAM on, 2.4 GHz VHT off.
brcmfmac never sets this iovar. As an AP the d11 PSM watchdog then fires
repeatedly once a client passes traffic, the client disassociates and
never completes DHCP.  This renders the radio unusable as an AP.

On an ASUS RT-AC86U (BCM43666 2.4 GHz radio), with every other bring-up
setting held fixed, values 0 and 6 fail and values 1 and 7 are stable,
so bit 0 alone decides it. The ASUS firmware for this router sets 7.

Set bit 0, keeping the other bits, on the primary 2.4 GHz BSS of the
4366 family while the radio is still down. 5 GHz is left alone: it
keeps 6 and is stable.  This stabilizes 2.4GHz AP and clients now
associate, DHCP and pass traffic at normal levels.

Signed-off-by: Jeff Campbell <inca.jeff.campbell@gmail.com>
---
Tested on an ASUS RT-AC86U, firmware 10.28.2 (r769115), AP mode, 2.4 GHz
channel 1 at 20 MHz, one client. The router runs OpenWrt on 6.12, so this
is wireless-next brcmfmac at 991a73f49 built as a module with a small
local shim for the older cfg80211 API (not part of this patch), not a
wireless-next kernel. The two builds differ only by this patch:

  with patch:    vht_features 7, three speed test runs on one association,
                 no watchdog, DHCP completes, 560/155917 tx failed
  without patch: vht_features 6, 16 PSM watchdogs in the first 102 s after
                 boot, client retries DHCP and gives up

5 GHz stays at 6 in both builds. One speed test run there was clean, with
no tx failures and no watchdog.

The chip check covers the 4366
family, but only the 43666 2.4 GHz radio on this board has been tested.

 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 46714d871..e971057fb 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -5253,6 +5253,36 @@ brcmf_parse_configure_security(struct brcmf_if *ifp,
 	return err;
 }
 
+#define BRCMF_VHT_FEATURES_2G_ENAB	BIT(0)
+
+static void brcmf_cfg80211_4366_2g_vht(struct brcmf_if *ifp,
+				       const struct cfg80211_chan_def *chandef)
+{
+	u32 chip = ifp->drvr->bus_if->chip;
+	u32 val, want;
+	s32 err;
+
+	if (chandef->chan->band != NL80211_BAND_2GHZ)
+		return;
+	if (chip != BRCM_CC_4366_CHIP_ID && chip != BRCM_CC_43664_CHIP_ID &&
+	    chip != BRCM_CC_43666_CHIP_ID)
+		return;
+	err = brcmf_fil_iovar_int_get(ifp, "vht_features", &val);
+	if (err < 0) {
+		brcmf_dbg(INFO, "vht_features get failed (%d)\n", err);
+		return;
+	}
+	if (val & BRCMF_VHT_FEATURES_2G_ENAB)
+		return;
+	want = val | BRCMF_VHT_FEATURES_2G_ENAB;
+	err = brcmf_fil_iovar_int_set(ifp, "vht_features", want);
+	if (err < 0)
+		bphy_err(ifp->drvr, "vht_features 2.4 GHz enable failed (%d)\n",
+			 err);
+	else
+		brcmf_dbg(INFO, "vht_features 0x%x -> 0x%x\n", val, want);
+}
+
 static s32
 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
 			struct cfg80211_ap_settings *settings)
@@ -5397,6 +5427,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
 				goto exit;
 			}
 		}
+		if (!mbss)
+			brcmf_cfg80211_4366_2g_vht(ifp, &settings->chandef);
 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
 		if (err < 0) {
 			bphy_err(drvr, "BRCMF_C_UP error (%d)\n", err);

base-commit: 991a73f4909f1348ffb4b38765cdb522a775e4c2
-- 
2.47.3


                 reply	other threads:[~2026-11-04 17:04 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=20261104170426.4129715-1-inca.jeff.campbell@gmail.com \
    --to=inca.jeff.campbell@gmail.com \
    --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

all inboxes | Powered by JetHome®