rtwn: enable LDPC support where possible

Tested with RTL8821AU, STA mode.
This commit is contained in:
Andriy Voskoboinyk 2017-01-21 15:03:58 +00:00
parent c5bba9da5a
commit 3111723c09
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312597
5 changed files with 27 additions and 3 deletions

View File

@ -695,6 +695,7 @@ rtwn_ioctl_reset(struct ieee80211vap *vap, u_long cmd)
case IEEE80211_IOC_RTSTHRESHOLD:
case IEEE80211_IOC_PROTMODE:
case IEEE80211_IOC_HTPROTMODE:
case IEEE80211_IOC_LDPC:
error = 0;
break;
default:

View File

@ -252,7 +252,9 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs,
rxdw4 = le32toh(stat->rxdw4);
rate = MS(rxdw3, R12A_RXDW3_RATE);
/* TODO: STBC, LDPC */
/* TODO: STBC */
if (rxdw4 & R12A_RXDW4_LDPC)
rxs->c_pktflags |= IEEE80211_RX_F_LDPC;
if (rxdw1 & R12A_RXDW1_AMPDU) {
if (rxdw0 & R92C_RXDW0_PHYST)
rxs->c_pktflags |= IEEE80211_RX_F_AMPDU;

View File

@ -214,6 +214,17 @@ r12a_tx_set_sgi(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni)
txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT);
}
static void
r12a_tx_set_ldpc(struct rtwn_softc *sc, struct r12a_tx_desc *txd,
struct ieee80211_node *ni)
{
struct ieee80211vap *vap = ni->ni_vap;
if ((vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX) &&
(ni->ni_htcap & IEEE80211_HTCAP_LDPC))
txd->txdw5 |= htole32(R12A_TXDW5_DATA_LDPC);
}
void
r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
struct mbuf *m, void *buf, uint8_t ridx, int maxretry)
@ -284,6 +295,7 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
if (ridx >= RTWN_RIDX_MCS(0)) {
r12a_tx_set_ht40(sc, txd, ni);
r12a_tx_set_sgi(sc, txd, ni);
r12a_tx_set_ldpc(sc, txd, ni);
prot = ic->ic_htprotmode;
} else if (ic->ic_flags & IEEE80211_F_USEPROT)
prot = ic->ic_protmode;

View File

@ -168,7 +168,15 @@ r12a_read_chipid_vendor(struct rtwn_softc *sc, uint32_t reg_sys_cfg)
static void
r12au_adj_devcaps(struct rtwn_softc *sc)
{
/* TODO: LDPC, STBC etc */
struct r12a_softc *rs = sc->sc_priv;
struct ieee80211com *ic = &sc->sc_ic;
if (rs->chip & R12A_CHIP_C_CUT) {
ic->ic_htcaps |= IEEE80211_HTCAP_LDPC |
IEEE80211_HTC_TXLDPC;
}
/* TODO: STBC, VHT etc */
}
void

View File

@ -157,10 +157,11 @@ r21au_adj_devcaps(struct rtwn_softc *sc)
struct ieee80211com *ic = &sc->sc_ic;
struct r12a_softc *rs = sc->sc_priv;
ic->ic_htcaps |= IEEE80211_HTC_TXLDPC;
if (rs->rs_radar != 0)
ic->ic_caps |= IEEE80211_C_DFS;
/* TODO: LDPC etc */
/* TODO: VHT */
}
void