From owner-svn-src-all@freebsd.org Sat May 30 00:06:27 2020 Return-Path: Delivered-To: svn-src-all@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 371E82F486F; Sat, 30 May 2020 00:06:27 +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 49YhYb0jd4z4fpK; Sat, 30 May 2020 00:06:27 +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 0F5A31FE79; Sat, 30 May 2020 00:06:27 +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 04U06Qtw070248; Sat, 30 May 2020 00:06:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04U06Q7N070247; Sat, 30 May 2020 00:06:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005300006.04U06Q7N070247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 30 May 2020 00:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361636 - 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: 361636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 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: Sat, 30 May 2020 00:06:27 -0000 Author: adrian Date: Sat May 30 00:06:26 2020 New Revision: 361636 URL: https://svnweb.freebsd.org/changeset/base/361636 Log: [run] Set ampdu rxmax same as linux; RF2020 isn't an 11n NIC This is from the linux driver: * set the ampdu rx max to 32k for 1 stream devics like mine, and 64k for larger ones * Don't enable 11n bits for RF2020 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 Fri May 29 19:44:18 2020 (r361635) +++ head/sys/dev/usb/wlan/if_run.c Sat May 30 00:06:26 2020 (r361636) @@ -847,20 +847,26 @@ run_attach(device_t self) IEEE80211_C_WME | /* WME */ IEEE80211_C_WPA; /* WPA1|WPA2(RSN) */ - ic->ic_htcaps = - IEEE80211_HTC_HT | - IEEE80211_HTC_AMPDU | - IEEE80211_HTC_AMSDU | - 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. + * RF2020 is not an 11n device. */ - ic->ic_rxstream = 1; - ic->ic_txstream = 1; + if (sc->rf_rev != RT3070_RF_2020) { + device_printf(sc->sc_dev, "[HT] Enabling 802.11n\n"); + ic->ic_htcaps = + IEEE80211_HTC_HT | + IEEE80211_HTC_AMPDU | + IEEE80211_HTC_AMSDU | + 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_cryptocaps = IEEE80211_CRYPTO_WEP | IEEE80211_CRYPTO_AES_CCM | @@ -1028,8 +1034,15 @@ run_vap_create(struct ieee80211com *ic, const char nam vap->iv_update_beacon = run_update_beacon; vap->iv_max_aid = RT2870_WCID_MAX; - vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K; - vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_2; + /* + * The linux rt2800 driver limits 1 stream devices to a 32KB + * RX AMPDU. + */ + if (ic->ic_rxstream > 1) + vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K; + else + vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_32K; + vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_2; /* 2uS */ /* * To delete the right key from h/w, we need wcid.