From 307f9c351588fcfe5a170c61754a5b1394b7dc0a Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 15 Dec 2024 13:04:28 -0800 Subject: [PATCH] rtwn: only set INIRATE if we're not doing firmware rate control. This register (array) controls the initial rate to use for each MACID. There's no need to set it if firmware rate control is enabled - it'll actually be under firmware control (and we can read it back to see what choices the firmware is making.) Locally tested: * RTL8188EU, STA * RTL8192CU, STA * RTL8192EU, STA Differential Revision: https://reviews.freebsd.org/D48094 Reviewed by: bz --- sys/dev/rtwn/rtl8192c/r92c_fw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/rtwn/rtl8192c/r92c_fw.c b/sys/dev/rtwn/rtl8192c/r92c_fw.c index 384cd50e901..58584b3cd02 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_fw.c +++ b/sys/dev/rtwn/rtl8192c/r92c_fw.c @@ -239,7 +239,12 @@ r92c_init_ra(struct rtwn_softc *sc, int macid) } #endif - rtwn_write_1(sc, R92C_INIDATA_RATE_SEL(macid), maxrate); + /* + * There's no need to set this if firmware rate control is + * enabled - the firmware will be controlling this per MACID. + */ + if (sc->sc_ratectl != RTWN_RATECTL_FW) + rtwn_write_1(sc, R92C_INIDATA_RATE_SEL(macid), maxrate); ieee80211_free_node(ni); }