Module Name: src Committed By: martin Date: Thu Jun 7 18:16:43 UTC 2018
Modified Files: src/sys/dev/usb [netbsd-8]: if_urtwn.c Log Message: Pull up following revision(s) (requested by nat in ticket #847): sys/dev/usb/if_urtwn.c: revision 1.58 Fix support for 8192eu, notably TPLINK TL-WN823NV2, by using the right registers when setting receiver gain. Ok christos@. To generate a diff of this commit: cvs rdiff -u -r1.53.2.2 -r1.53.2.3 src/sys/dev/usb/if_urtwn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/if_urtwn.c diff -u src/sys/dev/usb/if_urtwn.c:1.53.2.2 src/sys/dev/usb/if_urtwn.c:1.53.2.3 --- src/sys/dev/usb/if_urtwn.c:1.53.2.2 Wed Jan 31 18:01:54 2018 +++ src/sys/dev/usb/if_urtwn.c Thu Jun 7 18:16:43 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_urtwn.c,v 1.53.2.2 2018/01/31 18:01:54 martin Exp $ */ +/* $NetBSD: if_urtwn.c,v 1.53.2.3 2018/06/07 18:16:43 martin Exp $ */ /* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */ /*- @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.53.2.2 2018/01/31 18:01:54 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.53.2.3 2018/06/07 18:16:43 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -3799,12 +3799,19 @@ urtwn_bb_init(struct urtwn_softc *sc) DELAY(1); urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), 0x69553420); DELAY(1); + } - if (ISSET(sc->chip, URTWN_CHIP_92EU)) { - urtwn_write_2(sc, R92C_AFE_CTRL3, urtwn_read_2(sc, - R92C_AFE_CTRL3)); - } - + if (ISSET(sc->chip, URTWN_CHIP_92EU)) { + crystalcap = sc->r88e_rom[0xb9]; + if (crystalcap == 0x00) + crystalcap = 0x20; + crystalcap &= 0x3f; + reg = urtwn_bb_read(sc, R92C_AFE_CTRL3); + urtwn_bb_write(sc, R92C_AFE_CTRL3, + RW(reg, R92C_AFE_XTAL_CTRL_ADDR, + crystalcap | crystalcap << 6)); + urtwn_write_4(sc, R92C_AFE_XTAL_CTRL, 0xf81fb); + } else if (ISSET(sc->chip, URTWN_CHIP_88E)) { crystalcap = sc->r88e_rom[0xb9]; if (crystalcap == 0xff) crystalcap = 0x20;