From owner-svn-src-head@freebsd.org Tue Apr 26 01:37:04 2016 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 76D6CB1DE3C; Tue, 26 Apr 2016 01:37:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2F69C1F7B; Tue, 26 Apr 2016 01:37:04 +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 u3Q1b3wg091567; Tue, 26 Apr 2016 01:37:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1b3hR091565; Tue, 26 Apr 2016 01:37:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260137.u3Q1b3hR091565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298608 - head/sys/dev/ath 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.21 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, 26 Apr 2016 01:37:04 -0000 Author: adrian Date: Tue Apr 26 01:37:03 2016 New Revision: 298608 URL: https://svnweb.freebsd.org/changeset/base/298608 Log: [ath] add LDPC capability support and LDPC RX support. This enables LDPC receive support for the AR9300 chips that support it. It'll announce LDPC support via net80211. Tested: * AR9380, STA mode * AR9331, (to verify the HAL didn't attach it to a chip which doesn't support LDPC.) TODO: * Add in net80211 machinery to make this configurable at runtime. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 26 01:34:21 2016 (r298607) +++ head/sys/dev/ath/if_ath.c Tue Apr 26 01:37:03 2016 (r298608) @@ -1062,6 +1062,7 @@ ath_attach(u_int16_t devid, struct ath_s if (ath_hal_getcapability(ah, HAL_CAP_HT, 0, NULL) == HAL_OK && (wmodes & (HAL_MODE_HT20 | HAL_MODE_HT40))) { uint32_t rxs, txs; + uint32_t ldpc; device_printf(sc->sc_dev, "[HT] enabling HT modes\n"); @@ -1130,6 +1131,18 @@ ath_attach(u_int16_t devid, struct ath_s "[HT] RTS aggregates limited to %d KiB\n", sc->sc_rts_aggr_limit / 1024); + /* + * LDPC + */ + if ((ath_hal_getcapability(ah, HAL_CAP_LDPC, 0, &ldpc)) + == HAL_OK && (ldpc == 1)) { + sc->sc_has_ldpc = 1; + device_printf(sc->sc_dev, + "[HT] LDPC transmit/receive enabled\n"); + ic->ic_htcaps |= IEEE80211_HTCAP_LDPC; + } + + device_printf(sc->sc_dev, "[HT] %d RX streams; %d TX streams\n", rxs, txs); } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Apr 26 01:34:21 2016 (r298607) +++ head/sys/dev/ath/if_athvar.h Tue Apr 26 01:37:03 2016 (r298608) @@ -653,6 +653,7 @@ struct ath_softc { sc_use_ent : 1, sc_rx_stbc : 1, sc_tx_stbc : 1, + sc_has_ldpc : 1, sc_hasenforcetxop : 1, /* support enforce TxOP */ sc_hasdivcomb : 1, /* RX diversity combining */ sc_rx_lnamixer : 1; /* RX using LNA mixing */ @@ -1307,6 +1308,10 @@ void ath_intr(void *); #define ath_hal_hasdivantcomb(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_ANT_DIV_COMB, 0, NULL) == HAL_OK) +#define ath_hal_hasldpc(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_LDPC, 0, NULL) == HAL_OK) +#define ath_hal_hasldpcwar(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_LDPCWAR, 0, NULL) == HAL_OK) /* EDMA definitions */ #define ath_hal_hasedma(_ah) \