From owner-svn-src-all@freebsd.org Mon Mar 18 02:58:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CEF9152ADB3; Mon, 18 Mar 2019 02:58:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5F206CA8E; Mon, 18 Mar 2019 02:58:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EF281B3A6; Mon, 18 Mar 2019 02:58:35 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2I2wZEE000484; Mon, 18 Mar 2019 02:58:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2I2wZkA000482; Mon, 18 Mar 2019 02:58:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201903180258.x2I2wZkA000482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 18 Mar 2019 02:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r345254 - stable/11/sys/dev/urtwn X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/sys/dev/urtwn X-SVN-Commit-Revision: 345254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5F206CA8E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Mar 2019 02:58:36 -0000 Author: avos Date: Mon Mar 18 02:58:34 2019 New Revision: 345254 URL: https://svnweb.freebsd.org/changeset/base/345254 Log: MFC r344745: urtwn(4): fix Tx instability with RTL8192CU chipsets PR: 233949 Modified: stable/11/sys/dev/urtwn/if_urtwn.c stable/11/sys/dev/urtwn/if_urtwnreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/urtwn/if_urtwn.c ============================================================================== --- stable/11/sys/dev/urtwn/if_urtwn.c Mon Mar 18 02:56:51 2019 (r345253) +++ stable/11/sys/dev/urtwn/if_urtwn.c Mon Mar 18 02:58:34 2019 (r345254) @@ -3036,10 +3036,17 @@ urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211 R92C_TXDW4_HWRTSEN); } - /* XXX TODO: rtsrate is configurable? 24mbit may - * be a bit high for RTS rate? */ - txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, - URTWN_RIDX_OFDM24)); + if (!(sc->chip & URTWN_CHIP_88E)) { + /* XXX other rates will not work without + * urtwn_ra_init() */ + txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, + URTWN_RIDX_CCK1)); + } else { + /* XXX TODO: rtsrate is configurable? 24mbit + * may be a bit high for RTS rate? */ + txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, + URTWN_RIDX_OFDM24)); + } txd->txdw5 |= htole32(0x0001ff00); } else /* IEEE80211_FC0_TYPE_MGT */ @@ -5498,6 +5505,9 @@ urtwn_init(struct urtwn_softc *sc) urtwn_write_1(sc, R88E_TX_RPT_CTRL, urtwn_read_1(sc, R88E_TX_RPT_CTRL) | R88E_TX_RPT1_ENA); } + + if (!(sc->chip & URTWN_CHIP_88E)) + urtwn_write_4(sc, R92C_POWER_STATUS, 0x5); /* Perform LO and IQ calibrations. */ urtwn_iq_calib(sc); Modified: stable/11/sys/dev/urtwn/if_urtwnreg.h ============================================================================== --- stable/11/sys/dev/urtwn/if_urtwnreg.h Mon Mar 18 02:56:51 2019 (r345253) +++ stable/11/sys/dev/urtwn/if_urtwnreg.h Mon Mar 18 02:58:34 2019 (r345254) @@ -163,6 +163,7 @@ #define R92C_RD_RESP_PKT_TH 0x463 #define R92C_INIRTS_RATE_SEL 0x480 #define R92C_INIDATA_RATE_SEL(macid) (0x484 + (macid)) +#define R92C_POWER_STATUS 0x4a4 #define R92C_MAX_AGGR_NUM 0x4ca #define R88E_TX_RPT_CTRL 0x4ec #define R88E_TX_RPT_MACID_MAX 0x4ed