Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jan 2025 21:47:14 GMT
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 5f9a2eec337c - main - rtwn: bring the RTL8192EU RF read/write routines in line with rtl8xxxu
Message-ID:  <202501222147.50MLlE27009073@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by adrian:

URL: https://cgit.FreeBSD.org/src/commit/?id=5f9a2eec337c9cfdbfa800aff8875f5424e847e8

commit 5f9a2eec337c9cfdbfa800aff8875f5424e847e8
Author:     Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2025-01-19 01:08:32 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2025-01-22 21:46:57 +0000

    rtwn: bring the RTL8192EU RF read/write routines in line with rtl8xxxu
    
    The Linux rtl8xxxu driver has more delays in the RF read and write
    path.
    
    It looks like for writes it's ensuring the hardware is out of
    power save and that the transition has properly occured.
    
    And it looks for reads that it wants a delay after some bit setting,
    likely some shifting into the RF register space is occuring with
    a bit set/clear to trigger a load.
    
    See rtl8xxxu_write_rfreg() and rtl8xxxu_read_rfreg() for more
    information.
    
    Differential Revision:  https://reviews.freebsd.org/D48512
    Obtained from:  Linux rtl8xxxu
---
 sys/dev/rtwn/rtl8192e/r92e_rf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/dev/rtwn/rtl8192e/r92e_rf.c b/sys/dev/rtwn/rtl8192e/r92e_rf.c
index 8e05a827262b..478945d13c85 100644
--- a/sys/dev/rtwn/rtl8192e/r92e_rf.c
+++ b/sys/dev/rtwn/rtl8192e/r92e_rf.c
@@ -64,7 +64,9 @@ r92e_rf_read(struct rtwn_softc *sc, int chain, uint8_t addr)
 	    RW(val, R92C_HSSI_PARAM2_READ_ADDR, addr) &
 	    ~R92C_HSSI_PARAM2_READ_EDGE);
 
+	rtwn_delay(sc, 10);
 	rtwn_bb_setbits(sc, R92C_HSSI_PARAM2(0), R92C_HSSI_PARAM2_READ_EDGE, 0);
+	rtwn_delay(sc, 100);
 	rtwn_bb_setbits(sc, R92C_HSSI_PARAM2(0), 0, R92C_HSSI_PARAM2_READ_EDGE);
 	rtwn_delay(sc, 20);
 
@@ -82,5 +84,6 @@ r92e_rf_write(struct rtwn_softc *sc, int chain, uint8_t addr, uint32_t val)
 	rtwn_bb_setbits(sc, 0x818, 0x20000, 0);
 	rtwn_bb_write(sc, R92C_LSSI_PARAM(chain),
 	    SM(R88E_LSSI_PARAM_ADDR, addr) | SM(R92C_LSSI_PARAM_DATA, val));
+	rtwn_delay(sc, 1);
 	rtwn_bb_setbits(sc, 0x818, 0, 0x20000);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501222147.50MLlE27009073>