From owner-svn-src-head@freebsd.org Tue Jun 2 22:36:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 935602FCB51; Tue, 2 Jun 2020 22:36:17 +0000 (UTC) (envelope-from adrian@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 49c6Mj3R5Wz40h1; Tue, 2 Jun 2020 22:36:17 +0000 (UTC) (envelope-from adrian@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 710C12410C; Tue, 2 Jun 2020 22:36:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 052MaH8m024511; Tue, 2 Jun 2020 22:36:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 052MaHU8024510; Tue, 2 Jun 2020 22:36:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202006022236.052MaHU8024510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 2 Jun 2020 22:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361737 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 361737 X-SVN-Commit-Repository: base 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.33 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: Tue, 02 Jun 2020 22:36:17 -0000 Author: adrian Date: Tue Jun 2 22:36:17 2020 New Revision: 361737 URL: https://svnweb.freebsd.org/changeset/base/361737 Log: [run] Set the number of HT chains. * Set the tx/rx chains based on the existing MIMO eeprom reads * Add 3-chain rates Tested: * MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), 2g/5g STA * MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R), 2g/5g STA Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Tue Jun 2 20:42:45 2020 (r361736) +++ head/sys/dev/usb/wlan/if_run.c Tue Jun 2 22:36:17 2020 (r361737) @@ -537,6 +537,7 @@ static const struct rt2860_rate { { 0x85, 5, IEEE80211_T_HT, 4, 60, 60 }, { 0x86, 6, IEEE80211_T_HT, 4, 60, 60 }, { 0x87, 7, IEEE80211_T_HT, 4, 60, 60 }, + /* MCS - 2 streams */ { 0x88, 8, IEEE80211_T_HT, 4, 60, 60 }, { 0x89, 9, IEEE80211_T_HT, 4, 60, 60 }, @@ -546,6 +547,16 @@ static const struct rt2860_rate { { 0x8d, 13, IEEE80211_T_HT, 4, 60, 60 }, { 0x8e, 14, IEEE80211_T_HT, 4, 60, 60 }, { 0x8f, 15, IEEE80211_T_HT, 4, 60, 60 }, + + /* MCS - 3 streams */ + { 0x90, 16, IEEE80211_T_HT, 4, 60, 60 }, + { 0x91, 17, IEEE80211_T_HT, 4, 60, 60 }, + { 0x92, 18, IEEE80211_T_HT, 4, 60, 60 }, + { 0x93, 19, IEEE80211_T_HT, 4, 60, 60 }, + { 0x94, 20, IEEE80211_T_HT, 4, 60, 60 }, + { 0x95, 21, IEEE80211_T_HT, 4, 60, 60 }, + { 0x96, 22, IEEE80211_T_HT, 4, 60, 60 }, + { 0x97, 23, IEEE80211_T_HT, 4, 60, 60 }, }; /* These are indexes into the above rt2860_rates[] array */ @@ -553,7 +564,7 @@ static const struct rt2860_rate { #define RT2860_RIDX_CCK11 3 #define RT2860_RIDX_OFDM6 4 #define RT2860_RIDX_MCS0 12 -#define RT2860_RIDX_MAX 28 +#define RT2860_RIDX_MAX 36 static const struct { uint16_t reg; @@ -859,12 +870,8 @@ run_attach(device_t self) IEEE80211_HTCAP_MAXAMSDU_3839 | IEEE80211_HTCAP_SMPS_OFF; - /* - * For now, just do 1 stream. Later on we'll figure out - * how many tx/rx streams a particular NIC supports. - */ - ic->ic_rxstream = 1; - ic->ic_txstream = 1; + ic->ic_rxstream = sc->nrxchains; + ic->ic_txstream = sc->ntxchains; } ic->ic_cryptocaps =