[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.
This commit is contained in:
Adrian Chadd 2016-04-26 01:37:03 +00:00
parent f026d6931a
commit 9f3a915030
2 changed files with 18 additions and 0 deletions

View File

@ -1062,6 +1062,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
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_softc *sc)
"[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);
}

View File

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