From owner-svn-src-head@freebsd.org Sat Dec 5 15:08:03 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 349F6A4183A; Sat, 5 Dec 2015 15:08:03 +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 mx1.freebsd.org (Postfix) with ESMTPS id E51771FAD; Sat, 5 Dec 2015 15:08:02 +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 tB5F81aq001335; Sat, 5 Dec 2015 15:08:01 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB5F81CZ001333; Sat, 5 Dec 2015 15:08:01 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512051508.tB5F81CZ001333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 5 Dec 2015 15:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291858 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2015 15:08:03 -0000 Author: avos Date: Sat Dec 5 15:08:01 2015 New Revision: 291858 URL: https://svnweb.freebsd.org/changeset/base/291858 Log: urtwn: fix some regressions after r290630 - Restore R92C_TXDW4_HWSEQ_EN bit - it is used by non-8188EU chips. - Fix DRVRATE bit usage. Tested with: - RTL8188EU, STA mode. - RTL8188CUS, STA mode. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4352 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sat Dec 5 12:55:34 2015 (r291857) +++ head/sys/dev/usb/wlan/if_urtwn.c Sat Dec 5 15:08:01 2015 (r291858) @@ -1601,14 +1601,16 @@ urtwn_init_beacon(struct urtwn_softc *sc SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BEACON) | SM(R92C_TXDW1_RAID, R92C_RAID_11B)); - if (sc->chip & URTWN_CHIP_88E) + if (sc->chip & URTWN_CHIP_88E) { txd->txdw1 |= htole32(SM(R88E_TXDW1_MACID, URTWN_MACID_BC)); - else + txd->txdseq |= htole16(R88E_TXDSEQ_HWSEQ_EN); + } else { txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, URTWN_MACID_BC)); + txd->txdw4 |= htole32(R92C_TXDW4_HWSEQ_EN); + } txd->txdw4 = htole32(R92C_TXDW4_DRVRATE); txd->txdw5 = htole32(SM(R92C_TXDW5_DATARATE, URTWN_RIDX_CCK1)); - txd->txdseq = htole16(R92C_TXDSEQ_HWSEQ_EN); } static int @@ -2249,13 +2251,17 @@ urtwn_tx_data(struct urtwn_softc *sc, st txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, macid)); txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); - /* not sure here */ - if (ridx <= URTWN_RIDX_CCK11) + /* Force this rate if needed. */ + if (ismcast || type != IEEE80211_FC0_TYPE_DATA || + (m->m_flags & M_EAPOL)) txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); if (!IEEE80211_QOS_HAS_SEQ(wh)) { /* Use HW sequence numbering for non-QoS frames. */ - txd->txdseq = htole16(R92C_TXDSEQ_HWSEQ_EN); + if (sc->chip & URTWN_CHIP_88E) + txd->txdseq = htole16(R88E_TXDSEQ_HWSEQ_EN); + else + txd->txdw4 |= htole32(R92C_TXDW4_HWSEQ_EN); } else { /* Set sequence number. */ txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Sat Dec 5 12:55:34 2015 (r291857) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Sat Dec 5 15:08:01 2015 (r291858) @@ -1055,12 +1055,13 @@ struct r92c_tx_desc { uint16_t txdw3; uint16_t txdseq; -#define R92C_TXDSEQ_HWSEQ_EN 0x8000 +#define R88E_TXDSEQ_HWSEQ_EN 0x8000 uint32_t txdw4; #define R92C_TXDW4_RTSRATE_M 0x0000003f #define R92C_TXDW4_RTSRATE_S 0 #define R92C_TXDW4_HWSEQ_QOS 0x00000040 +#define R92C_TXDW4_HWSEQ_EN 0x00000080 #define R92C_TXDW4_DRVRATE 0x00000100 #define R92C_TXDW4_CTS2SELF 0x00000800 #define R92C_TXDW4_RTSEN 0x00001000