diff options
author | adrian <adrian@FreeBSD.org> | 2016-04-26 01:37:03 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2016-04-26 01:37:03 +0000 |
commit | eeff7ef46461dcea38df9ce0430f988a481bb5b8 (patch) | |
tree | fb2ce84a0755fbe2a5b33c60cf61dea7b62a97e5 /sys/dev | |
parent | 4df8bc5383a0fc549716f386d3b5b25e235ab95a (diff) | |
download | FreeBSD-src-eeff7ef46461dcea38df9ce0430f988a481bb5b8.zip FreeBSD-src-eeff7ef46461dcea38df9ce0430f988a481bb5b8.tar.gz |
[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.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ath/if_ath.c | 13 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 9a06218..ab7cec3 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -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); } diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 30763a2..b0ab2d1 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -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) \ |