svn commit: r298608 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Tue Apr 26 01:37:04 UTC 2016


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) \


More information about the svn-src-head mailing list